Skip to contentSkip to conversation

Booting PhyTec PCM043/IMX35 from USB/SD-Card

DISCUSSION Peter Kuennemann@Crane-Soft 4 participants 12 messages May 23, 2012 – Aug 27, 2012

lore
Share & tools
lore
#0 lore raw

Hi all.

I am trying to setup my PCM043/IMX35 board to boot from the USB MMC card but til now I do have have any clue how to manage. Searching the net, did not provide any hints regard that board.

I'ld like to have barebox to allow me to use the USB/MMC card as boot device. Is there a chance to boot from SD-Card at all?

-- barebox configuration data --

I have enabled USB support (USB_EHCI/OHCI and USB_STORAGE ) as well as CONFIG_UBI=y
CONFIG_DISK=y
CONFIG_DISK_WRITE=y
...
CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_USB_OHCI=y
# CONFIG_USB_ULPI is not set
# CONFIG_USB_TWL4030 is not set
CONFIG_USB_STORAGE=y
# CONFIG_USB_GADGET is not set
# CONFIG_VIDEO is not set
CONFIG_MCI=y
...
CONFIG_MCI_STARTUP=y
CONFIG_MCI_INFO=y
CONFIG_MCI_WRITE=y
CONFIG_MCI_IMX_ESDHC=y
CONFIG_MCI_IMX_ESDHC_PIO=y
Device list in bareBox after boot:

---------

barebox@Phytec phyCORE-i.MX35:/ ls /dev

defaultenv             env0                   imx_iim_bank0
imx_iim_bank1          imx_iim_bank2          imx_iim_bank3
imx_iim_bank4          imx_iim_bank5          imx_iim_bank6
imx_iim_bank7          mem                    nand0
nand0.barebox          nand0.barebox.bb       nand0.bareboxenv
nand0.bareboxenv.bb    nand0.kernel           nand0.kernel.bb
nand0.root             nand0.root.bb          nand_oob0
nor0                   nor0.barebox           nor0.bareboxenv
nor0.kernel            nor0.root              phy0
ram0                   self0                  zero

----------

And the environment:

locals:
machine=pcm043
kernel_loc=nor
rootfs_loc=nor
rootfs_type=jffs2
rootfsimage=root.jffs2
kernelimage_type=uimage
kernelimage=uImage-pcm043 nfsroot=192.168.1.161:/tftpboot
autoboot_timeout=3
bootargs=console=ttymxc0,115200 nor_parts=256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root) rootfs_mtdblock_nor=3 nand_parts=256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root) rootfs_mtdblock_nand=7 PS1=\e[1;32mbarebox@\e[1;31m\h:\w\e[0m
globals:
barebox_loc=nor
armlinux_architecture=2072
PATH=/env/bin

Any comments will be very much appreciated.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

Hi Peter,

Quoted 8 lines · On Wed, May 23, 2012 at 05:43:52PM +0200, Peter Kuennemann@Crane-Soft wrote:

Hi all.

I am trying to setup my PCM043/IMX35 board to boot from the USB MMC card but til now I do have have any clue how to manage. Searching the net, did not provide any hints regard that board.

I'ld like to have barebox to allow me to use the USB/MMC card as boot device. Is there a chance to boot from SD-Card at all?

Do you want to start barebox from USB/MMC or do you only want to load the kernel from USB/MMC? The latter is possible, though you have to add support for it. See arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c for an example how to do it. Basically for MMC you have to configure the iomuxer and register the device. USB might be a bit more complicated, you have to configure the phy correctly.

Sascba

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Am 24.05.2012 21:55, schrieb Sascha Hauer:

Quoted 12 lines

Hi Peter,

Quoted 8 lines · On Wed, May 23, 2012 at 05:43:52PM +0200, Peter Kuennemann@Crane-Soft wrote:

Hi all.

I am trying to setup my PCM043/IMX35 board to boot from the USB MMC card but til now I do have have any clue how to manage. Searching the net, did not provide any hints regard that board.

I'ld like to have barebox to allow me to use the USB/MMC card as boot device. Is there a chance to boot from SD-Card at all?

Quoted 9 lines

Do you want to start barebox from USB/MMC or do you only want to load the kernel from USB/MMC? The latter is possible, though you have to add support for it. See arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c for an example how to do it. Basically for MMC you have to configure the iomuxer and register the device. USB might be a bit more complicated, you have to configure the phy correctly.

Sascba

Thanks a lot for your reply, Sascha. I'ld really want to load the Kernel from the MMC and want to have the rootfs there as well. barebox is goint to stay in flash anyhow.
I already tried to boot the Kernel from NOR/NAND but have problems to mount the rootfs on MMC.
I think either way should work for us, booting kernel from MMC and having rootfs on MMC or boot kernel from flash and have rootfs on MMC. I'll investiage the sample that you referred to but I wonder if you could point me into right direction regarding the rootfs on MMC?

---

To have kernel in flash and rootfs on MMC i tried bootargs as:

... root=/dev/mmcblk0p1 rootfstype=ext2 rootflags=noatime rw noinitrd rootwait ..

and it boots the kernel properly from flash up to:
...
mmcblk0: mmc0:a95c SD01G 968 MiB <== Recognized the sd card
mmcblk0: p1 <== and partion 1
...
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 2048 mtdblock2 (driver?)
1f03 30336 mtdblock3 (driver?)
1f04 1048576 mtdblock4 (driver?)
b300 992000 mmcblk0 driver: mmcblk
b301 991585 mmcblk0p1 <=== Something missing here?
No filesystem could mount root, tried: ext2 <===

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1) <===

The mmc does contain a ext2 filesystem with the proper rootfs copied from the jffs2.image that I mounted under Ubuntu as loop device. The kernel has ext2 fs support compiled in.

The rootfs on the mmc is properly accessible when booting kernel and flash footfs on the very same platform.

Peter

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw

Hi Peter,

Quoted 19 lines · On Fri, May 25, 2012 at 11:35:36AM +0200, Peter Kuennemann@Crane-Soft wrote:

To have kernel in flash and rootfs on MMC i tried bootargs as:

... root=/dev/mmcblk0p1 rootfstype=ext2 rootflags=noatime rw noinitrd rootwait ..

and it boots the kernel properly from flash up to:
...
mmcblk0: mmc0:a95c SD01G 968 MiB <== Recognized the sd card
mmcblk0: p1 <== and partion 1
...
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 2048 mtdblock2 (driver?)
1f03 30336 mtdblock3 (driver?)
1f04 1048576 mtdblock4 (driver?)
b300 992000 mmcblk0 driver: mmcblk
b301 991585 mmcblk0p1 <=== Something missing here?
No filesystem could mount root, tried: ext2 <===

Quoted 8 lines
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1) <===

The mmc does contain a ext2 filesystem with the proper rootfs copied from the jffs2.image that I mounted under Ubuntu as loop device. The kernel has ext2 fs support compiled in.

The rootfs on the mmc is properly accessible when booting kernel and flash footfs on the very same platform.

Has this been solved in the mean time? The above looks correct, I have no idea what's wrong.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

Am 31.05.2012 um 20:27 schrieb Sascha Hauer <[email protected]>:

Quoted 28 lines

Hi Peter,

Quoted 25 lines · On Fri, May 25, 2012 at 11:35:36AM +0200, Peter Kuennemann@Crane-Soft wrote:

To have kernel in flash and rootfs on MMC i tried bootargs as:

... root=/dev/mmcblk0p1 rootfstype=ext2 rootflags=noatime rw noinitrd rootwait ..

and it boots the kernel properly from flash up to:
...
mmcblk0: mmc0:a95c SD01G 968 MiB <== Recognized the sd card
mmcblk0: p1 <== and partion 1
...
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 2048 mtdblock2 (driver?)
1f03 30336 mtdblock3 (driver?)
1f04 1048576 mtdblock4 (driver?)
b300 992000 mmcblk0 driver: mmcblk
b301 991585 mmcblk0p1 <=== Something missing here?
No filesystem could mount root, tried: ext2 <===

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1) <===

The mmc does contain a ext2 filesystem with the proper rootfs copied from the jffs2.image that I mounted under Ubuntu as loop device. The kernel has ext2 fs support compiled in.

Quoted 8 lines
Quoted 2 lines

The rootfs on the mmc is properly accessible when booting kernel and flash footfs on the very same platform.

Has this been solved in the mean time? The above looks correct, I have no idea what's wrong.

Sascha

Sascha,
I am sorry but this issue has not yet been resolved. I am currently out of office but will pick it up after my return. It may well be a Kernel configuration Problem.

Peter

Quoted 6 lines
Signature · 5 lines
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw
In reply to Sascha Hauer

mit freundlichen Grüßen,
sincerely yours
sincères salutations

Peter Künnemann
Kappeler Strasse 207
D-40599 Düsseldorf

Mobil: +49 151 40511525

       +49 211 1663157

http://www.crane-soft.de

Am 31.05.2012 20:27, schrieb Sascha Hauer:

Quoted 28 lines

Hi Peter,

Quoted 25 lines · On Fri, May 25, 2012 at 11:35:36AM +0200, Peter Kuennemann@Crane-Soft wrote:

To have kernel in flash and rootfs on MMC i tried bootargs as:

... root=/dev/mmcblk0p1 rootfstype=ext2 rootflags=noatime rw noinitrd rootwait ..

and it boots the kernel properly from flash up to:
...
mmcblk0: mmc0:a95c SD01G 968 MiB <== Recognized the sd card
mmcblk0: p1 <== and partion 1
...
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 2048 mtdblock2 (driver?)
1f03 30336 mtdblock3 (driver?)
1f04 1048576 mtdblock4 (driver?)
b300 992000 mmcblk0 driver: mmcblk
b301 991585 mmcblk0p1 <=== Something missing here?
No filesystem could mount root, tried: ext2 <===

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1) <===

The mmc does contain a ext2 filesystem with the proper rootfs copied from the jffs2.image that I mounted under Ubuntu as loop device. The kernel has ext2 fs support compiled in.

Quoted 5 lines
Quoted 2 lines

The rootfs on the mmc is properly accessible when booting kernel and flash footfs on the very same platform.

Has this been solved in the mean time? The above looks correct, I have no idea what's wrong.

The case has been partly solved now. I am able to boot from NAND and NOR but I cannot access the MMC. Reason for the kernel messages ...(driver?) above was a missing device "mxc_nand" in the kernel parms for mtdparts:

    mtdparts=physmap-flash.0:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root); \
    mxc_nand:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root)

However, I still cannot access the mmc from barebox. It would be enough to be able to read the mmc. I want to be able to store kernel or rootfs image updates on the mmc and flash them to either NAND or NOR after reboot to enable remote update services.

Question: "How can I access the MMC from barebox (read only may be sufficient)

Regards, Peter

Signature · 40 lines
Barebox device list:

[email protected]:/ ls -l /dev
crw-------         32 imx_iim_bank0
crw-------         32 imx_iim_bank1
crw-------         32 imx_iim_bank2
crw-------         32 imx_iim_bank3
crw-------         32 imx_iim_bank4
crw-------         32 imx_iim_bank5
crw-------         32 imx_iim_bank6
crw-------         32 imx_iim_bank7
cr-------- 4294967295 zero
crw-------  134217728 ram0
crw-------       8281 defaultenv
crw------- 4294967295 mem
crw-------         64 phy0
crw------- 1073741824 nand0
cr--------   33554432 nand_oob0
crw-------   33554432 nor0
crw-------     262144 self0
crw-------     131072 env0
crw-------     262144 nor0.barebox
crw-------     131072 nor0.bareboxenv
crw-------    2097152 nor0.kernel
crw-------   31064064 nor0.root
crw-------     262144 nand0.barebox
crw-------     131072 nand0.bareboxenv
crw-------    2097152 nand0.kernel
crw------- 1071251456 nand0.root
crw------- 1070071808 nand0.root.bb
crw-------    2097152 nand0.kernel.bb
crw-------     131072 nand0.bareboxenv.bb
crw-------     262144 nand0.barebox.bb



_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw
Quoted 8 lines · On Thu, Jun 28, 2012 at 08:53:32AM +0200, Peter Kuennemann@Crane-Soft wrote:
Quoted 3 lines

Has this been solved in the mean time? The above looks correct, I have no idea what's wrong.

The case has been partly solved now. I am able to boot from NAND and NOR but I cannot access the MMC. Reason for the kernel messages ...(driver?) above was a missing device "mxc_nand" in the kernel parms for mtdparts:

Quoted 8 lines
    mtdparts=physmap-flash.0:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root); \
    mxc_nand:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root)

However, I still cannot access the mmc from barebox. It would be enough to be able to read the mmc. I want to be able to store kernel or rootfs image updates on the mmc and flash them to either NAND or NOR after reboot to enable remote update services.

Question: "How can I access the MMC from barebox (read only may be sufficient)

The pcm043 currently does not have mmc support. You have to add this to the board file:

imx35_add_mmc0(NULL);

or

imx35_add_mmc1(NULL);

depending on which port is routed to the slot. Also you have to setup the iomuxer (you can probably copy the pin settings from the kernel). Of course you also have to enable MMC support in the config.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

Am 28.06.2012 12:43, schrieb Sascha Hauer:

Quoted 14 lines
Quoted 6 lines

...
However, I still cannot access the mmc from barebox. It would be enough to be able to read the mmc. I want to be able to store kernel or rootfs image updates on the mmc and flash them to either NAND or NOR after reboot to enable remote update services.

Question: "How can I access the MMC from barebox (read only may be sufficient)

The pcm043 currently does not have mmc support. You have to add this to the board file:

imx35_add_mmc0(NULL);

or

Quoted 9 lines

imx35_add_mmc1(NULL);

depending on which port is routed to the slot. Also you have to setup the iomuxer (you can probably copy the pin settings from the kernel). Of course you also have to enable MMC support in the config.

Sascha

I have tried to update the board code accordingly but stumbled upon another problem. The size of barebox increased to 0x40bb7 so I changed the partition definitions in pcm043.c as follows:

#define CONFIG_MX35_BBSIZE 0x42000
...
devfs_add_partition("nor0", 0x00000, CONFIG_MX35_BBSIZE, PARTITION_FIXED, "self0"); /* ourself */ devfs_add_partition("nor0", CONFIG_MX35_BBSIZE, 0x20000, PARTITION_FIXED, "env0");
...
Barebox boots OK but after having saved the environment (saveenv) it dow not boot anymore.

Barebox boot messages ...

Malloc space: 0x86e00000 -> 0x87dfffff (size 16 MB) Stack space : 0x86df8000 -> 0x86e00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment <== expected
running /env/bin/init...

devinfo <== What is defined ?
...
`---- cfi_flash0

     `---- 0x00000000-0x01ffffff: /dev/nor0
     `---- 0x00000000-0x00041fff: /dev/self0
     `---- 0x00042000-0x0005ffff: /dev/env0

saveenv <== save the environment
reset <== nothing after here

What is wrong here?

Peter

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#8 lore raw
Quoted 48 lines · On Thu, Jun 28, 2012 at 03:36:22PM +0200, Peter Kuennemann@Crane-Soft wrote:

Am 28.06.2012 12:43, schrieb Sascha Hauer:

Quoted 14 lines
Quoted 6 lines

...
However, I still cannot access the mmc from barebox. It would be enough to be able to read the mmc. I want to be able to store kernel or rootfs image updates on the mmc and flash them to either NAND or NOR after reboot to enable remote update services.

Question: "How can I access the MMC from barebox (read only may be sufficient)

The pcm043 currently does not have mmc support. You have to add this to the board file:

imx35_add_mmc0(NULL);

or

Quoted 9 lines

imx35_add_mmc1(NULL);

depending on which port is routed to the slot. Also you have to setup the iomuxer (you can probably copy the pin settings from the kernel). Of course you also have to enable MMC support in the config.

Sascha

I have tried to update the board code accordingly but stumbled upon another problem. The size of barebox increased to 0x40bb7 so I changed the partition definitions in pcm043.c as follows:

#define CONFIG_MX35_BBSIZE      0x42000
   ...
   devfs_add_partition("nor0", 0x00000, CONFIG_MX35_BBSIZE, PARTITION_FIXED, "self0"); /* ourself */
   devfs_add_partition("nor0", CONFIG_MX35_BBSIZE, 0x20000, PARTITION_FIXED, "env0");
   ...

Barebox boots OK but after having saved the environment (saveenv) it dow not boot anymore.

Barebox boot messages ...

Malloc space: 0x86e00000 -> 0x87dfffff (size 16 MB) Stack space : 0x86df8000 -> 0x86e00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment <== expected
running /env/bin/init...

devinfo <== What is defined ?
...
`---- cfi_flash0

Quoted 8 lines
     `---- 0x00000000-0x01ffffff: /dev/nor0
     `---- 0x00000000-0x00041fff: /dev/self0
     `---- 0x00042000-0x0005ffff: /dev/env0

saveenv <== save the environment
reset <== nothing after here

What is wrong here?

You should align partition sizes to eraseblock sizes.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw
In reply to Sascha Hauer

Am 28.06.2012 12:43, schrieb Sascha Hauer:

Quoted 4 lines · On Thu, Jun 28, 2012 at 08:53:32AM +0200, Peter Kuennemann@Crane-Soft wrote:
Quoted 3 lines
Quoted 3 lines

Has this been solved in the mean time? The above looks correct, I have no idea what's wrong.

...

Quoted 13 lines
Quoted 5 lines

However, I still cannot access the mmc from barebox. It would be enough to be able to read the mmc. I want to be able to store kernel or rootfs image updates on the mmc and flash them to either NAND or NOR after reboot to enable remote update services.

Question: "How can I access the MMC from barebox (read only may be sufficient)

The pcm043 currently does not have mmc support. You have to add this to the board file:

imx35_add_mmc0(NULL);

or

Quoted 8 lines

imx35_add_mmc1(NULL);

depending on which port is routed to the slot. Also you have to setup the iomuxer (you can probably copy the pin settings from the kernel). Of course you also have to enable MMC support in the config.

Sascha

Sascha I'ld like to pick up this thread again abd I hope that someone can give me the hint to help me out here.

I managed to access the mmc applying your hints above. The card seem to appear correctly with all it's partitions:

---
imx-esdhc@mci0: registered as mci0
mci@mci0: registered disk0
ehci@ehci0: USB EHCI 1.00
---
barebox:/ ls /dev

defaultenv             disk0                  disk0.0
disk0.1                env0                   full

---
I am able to boot the kernel from NOR flash and use the mmc as rootfs. However I did not yet find a way to boot the kernel from the MMC. I set up the MMC with 255 heads, 63 sectors/track, 245 cylinders and formated partition 1 as VFAT and made it bootable. I then copied uImage to it. Partition 2 contains the rootfs which can be used when booting the kernel from flash.

Barebox /env/config contains: (besides others)
...
kernel_loc=disk
rootfs_loc=disk
rootfs_type=ext2
rootfs_part_linux_dev=mmcblk0p2
kernel_part=disk0.0
...

Trying to boot results in:
booting kernel from /dev/disk0.0

and then followed by the barebox prompt.

barebox:/

Kernel parameters are: console=ttymxc0,115200 video=mx3fb:CTP-CLAA070LC0ACW ip=dhcp root=/dev/mmcblk0p2 rootfstype=ext2 noinitrd rootwait mtdparts=physmap-flash.0:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root);:256k(barebox)ro,128k(bareboxenv),2M(kernel),-(root)

A little help would be very much appreciated.

Regards and many thanks for your support.

Peter

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#10 lore raw

Hi!

Quoted 15 lines · Peter

I am able to boot the kernel from NOR flash and use the mmc as rootfs. However I did not yet find a way to boot the kernel from the MMC. I set up the MMC with 255 heads, 63 sectors/track, 245 cylinders and formated partition 1 as VFAT and made it bootable. I then copied uImage to it. Partition 2 contains the rootfs which can be used when booting the kernel from flash.

Barebox /env/config contains: (besides others)
...
kernel_loc=disk
rootfs_loc=disk
rootfs_type=ext2
rootfs_part_linux_dev=mmcblk0p2
kernel_part=disk0.0
...

Quoted 4 lines

Trying to boot results in:
booting kernel from /dev/disk0.0

and then followed by the barebox prompt.

You're using the old default-env which does not support uImage on FAT (only a kernel directly in a partition). Either switch to default-env-2 and mount the FAT ('mount /dev/disk0.0 fat /mnt') before loading the kernel from /mnt/uImage.

Otherwise for the old default-env take a look at <[email protected]>. Note that for that to work, the FAT must be mounted by the board code or you need to setup an automount.

Regards,
Jan

Signature · 10 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

Am 24.08.2012 10:46, schrieb Jan Lübbe:

Jan, thanks very much for pointing me into the right direction

Quoted 23 lines

Hi!

Quoted 15 lines · Peter

I am able to boot the kernel from NOR flash and use the mmc as rootfs. However I did not yet find a way to boot the kernel from the MMC. I set up the MMC with 255 heads, 63 sectors/track, 245 cylinders and formated partition 1 as VFAT and made it bootable. I then copied uImage to it. Partition 2 contains the rootfs which can be used when booting the kernel from flash.

Barebox /env/config contains: (besides others)
...
kernel_loc=disk
rootfs_loc=disk
rootfs_type=ext2
rootfs_part_linux_dev=mmcblk0p2
kernel_part=disk0.0
...

Quoted 4 lines

Trying to boot results in:
booting kernel from /dev/disk0.0

and then followed by the barebox prompt.

Quoted 8 lines

You're using the old default-env which does not support uImage on FAT (only a kernel directly in a partition). Either switch to default-env-2 and mount the FAT ('mount /dev/disk0.0 fat /mnt') before loading the kernel from /mnt/uImage.
Otherwise for the old default-env take a look at <[email protected]>. Note that for that to work, the FAT must be mounted by the board code or you need to setup an automount.

After implementing all required driver and support into barebox, it turns out that I also need to increase it's partition size to 512K. I then was able to use the existing environment and changed the boot script as follows

elif [ x$kernel_loc = xdisk ]; then

     kdev="/dev/$kernel_part"
+    mkdir /boot
+    mount $kdev fat /boot
+    kdev=/boot/UIMAGE

Many thanks, Peter

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox