mtdparts
Hi there.
I'm just trying to sync with U-Boot development and found a little regresion in new mtdparts code. Previously I was using custom partition function, which let me do precisely what I wanted.
mtd0 - U-Boot
mtd1 - env
mtd2 - r_env
mtd3 - rootfs0
mtd4 - rootfs1
... etc
In above scheme my custom part function allowed only chpart [34], so it was not even possible to change partition to evn sector for example. Moreover it was pretty easy to construct kernel command line this way:
setenv bootargs '$bootargs root=/dev/mtdblock$partition ro rootfstype=jffs2' And everything worked nicely. That is no longer case and it's real pain with both NOR and NAND devices used in system.
Prefered solution for me is to fix kernel to be able to mount root filesystem from MTD device given by name (root=mtd:rootfs0) unless someone has better idea :-). Something which would work also with 2.4 kernels would be appreciated.
ladis
Quoted 3 lines · In message <20050906180248.GA5160@orphique> you wrote:
In above scheme my custom part function allowed only chpart [34], so it was not even possible to change partition to evn sector for example.
Ummm... I can understand what you mean, but this is not how things normally are done in a UNIX environment. It seems a very arbitrary restriction to me, which I wouldn;t like if I was working on such a system.
Quoted 2 lines
Moreover it was pretty easy to construct kernel command line this way:
setenv bootargs '$bootargs root=/dev/mtdblock$partition ro rootfstype=jffs2'
What prevents you from doing the same now?
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de At the source of every error which is blamed on the computer you will find at least two human errors, including the error of blaming it on the computer.
Quoted 7 lines · Wolfgang Denk
Quoted 2 lines
In above scheme my custom part function allowed only chpart [34], so it was not even possible to change partition to evn sector for example.
Ummm... I can understand what you mean, but this is not how things normally are done in a UNIX environment. It seems a very arbitrary restriction to me, which I wouldn;t like if I was working on such a system.
Ack. I have no strong requirement for such feature.
Quoted 4 lines
Quoted 2 lines
Moreover it was pretty easy to construct kernel command line this way:
setenv bootargs '$bootargs root=/dev/mtdblock$partition ro rootfstype=jffs2'What prevents you from doing the same now?
Previously I did it in environment:
if test -n $swapos; then
if test $ospart -eq 0; then chpart 4; else chpart 3; fi; setenv swapos; saveenv; else if test $ospart -eq 0; then chpart 3; else chpart 4; fi;
fi
flashargs=run setpart; fixroot; setenv bootargs $bootargs \
root=/dev/mtdblock$partition ro rootfstype=jffs2
fboot=run flashargs;fsload;bootm
This no longer possible, because $partiton is nand0,1 now, so finding corresponding Linux device is more tricky. For now I solved it in C by writing new command which does the trick. Hush doesn't support 'eval' nor something like echo $fsecho $ospart where fs0=/dev/mtdblock3 and fs1=/dev/mtdblock4, so it's hard to do it using builtin commands. In case I'm the only one who needs something like this, I'm perfectly fine with my current solution.
Best regards,
ladis
Quoted 2 lines · In message <20050907082946.GA19256@orphique> you wrote:
Previously I did it in environment:
...
Quoted 2 lines
flashargs=run setpart; fixroot; setenv bootargs $bootargs \
root=/dev/mtdblock$partition ro rootfstype=jffs2
...
Quoted 3 lines
This no longer possible, because $partiton is nand0,1 now, so finding corresponding Linux device is more tricky. For now I solved it in C by
I see.
Quoted 2 lines
In case I'm the only one who needs something like this, I'm perfectly fine with my current solution.
You made a point. Please allow for a little time to think about it. Send me a reminder in a week or so in case I don;t send a followup.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Keep your eyes wide open before marriage, half shut afterwards.
-- Benjamin Franklin[U-Boot-Users] Does anyone use Lan91c96 in U-Boot?
Hi folks:
I use lan91c96 ethernet controller in my system board. And the Lan91c96 connects to my SoC by M68K bus. Now I modified the original code to support the chip in U-Boot, U-Boot can download the kernel from networks by tftp. But sometimes the kernel data is ok, sometimes the kernel data CRC error when I use bootm to bootup the kernel.
In the CRC error situation, U-Boot must think the kernel data downloaded from networks to RAM is ok, but the kernel decompressor said it is CRC error.
Is there any idea for this? How to debug this?
Thanks a lot
Best Regards
Bryan Wu from China
Quoted 10 lines · On Wed, 7 Sep 2005 10:29:46 +0200 Ladislav Michl wrote:
[...]
flashargs=run setpart; fixroot; setenv bootargs $bootargs \
root=/dev/mtdblock$partition ro rootfstype=jffs2
fboot=run flashargs;fsload;bootm[...]
In case I'm the only one who needs something like this, I'm perfectly fine with my current solution.
You're not the only one. I'm using a nearly identical approach here.
Regards,
Andreas
Quoted 5 lines · In message <20050907123053.0000449b@idefix> you wrote:
Quoted 3 lines
In case I'm the only one who needs something like this, I'm perfectly fine with my current solution.
You're not the only one. I'm using a nearly identical approach here.
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
Note: the numbering will be exactly as partitions are listed in the $mtdparts variable. This way user can fully control the indexing sequence but it is also a bit more troublesome you have to take care about the order of devices in $mtdparts.
But the greater flexibilty seems to me to be a big advantage over any fixed scheme which cannot know about the init sequence in the Linux kernel.
Is this OK with you?
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Nature is very un-American. Nature never hurries." - William George Jordan
Quoted 8 lines · Wolfgang Denk
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
Note: the numbering will be exactly as partitions are listed in the $mtdparts variable. This way user can fully control the indexing sequence but it is also a bit more troublesome you have to take care about the order of devices in $mtdparts.
Quoted 5 lines
But the greater flexibilty seems to me to be a big advantage over any fixed scheme which cannot know about the init sequence in the Linux kernel.
Is this OK with you?
Wolfgang,
that sounds perfectly right to me. Note that once Linux kernel gets capability of mounting rootfs by mtd(part) name, it might be usefull to add yet another variable mtddevname.
Currently you can do something like:
mount -t jffs2 mtd:fs1 /mount_point
I hope kernel will get support for mounting rootfs by name soon.
Best regards,
ladis
Quoted 8 lines · On Wed, 7 Sep 2005 14:54:59 +0200 Wolfgang Denk wrote:
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
Note: the numbering will be exactly as partitions are listed in the $mtdparts variable. This way user can fully control the indexing sequence but it is also a bit more troublesome you have to take care about the order of devices in $mtdparts.
Quoted 5 lines
But the greater flexibilty seems to me to be a big advantage over any fixed scheme which cannot know about the init sequence in the Linux kernel.
Is this OK with you?
That's ok with me, too. We won't change our current implementation anyway.
Regards,
Andreas Engel
Dear Ladislav,
Quoted 3 lines · in message <20050907133705.GA22895@orphique> you wrote:
Quoted 3 lines
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
Done.
Quoted 3 lines
that sounds perfectly right to me. Note that once Linux kernel gets capability of mounting rootfs by mtd(part) name, it might be usefull to add yet another variable mtddevname.
Done, too.
Just checked in. Please let me know if this works for you.
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de grep me no patterns and I'll tell you no lines.
Wolfgang,
Quoted 2 lines · Wolfgang Denk
Quoted 2 lines
Quoted 2 lines
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
[snip]
Quoted 1 line
Just checked in. Please let me know if this works for you.
Works nicely, thanks a lot! Tested on board VoiceBlue and NetStar. Btw, last commit to U-Boot's git repository is 10 days old. Am I supposed to generate patch against CVS?
Best regards,
ladis
PATCH 1/1 voiceblue update (Re: [U-Boot-Users] mtdparts)
Quoted 11 lines · Ladislav Michl
Wolfgang,
Quoted 2 lines · Wolfgang Denk
Quoted 2 lines
Quoted 2 lines
We willprovide an extension soon; we're going to create an additional variable 'mtddevnum'.
[snip]
Quoted 1 line
Just checked in. Please let me know if this works for you.
Works nicely, thanks a lot! Tested on board VoiceBlue and NetStar. Btw, last commit to U-Boot's git repository is 10 days old. Am I supposed to generate patch against CVS?
Git repository seems to be updated, thanks :-)
CHANGELOG
* VoiceBlue update: use new MTD flash partitioning methods, use more reasonable TEXT_BASE, update default environment and enable keyed autoboot.
board/voiceblue/config.mk +1 -1
@@ -12,5 +12,5 @@ ifeq ($(VOICEBLUE_SMALL_FLASH),y) TEXT_BASE = 0x20012000 else # Running in SDRAM... -TEXT_BASE = 0x13000000 +TEXT_BASE = 0x13FD0000 endif
board/voiceblue/voiceblue.c +2 -2
@@ -43,8 +43,8 @@ int dram_init(void) *((volatile unsigned short *)VOICEBLUE_LED_REG ) =0xff ; -/* Take the Ethernet controller out of reset and wait -* for the EEPROM load to complete. */ +/* Take the Ethernet controller out of reset and wait +* for the EEPROM load to complete. */ *((volatile unsigned short *)GPIO_DATA_OUTPUT_REG ) |=0x80 ;udelay (10 );/* doesn't work before interrupt_init call */ *((volatile unsigned short *)GPIO_DATA_OUTPUT_REG ) &= ~0x80 ;
include/configs/voiceblue.h +36 -28
113 lines not on this page · raw message
PATCH 1/1 voiceblue update (Re: mtdparts)
Quoted 4 lines · In message <20050915084918.GB8576@orphique> you wrote:
* VoiceBlue update: use new MTD flash partitioning methods, use more reasonable
TEXT_BASE, update default environment and enable keyed autoboot.
Sorry, this does not apply cleanly (any more). Can you please check and re-submit those parts that are still needed? Thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Let the programmers be many and the managers few -- then all will be productive. -- Geoffrey James, "The Tao of Programming"
PATCH 1/1 voiceblue update (Re: mtdparts)
Quoted 8 lines · Wolfgang Denk
Quoted 4 lines · In message <20050915084918.GB8576@orphique> you wrote:
* VoiceBlue update: use new MTD flash partitioning methods, use more reasonable
TEXT_BASE, update default environment and enable keyed autoboot.Sorry, this does not apply cleanly (any more). Can you please check and re-submit those parts that are still needed? Thanks.
Hi Wolfgang,
most of this patch went already in. Only minor part (done here also for NetStar board) is missing, which could be found in following patch, which also does minor whitespace cleanup.
CHANGELOG
* Use MACH_TYPE_NETSTAR and MACH_TYPE_VOICEBLUE defines instead of numbers in code.
board/netstar/netstar.c +1 -1
@@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;int board_init (void ) {/* arch number of NetStar board */ - gd->bd->bi_arch_number =692 ; + gd->bd->bi_arch_number =MACH_TYPE_NETSTAR ;/* adress of boot parameters */ gd->bd->bi_boot_params =0x10000100 ;
board/voiceblue/voiceblue.c +3 -4
@@ -28,8 +28,7 @@ int board_init(void) *((volatile unsigned char *)VOICEBLUE_LED_REG ) =0xaa ;/* arch number of VoiceBlue board */ -/* TODO: use define from asm/mach-types.h */ - gd->bd->bi_arch_number =218 ; + gd->bd->bi_arch_number =MACH_TYPE_VOICEBLUE ;/* adress of boot parameters */ gd->bd->bi_boot_params =0x10000100 ;
@@ -41,8 +40,8 @@ int dram_init(void) { *((volatile unsigned short *)VOICEBLUE_LED_REG ) =0xff ; -/* Take the Ethernet controller out of reset and wait -* for the EEPROM load to complete. */ +/* Take the Ethernet controller out of reset and wait +* for the EEPROM load to complete. */ *((volatile unsigned short *)GPIO_DATA_OUTPUT_REG ) |=0x80 ;udelay (10 );/* doesn't work before interrupt_init call */ *((volatile unsigned short *)GPIO_DATA_OUTPUT_REG ) &= ~0x80 ;
Stefan Roese
AppliedPATCH 1/1 voiceblue update (Re: mtdparts)
Hi Ladis,
Quoted 3 lines · Ladislav Michl
most of this patch went already in. Only minor part (done here also for NetStar board) is missing, which could be found in following patch, which also does minor whitespace cleanup.
Applied. Thanks.
Best regards,
Stefan