RFC: AT49BV6416 flash memory chipset on the AT91RM9200EK

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

nahas.sylvain
Posts: 5
Joined: Wed Jun 29, 2005 6:36 pm

RFC: AT49BV6416 flash memory chipset on the AT91RM9200EK

Thu Jul 07, 2005 10:50 am

Hi,
I wish to access from Linux the on-board flash memory that is on the -EK evaluation board and declare its partitioning so that I find back the layout of U-Boot

The layout of the flash is :
0x10000000 Bootimage 24 KBytes
0x10006000 Free 32 KBytes
0x1000E000 Env. var. 8 KBytes
0x10010000 UBoot img 64 KBytes

1) I activate "command line partition parsing"
CONFIG_MTD_CMDLINE_PARTS=y
2) I activate CFI AMD/Toshiba compliant chipset detection
CONFIG_MTD_CFI_AMDSTD=y

In the U-Boot environment I set up a variable:
3) setenv flayout mtdparts=phys:24576(bootstrap),32768@24576(free),8192@57344(env),65536@65536(uboot)

which declares the following layout :
size offset name
24576 0 bootstrap
32768 24576 free
8192 57344 env
65536 65536 uboot
(numbers are in decimal base)

According to these messages it seems to work OK :

physmap flash device: 200000 at 10000000
Amd/Fujitsu Extended Query Table v1.0 at 0x0041
Physically mapped flash: JEDEC Device ID is 0xD6. Assuming broken CFI table.
Physically mapped flash: Swapping erase regions for broken CFI table.
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Using command line partition definition
Creating 4 MTD partitions on "Physically mapped flash":
0x00000000-0x00006000 : "bootstrap"
0x00006000-0x0000e000 : "free"
0x0000e000-0x00010000 : "env"
0x00010000-0x00020000 : "uboot"

# cat /proc/mtd
dev: size erasesize name
mtd0: 00800000 00010000 "Physically mapped flash"
mtd1: 00006000 00002000 "bootstrap"
mtd2: 00008000 00002000 "free"
mtd3: 00002000 00002000 "env"
mtd4: 00010000 00010000 "uboot"

BUT I am not very comfortable with the MTD subsystem and would appreciate a check from somebody with more experience.

Is the configuration above really OK or is there some issues I am not aware of ?
What does mean this output "JEDEC Device ID is 0xD6. Assuming broken CFI table." ?
Could the partitions described above safely be used to update U-Boot ?
Is there another (better?) way to do the same thing ?

Thanks in advance for your comment.
nahas.sylvain
Posts: 5
Joined: Wed Jun 29, 2005 6:36 pm

Accessing the whole AT49BV6416 address space

Fri Jul 08, 2005 12:04 pm

I am now able to burn in the flash my own version of U-Boot with the following commands (from Linux's shell) :
> flash_erase /dev/mtd/4 0 10000
> flashcp /tmp/uboot.bin.gz /dev/mtd/4

I can also read and edit U-Boot's environment from Linux.

So far the procedure above seems to work.

The parameters in the default kernel's configuration file linux-2.4.27-vrs1-ATMEL/arch/arm/def-configs/at91rm9200ek are incorrect for the memory-mapping of the flash. It doesn't declare the whole storage range, which produce kernel panic when we try to access bytes at offset above 0x200000.

The following setup works:
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=10000000
CONFIG_MTD_PHYSMAP_LEN=8000000

All the best,
Sylvain
Misha
Location: Florence.
Posts: 73
Joined: Mon Nov 22, 2004 4:15 pm

Problems with mtd

Thu Aug 04, 2005 11:03 am

Your article was wery interesting: I tried to follow your steps but I find some
difficulties that I hope you will help to solve.

Basically, the kernel shows

physmap flash device: 800000 at 10000000
Amd/Fujitsu Extended Query Table v1.0 at 0x0041
Physically mapped flash: JEDEC Device ID is 0xD6.
Assuming broken CFI table.
Physically mapped flash: Swapping erase regions for broken CFI table.
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.

but does NOT show

Using command line partition definition
Creating 4 MTD partitions on "Physically mapped flash":
0x00000000-0x00006000 : "bootstrap"
0x00006000-0x0000e000 : "free"
0x0000e000-0x00010000 : "env"
0x00010000-0x00020000 : "uboot"

The result is:
[root@EVM /root]$cat /proc/mtd
dev: size erasesize name
mtd0: 00800000 00010000 "Physically mapped flash"

From make xconfig I understand that the command line issued recognition is not automatic:
how can it be started ?

In your article I maybe found some typo errors:
2) I activate CFI AMD/Toshiba compliant chipset detection
is to be interpreted as
2) I activate CFI AMD/Fujitsu compliant chipset support

3) setenv flayout mtdparts=phys:24576(bootstrap),32768@24576(free),8192@57344(env),65536@65536(uboot)
is to be interpreted as
3) setenv mtdparts phys:24576(bootstrap),32768@24576(free),8192@57344(env),65536@65536(uboot)

Even if I correct these typo, the Mtd command parsing is not started.
Moreover, supposing the procedure was OK, where do I find the
flash_erase or flashcp commands ?

The kernel I use is 2.4.27-vrs1, given by ATMEL

It would be great if you could give me some hints.
Regards.
Misha
Location: Florence.
Posts: 73
Joined: Mon Nov 22, 2004 4:15 pm

Solution found.

Fri Aug 05, 2005 2:05 pm

Now all it is O.K.
I found that the mtdparts was not a specific keyword of u-boot, but
another kernel parameter that was to be inserted in bootargs though the flayout variable...
Also, the CONFIG_MTD_ROM=y setup was missing in kernel configuration.

Regards.

Return to “LINUX”

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests