diff options
author | CHLin <CHLIN56@nuvoton.com> | 2017-10-06 16:13:07 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-15 21:55:56 -0700 |
commit | 72d91062f419c27a7cdbdd294ebd7beba32ce9ca (patch) | |
tree | 431c7f9dd40d2afcd64b650be0097079bb7bdf1b | |
parent | 828da3d55668edfc9b7d64e1d21dd0438fccfcd5 (diff) | |
download | chrome-ec-72d91062f419c27a7cdbdd294ebd7beba32ce9ca.tar.gz |
npcx/flash: not enable the flash pinmux when using internal flash
In npcx5, the flash interface pinmux should be turned on in order to
access the external flash. However, in npcx7, the internal flash is
used. It is meaningless to turn the pinmux on. And it also causes the
alternative function of these pins not work normally(such as
GPIOA0/GPIOA2) if the pinmux is enabled. This CL uses the preprocessor
flag NPCX_INT_FLASH_SUPPORT to conditionally prohibit the execution of
flash pinmux code.
BRANCH=none
BUG=none
TEST=No build errors for "make buildall". Build npcx_evb and npcx7_evb
boards, make sure the pinmux are correctly configured seperately.
Change-Id: Iba2300159f204b65d15852ec1755714df0c64816
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/704316
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | chip/npcx/flash.c | 4 | ||||
-rw-r--r-- | chip/npcx/gpio.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c index a0a02791ca..2274f256dc 100644 --- a/chip/npcx/flash.c +++ b/chip/npcx/flash.c @@ -40,6 +40,7 @@ static struct mutex flash_lock; /*****************************************************************************/ /* flash internal functions */ +#if !defined(NPCX_INT_FLASH_SUPPORT) static void flash_pinmux(int enable) { /* Select pin-mux for FIU*/ @@ -57,6 +58,7 @@ static void flash_pinmux(int enable) CLEAR_BIT(NPCX_DEVALT(0), NPCX_DEVALT0_F_SPI_CS1_2); } } +#endif static void flash_execute_cmd(uint8_t code, uint8_t cts) { @@ -683,8 +685,10 @@ int flash_pre_init(void) flash_protect_int_flash(!gpio_get_level(GPIO_WP_L)); #endif +#if !defined(NPCX_INT_FLASH_SUPPORT) /* Enable FIU interface */ flash_pinmux(1); +#endif #ifdef CONFIG_EXTERNAL_STORAGE /* Disable tristate all the time */ diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c index efc4458ecb..c06aff4d32 100644 --- a/chip/npcx/gpio.c +++ b/chip/npcx/gpio.c @@ -367,7 +367,9 @@ void gpio_pre_init(void) /* Pin_Mux for FIU/SPI (set to GPIO) */ SET_BIT(NPCX_DEVALT(0), NPCX_DEVALT0_GPIO_NO_SPIP); +#if defined(NPCX_INT_FLASH_SUPPORT) SET_BIT(NPCX_DEVALT(0), NPCX_DEVALT0_NO_F_SPI); +#endif /* Pin_Mux for PWRGD */ SET_BIT(NPCX_DEVALT(1), NPCX_DEVALT1_NO_PWRGD); |