]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pfla02: Rework excluding NAND from SPL
authorTom Rini <trini@konsulko.com>
Tue, 26 May 2020 19:06:12 +0000 (15:06 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jun 2020 19:05:45 +0000 (15:05 -0400)
Rather than only enable CONFIG_CMD_NAND for non-SPL builds, move the CMD
options to defconfig and rework the guards to not try and call the
function in SPL builds.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>
board/phytec/pfla02/pfla02.c
configs/pfla02_defconfig
include/configs/pfla02.h

index fed8f52e3e1d469759c3d07104294748cb8737f0..0a961cc8a5a4627452e568ec257eb5883204929d 100644 (file)
@@ -117,7 +117,7 @@ static iomux_v3_cfg_t const gpios_pads[] = {
        IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-#ifdef CONFIG_CMD_NAND
+#if defined(CONFIG_CMD_NAND) && !defined(CONFIG_SPL_BUILD)
 /* NAND */
 static iomux_v3_cfg_t const nfc_pads[] = {
        IOMUX_PADS(PAD_NANDF_CLE__NAND_CLE      | MUX_PAD_CTRL(NAND_PAD_CTRL)),
@@ -274,7 +274,7 @@ static void setup_gpios(void)
        SETUP_IOMUX_PADS(gpios_pads);
 }
 
-#ifdef CONFIG_CMD_NAND
+#if defined(CONFIG_CMD_NAND) && !defined(CONFIG_SPL_BUILD)
 static void setup_gpmi_nand(void)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
@@ -361,7 +361,7 @@ int board_init(void)
 
        setup_gpios();
 
-#ifdef CONFIG_CMD_NAND
+#if defined(CONFIG_CMD_NAND) && !defined(CONFIG_SPL_BUILD)
        setup_gpmi_nand();
 #endif
        return 0;
@@ -657,7 +657,7 @@ void board_init_f(ulong dummy)
                .refr = 7,      /* 8 refresh commands per refresh cycle */
        };
 
-#ifdef CONFIG_CMD_NAND
+#if defined(CONFIG_CMD_NAND) && !defined(CONFIG_SPL_BUILD)
        /* Enable NAND */
        setup_gpmi_nand();
 #endif
index 5e5bbb05bd5ef5419d9d6f09a1769ec3d3e84db7..52cebd9e22ed58e7ae2c736e3727ae6ba51f2edb 100644 (file)
@@ -37,7 +37,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-# CONFIG_CMD_NAND is not set
+CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
index d4a7de7df6a24b42ebfe007331e6b04a30136f32..4162a71ca6610d521306cb082fa5e8f67028172f 100644 (file)
 #define CONFIG_SYS_I2C_MXC_I2C1                /* enable I2C bus 0 */
 #define CONFIG_SYS_I2C_SPEED             100000
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_CMD_NAND
 /* Enable NAND support */
-#define CONFIG_CMD_NAND_TRIMFFS
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_SYS_NAND_BASE           0x40000000
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_ONFI_DETECTION
-#endif
 
 /* DMA stuff, needed for GPMI/MXS NAND support */