summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-30 15:48:21 +0200
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-03-09 01:40:02 +0100
commitf030f8d8909f28f064327a540aae503c9d62c19a (patch)
tree75b8ff9a06992f30ac1d78b1fe63619299934181 /board
parent6e8f97607fab7b40521dc6eb4b6f380cb2445c5c (diff)
ARM: sunxi: add emmcboot command
command that returns true if the first mmc device is the on-board emmc. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/board.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 0f5cdf03eb..5aeb6af7c1 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -33,6 +33,7 @@
#include <nand.h>
#include <net.h>
#include <sy8106a.h>
+#include <command.h>
#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
/* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */
@@ -863,3 +864,34 @@ int ft_board_setup(void *blob, bd_t *bd)
#endif
return 0;
}
+#endif /* CONFIG_OF_BOARD_SETUP */
+
+#ifdef CONFIG_SUNXI_PANGOLIN
+static int do_emmcboot(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ struct mmc *mmc0;
+ struct sunxi_mmc_host {
+ unsigned mmc_no;
+ uint32_t *mclkreg;
+ unsigned fatal_err;
+ struct sunxi_mmc *reg;
+ struct mmc_config cfg;
+ };
+
+ mmc0 = find_mmc_device(0);
+ /* lookup if first mmc device maps to the emmc */
+ struct sunxi_mmc_host *mmchost = mmc0->priv;
+ if(mmchost->mmc_no == 2)
+ return 0;
+ else
+ return 1;
+}
+
+U_BOOT_CMD(
+ emmcboot, CONFIG_SYS_MAXARGS, 1, do_emmcboot,
+ "returns true if booted from eMMC",
+ NULL
+ );
+#endif
+