diff options
author | Wolfgang Grandegger <wg@grandegger.com> | 2009-02-11 18:38:20 +0100 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2009-03-23 15:53:37 -0500 |
commit | 672ed2aee91b4856f6671fc72cd34168d8f1b624 (patch) | |
tree | b2eec2d99fbabf1844a8c2a01e93913000f8828c /common/cmd_nand.c | |
parent | 4ace2823bc1fcc96874069a9a8c0821ff4f95f5d (diff) | |
download | u-boot-imx-672ed2aee91b4856f6671fc72cd34168d8f1b624.zip u-boot-imx-672ed2aee91b4856f6671fc72cd34168d8f1b624.tar.gz u-boot-imx-672ed2aee91b4856f6671fc72cd34168d8f1b624.tar.bz2 |
Enable multi chip support in the NAND layer
This patch adds support for NAND_MAX_CHIPS to the MTD NAND layer.
Multi-chips devices are displayed as shown:
Device 0: 2x NAND 512MiB 3,3V 8-bit, sector size 128 KiB
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'common/cmd_nand.c')
-rw-r--r-- | common/cmd_nand.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 04b3200..e142d76 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -205,6 +205,17 @@ static void do_nand_status(nand_info_t *nand) } #endif +static void nand_print_info(int idx) +{ + nand_info_t *nand = &nand_info[idx]; + struct nand_chip *chip = nand->priv; + printf("Device %d: ", idx); + if (chip->numchips > 1) + printf("%dx ", chip->numchips); + printf("%s, sector size %u KiB\n", + nand->name, nand->erasesize >> 10); +} + int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { int i, dev, ret = 0; @@ -233,9 +244,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) putc('\n'); for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) { if (nand_info[i].name) - printf("Device %d: %s, sector size %u KiB\n", - i, nand_info[i].name, - nand_info[i].erasesize >> 10); + nand_print_info(i); } return 0; } @@ -243,12 +252,12 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) if (strcmp(cmd, "device") == 0) { if (argc < 3) { + putc('\n'); if ((nand_curr_device < 0) || (nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE)) - puts("\nno devices available\n"); + puts("no devices available\n"); else - printf("\nDevice %d: %s\n", nand_curr_device, - nand_info[nand_curr_device].name); + nand_print_info(nand_curr_device); return 0; } dev = (int)simple_strtoul(argv[2], NULL, 10); |