From 1f5ea1619b584e896967703c6ac002f272e24d72 Mon Sep 17 00:00:00 2001 From: CHLin Date: Tue, 22 Aug 2017 10:47:20 +0800 Subject: [PATCH] npcx: Don't enable CONFIG_CMD_FLASH_TRISTATE when internal flash is used The bit controlling the tri-state of FIU pins is reserved when the internal flash is used and should not be modified. This CL adds a compiler error to prevent this kind of misuse. BRANCH=none BUG=none TEST=No build errors for "make buildall". "BORAD=npcx7_evb make" with CONFIG_CMD_FLASH_TRISTATE defined, make sure the error message is printed. Change-Id: I020c8ab9e02b9a377879bbd2a337943e77a369d6 Signed-off-by: CHLin Reviewed-on: https://chromium-review.googlesource.com/624828 Commit-Ready: CH Lin Tested-by: CH Lin Reviewed-by: Shawn N --- chip/npcx/flash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c index 9c73bbdb3c..a0a02791ca 100644 --- a/chip/npcx/flash.c +++ b/chip/npcx/flash.c @@ -730,6 +730,9 @@ DECLARE_HOST_COMMAND(EC_CMD_FLASH_SPI_INFO, #endif #ifdef CONFIG_CMD_FLASH_TRISTATE +#ifdef NPCX_INT_FLASH_SUPPORT +#error "Flash tristate is not relevant when internal flash is used." +#endif static void flash_tristate(int enable) { /* Enable/Disable FIU pins to tri-state */