From 35e2b92344b1feee818a8e778b403c8a6a136230 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 13 Feb 2019 13:46:41 +0100 Subject: [PATCH] arm64: zynqmp: Fix logic around CONFIG_ZYNQ_SDHCI Replace SDHCI controller listing by Kconfig symbol to let SPL know that this board is using multiple SDHCIs controllers. Kconfig help message should explain why this is needed. Origin symbols were used in full u-boot but with moving to distro boot this was fixed already. Signed-off-by: Michal Simek --- arch/arm/mach-zynqmp/Kconfig | 11 +++++++++++ arch/arm/mach-zynqmp/spl.c | 2 +- configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig | 1 + include/configs/xilinx_zynqmp_zc1275_revB.h | 2 -- include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h | 3 --- include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h | 2 -- include/configs/xilinx_zynqmp_zc1751_xm019_dc5.h | 2 -- include/configs/xilinx_zynqmp_zcu102.h | 1 - include/configs/xilinx_zynqmp_zcu104.h | 2 -- include/configs/xilinx_zynqmp_zcu106.h | 2 -- include/configs/xilinx_zynqmp_zcu111.h | 2 -- 11 files changed, 13 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-zynqmp/Kconfig b/arch/arm/mach-zynqmp/Kconfig index e9f7e7e489..9bb5a5c202 100644 --- a/arch/arm/mach-zynqmp/Kconfig +++ b/arch/arm/mach-zynqmp/Kconfig @@ -99,6 +99,17 @@ config SPL_ZYNQMP_ALT_BOOTMODE_ENABLED config ZYNQ_SDHCI_MAX_FREQ default 200000000 +config SPL_ZYNQMP_TWO_SDHCI + bool "Enable booting from both SDHCIs" + depends on SPL + help + This option reflects that board has two SDHCI controllers which + platform can use as boot device. This option ensures that SPL will + setup BOOT_DEVICE_MMC2 for SDHCI1 controller and BOOT_DEVICE_MMC1 for + SDHCI0 controller. Platforms which have only one SDHCI controller + shouldn't enable this option because it for software SDHCI0 or SDHCI1 + are both covered by BOOT_DEVICE_MMC1. + config SPL_ZYNQMP_ALT_BOOTMODE hex default 0x0 if JTAG_MODE diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c index fb3955c93f..f6f5414201 100644 --- a/arch/arm/mach-zynqmp/spl.c +++ b/arch/arm/mach-zynqmp/spl.c @@ -85,7 +85,7 @@ u32 spl_boot_device(void) case SD_MODE1: case SD1_LSHFT_MODE: /* not working on silicon v1 */ /* if both controllers enabled, then these two are the second controller */ -#if defined(CONFIG_ZYNQ_SDHCI0) && defined(CONFIG_ZYNQ_SDHCI1) +#if defined(SPL_ZYNQMP_TWO_SDHCI) return BOOT_DEVICE_MMC2; /* else, fall through, the one SDHCI controller that is enabled is number 1 */ #endif diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig index 59db2131c0..5e41982246 100644 --- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig @@ -7,6 +7,7 @@ CONFIG_SPL=y CONFIG_DEBUG_UART_BASE=0xff000000 CONFIG_DEBUG_UART_CLOCK=100000000 CONFIG_ZYNQMP_USB=y +CONFIG_SPL_ZYNQMP_TWO_SDHCI=y CONFIG_DEBUG_UART=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y diff --git a/include/configs/xilinx_zynqmp_zc1275_revB.h b/include/configs/xilinx_zynqmp_zc1275_revB.h index f0880db0b0..244f61edd1 100644 --- a/include/configs/xilinx_zynqmp_zc1275_revB.h +++ b/include/configs/xilinx_zynqmp_zc1275_revB.h @@ -8,8 +8,6 @@ #ifndef __CONFIG_ZYNQMP_ZC1275_REVB_H #define __CONFIG_ZYNQMP_ZC1275_REVB_H -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZC1275_REVB_H */ diff --git a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h index f0ab3f1592..cd72e6f419 100644 --- a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h +++ b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h @@ -9,9 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZC1751_XM015_DC1_H #define __CONFIG_ZYNQMP_ZC1751_XM015_DC1_H -#define CONFIG_ZYNQ_SDHCI0 -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZC1751_XM015_DC1_H */ diff --git a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h index bd4a0c3178..dbacfde151 100644 --- a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h +++ b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h @@ -9,8 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZC1751_XM017_DC3_H #define __CONFIG_ZYNQMP_ZC1751_XM017_DC3_H -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZC1751_XM017_DC3_H */ diff --git a/include/configs/xilinx_zynqmp_zc1751_xm019_dc5.h b/include/configs/xilinx_zynqmp_zc1751_xm019_dc5.h index f39eeb9bfc..0b525c88b7 100644 --- a/include/configs/xilinx_zynqmp_zc1751_xm019_dc5.h +++ b/include/configs/xilinx_zynqmp_zc1751_xm019_dc5.h @@ -10,8 +10,6 @@ #ifndef __CONFIG_ZYNQMP_ZC1751_XM019_DC5_H #define __CONFIG_ZYNQMP_ZC1751_XM019_DC5_H -#define CONFIG_ZYNQ_SDHCI0 - #include #endif /* __CONFIG_ZYNQMP_ZC1751_XM019_DC5_H */ diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index f1504784fd..dfa1f7a0a9 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -9,7 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZCU102_H #define __CONFIG_ZYNQMP_ZCU102_H -#define CONFIG_ZYNQ_SDHCI1 #define CONFIG_SPD_EEPROM #define CONFIG_DDR_SPD diff --git a/include/configs/xilinx_zynqmp_zcu104.h b/include/configs/xilinx_zynqmp_zcu104.h index 9d40955d5d..a8303756e5 100644 --- a/include/configs/xilinx_zynqmp_zcu104.h +++ b/include/configs/xilinx_zynqmp_zcu104.h @@ -9,8 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZCU104_H #define __CONFIG_ZYNQMP_ZCU104_H -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZCU104_H */ diff --git a/include/configs/xilinx_zynqmp_zcu106.h b/include/configs/xilinx_zynqmp_zcu106.h index dc2efc7e05..bb5cf677cb 100644 --- a/include/configs/xilinx_zynqmp_zcu106.h +++ b/include/configs/xilinx_zynqmp_zcu106.h @@ -9,8 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZCU106_H #define __CONFIG_ZYNQMP_ZCU106_H -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZCU106_H */ diff --git a/include/configs/xilinx_zynqmp_zcu111.h b/include/configs/xilinx_zynqmp_zcu111.h index dea5e4a4d4..507aee9332 100644 --- a/include/configs/xilinx_zynqmp_zcu111.h +++ b/include/configs/xilinx_zynqmp_zcu111.h @@ -9,8 +9,6 @@ #ifndef __CONFIG_ZYNQMP_ZCU111_H #define __CONFIG_ZYNQMP_ZCU111_H -#define CONFIG_ZYNQ_SDHCI1 - #include #endif /* __CONFIG_ZYNQMP_ZCU111_H */ -- 2.39.5