Skip to contentSkip to conversation

mtd2 partition mapping on mtd1?...

DISCUSSION vijay vijay 1 participant 1 message Nov 3, 2002 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

J�rn,

Thanks for replying.
Am using AM29LV320D(its a NOR right?) on 2.4.2 kernel for MPC857
provided by Montavista.
When the target was not able to locate root filesystem inspite of 1.adding mtd1 in init/main.c root_dev_names[],
2.burning rootfs binary at offset specified in mtd_partitions and 3.running rdev on kernel image specifying root device and its offset in ramdisk word, had to hardcode in cramfs_read to return (flash_base_addr + rootfs_offset + offset). Only then the target was able to come up. Now for cat of /dev/mtd2, its going to cramfs_read() - why?. Are my
steps for getting rootfs OK?. Any better way to tell the same?.

ls -l is giving...
crw-rw---- 1 0 0 90, 0 Jan 1 1970 /dev/mtd0

# ls -l /dev/mtd1
crw-rw----    1 0        0         90,   2 Jan  1  1970 /dev/mtd1
# ls -l /dev/mtd2
crw-rw----    1 0        0         90,   4 Jan  1  1970 /dev/mtd2

Why am I seeing the devices(specially the cramfs partition on mtd1) as rw?. How to check wether the flash is locked?.

Quoted 1 line

From commands below, looks like the two unlocks are executed, followed

by an unlock-bypass(is that needed after unlocks?). Also, after running 'program' command why is the physmap_read32 (flash_base_addr_returned_by_ioremap) repeated for several minutes(3-4)?

Quoted 6 lines
Quoted 6 lines

(vijay) in physmap_write32(data=0xaa00aa, adr=0x1554) (vijay) in physmap_write32(data=0x550055, adr=0xaa8) (vijay) in physmap_write32(data=0x200020, adr=0x1554) (vijay) in physmap_write32(data=0xa000a0, adr=0x0) (vijay) in physmap_write32(data=0x28cd3d45, adr=0x400000) (vijay) in physmap_read32(0xc3ba3000)

Regards,
Vijay

Quoted 62 lines

From: J�rn Engel <[email protected]>
To: vijay vijay <[email protected]>
CC: [email protected], [email protected]
Subject: Re: mtd2 partition mapping on mtd1?...
Date: Sat, 2 Nov 2002 21:02:37 +0100

Quoted 11 lines · vijay vijay

Have added 3 partitions in mtd. The root filesystem is cramfs type. Since it was not being located by default, hardcoded cramfs_read to return the rootfs addr. Now the target is coming up..Am getting below results too...

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000c0000 00020000 "boot firmware + kernel"
mtd1: 00200000 00020000 "cramfs partition"
mtd2: 00100000 00020000 "test partition"
Quoted 7 lines
# mount
/dev/root on / type cramfs (rw)
/proc on /proc type proc (rw)
ramfs on /var type ramfs (rw)

Now, "cat /dev/mtd1" and "cat /dev/mtd2" are both fetching same data. How's that?. A dd to /dev/mtd2 is going as..

What do you get on "ls -l /dev/mtd?" ?
I'd like to be sure what device we are dealing with.

Quoted 16 lines
# busybox dd if=mtd2fs.bin bs=94208 of=/dev/mtd2 count=1
MTD_open
MTD_write
vijay mtd_write (?=E
(vijay) in physmap_write32(data=0xaa00aa, adr=0x1554)
(vijay) in physmap_write32(data=0x550055, adr=0xaa8)
(vijay) in physmap_write32(data=0x200020, adr=0x1554)
(vijay) in physmap_write32(data=0xa000a0, adr=0x0)
(vijay) in physmap_write32(data=0x28cd3d45, adr=0x400000)
(vijay) in physmap_read32(0xc3ba3000)
(vijay) in physmap_read32(0xc3ba3000)
(vijay) in physmap_read32(0xc3ba3000)
(vijay) in physmap_read32(0xc3ba3000)
:
:
:
Quoted 8 lines
(vijay) in physmap_read32(0xc3ba3000)
(vijay) in physmap_read32(0xc3ba3000)
(vijay) in physmap_read32(0xc3ba3000)
Last[3] is d726c2a6, datum is 28cd3d45
(vijay) in physmap_write32(data=0xf000f0, adr=0x0)
(vijay) in physmap_write32(data=0x900090, adr=0x0)
(vijay) in physmap_write32(data=0x0, adr=0x0)
dd: /dev/mtd2: Input/output error

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quoted 3 lines

MTD_close

On "cat /dev/mtd2", am still seeing old data(as on mtd1)?.

This does not surprise me. Something went wrong on the write. Can you narrow the options down a little? Make sure that you don't have an -ro-device, check wether flash is locked, etc.

Quoted 7 lines

The flash is nor, I suppose.

J�rn

--
When in doubt, use brute force.
-- Ken Thompson

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963