Skip to contentSkip to conversation

mtd partition &kernel

U-Boot Fundu 2 participants 3 messages Jul 21, 2010 1 message not in the archive

lore
Share & tools
lore

Fundu

author
#0 lore raw

does the kernel know about different mtd partition from the boot loader?

How do I go about creating a new mtd partition say /var/logs.

I'm using a mini2440 board which has 4 mtd partition uboot
uboot-env
kernel
rootfs

I want to add another one, how do I go about doing that?

TIA

#1 lore raw
Quoted 1 line · Fundu

does the kernel know about different mtd partition from the boot loader?

Yes. But only If the kernel is compiled with support for parsing the 'mtdpart' boot argument [1] and the mtdparts argument is passed to the linux kernel from u-boot by adding $mtdparts to the bootargs u-boot environment variable. See for example, include/configs/imx31_phycore.h.

Quoted 9 lines

How do I go about creating a new mtd partition say /var/logs.

I'm using a mini2440 board which has 4 mtd partition uboot
uboot-env
kernel
rootfs

I want to add another one, how do I go about doing that?

Once your system meets the requirements listed above, you can add another partition by adding its definition to the end of the mtdparts u-boot environment variable. The format of this variable is well documented [2].

Best Regards,
Ben Gardiner

[1] http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#1500
[2] http://www.denx.de/wiki/view/DULG/UBootCmdGroupFlash#Section_5.9.3.5.

---
Nanometrics Inc.
http://www.nanometrics.ca

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Please keep all correspondence on the list.

Quoted 1 line · Fundu

is there a way i could put this information in the kernel for testing ?

I don't understand the question.

Quoted 10 lines

in u-boot for my board is saw board/mini2440/mini2440.c

i saw

unsigned int dynpart_size[] = {
? ?CFG_UBOOT_SIZE, 0x20000, 0x500000, 0xffffffff, 0 }; char *dynpart_names[] = {
? ?"u-boot", "u-boot_env", "kernel", "rootfs", NULL };

If i change this would the propogation be taken care of.

The dynpart feature is not in mainline u-boot. There is currently a port of the dynpart feature submitted for inclusion [1].

Where did your source code come from? Perhaps the people that provided the source code can help?

As far as I understand dynpart you will need to take whatever space you need for the new partition from the rootfs partition and add the new partition definition to the mini2440.c file by appending an entry to both the dynpart_size and dynpart_names arrays. Compile and flash the new u-boot and with this u-boot execute the 'dynpart' command followed by saveenv. Then re-flash the rootfs and your new partition.

Best Regards,
Ben Gardiner

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/80843

---
Nanometrics Inc.
http://www.nanometrics.ca