diff --git a/arch/arm/src/cxd56xx/Kconfig b/arch/arm/src/cxd56xx/Kconfig index 04132ad1e3..512ed22d23 100644 --- a/arch/arm/src/cxd56xx/Kconfig +++ b/arch/arm/src/cxd56xx/Kconfig @@ -26,6 +26,15 @@ config CXD56_WLCSP endchoice +config CXD56_CUSTOM_PINCONFIG + bool "Board-specific pin configuration" + default n + ---help--- + Custom PIN Configuration of CXD56xx pins to fit a specific board. + If this option is enabled, some PINs configurations are overwritten + in "boards/arm/cxd56xx//include/board_pinconfig.h" + from "arch/arm/src/cxd56xx/hardware/cxd56xx_pinconfig.h". + comment "Debug Features" config CXD56_BACKUPLOG diff --git a/arch/arm/src/cxd56xx/hardware/cxd5602_pinconfig.h b/arch/arm/src/cxd56xx/hardware/cxd5602_pinconfig.h index 5b796a964a..1fb1e3bde4 100644 --- a/arch/arm/src/cxd56xx/hardware/cxd5602_pinconfig.h +++ b/arch/arm/src/cxd56xx/hardware/cxd5602_pinconfig.h @@ -649,11 +649,11 @@ #define PINCONFS_USB_VBUSINT_GPIO { PINCONF_USB_VBUSINT_GPIO } #define PINCONFS_USB_VBUSINT { PINCONF_USB_VBUSINT } -#ifdef CONFIG_BOARD_CUSTOM_PINCONFIG +#ifdef CONFIG_CXD56_CUSTOM_PINCONFIG /* Change the pin configuration depending on each board */ # include -#endif /* CONFIG_BOARD_CUSTOM_PINCONFIG */ +#endif /* CONFIG_CXD56_CUSTOM_PINCONFIG */ #endif /* __ARCH_ARM_SRC_CXD56XX_CHIP_CXD5602_PINCONFIG_H */ diff --git a/boards/arm/cxd56xx/spresense/include/board_pinconfig.h b/boards/arm/cxd56xx/spresense/include/board_pinconfig.h new file mode 100644 index 0000000000..7bce0fecdc --- /dev/null +++ b/boards/arm/cxd56xx/spresense/include/board_pinconfig.h @@ -0,0 +1,102 @@ +/**************************************************************************** + * boards/arm/cxd56xx/spresense/include/board_pinconfig.h + * + * Copyright 2018 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __BOARDS_ARM_CXD56XX_SPRESENCE_INCLUDE_BOARD_PINCONFIG_H +#define __BOARDS_ARM_CXD56XX_SPRESENCE_INCLUDE_BOARD_PINCONFIG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Customize from default to the board specific pin configuration + * The default pin configurations are defined in + * boards/arm/cxd56xx/spresense/inclue/board_pinconfig.h. + * + * Mode: shared pin function mode + * ENZI: 1=Input Enable, 0=Input Disable + * 4mA : Drive Current 1=4mA, 0=2mA + * Pull: 0=HiZ floating, PINCONF_PULLUP, PINCONF_PULLDOWN + * + * M E P + * P o N 4 u + * i d Z m l + * n e I A l + */ + +#undef PINCONF_UART2_CTS +#define PINCONF_UART2_CTS PINCONF(PIN_UART2_CTS, 1, 1, 0, PINCONF_PULLDOWN) + +#undef PINCONF_SPI4_CS_X +#undef PINCONF_SPI4_SCK +#undef PINCONF_SPI4_MOSI +#define PINCONF_SPI4_CS_X PINCONF(PIN_SPI4_CS_X, 1, 0, 1, 0) +#define PINCONF_SPI4_SCK PINCONF(PIN_SPI4_SCK, 1, 0, 1, 0) +#define PINCONF_SPI4_MOSI PINCONF(PIN_SPI4_MOSI, 1, 0, 1, 0) + +#undef PINCONF_PWM0 +#undef PINCONF_PWM1 +#undef PINCONF_PWM2 +#undef PINCONF_PWM3 +#define PINCONF_PWM0 PINCONF(PIN_PWM0, 1, 0, 1, 0) +#define PINCONF_PWM1 PINCONF(PIN_PWM1, 1, 0, 1, 0) +#define PINCONF_PWM2 PINCONF(PIN_PWM2, 1, 0, 1, 0) +#define PINCONF_PWM3 PINCONF(PIN_PWM3, 1, 0, 1, 0) + +#undef PINCONF_I2C0_BCK +#undef PINCONF_I2C0_BDT +#define PINCONF_I2C0_BCK PINCONF(PIN_I2C0_BCK, 1, 1, 1, 0) +#define PINCONF_I2C0_BDT PINCONF(PIN_I2C0_BDT, 1, 1, 1, 0) + +#undef PINCONF_SDIO_CLK_GPIO +#undef PINCONF_SDIO_CMD_GPIO +#undef PINCONF_SDIO_DATA0_GPIO +#undef PINCONF_SDIO_DATA1_GPIO +#undef PINCONF_SDIO_DATA2_GPIO +#undef PINCONF_SDIO_DATA3_GPIO +#define PINCONF_SDIO_CLK_GPIO PINCONF(PIN_SDIO_CLK, 0, 0, 0, PINCONF_PULLDOWN) +#define PINCONF_SDIO_CMD_GPIO PINCONF(PIN_SDIO_CMD, 0, 0, 0, PINCONF_PULLDOWN) +#define PINCONF_SDIO_DATA0_GPIO PINCONF(PIN_SDIO_DATA0, 0, 0, 0, PINCONF_PULLDOWN) +#define PINCONF_SDIO_DATA1_GPIO PINCONF(PIN_SDIO_DATA1, 0, 0, 0, PINCONF_PULLDOWN) +#define PINCONF_SDIO_DATA2_GPIO PINCONF(PIN_SDIO_DATA2, 0, 0, 0, PINCONF_PULLDOWN) +#define PINCONF_SDIO_DATA3_GPIO PINCONF(PIN_SDIO_DATA3, 0, 0, 0, PINCONF_PULLDOWN) + +#undef PINCONF_SDIO_CD_GPIO +#define PINCONF_SDIO_CD_GPIO PINCONF(PIN_SDIO_CD, 0, 0, 0, PINCONF_PULLUP) + +#endif /* __BOARDS_ARM_CXD56XX_SPRESENCE_INCLUDE_BOARD_PINCONFIG_H */