Add a board¶
A target is one build (one SoC family and toolchain), for example a33. A
target can produce several images, one per device or board (for example
miyoo-a30 and pocketgo-s30). Adding a device to an existing target is much
less work than adding a target.
The files¶
| File | Role |
|---|---|
package/system/reglinux-system/Config.in.targets |
declares BR2_PACKAGE_SYSTEM_TARGET_<TARGET> |
configs/reglinux-<target>.board |
the target's Buildroot configuration |
board/<vendor>/<soc>/ |
everything specific to the SoC family: kernel config and patches, package patches, root overlay |
board/<vendor>/<soc>/<board>/ |
one image: create-boot-script.sh, genimage.cfg, boot/extlinux.conf, boot loader build |
package/system/reglinux-system/sysconfigs/<target>/system.conf.<model> |
default settings for one device |
configs/reglinux-<target>.board¶
Starts from two includes, a toolchain and the common system:
include toolchain-gcc14-musl.common # or -glibc, gcc15, gcc16
include reglinux-board.common
then sets:
- the CPU (
BR2_arm/BR2_aarch64,BR2_cortex_*…) andBR2_PACKAGE_SYSTEM_TARGET_<TARGET>=y; BR2_GLOBAL_PATCH_DIR(package patches, shared ones first) andBR2_ROOTFS_OVERLAY;- the kernel: version, defconfig and fragments,
BR2_LINUX_KERNEL_PATCHdirectories, and the device trees to build (BR2_LINUX_KERNEL_INTREE_DTS_NAME); BR2_TARGET_REGLINUX_IMAGES: the board folders to make images from, for example"allwinner/a33/miyoo-a30 allwinner/a33/pocketgo-s30";- the GPU, compositor and audio choices, as the other
.boardfiles do.
Copy the .board of the closest existing target and change what differs.
board/<vendor>/<soc>/<board>/¶
create-boot-script.shcopies the kernel, initrd, device trees, boot loader andextlinux.confinto the boot partition staging folder. It is called withHOST_DIR BOARD_DIR BUILD_DIR BINARIES_DIR TARGET_DIR REGLINUX_BINARIES_DIR;BR2_CONFIGis in its environment.genimage.cfgdescribes the card: the boot loader at the offset the boot ROM reads, a FATREGLINUXboot partition and the ext4SHAREpartition (/userdata, grown on first boot).boot/extlinux.confpoints at/boot/linux, the initrd and the device tree (FDT).
Patches¶
- Kernel patches go in
board/<vendor>/<soc>/linux_patches/, numbered, asgit format-patchoutput with an author (From:) andSigned-off-by:. Patches taken from another project keep their author and carry aLink:to the source. - Patches for a package go in
board/<vendor>/<soc>/patches/<package>/.
Device settings¶
S001populate picks system.conf.<model> from sysconfigs/<target>/, where
<model> is the device tree model (the DMI product name on PCs) with every
character other than letters and digits turned into _. For example
system.conf.Miyoo_A30. Use it for the screen rotation, the power key
behaviour, audio and similar defaults.
Bring-up order¶
Prove each step on the device before the next one:
- Identify the SoC variant, RAM type, PMIC, panel, input and Wi-Fi chips. Save the stock system's device tree and boot files before anything else.
- Boot loader from the card, at the right offset, with the stock DRAM settings.
- Kernel + minimal device tree: CPU, RAM, PMIC, SD card, and a USB network gadget for ssh.
- REG image boots to
/userdataand ssh. - Display, then input, sound, battery and power off, Wi-Fi, sleep.
- Package it: patches with authors, device tree,
sysconfigs, agamecontrollerdbrow for a built-in pad, and an image built withDEBUG_BUILD=nchecked on the device.
Never write to the device's internal storage during bring-up: the stock system is your reference and your way back.