* [Buildroot] How to create/install U-Boot and Linux to boot from eMMC
@ 2019-11-11 20:14 Whitney, Scott
2019-11-12 5:45 ` Baruch Siach
2019-11-17 16:14 ` Arnout Vandecappelle
0 siblings, 2 replies; 4+ messages in thread
From: Whitney, Scott @ 2019-11-11 20:14 UTC (permalink / raw)
To: buildroot
Hi Buildroot community,
I'm using Buildroot to successfully build U-Boot and a Linux image for an AM6548 Sitara processor. I created sdcard.img in output/images using genimage, with the following configuration file:
image boot.vfat {
vfat {
files = {
"sysfw.itb",
"tiboot3.bin",
"tispl.bin",
"u-boot.img",
"uEnv.txt",
"Image",
"k3-am654-reflex3-board.dtb"
}
}
size = 70M
}
image sdcard.img {
hdimage {
}
partition u-boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 1G
}
}
I program this directly onto the SD card with:
sudo dd if=./sdcard.img of=/dev/mmcblk0 bs=1M
where /dev/mmcblk0 is how my SD card shows up in Ubuntu, as can be seen using lsblk. This combination of boot and rootfs partitions goes through U-Boot successfully and gets me to a Linux login prompt. So far, so good.
Our board also has 8GB of eMMC memory. I'd like to know how to use Buildroot to program boot/U-Boot and rootfs/Linux onto the eMMC so that we can boot directly from that without having to have an SD card installed.
Can anyone provide instructions for partitioning, formatting, and installing an image suitable for booting from eMMC card? I can have genimage create an eMMC.img file if the format needs to be different, but I'm just not sure what needs to be on the eMMC for this to work successfully.
Many thanks for your help, and best regards!
Scott Whitney | Contractor - Software Engineering
scwhitn at amazon.com| o: xxx.xxx.xxx| m: 603.321.6662
a: 300 Riverpark Drive, North Reading, MA 01864
www.amazonrobotics.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] How to create/install U-Boot and Linux to boot from eMMC
2019-11-11 20:14 [Buildroot] How to create/install U-Boot and Linux to boot from eMMC Whitney, Scott
@ 2019-11-12 5:45 ` Baruch Siach
2019-11-17 16:14 ` Arnout Vandecappelle
1 sibling, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2019-11-12 5:45 UTC (permalink / raw)
To: buildroot
Hi Scott,
On Mon, Nov 11, 2019 at 08:14:59PM +0000, Whitney, Scott wrote:
> Our board also has 8GB of eMMC memory. I'd like to know how to use
> Buildroot to program boot/U-Boot and rootfs/Linux onto the eMMC so that we
> can boot directly from that without having to have an SD card installed.
>
> Can anyone provide instructions for partitioning, formatting, and installing
> an image suitable for booting from eMMC card? I can have genimage create an
> eMMC.img file if the format needs to be different, but I'm just not sure
> what needs to be on the eMMC for this to work successfully.
eMMC usually provides two hardware boot partitions that are meant to make boot
more reliable. These are shown as /dev/mmcblkXboot{0,1} device nodes under
Linux. That in addition to the main /dev/mmcblkX device node. See the link
below for some more information.
https://www.kernel.org/doc/html/latest/driver-api/mmc/mmc-dev-parts.html
Some hardware platforms are aware of eMMC boot partitions, some not. To
complicate things even more, there are eMMC hardware configuration settings
(BOOT_PARTITION_ENABLE, PARTITION_ACCESS) that control the visibility of the
boot partition at boot. Use the mmc-utils 'mmc' utility, or U-Boot 'mmc
partconf' command to query and manipulate these bits.
Also note that the offset of the boot image into the block device might be
different when the eMMC boot partition is used for boot.
See below two eMMC software installation guides that I have been involved in,
for two different platforms.
https://developer.solid-run.com/knowledge-base/installing-and-booting-an-image-on-i-mx6-som-emmc/
https://developer.solid-run.com/knowledge-base/a388-debian/#emmc-software-installation
They talk about Debian image installation, but it equally applies to any SD
card software image like the one you generated with Buildroot. You'll find
there some hints that might help you while experimenting with your hardware.
Hope this helps,
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] How to create/install U-Boot and Linux to boot from eMMC
2019-11-11 20:14 [Buildroot] How to create/install U-Boot and Linux to boot from eMMC Whitney, Scott
2019-11-12 5:45 ` Baruch Siach
@ 2019-11-17 16:14 ` Arnout Vandecappelle
2019-11-19 21:25 ` Whitney, Scott
1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2019-11-17 16:14 UTC (permalink / raw)
To: buildroot
On 11/11/2019 21:14, Whitney, Scott wrote:
> Hi Buildroot community,
>
> I'm using Buildroot to successfully build U-Boot and a Linux image for an AM6548 Sitara processor. I created sdcard.img in output/images using genimage, with the following configuration file:
[snip]
> Our board also has 8GB of eMMC memory. I'd like to know how to use Buildroot to program boot/U-Boot and rootfs/Linux onto the eMMC so that we can boot directly from that without having to have an SD card installed.
>
> Can anyone provide instructions for partitioning, formatting, and installing an image suitable for booting from eMMC card? I can have genimage create an eMMC.img file if the format needs to be different, but I'm just not sure what needs to be on the eMMC for this to work successfully.
Baruch gave you a complex answer. In general, though, you can flash the same
image to eMMC that you used for the SD card, and it will just work.
Basically, you have to make sure that each step in the boot process finds the
next one:
ROM -> SPL -> U-Boot -> kernel -> rootfs
ROM should normally try the different boot devices and find the boot.vfat
partition on eMMC.
SPL will generally use the information on where it booted from to decide where
to load the next step, so it will load U-Boot from eMMC as well. Sometimes,
however, the next step is hardcoded in SPL, so you should check that.
U-Boot will generally try different devices to find the kernel. What it does
exactly depends on its environment, so you can just look into the environment
and chane that as needed.
The rootfs is given on the kernel command line. This can be set either by
U-Boot (usually) but sometimes is hardcoded in the device tree. In the latter
case, you need to update the device tree. If the U-Boot boot script does it, it
will generally set the rootfs based on where the kernel was found.
Hope this helps.
Regards,
Arnout
>
> Many thanks for your help, and best regards!
> Scott Whitney | Contractor - Software Engineering
> scwhitn at amazon.com| o: xxx.xxx.xxx| m: 603.321.6662
> a: 300 Riverpark Drive, North Reading, MA 01864
> www.amazonrobotics.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] How to create/install U-Boot and Linux to boot from eMMC
2019-11-17 16:14 ` Arnout Vandecappelle
@ 2019-11-19 21:25 ` Whitney, Scott
0 siblings, 0 replies; 4+ messages in thread
From: Whitney, Scott @ 2019-11-19 21:25 UTC (permalink / raw)
To: buildroot
Thanks for the reply, Arnout,
Still have not had success with booting from eMMC, but even the TI FAE has had difficulty, so it may be that the early silicon we are using still has problems.
I will keep your suggestions and Baruch's - but my supervisor indicates that booting from eMMC is not a big priority at the moment, and we'll likely be booting from SD card for the next year or so! I have already proven that I can format/write to/read from eMMC partitions, so it's there for additional storage if the need arises.
Best regards!
Scott Whitney
________________________________________
From: Arnout Vandecappelle <arnout@mind.be>
Sent: Sunday, November 17, 2019 11:14 AM
To: Whitney, Scott; buildroot at busybox.net
Subject: Re: [Buildroot] How to create/install U-Boot and Linux to boot from eMMC
On 11/11/2019 21:14, Whitney, Scott wrote:
> Hi Buildroot community,
>
> I'm using Buildroot to successfully build U-Boot and a Linux image for an AM6548 Sitara processor. I created sdcard.img in output/images using genimage, with the following configuration file:
[snip]
> Our board also has 8GB of eMMC memory. I'd like to know how to use Buildroot to program boot/U-Boot and rootfs/Linux onto the eMMC so that we can boot directly from that without having to have an SD card installed.
>
> Can anyone provide instructions for partitioning, formatting, and installing an image suitable for booting from eMMC card? I can have genimage create an eMMC.img file if the format needs to be different, but I'm just not sure what needs to be on the eMMC for this to work successfully.
Baruch gave you a complex answer. In general, though, you can flash the same
image to eMMC that you used for the SD card, and it will just work.
Basically, you have to make sure that each step in the boot process finds the
next one:
ROM -> SPL -> U-Boot -> kernel -> rootfs
ROM should normally try the different boot devices and find the boot.vfat
partition on eMMC.
SPL will generally use the information on where it booted from to decide where
to load the next step, so it will load U-Boot from eMMC as well. Sometimes,
however, the next step is hardcoded in SPL, so you should check that.
U-Boot will generally try different devices to find the kernel. What it does
exactly depends on its environment, so you can just look into the environment
and chane that as needed.
The rootfs is given on the kernel command line. This can be set either by
U-Boot (usually) but sometimes is hardcoded in the device tree. In the latter
case, you need to update the device tree. If the U-Boot boot script does it, it
will generally set the rootfs based on where the kernel was found.
Hope this helps.
Regards,
Arnout
>
> Many thanks for your help, and best regards!
> Scott Whitney | Contractor - Software Engineering
> scwhitn at amazon.com| o: xxx.xxx.xxx| m: 603.321.6662
> a: 300 Riverpark Drive, North Reading, MA 01864
> www.amazonrobotics.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-19 21:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-11 20:14 [Buildroot] How to create/install U-Boot and Linux to boot from eMMC Whitney, Scott
2019-11-12 5:45 ` Baruch Siach
2019-11-17 16:14 ` Arnout Vandecappelle
2019-11-19 21:25 ` Whitney, Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox