2.5 KiB
2.5 KiB
Brain (i.MX28) Linux boot flow notes
This is a consolidated boot-flow summary based on local sources:
- buildbrain (boot image scripts, BrainLILO, u-boot-brain)
- linux-brain kernel tree
- brainux wiki pages (build + USB gadget)
1) Boot chain overview
- i.MX28 ROM loads Windows CE from internal storage (vendor default).
- Windows CE launches the BrainLILO app from the SD card.
- BrainLILO selects a model-specific U-Boot binary from the SD card and jumps to it (soft reset / memory remap).
- U-Boot loads the Linux kernel (zImage) + DTB from SD/eMMC
and boots Linux with
bootz.
Key locations:
- BrainLILO loads from
\\Storage Card\\loader\\<model>.bin(seesources/buildbrain/brainlilo/models.h). - Boot image creation logic is in
sources/buildbrain/image/build_image.sh.
2) SD card layout (buildbrain convention)
From sources/buildbrain/image/build_image.sh:
- Partition 1: FAT32 (~64 MiB)
zImageand DTBs (imx28-pwsh*.dtb)nk/andloader/containing U-Boot binaries- BrainLILO app directory (Windows CE):
アプリ/Launch LinuxAppMain.exe(exeopener)AppMain_.exe(BrainLILO.exe)*.dll,index.din,AppMain.cfg
- Partition 2: ext4 rootfs
3) U-Boot behavior (brain_mx28_common.h)
sources/buildbrain/u-boot-brain/include/configs/brain_mx28_common.h:
bootorder=emmc sd,sddev=1(SD),emmcdev=0(eMMC)- Loads
zImage+fdt_filefrom FAT (fatload), thenbootz - Optional
uEnv.txtimport on SD/eMMC viapreboot - Default DTB is set by defconfig, e.g.
CONFIG_DEFAULT_FDT_FILE=imx28-pwsh5.dtb
4) Kernel/DTB
linux-brain provides the kernel and DTBs:
- Kernel:
arch/arm/boot/zImage - DTB:
arch/arm/boot/dts/imx28-pwsh{1..7}.dtb,imx28-pwa7200.dtb, etc. - Base DTS:
arch/arm/boot/dts/imx28-brain.dtsi
Kernel version in this tree: 5.4.149 (see sources/linux-brain-brain/Makefile).
5) USB gadget (RNDIS)
Default imx28-brain.dtsi sets USB controller to host mode:
usb@80080000 { dr_mode = "host"; }
Brainux wiki describes switching to gadget mode by changing
dr_mode = "peripheral" and then enabling RNDIS via configfs.
A reference script/service exists in:
sources/buildbrain/os-brainux/override/usr/bin/enable_rndis_gadgetsources/buildbrain/os-brainux/override/lib/systemd/system/rndis_gadget.service
6) Recovery / USB boot
Buildbrain uses u-boot.sb for i.MX28 USB recovery mode (uuu).
See sources/buildbrain/README.md and sources/buildbrain/Makefile.