summaryrefslogtreecommitdiff
path: root/board/sixnet
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-08 01:03:24 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-08 01:03:24 +0200
commit700a0c648df72f2c8e0589c0d0470b5ffd7cab7b (patch)
tree819928504de4b8fc80e632fa5c485204fd7542a7 /board/sixnet
parent452e8e72ada5141f58008a902e1d4be42ce15abb (diff)
downloadu-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.zip
u-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.tar.gz
u-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.tar.bz2
Add common (with Linux) MTD partition scheme and "mtdparts" command
Old, obsolete and duplicated code was cleaned up and replace by the new partitioning method. There are two possible approaches now: * define a single, static partition * use mtdparts command line option and dynamic partitioning Default is static partitioning.
Diffstat (limited to 'board/sixnet')
-rw-r--r--board/sixnet/sixnet.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/board/sixnet/sixnet.c b/board/sixnet/sixnet.c
index 42d1497..c31ea53 100644
--- a/board/sixnet/sixnet.c
+++ b/board/sixnet/sixnet.c
@@ -601,70 +601,3 @@ long int initdram(int board_type)
return (size_sdram);
}
-
-#ifdef CFG_JFFS_CUSTOM_PART
-
-static struct part_info part;
-
-#define jffs2_block(i) \
- ((struct jffs2_unknown_node*)(CFG_JFFS2_BASE + (i) * 65536))
-
-struct part_info* jffs2_part_info(int part_num)
-{
- DECLARE_GLOBAL_DATA_PTR;
- bd_t *bd = gd->bd;
- char* s;
- int i;
- int bootnor = 0; /* assume booting from NAND flash */
-
- if (part_num != 0)
- return 0; /* only support one partition */
-
- if (part.usr_priv == (void*)1)
- return &part; /* already have part info */
-
- memset(&part, 0, sizeof(part));
-
- if (nand_dev_desc[0].ChipID == NAND_ChipID_UNKNOWN)
- bootnor = 1;
- else if (bd->bi_flashsize < 0x800000)
- bootnor = 0;
- else for (i = 0; !bootnor && i < 4; ++i) {
- /* boot from NOR if JFFS2 info in any of
- * first 4 erase blocks
- */
-
- if (jffs2_block(i)->magic == JFFS2_MAGIC_BITMASK)
- bootnor = 1;
- }
-
- if (bootnor) {
- /* no NAND flash or boot in NOR, use NOR flash */
- part.offset = (unsigned char *)CFG_JFFS2_BASE;
- part.size = CFG_JFFS2_SIZE;
- }
- else {
- char readcmd[60];
-
- /* boot info in NAND flash, get and use copy in RAM */
-
- /* override info from environment if present */
- s = getenv("fsaddr");
- part.offset = s ? (void *)simple_strtoul(s, NULL, 16)
- : (void *)CFG_JFFS2_RAMBASE;
- s = getenv("fssize");
- part.size = s ? simple_strtoul(s, NULL, 16)
- : CFG_JFFS2_RAMSIZE;
-
- /* read from nand flash */
- sprintf(readcmd, "nand read.jffs2 %x 0 %x",
- (uint32_t)part.offset, part.size);
- run_command(readcmd, 0);
- }
-
- part.erasesize = 0; /* unused */
- part.usr_priv=(void*)1; /* ready */
-
- return &part;
-}
-#endif /* ifdef CFG_JFFS_CUSTOM_PART */