summaryrefslogtreecommitdiff
path: root/cpu/arm926ejs/mx28/mmcops.c
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-03-08 17:12:51 +0800
committerTerry Lv <r65388@freescale.com>2010-03-12 11:07:40 +0800
commitaca6f560d03a0780d4713e1f458e132bec28f37b (patch)
tree7556ea9a2ec59871d8947e273437c5066bcd13ea /cpu/arm926ejs/mx28/mmcops.c
parentf4c2bfd8fbed1fcf8d33abf54f614594779f57e8 (diff)
downloadu-boot-imx-aca6f560d03a0780d4713e1f458e132bec28f37b.zip
u-boot-imx-aca6f560d03a0780d4713e1f458e132bec28f37b.tar.gz
u-boot-imx-aca6f560d03a0780d4713e1f458e132bec28f37b.tar.bz2
ENGR00121379: MX28 U-BOOT enhancements
MX28 U-BOOT enhancements. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'cpu/arm926ejs/mx28/mmcops.c')
-rw-r--r--cpu/arm926ejs/mx28/mmcops.c50
1 files changed, 13 insertions, 37 deletions
diff --git a/cpu/arm926ejs/mx28/mmcops.c b/cpu/arm926ejs/mx28/mmcops.c
index eed2046..e1d211b 100644
--- a/cpu/arm926ejs/mx28/mmcops.c
+++ b/cpu/arm926ejs/mx28/mmcops.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -24,7 +24,7 @@
#include <exports.h>
#include <mmc.h>
-#if defined(CONFIG_GENERIC_MMC) && defined(CONFIG_CUSTOMIZE_MMCOPS)
+#ifdef CONFIG_GENERIC_MMC
#define MMCOPS_DEBUG
#define MBR_SIGNATURE 0xaa55
@@ -96,7 +96,7 @@ static int mmc_format(int dev)
/* Warning */
printf("WARN: Data on card will get lost with format.\n"
- "Continue?(y/n)");
+ "Continue? (y/n)");
char ch = getc();
printf("\n");
if (ch != 'y') {
@@ -309,7 +309,7 @@ static int install_sbimage(int dev, void *addr, u32 size)
}
if (memcmp(addr, addr + sectors * mmc->read_bl_len,
sectors * mmc->read_bl_len)) {
- printf("Verifying sbImage write fails");
+ printf("Verifying sbImage write fails\n");
rc = -1;
goto out;
}
@@ -493,7 +493,7 @@ out:
return rc;
}
-int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mxs_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
int dev = 0;
struct mmc *mmc;
@@ -501,9 +501,8 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argc < 2)
goto err_out;
- if (strcmp(argv[1], "read") && strcmp(argv[1], "write") &&
- strcmp(argv[1], "rescan") && strcmp(argv[1], "format") &&
- strcmp(argv[1], "install") && strcmp(argv[1], "list"))
+ if (strcmp(argv[1], "format") &&
+ strcmp(argv[1], "install"))
goto err_out;
if (argc == 2) { /* list */
@@ -531,26 +530,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argc != 6)
goto err_out;
- if (!strcmp(argv[1], "read") || !strcmp(argv[1], "write")) {
- void *addr = (void *)simple_strtoul(argv[3], NULL, 16);
- u32 blk = simple_strtoul(argv[4], NULL, 16);
- u32 cnt = simple_strtoul(argv[5], NULL, 16);
- u32 n;
-
- printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
- argv[1], dev, blk, cnt);
-
- if (!strcmp(argv[1], "read")) {
- n = mmc->block_dev.block_read(dev, blk, cnt, addr);
- /* flush cache after read */
- flush_cache((ulong)addr, cnt * 512); /* FIXME */
- } else /* write */
- n = mmc->block_dev.block_write(dev, blk, cnt, addr);
-
- printf("%d blocks %s: %s\n", n, argv[1],
- (n == cnt) ? "OK" : "ERROR");
- return (n == cnt) ? 0 : -1;
- } else if (!strcmp(argv[1], "install")) {
+ if (!strcmp(argv[1], "install")) {
void *addr = (void *)simple_strtoul(argv[3], NULL, 16);
u32 size = simple_strtoul(argv[4], NULL, 16);
@@ -568,12 +548,8 @@ err_out:
}
U_BOOT_CMD(
- mmc, 6, 1, do_mmcops,
- "MMC sub system",
- "mmc read <device num> addr blk# cnt\n"
- "mmc write <device num> addr blk# cnt\n"
- "mmc rescan <device num>\n"
- "mmc format <device num>\n"
- "mmc install <device num> addr size sbImage/uImage/rootfs\n"
- "mmc list - lists available devices");
-#endif /* (CONFIG_GENERIC_MMC && CONFIG_CUSTOMIZE_MMCOPS) */
+ mxs_mmc, 6, 1, do_mxs_mmcops,
+ "MXS specific MMC sub system",
+ "mxs_mmc format <device num>\n"
+ "mxs_mmc install <device num> addr size sbImage/uImage/rootfs\n");
+#endif /* CONFIG_GENERIC_MMC */