[U-Boot] U-Boot v2009.08 & JFFS2 (NOR)

Tommy Wang subscription at august8.net
Tue Sep 15 03:08:52 CEST 2009


Hello U-Boot Users,

I am working on updating a EP8248 based board from a very old U-Boot
1.1.2 to v2009.08.

The board has 2 banks of 32MB/256 sector NOR flash at 0xFC000000 and
0xFE000000.  The (single) JFFS2 partition is located at 0xFE020000 to
0xFFEFFFFF.

Using U-Boot 1.1.2, the files within the partition show up just fine
w/ the ls command.  Using U-Boot v2009.08, when booting Linux via
TFTP, the JFFS2 partition can be mounted (mount -t jffs2
/dev/mtdblock2 /mnt), and the files show up fine.  I cannot seem to
get U-Boot to recognize the JFFS2 partition, however.

The existing JFFS2 configuration in U-Boot 1.1.2 is:

#define CFG_JFFS2_FIRST_BANK 1
#define CFG_JFFS2_FIRST_SECTOR 1
#define CFG_JFFS2_NUM_BANKS 1

In v2009.08, I have tried:

#define CONFIG_SYS_JFFS2_FIRST_BANK 1
#define CONFIG_SYS_JFFS2_FIRST_SECTOR 1
#define CONFIG_SYS_JFFS2_NUM_BANKS 1

My debug output shows me:

start_phys: fc000000
end_phys: fbffffff
part->size: ffffffff

Looking through code, I saw that the above macros were no longer used.
 The doc/README.JFFS2 seemed to be out of date.  I tried copying from
configurations that look like they may work from other platforms:

#define CONFIG_JFFS2_DEV "nor1"
#define CONFIG_JFFS2_PART_SIZE 0x01edffff
#define CONFIG_JFFS2_PART_OFFSET 0x00020000
#define CONFGI_SYS_JFFS2_SORT_FRAGMENTS

This gives me the correct start and end address, but it still does not
recognize the JFFS2 partition:

=> ls
start_phys: fe020000
end_phys: ffefffff
part->size: 1edffff
size: 131072
Scanning JFFS2 FS: .  add_node: malloc failed
add_node failed!
ls: Failed to scan JFFSv2 file structure

Next, I tried setting up the mtd partitions:

#define CONFIG_CMD_MTDPARTS
#define CONFIG_MTD_DEVICE
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT "nor1=primary"
#define MTDPARTS_DEFAULT "mtdparts=primary:31616k at 128k(mypart)"
#define CONFIG_EXTRA_ENV_SETTINGS \
  "mtdids=nor1=primary \0" \
  "mtdparts=" MK_STR(MTDPARTS_DEFAULT) "\0"

But, again, the JFFS2 fails to load with the same error as above.

I am kind of out of ideas.  Can anyone give some advice?

Thanks,
Tommy


More information about the U-Boot mailing list