From aa5ffa16d7e4c461b7b77bf8e79d2ef5638cf754 Mon Sep 17 00:00:00 2001 From: "dirk.behme@googlemail.com" Date: Sun, 10 Aug 2008 17:56:36 +0200 Subject: OneNAND: Remove base address offset usage While locally preparing some U-Boot patches for ARM based OMAP3 boards, some using OneNAND and some using NAND, we found some differences in OneNAND and NAND command address handling. As this might confuse users (it already confused us), we like to align OneNAND and NAND address handling. The issue is that cmd_onenand.c subtracts the onenand base address from the addresses you type into the u-boot command line so, unlike nand, you can't use addresses relative to the start of the onenand part e.g. this won't work: onenand read 82000000 280000 400000 you have to use: onenand read 82000000 20280000 400000 Looking at recent git, the only board currently using OneNAND is Apollon, and for this the OneNAND base address is 0 (apollon.h) #define CFG_ONENAND_BASE 0x00000000 so patch below won't break any existing boards and will align OneNAND and NAND handling on boards where OneNAND base address is != 0. Signed-off-by: Steve Sakoman Signed-off-by: Manikandan Pillai Signed-off-by: Dirk Behme --- common/cmd_onenand.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'common/cmd_onenand.c') diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index ce99a38..d6d3376 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -58,8 +58,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } else { start = simple_strtoul(argv[2], NULL, 10); end = simple_strtoul(argv[3], NULL, 10); - start -= (unsigned long)onenand_chip.base; - end -= (unsigned long)onenand_chip.base; start >>= onenand_chip.erase_shift; end >>= onenand_chip.erase_shift; @@ -92,8 +90,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) size_t retlen = 0; int oob = strncmp(argv[1], "read.oob", 8) ? 0 : 1; - ofs -= (unsigned long)onenand_chip.base; - if (oob) onenand_read_oob(&onenand_mtd, ofs, len, &retlen, (u_char *) addr); @@ -111,8 +107,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) size_t len = simple_strtoul(argv[4], NULL, 16); size_t retlen = 0; - ofs -= (unsigned long)onenand_chip.base; - onenand_write(&onenand_mtd, ofs, len, &retlen, (u_char *) addr); printf("Done\n"); -- cgit v1.1 From 195ccfc5991d48764b2519941e3507f693851d5d Mon Sep 17 00:00:00 2001 From: Fathi BOUDRA Date: Wed, 6 Aug 2008 10:06:20 +0200 Subject: OneNAND: Fill in MTD function pointers for OneNAND. onenand_print_device_info(): - Now returns a string to be placed in mtd->name, rather than calling printf. - Remove verbose parameter as it becomes useless. Signed-off-by: Fathi Boudra Signed-off-by: Scott Wood --- common/cmd_onenand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/cmd_onenand.c') diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index d6d3376..419bf70 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -38,7 +38,7 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) onenand_init(); return 0; } - onenand_print_device_info(onenand_chip.device_id, 1); + printf("%s\n", onenand_mtd.name); return 0; default: -- cgit v1.1 From d6e9ee92e890f67594ab150689510df361133ead Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 13 Aug 2008 01:40:38 +0200 Subject: common: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_onenand.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'common/cmd_onenand.c') diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 419bf70..5e2062b 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -12,8 +12,6 @@ #include #include -#ifdef CONFIG_CMD_ONENAND - #include #include #include @@ -159,5 +157,3 @@ U_BOOT_CMD( "onenand block[.oob] addr block [page] [len] - " "read data with (block [, page]) to addr" ); - -#endif /* CONFIG_CMD_ONENAND */ -- cgit v1.1