Skip to contentSkip to conversation

mmc: Added Kconfig support to set minimum and maximum frequency of the mmc controller

PATCH Superseded Vipul Kumar 3 participants 5 messages Feb 22, 2018 – Feb 26, 2018

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover mmc: Added Kconfig support to set minimum and maximum frequency of the mmc controller

This series of patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ and CONFIG_ZYNQ_SDHCI_MIN_FREQ and set the default values.

Vipul Kumar (2):
mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ
mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ

 arch/arm/cpu/armv8/zynqmp/Kconfig  |  3 +++
 arch/arm/mach-zynq/Kconfig         |  3 +++
 configs/xilinx_zynqmp_ep_defconfig |  2 ++
 drivers/mmc/Kconfig                | 13 +++++++++++++
 drivers/mmc/zynq_sdhci.c           |  4 ----
 include/configs/xilinx_zynqmp.h    |  3 ---
 include/configs/xilinx_zynqmp_ep.h |  2 --
 include/configs/zynq-common.h      |  5 -----
 8 files changed, 21 insertions(+), 14 deletions(-)

--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

#1 lore raw

PATCH 1/2 mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ

This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ and enabled it in respective defconfig.

---
 arch/arm/cpu/armv8/zynqmp/Kconfig  | 3 +++
 arch/arm/mach-zynq/Kconfig         | 3 +++
 configs/xilinx_zynqmp_ep_defconfig | 1 +
 drivers/mmc/Kconfig                | 6 ++++++
 include/configs/xilinx_zynqmp.h    | 3 ---
 include/configs/xilinx_zynqmp_ep.h | 1 -
 include/configs/zynq-common.h      | 5 -----
 7 files changed, 13 insertions(+), 9 deletions(-)
arch/arm/cpu/armv8/zynqmp/Kconfig +3 -0
index 9e521ed..8a311e1 100644
@@ -96,6 +96,9 @@ config SPL_ZYNQMP_ALT_BOOTMODE_ENABLED
          Overwrite bootmode selected via boot mode pins to tell SPL what should
          be the next boot device.
 
+config ZYNQ_SDHCI_MAX_FREQ
+       default 200000000
+
 config SPL_ZYNQMP_ALT_BOOTMODE
        hex
        default 0x0 if JTAG_MODE
arch/arm/mach-zynq/Kconfig +3 -0
index b9cd45b..8772904 100644
@@ -63,4 +63,7 @@ config BOOT_INIT_FILE
          Add register writes to boot.bin format (max 256 pairs).
          Expect a table of register-value pairs, e.g. "0x12345678 0x4321"
 
+config ZYNQ_SDHCI_MAX_FREQ
+       default 52000000
+
 endif
configs/xilinx_zynqmp_ep_defconfig +1 -0
index 7f8e774..00db5e3 100644
@@ -3,6 +3,7 @@ CONFIG_SYS_CONFIG_NAME="xilinx_zynqmp_ep"
 CONFIG_ARCH_ZYNQMP=y
 CONFIG_SYS_TEXT_BASE=0x8000000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
+CONFIG_ZYNQ_SDHCI_MAX_FREQ=52000000
 CONFIG_ZYNQMP_USB=y
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep108"
 CONFIG_DEBUG_UART=y
drivers/mmc/Kconfig +6 -0
index f2d8256..42b7d21 100644
@@ -472,6 +472,12 @@ config MMC_SDHCI_ZYNQ
        help
          Support for Arasan SDHCI host controller on Zynq/ZynqMP ARM SoCs platform
 
+config ZYNQ_SDHCI_MAX_FREQ
+       int "Set the maximum frequency of cotroller"
+       depends on MMC_SDHCI_ZYNQ
+       help
+         Set the maximum frequency for the SDHCI controller.
+
 config MMC_SUNXI
        bool "Allwinner sunxi SD/MMC Host Controller support"
        depends on ARCH_SUNXI && !UART0_PORT_F
include/configs/xilinx_zynqmp.h +0 -3
index 5533831..1c82050 100644
@@ -69,9 +69,6 @@
 
 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
 # define CONFIG_SUPPORT_EMMC_BOOT
-# ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ
-#  define CONFIG_ZYNQ_SDHCI_MAX_FREQ   200000000
-# endif
 #endif
 
 #ifdef CONFIG_NAND_ARASAN
include/configs/xilinx_zynqmp_ep.h +0 -1
index 3a572b7..a77eeea 100644
@@ -13,7 +13,6 @@
 #ifndef __CONFIG_ZYNQMP_EP_H
 #define __CONFIG_ZYNQMP_EP_H
 
-#define CONFIG_ZYNQ_SDHCI_MAX_FREQ     52000000
 #define CONFIG_ZYNQ_SDHCI_MIN_FREQ     (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
include/configs/zynq-common.h +0 -5
index 2dfac6f..fd3e17d 100644
@@ -76,11 +76,6 @@
 #define CONFIG_MTD_DEVICE
 #endif
 
-/* MMC */
-#if defined(CONFIG_MMC_SDHCI_ZYNQ)
-# define CONFIG_ZYNQ_SDHCI_MAX_FREQ    52000000
-#endif
-
 #ifdef CONFIG_USB_EHCI_ZYNQ
 # define CONFIG_EHCI_IS_TDI
 

--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

#2 lore raw

PATCH 2/2 mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ

In reply to Vipul Kumar

This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ and enabled it in respective defconfig.

---
 configs/xilinx_zynqmp_ep_defconfig | 1 +
 drivers/mmc/Kconfig                | 7 +++++++
 drivers/mmc/zynq_sdhci.c           | 4 ----
 include/configs/xilinx_zynqmp_ep.h | 1 -
 4 files changed, 8 insertions(+), 5 deletions(-)
configs/xilinx_zynqmp_ep_defconfig +1 -0
index 00db5e3..4de1ac1 100644
@@ -62,6 +62,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
+CONFIG_ZYNQ_SDHCI_MIN_FREQ=101562
 CONFIG_NAND=y
 CONFIG_NAND_ARASAN=y
 CONFIG_SPI_FLASH=y
drivers/mmc/Kconfig +7 -0
index 42b7d21..4f2993c 100644
@@ -478,6 +478,13 @@ config ZYNQ_SDHCI_MAX_FREQ
        help
          Set the maximum frequency for the SDHCI controller.
 
+config ZYNQ_SDHCI_MIN_FREQ
+       int "Set the minimum frequencyof the controller"
+       depends on MMC_SDHCI_ZYNQ
+       default 0
+       help
+         Set the minimum frequencyof the controller.
+
 config MMC_SUNXI
        bool "Allwinner sunxi SD/MMC Host Controller support"
        depends on ARCH_SUNXI && !UART0_PORT_F
drivers/mmc/zynq_sdhci.c +0 -4
index 0fddb42..414778c 100644
@@ -16,10 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ
-# define CONFIG_ZYNQ_SDHCI_MIN_FREQ    0
-#endif
-
 struct arasan_sdhci_plat {
        struct mmc_config cfg;
        struct mmc mmc;
include/configs/xilinx_zynqmp_ep.h +0 -1
index a77eeea..a26377a 100644
@@ -13,7 +13,6 @@
 #ifndef __CONFIG_ZYNQMP_EP_H
 #define __CONFIG_ZYNQMP_EP_H
 
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ     (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
                                 ZYNQMP_USB1_XHCI_BASEADDR}

--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

#3 lore raw

PATCH 2/2 mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ

Hi,

Quoted 17 lines · Vipul Kumar

This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ and enabled it in respective defconfig.

---
 configs/xilinx_zynqmp_ep_defconfig | 1 +
 drivers/mmc/Kconfig                | 7 +++++++
 drivers/mmc/zynq_sdhci.c           | 4 ----
 include/configs/xilinx_zynqmp_ep.h | 1 -
 4 files changed, 8 insertions(+), 5 deletions(-)
configs/xilinx_zynqmp_ep_defconfig +0 -0
index 00db5e3..4de1ac1 100644

configs/xilinx_zynqmp_ep_defconfig CONFIG_MISC=y · line 65

Quoted 4 lines
configs/xilinx_zynqmp_ep_defconfig +1 -0
@@ -62,6 +62,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
+CONFIG_ZYNQ_SDHCI_MIN_FREQ=101562

It seems that 101562 is the shifted value. If ZYNQ_SDHCI_MIN_REQ is set to 100KHz, what happen?

Best Regards,
Jaehoon Chung

Quoted 57 lines
configs/xilinx_zynqmp_ep_defconfig +0 -0
 CONFIG_NAND=y
 CONFIG_NAND_ARASAN=y
 CONFIG_SPI_FLASH=y
drivers/mmc/Kconfig +7 -0
index 42b7d21..4f2993c 100644
@@ -478,6 +478,13 @@ config ZYNQ_SDHCI_MAX_FREQ
        help
          Set the maximum frequency for the SDHCI controller.
 
+config ZYNQ_SDHCI_MIN_FREQ
+       int "Set the minimum frequencyof the controller"
+       depends on MMC_SDHCI_ZYNQ
+       default 0
+       help
+         Set the minimum frequencyof the controller.
+
 config MMC_SUNXI
        bool "Allwinner sunxi SD/MMC Host Controller support"
        depends on ARCH_SUNXI && !UART0_PORT_F
drivers/mmc/zynq_sdhci.c +0 -4
index 0fddb42..414778c 100644
@@ -16,10 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ
-# define CONFIG_ZYNQ_SDHCI_MIN_FREQ    0
-#endif
-
 struct arasan_sdhci_plat {
        struct mmc_config cfg;
        struct mmc mmc;
include/configs/xilinx_zynqmp_ep.h +0 -2
index a77eeea..a26377a 100644
@@ -13,7 +13,6 @@
 #ifndef __CONFIG_ZYNQMP_EP_H
 #define __CONFIG_ZYNQMP_EP_H
 
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ     (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
                                 ZYNQMP_USB1_XHCI_BASEADDR}
--

2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#4 lore raw

PATCH 2/2 mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ

Quoted 15 lines · Jaehoon Chung

Hi,

Quoted 12 lines · Vipul Kumar

This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ and enabled it in respective defconfig.

---
 configs/xilinx_zynqmp_ep_defconfig | 1 +
 drivers/mmc/Kconfig                | 7 +++++++
 drivers/mmc/zynq_sdhci.c           | 4 ----
 include/configs/xilinx_zynqmp_ep.h | 1 -
 4 files changed, 8 insertions(+), 5 deletions(-)
Quoted 12 lines

configs/xilinx_zynqmp_ep_defconfig CONFIG_MISC=y · line 65

Quoted 9 lines
configs/xilinx_zynqmp_ep_defconfig +1 -0
index 00db5e3..4de1ac1 100644
@@ -62,6 +62,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
+CONFIG_ZYNQ_SDHCI_MIN_FREQ=101562

It seems that 101562 is the shifted value. If ZYNQ_SDHCI_MIN_REQ is set to 100KHz, what happen?

Vipul: Please test it but I think 100kHz should just work without any issue.

M