]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Convert CONFIG_ESDHC_DETECT_QUIRK to Kconfig
authorTom Rini <trini@konsulko.com>
Thu, 16 Jun 2022 18:04:38 +0000 (14:04 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 5 Jul 2022 21:03:46 +0000 (17:03 -0400)
This converts the following to Kconfig:
   CONFIG_ESDHC_DETECT_QUIRK

Signed-off-by: Tom Rini <trini@konsulko.com>
22 files changed:
board/freescale/common/qixis.h
board/freescale/lx2160a/lx2160a.c
configs/ls1088aqds_defconfig
configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
configs/ls1088aqds_qspi_defconfig
configs/ls1088aqds_sdcard_ifc_defconfig
configs/ls1088aqds_sdcard_qspi_defconfig
configs/ls1088aqds_tfa_defconfig
configs/ls2080aqds_SECURE_BOOT_defconfig
configs/ls2080aqds_defconfig
configs/ls2080aqds_nand_defconfig
configs/ls2080aqds_qspi_defconfig
configs/ls2080aqds_sdcard_defconfig
configs/ls2088aqds_tfa_defconfig
configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
configs/lx2160aqds_tfa_defconfig
drivers/mmc/Kconfig
drivers/mmc/fsl_esdhc.c
include/configs/ls1088aqds.h
include/configs/ls2080aqds.h
include/configs/lx2160aqds.h
include/configs/lx2162aqds.h

index 0860bd2312670fe8a71795f4703d16a4b3444d89..af76327e4d2f6806ed3dcc119406d756de94dcee 100644 (file)
@@ -166,4 +166,25 @@ defined(CONFIG_TARGET_LX2160ARDB)
 #define QIXIS_ESDHC_NO_ADAPTER         0x7
 #endif
 
+/*
+ * implementation of CONFIG_ESDHC_DETECT_QUIRK Macro.
+ */
+static inline u8 qixis_esdhc_detect_quirk(void)
+{
+       /*
+        * SDHC1 Card ID:
+        * Specifies the type of card installed in the SDHC1 adapter slot.
+        * 000= (reserved)
+        * 001= eMMC V4.5 adapter is installed.
+        * 010= SD/MMC 3.3V adapter is installed.
+        * 011= eMMC V4.4 adapter is installed.
+        * 100= eMMC V5.0 adapter is installed.
+        * 101= MMC card/Legacy (3.3V) adapter is installed.
+        * 110= SDCard V2/V3 adapter installed.
+        * 111= no adapter is installed.
+        */
+       return ((QIXIS_READ(sdhc1) & QIXIS_SDID_MASK) !=
+                QIXIS_ESDHC_NO_ADAPTER);
+}
+
 #endif
index 49d96d3fa2a97e9625950c119e492af2beea7289..a078643708f79d3f20d3fd8953200dced085d56b 100644 (file)
@@ -356,27 +356,6 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_TARGET_LX2160AQDS) || defined(CONFIG_TARGET_LX2162AQDS)
-/*
- * implementation of CONFIG_ESDHC_DETECT_QUIRK Macro.
- */
-u8 qixis_esdhc_detect_quirk(void)
-{
-       /*
-        * SDHC1 Card ID:
-        * Specifies the type of card installed in the SDHC1 adapter slot.
-        * 000= (reserved)
-        * 001= eMMC V4.5 adapter is installed.
-        * 010= SD/MMC 3.3V adapter is installed.
-        * 011= eMMC V4.4 adapter is installed.
-        * 100= eMMC V5.0 adapter is installed.
-        * 101= MMC card/Legacy (3.3V) adapter is installed.
-        * 110= SDCard V2/V3 adapter installed.
-        * 111= no adapter is installed.
-        */
-       return ((QIXIS_READ(sdhc1) & QIXIS_SDID_MASK) !=
-                QIXIS_ESDHC_NO_ADAPTER);
-}
-
 static void esdhc_adapter_card_ident(void)
 {
        u8 card_id, val;
index 1580ceb6b72cd79f181b02002e9fa46b30eb238b..be351a3b6bf63ced882278f53ff4c0d8d11aeb70 100644 (file)
@@ -71,6 +71,7 @@ CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index b20a5d20f7d1d15aca4d60e89df71ebd16c93a01..7c2134ae4d9764fce15f665a2617d4ecb6870549 100644 (file)
@@ -65,6 +65,7 @@ CONFIG_MPC8XXX_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_FSL_IFC=y
index caf5d774f57cd5bf432c160707f0866a92db8ce8..0aed10298b3e231a95f51423862b560ae05a06c6 100644 (file)
@@ -68,6 +68,7 @@ CONFIG_MPC8XXX_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_FSL_IFC=y
index 663aacf876b9a1b8985e1f7de7a3c554ed05d281..6ec9f2b333e0fefb1bd40802ddc1940f073c768a 100644 (file)
@@ -90,6 +90,7 @@ CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index f3e204875efad306d309f14ea625bcd062b2ce3e..0ca54c8340b3057174da38d013e50d4a0d81ac73 100644 (file)
@@ -86,6 +86,7 @@ CONFIG_MPC8XXX_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_FSL_IFC=y
index a135de388ff96cf290faa55d31159b93b36175de..e5063be8fc3669a91b76a8cfb6ec1ca594cbe6e9 100644 (file)
@@ -79,6 +79,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index abc958f5dd1143842538d87b715b87c2d208913b..383e8928870fec0eda46ec7e0a7241c396dbdd5e 100644 (file)
@@ -59,6 +59,7 @@ CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index 9278a6e80f7ea346ae2303f26dceedcef8e8082a..92f129551c2589ef0016bcd81b1b4296646dd2eb 100644 (file)
@@ -62,6 +62,7 @@ CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index dab9a7fb85a91b695564ceac0416f568c6ede831..855d1176e0ba8bd4cc3f9ba0b092dc2fe71a6692 100644 (file)
@@ -83,6 +83,7 @@ CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_NAND_FSL_IFC=y
 CONFIG_SYS_NAND_ONFI_DETECTION=y
index afa2469b1b44ffe526565c35a3bae9749cd00271..8ca856c788e37f59490fc1e493b5a7bc56b0a9a0 100644 (file)
@@ -64,6 +64,7 @@ CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_FSL_IFC=y
index 3d6aa69d5f187cdfccca1f9a75afd2f5c548f0d3..bc9febcf507c9e3eca8d6e9a14d9a51b27f1f1af 100644 (file)
@@ -78,6 +78,7 @@ CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_FSL_IFC=y
index c46e506213c9282bd26553083f10c638ec77dc88..60e489facb5cd56c48c4bd3b689223df771bb41a 100644 (file)
@@ -73,6 +73,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index 317347b0d295ce92af09e645a6317ffdd025b901..d65d611d7c49e53b02e55d98ff44efce770e3de0 100644 (file)
@@ -69,6 +69,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_EON=y
index b6441a3abde95330528ba54f9c4cdbeacaf61037..97cfb663fb61175ccf9a447b46c61195f098afc6 100644 (file)
@@ -76,6 +76,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
+CONFIG_ESDHC_DETECT_QUIRK=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_EON=y
index 5a87db6be0835b606048152fe6fb93c3d0772065..53a6b0093d10b2d167e77a33eb6af10d5f3335ef 100644 (file)
@@ -844,6 +844,10 @@ config SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH
        depends on FSL_ESDHC
        default 1
 
+config ESDHC_DETECT_QUIRK
+       bool "QIXIS-based eSDHC quirk detection"
+       depends on FSL_ESDHC && FSL_QIXIS
+
 config FSL_ESDHC_IMX
        bool "Freescale/NXP i.MX eSDHC controller support"
        help
index 4e7bfdfaa7e71721e6920cf38b3e55ca5c31be20..b49a7b425b9a01c64d37cd8747b5c68c05585727 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/iopoll.h>
 #include <linux/dma-mapping.h>
 #include <sdhci.h>
+#include "../../board/freescale/common/qixis.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -773,7 +774,7 @@ static int esdhc_getcd_common(struct fsl_esdhc_priv *priv)
        struct fsl_esdhc *regs = priv->esdhc_regs;
 
 #ifdef CONFIG_ESDHC_DETECT_QUIRK
-       if (CONFIG_ESDHC_DETECT_QUIRK)
+       if (qixis_esdhc_detect_quirk())
                return 1;
 #endif
        if (esdhc_read32(&regs->prsstat) & PRSSTAT_CINS)
index 7c60f287981aa1f9f411f1b19e467e512ea5c017..debb60d25cef92b773823f30d3033e2561470b7b 100644 (file)
 
 #define CONFIG_FSL_MEMAC
 
-/*  MMC  */
-#define CONFIG_ESDHC_DETECT_QUIRK ((readb(QIXIS_BASE + QIXIS_STAT_PRES1) & \
-       QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
-
 #define COMMON_ENV \
        "kernelheader_addr_r=0x80200000\0"      \
        "fdtheader_addr_r=0x80100000\0"         \
index a0e2127f1dddf44bcfcdf762bb34afa4e92a665c..9de602bc164020c1b0322c95d3e7d62d0a211d14 100644 (file)
  */
 #define FSL_QIXIS_BRDCFG9_QSPI         0x1
 
-/*
- * MMC
- */
-#ifdef CONFIG_MMC
-#define CONFIG_ESDHC_DETECT_QUIRK ((readb(QIXIS_BASE + QIXIS_STAT_PRES1) & \
-       QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
-#endif
-
 /*
  * RTC configuration
  */
index e7aec6bc5964efe9d0b63e4a8be447a1f6b526ce..585aab26bff7cc5cf2e52a7de03f05e68e1414b2 100644 (file)
 /* RTC */
 #define CONFIG_SYS_RTC_BUS_NUM         0
 
-/*
- * MMC
- */
-#ifdef CONFIG_MMC
-#ifndef __ASSEMBLY__
-u8 qixis_esdhc_detect_quirk(void);
-#endif
-#define CONFIG_ESDHC_DETECT_QUIRK  qixis_esdhc_detect_quirk()
-#endif
-
 /* MAC/PHY configuration */
 
 /* EEPROM */
index 729c2707e990ad0a0366a00d22fb8f7d5474ffb2..d1ae403473148daedb2103fe21321dfd1f552ded 100644 (file)
 /* RTC */
 #define CONFIG_SYS_RTC_BUS_NUM         0
 
-/*
- * MMC
- */
-#ifdef CONFIG_MMC
-#ifndef __ASSEMBLY__
-u8 qixis_esdhc_detect_quirk(void);
-#endif
-#define CONFIG_ESDHC_DETECT_QUIRK  qixis_esdhc_detect_quirk()
-#endif
-
 /* EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_NXID
 #define CONFIG_SYS_EEPROM_BUS_NUM              0