* [Buildroot] Buildroot + u-boot + raspberry-pi Zero W @ 2024-01-22 17:31 uhmgawa 2024-01-24 17:25 ` Peter Seiderer via buildroot 0 siblings, 1 reply; 3+ messages in thread From: uhmgawa @ 2024-01-22 17:31 UTC (permalink / raw) To: buildroot [-- Attachment #1: Type: text/html, Size: 7447 bytes --] [-- Attachment #2: Type: text/plain, Size: 150 bytes --] _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] Buildroot + u-boot + raspberry-pi Zero W 2024-01-22 17:31 [Buildroot] Buildroot + u-boot + raspberry-pi Zero W uhmgawa @ 2024-01-24 17:25 ` Peter Seiderer via buildroot 2024-01-28 20:19 ` uhmgawa 0 siblings, 1 reply; 3+ messages in thread From: Peter Seiderer via buildroot @ 2024-01-24 17:25 UTC (permalink / raw) To: uhmgawa; +Cc: buildroot Hello *, On Mon, 22 Jan 2024 12:31:58 -0500, uhmgawa <uhmgawa@third-harmonic.com> wrote: > I have a vanilla build of gitlab.com/buildroot.org/buildroot.git @ b200632b1ab for raspberrypi0w_defconfig > which seems fine directly booting the kernel using the stock Broadcom binary bootloader. However > changing the Buildroot bootloader config to BR2_TARGET_UBOOT=y, several issues appear: > • While output/images/u-boot.bin is generated, it is not present in output/images/boot.vfat nor does the file /boot/config.txt reflect the expected launch of u-boot with "kernel=u-boot.bin" but rather remains set to directly boot the kernel zImage. The buildroot defconfigs are very minimal starting points for your own development (mostly simple booting with minimal feature set and console output/login via serial line)..., everything more special has to be done by (local) adjustments..., e.g. in your case: - providing an adjusted genimage.cfg (more straight forward before autogenerated, see commit [1] and [2]) to include (additional) u-boot.bin to boot.vfat - providing an adjusted config.txt (see [1] and BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE): enable_uart=1 kernel=u-boot.bin After copying u-booot.bin manually to the boot partition and overwriting the config.txt my RPi zero w boots u-boot with the following output via serial line: U-Boot 2024.01 (Jan 24 2024 - 16:37:26 +0100) DRAM: 448 MiB RPI Zero W (0x9000c1) Core: 67 devices, 14 uclasses, devicetree: embed MMC: mmc@7e202000: 0, mmc@7e300000: 1 Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... In: serial,usbkbd Out: serial,vidconsole Err: serial,vidconsole Net: No ethernet found. starting USB... Bus usb@7e980000: USB DWC2 scanning bus usb@7e980000 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 Card did not respond to voltage select! : -110 No ethernet found. No ethernet found. > • Implementing #1 manually (which is the drill for grafting a standalone u-boot into an existing PI install) does not result in u-boot coming up out of reset. > • If I take the same Buildroot built u-boot and install it (per #2) in a creaky Raspbian 9 install, u-boot functions just fine. > • If I take a git.denx.de/u-boot.git standalome build of u-boot.bin which known to work on the above Raspbian 9, it similarly fails in the Buildroot generated install. > So a few thoughts: > • I may be missing some configuration step given the seeming lack of image preparation in #1. > • Otherwise #1 may imply full Buildroot + u-boot integration remains a WIP, at least for a Raspberry Pi Zero W. > • The actual root cause may be an incompatible holy binary Broadcom firmware package being selected as the only other source of root cause appears to be the /boot installed bootcode.bin and/or start.elf. I do find a limited set of config knobs in the form "BR2_PACKAGE_RPI_FIRMWARE*" but at this point would like to have some sense of where in this problem space I may be. > For reference, this is the Buildroot .config content change from a successful direct boot of the kernel zImage to the selection of u-boot as an intermediate boot loader: > > dot-config-default ? .config > --------------------------------------------------------------------------------------------------- > # BR2_TARGET_UBOOT is not set | BR2_TARGET_UBOOT=y > > BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="" > > BR2_TARGET_UBOOT_PATCH="" > > BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="" > > BR2_TARGET_UBOOT_FORMAT_BIN=y > > BR2_TARGET_UBOOT_VERSION="2024.01" > > BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y > > BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rpi_0_w" > > BR2_TARGET_UBOOT_LATEST_VERSION=y > > BR2_TARGET_UBOOT_USE_DEFCONFIG=y > > BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="" > Any illumination here much appreciated. > > Regards, Peter [1] https://gitlab.com/buildroot.org/buildroot/-/commit/e37ee5acdcebb59c0bcc89eca69540cea2ed441d [2] https://gitlab.com/buildroot.org/buildroot/-/commit/fc5cdeed724174d248dd1f979acea40af6e344ce [3] https://hechao.li/2021/12/20/Boot-Raspberry-Pi-4-Using-uboot-and-Initramfs/ _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] Buildroot + u-boot + raspberry-pi Zero W 2024-01-24 17:25 ` Peter Seiderer via buildroot @ 2024-01-28 20:19 ` uhmgawa 0 siblings, 0 replies; 3+ messages in thread From: uhmgawa @ 2024-01-28 20:19 UTC (permalink / raw) To: ps.report; +Cc: buildroot On 01/24/2024 12:25 PM, Peter Seiderer via buildroot wrote: > Hello *, > > On Mon, 22 Jan 2024 12:31:58 -0500, uhmgawa <uhmgawa@third-harmonic.com> wrote: > >> I have a vanilla build of gitlab.com/buildroot.org/buildroot.git @ b200632b1ab for raspberrypi0w_defconfig >> which seems fine directly booting the kernel using the stock Broadcom binary bootloader. However >> changing the Buildroot bootloader config to BR2_TARGET_UBOOT=y, several issues appear: >> • While output/images/u-boot.bin is generated, it is not present in output/images/boot.vfat nor does the file /boot/config.txt reflect the expected launch of u-boot with "kernel=u-boot.bin" but rather remains set to directly boot the kernel zImage. > > The buildroot defconfigs are very minimal starting points for your own development > (mostly simple booting with minimal feature set and console output/login via serial > line)..., everything more special has to be done by (local) adjustments..., e.g. in > your case: > > - providing an adjusted genimage.cfg (more straight forward before autogenerated, > see commit [1] and [2]) to include (additional) u-boot.bin to boot.vfat > > - providing an adjusted config.txt (see [1] and BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE): > > enable_uart=1 > kernel=u-boot.bin I actually tried the above as a direct modification of /boot/config.txt before my prior mail. Still didn't resolve my issue (below). Anyway after capturing the changes as prescribed above, it took some rattling around to find a "make rpi-firmware-reinstall" was also required to percolate the change into the buildroot's make scope. > > > After copying u-booot.bin manually to the boot partition and overwriting > the config.txt my RPi zero w boots u-boot with the following output via serial line: > > U-Boot 2024.01 (Jan 24 2024 - 16:37:26 +0100) > > DRAM: 448 MiB > RPI Zero W (0x9000c1) > Core: 67 devices, 14 uclasses, devicetree: embed > MMC: mmc@7e202000: 0, mmc@7e300000: 1 > Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... > In: serial,usbkbd > Out: serial,vidconsole > Err: serial,vidconsole > Net: No ethernet found. > starting USB... > Bus usb@7e980000: USB DWC2 > scanning bus usb@7e980000 for devices... 1 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > Hit any key to stop autoboot: 0 > Card did not respond to voltage select! : -110 > No ethernet found. > No ethernet found. I'd hazard your config.txt doesn't have "dtoverlay=miniuart-bt" which was the root cause of my issue as by default the miniuart is intended to serve as the u-boot console. Once that's gone both u-boot and the kernel (via u-boot bootargs) successfully speak to the miniuart. I started to get suspicious after realizing /boot/cmdline.txt contained "console=ttyAMA0,115200" which was successfully booting the default kernel directly from the bootcode.bin/start.elf firmware. > [1] https://gitlab.com/buildroot.org/buildroot/-/commit/e37ee5acdcebb59c0bcc89eca69540cea2ed441d > [2] https://gitlab.com/buildroot.org/buildroot/-/commit/fc5cdeed724174d248dd1f979acea40af6e344ce > [3] https://hechao.li/2021/12/20/Boot-Raspberry-Pi-4-Using-uboot-and-Initramfs/ All of the above was very helpful. Thanks! -john (AKA '*') _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-28 20:32 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-01-22 17:31 [Buildroot] Buildroot + u-boot + raspberry-pi Zero W uhmgawa 2024-01-24 17:25 ` Peter Seiderer via buildroot 2024-01-28 20:19 ` uhmgawa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox