• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Questions regarding nand and u-boot partitions  (Read 4393 times)
lyzby
Newbie
*

Karma: 0
Posts: 48


View Profile
« on: August 05, 2010, 07:49:39 PM »

By default on the Sheevaplug, in Nand address 0-0xfffff contains u-boot, 0x100000-0x4fffff contains the kernel, and 0x500000 through the end of memory contains the file system.

In some setups, within linux, mtd0 is the u-boot partition, mtd1 is the kernel, and mtd2 is the file system.  In others, mtd0 is the kernel and mtd1 is the file system, and u-boot is not accessible to linux.

My question is this: is this availability of mtd? within linux totally a result of the u-boot argument "mtdparts" within the bootargs environmental variable, for example, mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)?  So that this example would give mtd0 as 'uImage' and mtd1 as 'rootfs'?

Many kernel sizes are less than 0x400000--is there any reason not to start the file system at 0x400000 instea of 0x500000?
Logged

sfzhi
Jr. Member
**

Karma: 1
Posts: 83


View Profile
« Reply #1 on: August 06, 2010, 03:46:58 AM »

Many kernel sizes are less than 0x400000--is there any reason not to start the file system at 0x400000 instead of 0x500000?

One of the first things I did when I got my plug was decreasing the MTD partition size for kernel. I think 4MB is way too much. If you are a bit conservative about what should be built-in (as opposed to a loadable module) then you will usually end up with a kernel under 2MB.

Although, I did not even try to play with the "mtdparts" boot option, I just changed the default partitioning in the kernel source, as I do not intend to change it again any time soon.
Logged

Lack of knowledge is not such a big problem, unwillingness to learn is.

tylernt
Jr. Member
**

Karma: 2
Posts: 56


View Profile
« Reply #2 on: August 06, 2010, 12:35:12 PM »

4MB is plenty for a compressed kernel, but not uncompressed. I use an uncompressed kernel on my DockStar, and it's about 4.02MB. And, a compressed kernel could conceivably exceed 4MB if you compiled in a lot of modules.

I too would like to know how this mtd partition thing works, so I'll be following this thread with interest.
Logged

rooster
Administrator
Sr. Member
*****

Karma: 8
Posts: 311


View Profile
« Reply #3 on: August 06, 2010, 08:33:44 PM »

Quote
is this availability of mtd? within linux totally a result of the u-boot argument "mtdparts" within the bootargs environmental variable, for example, mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)?  So that this example would give mtd0 as 'uImage' and mtd1 as 'rootfs'?
correct, the uboot mtdparts does the mtd mapping, you could also set it in the kernel config if you do not want to do it in uboot.

Quote
Many kernel sizes are less than 0x400000--is there any reason not to start the file system at 0x400000 instea of 0x500000?
You can place your kernel anywhere you want, this is not true for uboot image which the bootROM loads (the address is hard coded in bootROM)
Logged

Schmerm
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: November 16, 2010, 06:41:11 PM »

Just for curiosity, while the kernel can exist anywhere in flash according to the above, does it have to be loaded to a specific area of RAM by uBoot before control is transferred from uBoot?
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #5 on: November 17, 2010, 07:36:12 AM »

It can be anywhere as long as it is not conflict with uboot. I think u-boot load at 0x6000 for around 500KB size I am not sure if it will relocate itself after started.

 Smiley
Logged

Good Luck Smiley

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #6 on: November 17, 2010, 01:56:58 PM »

However, to be clear, the kernel image has to be compiled for a specific initial memory location, right?  (In other words, it's not compiled entirely of relatively addressed code.)
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #7 on: November 18, 2010, 07:41:40 AM »

Not necessary, if I remember correctly linux boot code begin with relocation so it will move it self to right place.

 Smiley
Logged

Good Luck Smiley

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #8 on: November 18, 2010, 01:07:06 PM »

That's a good bit of information to know.  Thanks.
Logged

Pages: [1]
Print
Jump to: