summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorShengzhou Liu <Shengzhou.Liu@freescale.com>2015-07-28 10:46:47 +0800
committerYork Sun <yorksun@freescale.com>2015-07-31 08:50:19 -0700
commite04dd12bf1fd04a95b9a7c36ddc5ee5ddeb06dab (patch)
tree94e5559f74b798f67e340830ce60f216b25a0d2b /board
parent4bf7f908250f21bb0ea6b81f36e115914167790a (diff)
downloadu-boot-imx-e04dd12bf1fd04a95b9a7c36ddc5ee5ddeb06dab.zip
u-boot-imx-e04dd12bf1fd04a95b9a7c36ddc5ee5ddeb06dab.tar.gz
u-boot-imx-e04dd12bf1fd04a95b9a7c36ddc5ee5ddeb06dab.tar.bz2
powerpc/t1023rdb: eMMC boot without external SD card
eMMC has no CD and WP pins, it needs to add board-specific board_mmc_getcd() and board_mmc_getwp() in SPL to support eMMC boot without external SD card inserted. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/t102xrdb/spl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c
index 1a3a996..9c581ff 100644
--- a/board/freescale/t102xrdb/spl.c
+++ b/board/freescale/t102xrdb/spl.c
@@ -30,6 +30,30 @@ unsigned long get_board_ddr_clk(void)
return CONFIG_DDR_CLK_FREQ;
}
+#if defined(CONFIG_SPL_MMC_BOOT)
+#define GPIO1_SD_SEL 0x00020000
+int board_mmc_getcd(struct mmc *mmc)
+{
+ ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
+ u32 val = in_be32(&pgpio->gpdat);
+
+ /* GPIO1_14, 0: eMMC, 1: SD */
+ val &= GPIO1_SD_SEL;
+
+ return val ? -1 : 1;
+}
+
+int board_mmc_getwp(struct mmc *mmc)
+{
+ ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
+ u32 val = in_be32(&pgpio->gpdat);
+
+ val &= GPIO1_SD_SEL;
+
+ return val ? -1 : 0;
+}
+#endif
+
void board_init_f(ulong bootflag)
{
u32 plat_ratio, sys_clk, ccb_clk;