[U-Boot] [PATCH 4/4] mmc: meson: add MMC support in Odroid C2 board init / config

Heiner Kallweit hkallweit1 at gmail.com
Fri Jan 20 08:17:42 CET 2017


Add MMC support in Odroid C2 board init code and config.

Signed-off-by: Heiner Kallweit <hkallweit1 at gmail.com>
---
 board/amlogic/odroid-c2/odroid-c2.c | 27 +++++++++++++++++++++++++++
 configs/odroid-c2_defconfig         |  6 +++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index b61daaa..b559c71 100644
--- a/board/amlogic/odroid-c2/odroid-c2.c
+++ b/board/amlogic/odroid-c2/odroid-c2.c
@@ -8,6 +8,7 @@
 #include <asm/io.h>
 #include <asm/arch/gxbb.h>
 #include <asm/arch/sm.h>
+#include <asm/arch/sd_emmc.h>
 #include <dm/platdata.h>
 #include <phy.h>
 
@@ -52,3 +53,29 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+static void meson_mmc_pinmux_setup(unsigned int port)
+{
+       switch (port) {
+       case SDIO_PORT_A:
+               setbits_le32(GXBB_PINMUX(8), 0x3f);
+               break;
+       case SDIO_PORT_B:
+               setbits_le32(GXBB_PINMUX(2), 0x3f << 10);
+               break;
+       case SDIO_PORT_C:
+               clrbits_le32(GXBB_PINMUX(2), 0x1f << 22);
+               setbits_le32(GXBB_PINMUX(4), (0x3 << 18) | (3 << 30));
+               break;
+       default:
+               printf("meson: invalid MMC port %d for pinmux setup\n", port);
+               break;
+       }
+}
+
+int board_mmc_init(bd_t *bis)
+{
+       meson_mmc_pinmux_setup(CONFIG_MMC_MESON_GX_SD_PORT);
+
+       return 0;
+}
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 7d0b2b1..b4e3277 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -3,7 +3,10 @@ CONFIG_ARCH_MESON=y
 CONFIG_MESON_GXBB=y
 CONFIG_TARGET_ODROID_C2=y
 CONFIG_IDENT_STRING=" odroid-c2"
-# CONFIG_MMC is not set
+CONFIG_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_MESON_GX=y
+CONFIG_MMC_MESON_GX_SD_PORT=1
 CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2"
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -15,6 +18,7 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MMC=y
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_ETH=y
-- 
2.11.0




More information about the U-Boot mailing list