Re: [U-Boot] Can't erase or read NOR using mtd part-id
Dear Wolfgang, Thanks for this explanation. Best regards Alex On 02/09/2011 07:50 PM, Wolfgang Denk wrote: > Dear Alexandre Gambier, > > In message<4d52b843.5010...@ftemaximal.fr> you wrote: >> 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, # parts = 4 >>#: namesizeoffset mask_flags >>0: U-Boot 0x0008 0x 0 >>1: Environment 0x0002 0x0008 0 >>2: Kernel 0x0040 0x000a 0 >>3: FreeNOR 0x0036 0x004a 0 >> > ... >> 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 ? > There are many ways to specify a flash area. When referring to MTD > partitions, the synatx is ",", i. e. > for the partition named "U-Boot" above you use > > erase nor0,0 > > So yes, the behaviour is 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). >> >> 000e: 0e 40 ff e0 18 40 c0 cb 18 40 18 40 0c cb 03 61 >> .@...@...@.@...a > ... > > Only very few commands (and only flash related ones) accept MTD > partition specifications for addresses. "md" does not. What happpens > here is that the argument "Environment" gets parsed as a hex number. > Only the first character, 'E', can successfully be converted, then the > conversion stops (without error message). Then you get the dump > starting at 0x000E. > >> Is-it normal as well ? > Yes, it is. > > Best regards, > > Wolfgang Denk > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can't erase or read NOR using mtd part-id
Dear Alexandre Gambier, In message <4d52b843.5010...@ftemaximal.fr> you wrote: > > 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 , # parts = 4 > #: namesizeoffset mask_flags > 0: U-Boot 0x0008 0x 0 > 1: Environment 0x0002 0x0008 0 > 2: Kernel 0x0040 0x000a 0 > 3: FreeNOR 0x0036 0x004a 0 > ... > 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 ? There are many ways to specify a flash area. When referring to MTD partitions, the synatx is ",", i. e. for the partition named "U-Boot" above you use erase nor0,0 So yes, the behaviour is 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). > > 000e: 0e 40 ff e0 18 40 c0 cb 18 40 18 40 0c cb 03 61 > .@...@...@.@...a ... Only very few commands (and only flash related ones) accept MTD partition specifications for addresses. "md" does not. What happpens here is that the argument "Environment" gets parsed as a hex number. Only the first character, 'E', can successfully be converted, then the conversion stops (without error message). Then you get the dump starting at 0x000E. > Is-it normal as well ? Yes, it is. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de There are certain things men must do to remain men. -- Kirk, "The Ultimate Computer", stardate 4929.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can't erase or read NOR using mtd part-id
Hello, On Wednesday 09 February 2011, 17:16:37 Alexandre Gambier wrote: > thanks for your reply. > I'm running u-boot 1.3.1. I got it from STLinux. ouch, that's pretty old. > I will try to set CONFIG_JFFS2. > But does it mean it will erase the partition using JFFS2 ? No, the feature depended on both MTDPARTS and JFFS2 which has changed by now. If this doesn't work. I can't help you (see above) Alexander ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can't erase or read NOR using mtd part-id
Hello, On Wednesday 09 February 2011, 16:52:35 Alexandre Gambier wrote: > I'm using u-boot to boot a Linux-based device. Which version og u-boot are you running? > I created some MTD partitions for my NOR and NAND flashes. > > Here is the configuration: > > device nor0 , # parts = 4 > #: namesizeoffset mask_flags > 0: U-Boot 0x0008 0x 0 > 1: Environment 0x0002 0x0008 0 > 2: Kernel 0x0040 0x000a 0 > 3: FreeNOR 0x0036 0x004a 0 > > device nand0 , # parts = 2 > #: namesizeoffset mask_flags > 0: FS 0x0200 0x 0 > 1: FreeNAND0x0600 0x0200 0 > > active partition: nor0,0 - (U-Boot) 0x0008 @ 0x > > 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 ? Some old version also had to set CONFIG_JFFS2 to get erase & friends to accept mtdparts. HTH Alexander ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can't erase or read NOR using mtd part-id
Hello, thanks for your reply. I'm running u-boot 1.3.1. I got it from STLinux. I will try to set CONFIG_JFFS2. But does it mean it will erase the partition using JFFS2 ? Will it support to read and write the environment settings with this file format ? Alex On 02/09/2011 05:10 PM, Alexander Stein wrote: > Hello, > > On Wednesday 09 February 2011, 16:52:35 Alexandre Gambier wrote: >> I'm using u-boot to boot a Linux-based device. > Which version og u-boot are you running? > >> I created some MTD partitions for my NOR and NAND flashes. >> >> Here is the configuration: >> >> device nor0, # parts = 4 >>#: namesizeoffset mask_flags >>0: U-Boot 0x0008 0x 0 >>1: Environment 0x0002 0x0008 0 >>2: Kernel 0x0040 0x000a 0 >>3: FreeNOR 0x0036 0x004a 0 >> >> device nand0, # parts = 2 >>#: namesizeoffset mask_flags >>0: FS 0x0200 0x 0 >>1: FreeNAND0x0600 0x0200 0 >> >> active partition: nor0,0 - (U-Boot) 0x0008 @ 0x >> >> 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 ? > Some old version also had to set CONFIG_JFFS2 to get erase& friends to accept > mtdparts. > > HTH > Alexander > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Can't erase or read NOR using mtd part-id
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 , # parts = 4 #: namesizeoffset mask_flags 0: U-Boot 0x0008 0x 0 1: Environment 0x0002 0x0008 0 2: Kernel 0x0040 0x000a 0 3: FreeNOR 0x0036 0x004a 0 device nand0 , # parts = 2 #: namesizeoffset mask_flags 0: FS 0x0200 0x 0 1: FreeNAND0x0600 0x0200 0 active partition: nor0,0 - (U-Boot) 0x0008 @ 0x 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). 000e: 0e 40 ff e0 18 40 c0 cb 18 40 18 40 0c cb 03 61 .@...@...@.@...a 001e: a5 e0 18 40 01 21 1f e0 18 40 ff cb 18 40 ff cb ...@.!...@...@.. 002e: 18 40 ff cb 03 64 b5 c7 03 69 92 6a a8 39 b4 da .@...d...i.j.9.. 003e: b6 db 90 3a 29 08 49 29 f6 e0 18 40 10 cb 18 40 ...:).I)...@...@ 004e: 18 40 03 61 00 e2 01 e3 18 43 01 e0 3c 31 22 21 .@.a.C..<1"! 005e: 0f 88 fb 8f 01 70 80 e0 18 40 18 40 18 40 03 61 .p...@.@.@.a 006e: f6 e0 18 40 10 cb 18 40 18 40 12 20 40 e0 18 40...@...@.@. @..@ 007e: 18 40 03 cb 18 40 80 cb 03 61 f7 e0 18 40 10 cb .@...@...a...@.. 008e: 18 40 18 40 12 20 90 e0 18 40 18 40 18 40 03 61.@.@. ...@.@.@.a 009e: f6 e0 18 40 10 cb 18 40 02 cb 18 40 12 20 40 e0 ...@...@...@. @. 00ae: 18 40 18 40 03 cb 18 40 80 cb 03 61 f7 e0 18 40 .@.@...@...a...@ 00be: 10 cb 18 40 02 cb 18 40 12 20 88 e0 18 40 18 40...@...@. ...@.@ 00ce: 18 40 03 61 f6 e0 18 40 10 cb 18 40 01 cb 18 40 .@.a...@...@...@ 00de: 12 20 48 e0 18 40 18 40 03 cb 18 40 80 cb 03 61. H..@.@...@...a 00ee: f7 e0 18 40 10 cb 18 40 01 cb 18 40 12 20 98 e0 ...@...@...@. .. 00fe: 18 40 18 40 18 40 03 61 f6 e0 18 40 10 cb 18 40 .@.@.@.a...@...@ 010e: 03 cb 18 40 12 20 48 e0 18 40 18 40 03 cb 18 40...@. H..@.@...@ 011e: 80 cb 03 61 f7 e0 18 40 10 cb 18 40 03 cb 18 40 ...a...@...@...@ 012e: 12 20 a0 e0 18 40 18 40. ...@.@ If use the command `md.b 0xA008 128` I get the right dump... a008: 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 000.monitor_ a0080050: 6c 65 6e 3d 30 78 30 30 30 38 30 30 30 30 00 6d len=0x0008.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 0.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 3bl;run erase_nor; a00800f0: 6d 74 64 20 64 65 66 61 75 6c 74 3b 73 61 76 65mtd default;save a0080100: 65 6e 76 3b 72 75 6e 20 75 70 64 61 74 65 5f 75env;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 6frotect o Is-it normal as well ? Thanls in advance for your help. Alex. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot