summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-02-05 10:24:22 -0500
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-02-07 18:17:49 +0200
commit5a99b9de1a845bf254292ae4730633e6ca8a29c7 (patch)
tree1affc403ef892fb8c5eafac34221d77adfccbbed /common
parent792970b0a344d905848fb98564ed469786af11b7 (diff)
downloadu-boot-imx-5a99b9de1a845bf254292ae4730633e6ca8a29c7.zip
u-boot-imx-5a99b9de1a845bf254292ae4730633e6ca8a29c7.tar.gz
u-boot-imx-5a99b9de1a845bf254292ae4730633e6ca8a29c7.tar.bz2
cmd_mmc.c: Add bootbus mmc sub-command
Add a bootbus sub-command to the mmc command to allow for setting the boot_bus_width, reset_boot_bus_width and boot_mode fields of BOOT_BUS_WIDTH (EXT_CSD[177]). Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mmc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 5842e85..a028149 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -338,6 +338,33 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* acknowledge to be sent during boot operation */
return mmc_set_part_conf(mmc, ack, part_num, access);
+ } else if (strcmp(argv[1], "bootbus") == 0) {
+ int dev;
+ struct mmc *mmc;
+ u8 width, reset, mode;
+
+ if (argc == 6) {
+ dev = simple_strtoul(argv[2], NULL, 10);
+ width = simple_strtoul(argv[3], NULL, 10);
+ reset = simple_strtoul(argv[4], NULL, 10);
+ mode = simple_strtoul(argv[5], NULL, 10);
+ } else {
+ return CMD_RET_USAGE;
+ }
+
+ mmc = find_mmc_device(dev);
+ if (!mmc) {
+ printf("no mmc device at slot %x\n", dev);
+ return 1;
+ }
+
+ if (IS_SD(mmc)) {
+ puts("BOOT_BUS_WIDTH only exists on eMMC\n");
+ return 1;
+ }
+
+ /* acknowledge to be sent during boot operation */
+ return mmc_set_boot_bus_width(mmc, width, reset, mode);
} else if (strcmp(argv[1], "bootpart-resize") == 0) {
int dev;
struct mmc *mmc;
@@ -475,6 +502,8 @@ U_BOOT_CMD(
" - Enable boot_part for booting and enable R/W access of boot_part\n"
"mmc close <dev> <boot_partition>\n"
" - Enable boot_part for booting and disable access to boot_part\n"
+ "mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode\n"
+ " - Set the BOOT_BUS_WIDTH field of the specified device\n"
"mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>\n"
" - Change sizes of boot and RPMB partitions of specified device\n"
"mmc partconf dev boot_ack boot_partition partition_access\n"