From: carlo@caione.org (Carlo Caione)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 2/2] arm: amlogic: Enable MMC driver on Odroid-C2
Date: Thu, 12 May 2016 14:41:42 +0200 [thread overview]
Message-ID: <1463056902-8533-3-git-send-email-carlo@caione.org> (raw)
In-Reply-To: <1463056902-8533-1-git-send-email-carlo@caione.org>
From: Carlo Caione <carlo@endlessm.com>
Add support for the MMC on the Hardkernel Odroid-C2 board.
Signed-off-by: Carlo Caione <carlo@endlessm.com>
---
board/hardkernel/odroid-c2/odroid-c2.c | 42 ++++++++++++++++++++++++++++++++++
configs/odroid-c2_defconfig | 5 ++++
include/configs/odroid-c2.h | 7 ++++++
3 files changed, 54 insertions(+)
diff --git a/board/hardkernel/odroid-c2/odroid-c2.c b/board/hardkernel/odroid-c2/odroid-c2.c
index bd72100..34b9a95 100644
--- a/board/hardkernel/odroid-c2/odroid-c2.c
+++ b/board/hardkernel/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>
@@ -65,3 +66,44 @@ int misc_init_r(void)
return 0;
}
+
+#ifdef CONFIG_GENERIC_MMC
+
+static const struct meson_mmc_platdata gxbb_sd_platdata[] = {
+ { .sd_emmc_reg = (struct meson_mmc_regs *)SD_EMMC_BASE_A },
+ { .sd_emmc_reg = (struct meson_mmc_regs *)SD_EMMC_BASE_B },
+ { .sd_emmc_reg = (struct meson_mmc_regs *)SD_EMMC_BASE_C },
+};
+
+U_BOOT_DEVICE(meson_mmc) = {
+ .name = "meson_mmc",
+ .platdata = &gxbb_sd_platdata[CONFIG_MMC_MESON_SD_PORT],
+};
+
+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_SD_PORT);
+
+ return 0;
+}
+
+#endif
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index a771b20..a1ffe73 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -7,11 +7,16 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2"
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
# CONFIG_CMD_FPGA is not set
# CONFIG_CMD_SOURCE is not set
# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
CONFIG_OF_CONTROL=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_MMC=y
CONFIG_DM_ETH=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_DEBUG_UART=y
diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
index 37a5671..4af7cc6 100644
--- a/include/configs/odroid-c2.h
+++ b/include/configs/odroid-c2.h
@@ -46,6 +46,13 @@
#define CONFIG_SYS_LONGHELP
#define CONFIG_CMDLINE_EDITING
+#ifdef CONFIG_DM_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC_MESON
+#define CONFIG_MMC_MESON_SD_PORT 1
+#endif
+
#include <config_distro_defaults.h>
#endif /* __CONFIG_H */
--
2.7.4
next prev parent reply other threads:[~2016-05-12 12:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 12:41 [PATCH 0/2] Add support for Amlogic Meson MMC controller Carlo Caione
2016-05-12 12:41 ` [PATCH 1/2] mmc: Add Amlogic Meson driver Carlo Caione
2016-05-13 13:46 ` Kevin Hilman
2016-05-13 13:53 ` Carlo Caione
2016-05-13 16:07 ` Kevin Hilman
2016-08-07 15:49 ` [U-Boot] " Andreas Färber
2016-08-04 6:48 ` [U-Boot,1/2] " Jaehoon Chung
2016-05-12 12:41 ` Carlo Caione [this message]
2016-05-20 4:51 ` [PATCH 0/2] Add support for Amlogic Meson MMC controller Robert Gadsdon
2016-05-20 6:27 ` Carlo Caione
2016-05-20 8:07 ` Carlo Caione
2016-05-20 18:58 ` Robert Gadsdon
2016-05-20 19:34 ` Carlo Caione
2016-05-21 2:28 ` Robert Gadsdon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463056902-8533-3-git-send-email-carlo@caione.org \
--to=carlo@caione.org \
--cc=linus-amlogic@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).