[U-Boot] Can't erase or read NOR using mtd part-id

Alexandre Gambier a.gambier at ftemaximal.fr
Wed Feb 9 16:52:35 CET 2011


Hello,

I'm using u-boot to boot a Linux-based device.
I created some MTD partitions for my NOR and NAND flashes.

Here is the configuration:

device nor0 <NOR>, # parts = 4
  #: name                        size            offset          mask_flags
  0: U-Boot              0x00080000      0x00000000      0
  1: Environment         0x00020000      0x00080000      0
  2: Kernel              0x00400000      0x000a0000      0
  3: FreeNOR             0x00360000      0x004a0000      0

device nand0 <NAND>, # parts = 2
  #: name                        size            offset          mask_flags
  0: FS                  0x02000000      0x00000000      0
  1: FreeNAND            0x06000000      0x02000000      0

active partition: nor0,0 - (U-Boot) 0x00080000 @ 0x00000000

defaults:
mtdids  : nor0=NOR,nand0=NAND
mtdparts: 
mtdparts=NOR:512k(U-Boot),128k(Environment),4M(Kernel),-(FreeNOR);NAND:32M(FS),-(FreeNAND)

When I want to erase the U-Boot partition I can't use the command `erase 
U-Boot`, the following error occurs : "incorrect device type in U-Boot".
I must use the command `erase 1:0-7`.

Is-it normal ?

My second question is when I try to read the Environment partition with 
the command `md.b Environment 128` I get the following dump (which is 
not correct).

0000000e: 0e 40 ff e0 18 40 c0 cb 18 40 18 40 0c cb 03 61    
. at ...@... at .@...a
0000001e: a5 e0 18 40 01 21 1f e0 18 40 ff cb 18 40 ff cb    
... at .!... at ...@..
0000002e: 18 40 ff cb 03 64 b5 c7 03 69 92 6a a8 39 b4 da    
. at ...d...i.j.9..
0000003e: b6 db 90 3a 29 08 49 29 f6 e0 18 40 10 cb 18 40    
...:).I)... at ...@
0000004e: 18 40 03 61 00 e2 01 e3 18 43 01 e0 3c 31 22 21    
. at .a.....C..<1"!
0000005e: 0f 88 fb 8f 01 70 80 e0 18 40 18 40 18 40 03 61    
.....p... at .@. at .a
0000006e: f6 e0 18 40 10 cb 18 40 18 40 12 20 40 e0 18 40    ... at ...@. at . 
@..@
0000007e: 18 40 03 cb 18 40 80 cb 03 61 f7 e0 18 40 10 cb    
. at ...@...a... at ..
0000008e: 18 40 18 40 12 20 90 e0 18 40 18 40 18 40 03 61    . at .@. 
... at .@. at .a
0000009e: f6 e0 18 40 10 cb 18 40 02 cb 18 40 12 20 40 e0    
... at ...@... at . @.
000000ae: 18 40 18 40 03 cb 18 40 80 cb 03 61 f7 e0 18 40    
. at .@... at ...a...@
000000be: 10 cb 18 40 02 cb 18 40 12 20 88 e0 18 40 18 40    ... at ...@. 
... at .@
000000ce: 18 40 03 61 f6 e0 18 40 10 cb 18 40 01 cb 18 40    
. at .a...@... at ...@
000000de: 12 20 48 e0 18 40 18 40 03 cb 18 40 80 cb 03 61    . 
H.. at .@... at ...a
000000ee: f7 e0 18 40 10 cb 18 40 01 cb 18 40 12 20 98 e0    
... at ...@... at . ..
000000fe: 18 40 18 40 18 40 03 61 f6 e0 18 40 10 cb 18 40    
. at .@. at .a...@...@
0000010e: 03 cb 18 40 12 20 48 e0 18 40 18 40 03 cb 18 40    ... at . 
H.. at .@...@
0000011e: 80 cb 03 61 f7 e0 18 40 10 cb 18 40 03 cb 18 40    
...a... at ...@...@
0000012e: 12 20 a0 e0 18 40 18 40    . ... at .@

If use the command `md.b 0xA0080000 128` I get the right dump...

a0080000: 0e c8 12 74 62 6f 6f 74 64 65 6c 61 79 3d 31 30    
...tbootdelay=10
a0080010: 00 62 61 75 64 72 61 74 65 3d 31 31 35 32 30 30    
.baudrate=115200
a0080020: 00 62 6f 61 72 64 3d 73 6b 79 77 6f 72 74 68 00    
.board=skyworth.
a0080030: 6d 6f 6e 69 74 6f 72 5f 62 61 73 65 3d 30 78 41    
monitor_base=0xA
a0080040: 30 30 30 30 30 30 30 00 6d 6f 6e 69 74 6f 72 5f    
0000000.monitor_
a0080050: 6c 65 6e 3d 30 78 30 30 30 38 30 30 30 30 00 6d    
len=0x00080000.m
a0080060: 6f 6e 69 74 6f 72 5f 73 65 63 3d 31 3a 30 2d 37    
onitor_sec=1:0-7
a0080070: 00 6c 6f 61 64 5f 61 64 64 72 3d 30 78 38 30 30    
.load_addr=0x800
a0080080: 30 30 30 30 30 00 65 74 68 61 64 64 72 3d 30 30    
00000.ethaddr=00
a0080090: 3a 30 65 3a 65 62 3a 30 30 3a 33 34 3a 62 63 00    
:0e:eb:00:34:bc.
a00800a0: 73 65 72 76 65 72 69 70 3d 31 39 32 2e 31 36 38    
serverip=192.168
a00800b0: 2e 31 2e 36 30 00 69 70 61 64 64 72 3d 31 39 32    
.1.60.ipaddr=192
a00800c0: 2e 31 36 38 2e 31 2e 31 31 30 00 66 69 72 73 74    
.168.1.110.first
a00800d0: 5f 69 6e 69 74 3d 6d 74 64 20 64 65 6c 20 61 6c    _init=mtd 
del al
a00800e0: 6c 3b 72 75 6e 20 65 72 61 73 65 5f 6e 6f 72 3b    l;run 
erase_nor;
a00800f0: 6d 74 64 20 64 65 66 61 75 6c 74 3b 73 61 76 65    mtd 
default;save
a0080100: 65 6e 76 3b 72 75 6e 20 75 70 64 61 74 65 5f 75    env;run 
update_u
a0080110: 62 6f 6f 74 00 65 72 61 73 65 5f 6e 6f 72 3d 70    
boot.erase_nor=p
a0080120: 72 6f 74 65 63 74 20 6f    rotect o

Is-it normal as well ?

Thanls in advance for your help.
Alex.




More information about the U-Boot mailing list