summaryrefslogtreecommitdiffstats
path: root/board
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
parent452e8e72ada5141f58008a902e1d4be42ce15abb (diff)
downloadblackbird-obmc-uboot-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.tar.gz
blackbird-obmc-uboot-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.zip
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')
-rw-r--r--board/dave/PPChameleonEVB/config.mk4
-rw-r--r--board/eltec/bab7xx/asm_init.S1
-rw-r--r--board/eltec/bab7xx/l2cache.c1
-rw-r--r--board/eltec/elppc/asm_init.S1
-rw-r--r--board/fads/fads.h22
-rw-r--r--board/funkwerk/vovpn-gw/flash.c57
-rw-r--r--board/innokom/flash.c177
-rw-r--r--board/mpc8260ads/flash.c56
-rw-r--r--board/mx1fs2/flash.c65
-rw-r--r--board/sixnet/sixnet.c67
-rw-r--r--board/voiceblue/voiceblue.c80
-rw-r--r--board/xsengine/flash.c78
12 files changed, 26 insertions, 583 deletions
diff --git a/board/dave/PPChameleonEVB/config.mk b/board/dave/PPChameleonEVB/config.mk
index 1bdf5e4fcf..5856aec0ce 100644
--- a/board/dave/PPChameleonEVB/config.mk
+++ b/board/dave/PPChameleonEVB/config.mk
@@ -21,4 +21,8 @@
# MA 02111-1307 USA
#
+# Reserve 256 kB for Monitor
TEXT_BASE = 0xFFFC0000
+
+# Reserve 320 kB for Monitor
+#TEXT_BASE = 0xFFFB0000
diff --git a/board/eltec/bab7xx/asm_init.S b/board/eltec/bab7xx/asm_init.S
index 3f88bc2b4b..2a9b33e12c 100644
--- a/board/eltec/bab7xx/asm_init.S
+++ b/board/eltec/bab7xx/asm_init.S
@@ -24,6 +24,7 @@
*/
#include <config.h>
+#include <asm/processor.h>
#include <74xx_7xx.h>
#include <mpc106.h>
#include <version.h>
diff --git a/board/eltec/bab7xx/l2cache.c b/board/eltec/bab7xx/l2cache.c
index 077f2c919d..1e7537745a 100644
--- a/board/eltec/bab7xx/l2cache.c
+++ b/board/eltec/bab7xx/l2cache.c
@@ -27,6 +27,7 @@
#include <pci.h>
#include <mpc106.h>
+#include <asm/processor.h>
/* defines L2CR register for MPC750 */
diff --git a/board/eltec/elppc/asm_init.S b/board/eltec/elppc/asm_init.S
index a5605b7033..1b8d399ed3 100644
--- a/board/eltec/elppc/asm_init.S
+++ b/board/eltec/elppc/asm_init.S
@@ -24,6 +24,7 @@
*/
#include <config.h>
+#include <asm/processor.h>
#include <version.h>
#include <mpc106.h>
diff --git a/board/fads/fads.h b/board/fads/fads.h
index 9aed226b1d..aff1b7efec 100644
--- a/board/fads/fads.h
+++ b/board/fads/fads.h
@@ -197,9 +197,25 @@
#define CFG_DIRECT_FLASH_TFTP
#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
-#define CFG_JFFS2_FIRST_BANK 0
-#define CFG_JFFS2_NUM_BANKS CFG_MAX_FLASH_BANKS
-#define CFG_JFFS2_FIRST_SECTOR 4
+
+/*
+ * JFFS2 partitions
+ *
+ */
+/* No command line, one static partition, whole device */
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV "nor0"
+#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
+#define CONFIG_JFFS2_PART_OFFSET 0x00000000
+
+/* mtdparts command line support */
+/* Note: fake mtd_id used, no linux mtd map file */
+/*
+#define CONFIG_JFFS2_CMDLINE
+#define MTDIDS_DEFAULT "nor0=fads0,nor1=fads-1,nor2=fads-2,nor3=fads-3"
+#define MTDPARTS_DEFAULT "mtdparts=fads-0:-@1m(user1),fads-1:-(user2),fads-2:-(user3),fads-3:-(user4)"
+*/
+
#define CFG_JFFS2_SORT_FRAGMENTS
#endif /* CFG_CMD_JFFS2 */
diff --git a/board/funkwerk/vovpn-gw/flash.c b/board/funkwerk/vovpn-gw/flash.c
index 4073453ada..7dd0d3f234 100644
--- a/board/funkwerk/vovpn-gw/flash.c
+++ b/board/funkwerk/vovpn-gw/flash.c
@@ -447,60 +447,3 @@ flash_real_protect(flash_info_t *info, long sector, int prot)
*addr = FLASH_CMD_RESET;
return (0);
}
-
-/*-----------------------------------------------------------------------
- * Support for flash file system (JFFS2)
- *
- * We use custom partition info function because we have to fit the
- * file system image between first sector (containing hard reset
- * configuration word) and the sector containing U-Boot image. Standard
- * partition info function does not allow for last sector specification
- * and assumes that the file system occupies flash bank up to and
- * including bank's last sector.
- */
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CFG_JFFS_CUSTOM_PART)
-#error TODO
-
-#ifndef CFG_JFFS2_FIRST_SECTOR
-#define CFG_JFFS2_FIRST_SECTOR 0
-#endif
-#ifndef CFG_JFFS2_FIRST_BANK
-#define CFG_JFFS2_FIRST_BANK 0
-#endif
-#ifndef CFG_JFFS2_NUM_BANKS
-#define CFG_JFFS2_NUM_BANKS 1
-#endif
-#define CFG_JFFS2_LAST_BANK (CFG_JFFS2_FIRST_BANK + CFG_JFFS2_NUM_BANKS - 1)
-
-#include <jffs2/jffs2.h>
-
-static struct part_info partition;
-
-struct part_info *jffs2_part_info(int part_num)
-{
- int i;
-
- if (part_num == 0) {
- if (partition.usr_priv == 0) {
- partition.offset =
- (unsigned char *) flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR];
- for (i = CFG_JFFS2_FIRST_BANK; i <= CFG_JFFS2_LAST_BANK; i++)
- partition.size += flash_info[i].size;
- partition.size -=
- flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR] -
- flash_info[CFG_JFFS2_FIRST_BANK].start[0];
-#ifdef CFG_JFFS2_LAST_SECTOR
- i = flash_info[CFG_JFFS2_LAST_BANK].sector_count - 1;
- partition.size -=
- flash_info[CFG_JFFS2_LAST_BANK].start[i] -
- flash_info[CFG_JFFS2_LAST_BANK].start[CFG_JFFS2_LAST_SECTOR];
-#endif
-
- partition.usr_priv = (void *)1;
- }
- return &partition;
- }
- return 0;
-}
-
-#endif /* JFFS2 */
diff --git a/board/innokom/flash.c b/board/innokom/flash.c
index 29c9166484..298acc86a3 100644
--- a/board/innokom/flash.c
+++ b/board/innokom/flash.c
@@ -35,10 +35,6 @@
#include <common.h>
#include <asm/arch/pxa-regs.h>
-#if defined CFG_JFFS_CUSTOM_PART
-#include <jffs2/jffs2.h>
-#endif
-
/* Debugging macros ------------------------------------------------------ */
#undef FLASH_DEBUG
@@ -78,179 +74,6 @@
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
-
-#if defined CFG_JFFS_CUSTOM_PART
-
-/**
- * jffs2_part_info - get information about a JFFS2 partition
- *
- * @part_num: number of the partition you want to get info about
- * @return: struct part_info* in case of success, 0 if failure
- */
-
-static struct part_info part;
-static int current_part = -1;
-
-#ifdef CONFIG_MTD_INNOKOM_16MB
-#ifdef CONFIG_MTD_INNOKOM_64MB
-#error Please define only one CONFIG_MTD_INNOKOM_XXMB option.
-#endif
-struct part_info* jffs2_part_info(int part_num) {
- void *jffs2_priv_saved = part.jffs2_priv;
-
- PRINTK2("jffs2_part_info: part_num=%i\n",part_num);
-
- if (current_part == part_num)
- return &part;
-
- /* u-boot partition */
- if(part_num==0){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00000000;
- part.size=256*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* primary OS+firmware partition */
- if(part_num==1){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00040000;
- part.size=768*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* secondary OS+firmware partition */
- if(part_num==2){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00100000;
- part.size=8*1024*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* data partition */
- if(part_num==3){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00900000;
- part.size=7*1024*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- if (current_part == part_num) {
- part.usr_priv = &current_part;
- part.jffs2_priv = jffs2_priv_saved;
- return &part;
- }
-
- PRINTK("jffs2_part_info: end of partition table\n");
- return 0;
-}
-#endif /* CONFIG_MTD_INNOKOM_16MB */
-
-#ifdef CONFIG_MTD_INNOKOM_64MB
-#ifdef CONFIG_MTD_INNOKOM_16MB
-#error Please define only one CONFIG_MTD_INNOKOM_XXMB option.
-#endif
-struct part_info* jffs2_part_info(int part_num) {
- void *jffs2_priv_saved = part.jffs2_priv;
-
- PRINTK2("jffs2_part_info: part_num=%i\n",part_num);
-
- if (current_part == part_num)
- return &part;
-
- /* u-boot partition */
- if(part_num==0){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00000000;
- part.size=256*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* primary OS+firmware partition */
- if(part_num==1){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00040000;
- part.size=16*1024*1024-128*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* secondary OS+firmware partition */
- if(part_num==2){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x01020000;
- part.size=16*1024*1024-128*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* data partition */
- if(part_num==3){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x02000000;
- part.size=32*1024*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- PRINTK("part.offset = 0x%08x\n",(unsigned int)part.offset);
- PRINTK("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- if (current_part == part_num) {
- part.usr_priv = &current_part;
- part.jffs2_priv = jffs2_priv_saved;
- return &part;
- }
-
- PRINTK("jffs2_part_info: end of partition table\n");
- return 0;
-}
-#endif /* CONFIG_MTD_INNOKOM_64MB */
-#endif /* defined CFG_JFFS_CUSTOM_PART */
-
-
/**
* flash_init: - initialize data structures for flash chips
*
diff --git a/board/mpc8260ads/flash.c b/board/mpc8260ads/flash.c
index b2e9df2432..59997aac4f 100644
--- a/board/mpc8260ads/flash.c
+++ b/board/mpc8260ads/flash.c
@@ -490,59 +490,3 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
return rc;
}
-
-/*-----------------------------------------------------------------------
- * Support for flash file system (JFFS2)
- *
- * We use custom partition info function because we have to fit the
- * file system image between first sector (containing hard reset
- * configuration word) and the sector containing U-Boot image. Standard
- * partition info function does not allow for last sector specification
- * and assumes that the file system occupies flash bank up to and
- * including bank's last sector.
- */
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CFG_JFFS_CUSTOM_PART)
-
-#ifndef CFG_JFFS2_FIRST_SECTOR
-#define CFG_JFFS2_FIRST_SECTOR 0
-#endif
-#ifndef CFG_JFFS2_FIRST_BANK
-#define CFG_JFFS2_FIRST_BANK 0
-#endif
-#ifndef CFG_JFFS2_NUM_BANKS
-#define CFG_JFFS2_NUM_BANKS 1
-#endif
-#define CFG_JFFS2_LAST_BANK (CFG_JFFS2_FIRST_BANK + CFG_JFFS2_NUM_BANKS - 1)
-
-#include <jffs2/jffs2.h>
-
-static struct part_info partition;
-
-struct part_info *jffs2_part_info(int part_num)
-{
- int i;
-
- if (part_num == 0) {
- if (partition.usr_priv == 0) {
- partition.offset =
- (unsigned char *) flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR];
- for (i = CFG_JFFS2_FIRST_BANK; i <= CFG_JFFS2_LAST_BANK; i++)
- partition.size += flash_info[i].size;
- partition.size -=
- flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR] -
- flash_info[CFG_JFFS2_FIRST_BANK].start[0];
-#ifdef CFG_JFFS2_LAST_SECTOR
- i = flash_info[CFG_JFFS2_LAST_BANK].sector_count - 1;
- partition.size -=
- flash_info[CFG_JFFS2_LAST_BANK].start[i] -
- flash_info[CFG_JFFS2_LAST_BANK].start[CFG_JFFS2_LAST_SECTOR];
-#endif
-
- partition.usr_priv = (void *)1;
- }
- return &partition;
- }
- return 0;
-}
-
-#endif /* JFFS2 */
diff --git a/board/mx1fs2/flash.c b/board/mx1fs2/flash.c
index 3a79a9eb4b..38063106e2 100644
--- a/board/mx1fs2/flash.c
+++ b/board/mx1fs2/flash.c
@@ -25,10 +25,6 @@
#include <common.h>
-#if defined CFG_JFFS_CUSTOM_PART
-#include <jffs2/jffs2.h>
-#endif
-
#define FLASH_BANK_SIZE MX1FS2_FLASH_BANK_SIZE
#define MAIN_SECT_SIZE MX1FS2_FLASH_SECT_SIZE
@@ -70,67 +66,6 @@ static int write_word_amd(flash_info_t * info, FPWV * dest, FPW data);
static void flash_sync_real_protect(flash_info_t * info);
#endif
-#if defined CFG_JFFS_CUSTOM_PART
-
-/**
- * jffs2_part_info - get information about a JFFS2 partition
- *
- * @part_num: number of the partition you want to get info about
- * @return: struct part_info* in case of success, 0 if failure
- */
-
-static struct part_info part;
-static int current_part = -1;
-
-struct part_info *
-jffs2_part_info(int part_num)
-{
- void *jffs2_priv_saved = part.jffs2_priv;
-
- printf("jffs2_part_info: part_num=%i\n", part_num);
-
- if (current_part == part_num)
- return &part;
-
- /* rootfs */
- if (part_num == 0) {
- memset(&part, 0, sizeof (part));
-
- part.offset = (char *) MX1FS2_JFFS2_PART0_START;
- part.size = MX1FS2_JFFS2_PART0_SIZE;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- printf("part.offset = 0x%08x\n", (unsigned int) part.offset);
- printf("part.size = 0x%08x\n", (unsigned int) part.size);
- }
-
- /* userfs */
- if (part_num == 1) {
- memset(&part, 0, sizeof (part));
-
- part.offset = (char *) MX1FS2_JFFS2_PART1_START;
- part.size = MX1FS2_JFFS2_PART1_SIZE;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- printf("part.offset = 0x%08x\n", (unsigned int) part.offset);
- printf("part.size = 0x%08x\n", (unsigned int) part.size);
- }
-
- if (current_part == part_num) {
- part.usr_priv = &current_part;
- part.jffs2_priv = jffs2_priv_saved;
- return &part;
- }
-
- printf("jffs2_part_info: end of partition table\n");
- return 0;
-}
-#endif /* CFG_JFFS_CUSTOM_PART */
-
/*-----------------------------------------------------------------------
* flash_init()
*
diff --git a/board/sixnet/sixnet.c b/board/sixnet/sixnet.c
index 42d1497040..c31ea539e2 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 */
diff --git a/board/voiceblue/voiceblue.c b/board/voiceblue/voiceblue.c
index 9691106581..7a2d243ef8 100644
--- a/board/voiceblue/voiceblue.c
+++ b/board/voiceblue/voiceblue.c
@@ -56,90 +56,10 @@ int dram_init(void)
return 0;
}
-#ifndef VOICEBLUE_SMALL_FLASH
-
-#include <jffs2/jffs2.h>
-
-extern flash_info_t flash_info[];
-static struct part_info partinfo;
-static int current_part = -1;
-
-/* Partition table (Linux MTD see it this way)
- *
- * 0 - U-Boot
- * 1 - env
- * 2 - redundant env
- * 3 - data1 (jffs2)
- * 4 - data2 (jffs2)
- */
-
-static struct {
- ulong offset;
- ulong size;
-} part[5];
-
-static void partition_flash(flash_info_t *info)
-{
- char mtdparts[128];
- int i, n, size, psize;
- const ulong plen[3] = { CFG_MONITOR_LEN, CFG_ENV_SIZE, CFG_ENV_SIZE };
-
- size = n = 0;
- for (i = 0; i < 4; i++) {
- part[i].offset = info->start[n];
- psize = i < 3 ? plen[i] : (info->size - size) / 2;
- while (part[i].size < psize) {
- if (++n > info->sector_count) {
- printf("Partitioning error. System halted.\n");
- while (1) ;
- }
- part[i].size += info->start[n] - info->start[n - 1];
- }
- size += part[i].size;
- }
- part[4].offset = info->start[n];
- part[4].size = info->start[info->sector_count - 1] - info->start[n];
-
- sprintf(mtdparts, "omapflash.0:"
- "%dk(U-Boot)ro,%dk(env),%dk(r_env),%dk(data1),-(data2)",
- part[0].size >> 10, part[1].size >> 10,
- part[2].size >> 10, part[3].size >> 10);
- setenv ("mtdparts", mtdparts);
-}
-
-struct part_info* jffs2_part_info(int part_num)
-{
- void *jffs2_priv_saved = partinfo.jffs2_priv;
-
- if (part_num != 3 && part_num != 4)
- return NULL;
-
- if (current_part != part_num) {
- memset(&partinfo, 0, sizeof(partinfo));
- current_part = part_num;
- partinfo.offset = (char*) part[part_num].offset;
- partinfo.size = part[part_num].size;
- partinfo.usr_priv = &current_part;
- partinfo.jffs2_priv = jffs2_priv_saved;
- }
-
- return &partinfo;
-}
-
-#endif
-
int misc_init_r(void)
{
*((volatile unsigned short *) VOICEBLUE_LED_REG) = 0x55;
-#ifndef VOICEBLUE_SMALL_FLASH
- if (flash_info[0].flash_id == FLASH_UNKNOWN) {
- printf("Unknown flash. System halted.\n");
- while (1) ;
- }
- partition_flash(&flash_info[0]);
-#endif
-
return 0;
}
diff --git a/board/xsengine/flash.c b/board/xsengine/flash.c
index bfa287b004..3f93700d6d 100644
--- a/board/xsengine/flash.c
+++ b/board/xsengine/flash.c
@@ -27,10 +27,6 @@
#include <common.h>
#include <linux/byteorder/swab.h>
-#if defined CFG_JFFS_CUSTOM_PART
-#include <jffs2/jffs2.h>
-#endif
-
#define SWAP(x) __swab32(x)
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
@@ -40,80 +36,6 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info);
static int write_word (flash_info_t *info, ulong dest, ulong data);
static void flash_get_offsets (ulong base, flash_info_t *info);
-#if defined CFG_JFFS_CUSTOM_PART
-
-/*
- * jffs2_part_info - get information about a JFFS2 partition
- *
- * @part_num: number of the partition you want to get info about
- * @return: struct part_info* in case of success, 0 if failure
- */
-
-static struct part_info part;
-static int current_part = -1;
-
-struct part_info* jffs2_part_info(int part_num) {
- void *jffs2_priv_saved = part.jffs2_priv;
-
- printf("jffs2_part_info: part_num=%i\n",part_num);
-
- if (current_part == part_num)
- return &part;
-
- /* u-boot partition */
- if(part_num==0){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00000000;
- part.size=256*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- printf("part.offset = 0x%08x\n",(unsigned int)part.offset);
- printf("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* primary OS+firmware partition */
- if(part_num==1){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00040000;
- part.size=1024*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- printf("part.offset = 0x%08x\n",(unsigned int)part.offset);
- printf("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- /* secondary OS+firmware partition */
- if(part_num==2){
- memset(&part, 0, sizeof(part));
-
- part.offset=(char*)0x00140000;
- part.size=8*1024*1024;
-
- /* Mark the struct as ready */
- current_part = part_num;
-
- printf("part.offset = 0x%08x\n",(unsigned int)part.offset);
- printf("part.size = 0x%08x\n",(unsigned int)part.size);
- }
-
- if (current_part == part_num) {
- part.usr_priv = &current_part;
- part.jffs2_priv = jffs2_priv_saved;
- return &part;
- }
-
- printf("jffs2_part_info: end of partition table\n");
- return 0;
-}
-#endif
-
-
/*-----------------------------------------------------------------------
*/
unsigned long flash_init (void)
OpenPOWER on IntegriCloud