2009-08-21 14:39:28 Problem in mounting the rootfs.jffs2 from NOR flash
V Hemanth Kumar (INDIA)
Message: 79125
Hi All,
We are working on a custom board (BF527) with 16MB CFI NOR Flash interfaced to it. Three GPIOs are connected to the MSB Address lines of Flash to access the higher banks of flash. In the platform file I have declared the information about the GPIOs and have chosen the "gpio-addr-flash" as the mapping driver. Below is the information in linux-2.6.x/arch/blackfin/mach-bf527/boards/custom.c:-
#######################################################################
static struct mtd_partition custom_flash_partitions[] = {
{
.name = "bootloader(nor)",
.size = 0x40000,
.offset = 0,
}, {
.name = "linux kernel(nor)",
.size = 0x1C0000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "file system(nor)",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND,
}
};
static struct physmap_flash_data custom_flash_data = {
.width = 2,
.parts = custom_flash_partitions,
.nr_parts = ARRAY_SIZE(custom_flash_partitions),
};
static unsigned custom_flash_gpios[] = { GPIO_PG11, GPIO_PH11, GPIO_PH12 };
static struct resource custom_flash_resource[] = {
{
.name = "cfi_probe",
.start = 0x20000000,
.end = 0x201fffff,
.flags = IORESOURCE_MEM,
}, {
.start = (unsigned long)custom_flash_gpios,
.end = ARRAY_SIZE(custom_flash_gpios),
.flags = IORESOURCE_IRQ,
}
};
static struct platform_device custom_flash_device = {
.name = "gpio-addr-flash",
.id = 0,
.dev = {
.platform_data = &custom_flash_data,
},
.num_resources = ARRAY_SIZE(custom_flash_resource),
.resource = custom_flash_resource,
};
#######################################################################
In the kernel configuration I have selected the "gpio-addr-flash" driver:-
Device Drivers ---><*> Memory Technology Device (MTD) support ---> [*] Support non-linear mappings of flash chips
<*> GPIO-assisted Flash Chip Support
My vmImage size is 0xC5733 (size 800KB) and rootfs.jffs2 is 0x1F0000 (size is 1.9MB).
In u-boot I program the vmImage from location 0x20040000 and rootfs.jffs2 from location 0x20200000.
The partition looks like this...
0x20000000 - 0x2003FFFF : u-boot
0x20040000 - 0x201FFFFF : vmImage
0x20200000 - 0x20FFFFFF : rootfs.jffs2
Also in u-boot I changed the bootargs to "root=/dev/mtdblock2 rw rootfstype=rootfs"
With this when I try to boot the vmImage from flash...i.e "bootm 0x20040000", the kernel boots, detects the flash, but when kernel tries to mount, it throws a lot of error messages ....
Empty flash at 0x0000fffc ends at 0x00010000
CLEANMARKER node found at 0x00010000, not first node in block (0x00000000)
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00100000: 0xe531 in
stead
(basically the mount fails)...
I have attached the kernel logs by name "mount-fail-kernel-logs.txt" for your reference.
What could be the issue?
Please help me in pointing out the problem.
(Sorry for the long mail.)
Thanks
Hemanth Varadha.
mount-fail-kernel-logs.txt