2009-09-23 08:36:47     MTD in CM-BF537E

2009-09-23 08:36:47     MTD in CM-BF537E

Miquel Soler i Mir (SPAIN)

Message: 80306   

Hello everybody.

I'm working with CM-BF537E board.

I had some program working and now is the time to play with Flash memory.

The uImage.ext2 is 2271974, I cleaned something that I don't need.

I'm trying to use the Flash memory with this layout: 4096 kB CM-BF537E

size offset Name

P1: 256 kb 0 kb uboot

P2: 2560 kb 256 kb uImage.ext2

P3: 128 kb 2816 kB serial

P4: 768 kb 2944 kB test01

P5: 384 kb 3712 kb test02

I readed the MTD page in uClinux.

I configured the kernel with this parameters:

Device Drivers --->

<*> Memory Technology Device (MTD) support --->

[*] MTD partitioning support

[*] Command line partition table parsing

<*> Direct char device access to MTD devices

-*- Common interface to block layer for MTD 'translation layers' <*> Caching block device access to MTD devices

RAM/ROM/Flash chip drivers --->

<*> Detect flash chips by Common Flash Interface (CFI) probe

< > Detect non-CFI AMD/JEDEC-compatible flash chips

[ ] Flash chip driver advanced configuration options (NEW)

<*> Support for Intel/Sharp flash chips

<*> Support for AMD/Fujitsu/Spansion flash chips

< > Support for ST (Advanced Architecture) flash chips (NEW)

<*> Support for RAM chips in bus mapping

<*> Support for ROM chips in bus mapping

< > Support for absent chips in bus mapping

Mapping drivers for chip access --->

[ ] Support non-linear mappings of flash chips

<*> CFI Flash device in physical memory map

[ ] Physmap compat support (NEW)

<*> Generic uClinux RAM/ROM filesystem support

< > Map driver for platform device RAM (mtd-ram)

Flash Tools --->

--- MTD utils

[*] mtd-utils

[*] nanddump

[*] nandtest

[*] nandwrite

In u-boot I made this:

erase 0x20040000 0x203FFFFF

tftp 0x1000000 uImage.ext2

cp.b 0x1000000 0x20040000 0x 22aceb

root=/dev/mtdblock0 rw console=ttyBF0,57600 mtdparts=physmap-flash.0:256k(uboot)ro,2560k(uImage),128k(serial),768k(test01),384k(test02)

setenv flashload bootm 0x20040000

setenv bootcmd run flashload

The result in boot are:

U-Boot 2008.10 (ADI-2009R1-rc3) (Sep 3 2009 - 17:08:40)

CPU: ADSP bf537-0.2 (Detected Rev: 0.2) (bypass boot)

Board: Bluetechnix CM-BF537E board

Support:   www.bluetechnix.at/

Clock: VCO: 525 MHz, Core: 525 MHz, System: 131.250 MHz

RAM: 32 MB

Flash: Device ID of the Flash is 890016

Flash Memory Start 0x20000000

Memory Map for the Flash

0x20000000 - 0x203FFFFF Single Flash Chip (4MB)

Using PF4 as a 2M bank switch

Please type command flinfo for information on Sectors

4 MB

In: serial

Out: serial

Err: serial

Net: Blackfin EMAC

MAC: 02:80:AD:20:31:E8

Hit any key to stop autoboot: 5 ### 4 ### 3 ### 2 ### 1 ### 0

Done.

## Booting kernel from Legacy Image at 01000000 ...

Image Name: Linux Kernel and ext2

Created: 2009-09-23 10:44:34 UTC

Image Type: Blackfin Linux Kernel Image (gzip compressed)

Data Size: 2272426 Bytes = 2.2 MB

Load Address: 00001000

Entry Point: 0017f90c

Verifying Checksum ... OK

Uncompressing Kernel Image ... OK

Starting Kernel at = 0017f90c

Linux version 2.6.28.10-ADI-2009R1 (mikimonster@mikimonster-laptop) (gcc version 4.1.2 (ADI svn)) #33 Wed Sep 23 12:44:08 CEST 2009

Warning: limiting memory to 26MB due to hardware anomaly 05000263

Board Memory: 32MB

Kernel Managed Memory: 32MB

Memory map:

fixedcode = 0x00000400-0x00000490

text = 0x00001000-0x00107f30

rodata = 0x00107f30-0x001559c4

bss = 0x00156000-0x00165414

data = 0x00165414-0x00174000

stack = 0x00172000-0x00174000

init = 0x00174000-0x00192000

available = 0x00192000-0x01a00000

rootfs = 0x01a00000-0x01f00000

DMA Zone = 0x01f00000-0x02000000

Hardware Trace Active and Enabled

Boot Mode: 0

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

Data Cache Enabled for CPU0 (write-back)

Built 1 zonelists in Zone order, mobility grouping off. Total pages: 6604

Kernel command line: root=/dev/mtdblock0 rw console=ttyBF0,115200 mtdparts=physmap-flash.0:356k(uboot)ro,2560k(uImage),128k(serial),768k(test01),385k(test02)

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 128 (order: 7, 512 bytes)

console [ttyBF0] enabled

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory available: 24728k/32768k RAM, (120k init code, 1051k kernel code, 433k data, 1024k dma, 5412k reserved)

Calibrating delay loop... 989.18 BogoMIPS (lpj=494592)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (9 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (37 KB free)

net_namespace: 288 bytes

NET: Registered protocol family 16

Blackfin DMA Controller

cm_bf537_init(): registering device resources

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 48

io scheduler noop registered (default)

io scheduler cfq registered

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 20) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

arch/blackfin/mach-bf537/boards/cm_bf537.c:bfin_get_ether_addr: Setting Ethernet MAC to a random one

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

uclinux[mtd]: RAM probe address=0x1a00000 size=0x500000

Creating 1 MTD partitions on "RAM":

0x00000000-0x00500000 : "ROMfs"

Generic platform RAM MTD, (c) 2004 Simtec Electronics

TCP cubic registered

NET: Registered protocol family 17

VFS: Mounted root (ext2 filesystem).

Freeing unused kernel memory: 120k freed

dma_alloc_init: dma_page @ 0x00175000 - 256 pages at 0x01f00000

Welcome to:

____ _ _

/ __| ||_| _ _

_ _| | | | _ ____ _ _ \ \/ /

| | | | | | || | _ \| | | | \ /

| |_| | |__| || | | | | |_| | / \

| ___\____|_||_|_| |_|\____|/_/\_\

|_|

For further information see:

  www.uclinux.org/

  blackfin.uclinux.org/

  www.bluetechnix.at

BusyBox v1.13.4 (2009-09-22 12:21:59 CEST) built-in shell (msh)

Enter 'help' for a list of built-in commands.

root:/>

As you can see, I only has one partition.

Can somebody help me to fine the error or errors?

Thanks

TranslateQuoteReplyEditDelete

2009-09-23 10:22:46     Re: MTD in CM-BF537E

Mike Frysinger (UNITED STATES)

Message: 80311   

you enabled the fake mtd disk (uClinux MTD), not the ones backed by real flash.

you need to enable the GPIO addr flash driver as explained in the documentation:

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:mtd#flash_types

QuoteReplyEditDelete

2009-09-24 07:02:41     Re: MTD in CM-BF537E

Miquel Soler i Mir (SPAIN)

Message: 80373   

Thanks Mike, now is working, I had the partitions.

Another question, the Flash from bluetechnix is 4 MB divided in 32 sectors: 0x20.000 each sector.

The minimal size of the partition will be 1 sector?

I read in forum that the jffs2 file system need minimum 2 sector? It's true?

Thanks

Miquel Soler i Mir

TranslateQuoteReplyEditDelete

2009-09-24 11:08:57     Re: MTD in CM-BF537E

Mike Frysinger (UNITED STATES)

Message: 80390   

you can create smaller partitions, but you wont be able to erase them.  jffs2 may require multiple sectors so that it can properly erase/update things.

  • Created
Was this helpful?

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.