summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2014-12-03 06:30:30 (GMT)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>2014-12-10 05:32:18 (GMT)
commitd7916b1d38c20a55ca7248742dd0bdf049deb7e4 (patch)
tree60156c97bab28c15174daf1b6ffc28f88acd80ad
parent9427c610cd9cabaa6ccdb59f8effdce5272b8917 (diff)
downloadu-boot-d7916b1d38c20a55ca7248742dd0bdf049deb7e4.tar.xz
arm: rmobile: lager: Add support MMC and MMC command
Lager board has been connected to eMMC of 8GB to MMC1 port. This enables MMC1 port and MMC command. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
-rw-r--r--board/renesas/lager/lager.c27
-rw-r--r--include/configs/lager.h9
2 files changed, 36 insertions, 0 deletions
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 4afb1ac..d1e29d2 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -19,8 +19,10 @@
#include <asm/gpio.h>
#include <asm/arch/rmobile.h>
#include <asm/arch/rcar-mstp.h>
+#include <asm/arch/mmc.h>
#include <miiphy.h>
#include <i2c.h>
+#include <mmc.h>
#include "qos.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -54,6 +56,7 @@ void s_init(void)
#define TMU0_MSTP125 (1 << 25)
#define SCIF0_MSTP721 (1 << 21)
#define ETHER_MSTP813 (1 << 13)
+#define MMC1_MSTP305 (1 << 5)
int board_early_init_f(void)
{
@@ -63,6 +66,8 @@ int board_early_init_f(void)
mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721);
/* ETHER */
mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHER_MSTP813);
+ /* eMMC */
+ mstp_clrbits_le32(MSTPSR3, SMSTPCR3, MMC1_MSTP305);
return 0;
}
@@ -141,6 +146,28 @@ int board_phy_config(struct phy_device *phydev)
return 0;
}
+int board_mmc_init(bd_t *bis)
+{
+ int ret = 0;
+
+#ifdef CONFIG_SH_MMCIF
+ gpio_request(GPIO_FN_MMC1_D0, NULL);
+ gpio_request(GPIO_FN_MMC1_D1, NULL);
+ gpio_request(GPIO_FN_MMC1_D2, NULL);
+ gpio_request(GPIO_FN_MMC1_D3, NULL);
+ gpio_request(GPIO_FN_MMC1_D4, NULL);
+ gpio_request(GPIO_FN_MMC1_D5, NULL);
+ gpio_request(GPIO_FN_MMC1_D6, NULL);
+ gpio_request(GPIO_FN_MMC1_D7, NULL);
+ gpio_request(GPIO_FN_MMC1_CLK, NULL);
+ gpio_request(GPIO_FN_MMC1_CMD, NULL);
+
+ ret = mmcif_mmc_init();
+#endif
+ return ret;
+}
+
+
int dram_init(void)
{
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
diff --git a/include/configs/lager.h b/include/configs/lager.h
index 9c89b16..291267f 100644
--- a/include/configs/lager.h
+++ b/include/configs/lager.h
@@ -93,6 +93,15 @@
#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
#define CONFIG_USB_STORAGE
+/* MMC */
+#define CONFIG_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_GENERIC_MMC
+
+#define CONFIG_SH_MMCIF
+#define CONFIG_SH_MMCIF_ADDR 0xEE220000
+#define CONFIG_SH_MMCIF_CLK 97500000
+
/* Module stop status bits */
/* INTC-RT */
#define CONFIG_SMSTP0_ENA 0x00400000