Repository navigation
ambarella: s3l: Amcrest IP4M-1026E, with the board DTB appended to the uImage - #178
Conversation
Boot loaders like the Dahua one on the Amcrest IP4M-1026E pass ATAGs, never a device tree, so the board DTB has to travel with the kernel (CONFIG_ARM_APPENDED_DTB). Buildroot's appended-uImage option names the result uImage.<dtb>, which the firmware's repack step doesn't pick up. As on the Anyka kernel: CONFIG_AMBARELLA_OPENIPC_DTB names the board's DTB, and the uImage target then wraps zImage plus that DTB, still called uImage. Left empty (the default), the uImage stays the plain zImage, so boards whose boot loader passes a DTB are unchanged. Tested for the IP4M-1026E: with the DTB set, the uImage carries zImage plus the board DTB, netboots with an initramfs, and the flash build repacks it; with the option empty, the uImage carries the plain zImage.
Amcrest IP4M-1026E (Dahua IPC-HFW1430SN): S3L, OV4689 over MIPI, 32 MiB SPI-NOR, RTL8201F over RMII. Its Dahua U-Boot boots with ATAGs, so this is the DTB a board build appends to the uImage (CONFIG_AMBARELLA_OPENIPC_DTB="ambarella-s3l-ip4m1026e"). - Memory as the stock firmware splits it: 118 MiB for Linux above the boot area, the rest for the DSP (the dtsi's 126 MiB would overlap it). - SPI-NOR on, NAND off (shared pins). - The VIN placeholder on i2c0 the sensor modules rename, and the sensor reset on GPIO 107, active low. - IR receiver, I2S and sdmmc0 off: the board has none, and their pins are the reset button (GPIO 34) and a status LED output (GPIO 60). - The bit-banged MDIO off, as it would share the MAC's pins. Tested on the IP4M-1026E: netbooted with this DTB appended, the sensor, SPI-NOR, Ethernet and IAV come up and Divinus streams.
PR Summary by QodoAdd Amcrest IP4M-1026E device tree and optional DTB-appended uImage
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
The decompressor only looks for an appended DTB with CONFIG_ARM_APPENDED_DTB, so CONFIG_AMBARELLA_OPENIPC_DTB without it built a uImage carrying a blob the kernel ignores. It now depends on ARM_APPENDED_DTB, as hisilicon-hi3516cv6xx's BUILD_ARM_APPENDED_DTB_IMAGE_NAMES does; without it the option is hidden and the uImage stays the plain zImage. The IP4M-1026E DTS comment now says which command line the board uses: the built-in one (CONFIG_CMDLINE), since the one its U-Boot passes is the stock firmware's. Tested: with the board's config the uImage is still the zImage plus the board DTB, and the DTB is unchanged; with ARM_APPENDED_DTB off, olddefconfig drops the option and the uImage is the plain zImage.
|
Thanks. Point 1 is fixed in 11dc6ba: CONFIG_AMBARELLA_OPENIPC_DTB now depends on ARM_APPENDED_DTB, as hisilicon-hi3516cv6xx's BUILD_ARM_APPENDED_DTB_IMAGE_NAMES does. Without it the option is hidden and the uImage stays the plain zImage. Point 2 is intentional. The Dahua U-Boot passes the stock firmware's command line (root=/dev/mtdblock5 and the stock flash layout), so this board takes its command line from CONFIG_CMDLINE in its kernel fragment. ARM_ATAG_DTB_COMPAT would merge the stock arguments back in. The same commit rewords the DTS comment to say so. Point 3: the FORCE + cat rule is the one every OpenIPC ARM kernel uses (anyka-ak3918ev300, hisilicon-hi3516cv500/ev200/cv6xx), so I've kept it as is here. A change to it would make sense across all of those kernels at once. |
Problem
The Amcrest IP4M-1026E (Dahua IPC-HFW1430SN) boots through Dahua's U-Boot, which passes ATAGs and never a device tree, so the board DTB has to travel with the kernel (
CONFIG_ARM_APPENDED_DTB). Buildroot's appended-uImage option can do that, but it names the resultuImage.<dtb>, and the firmware's repack step only picks upuImage.Change
ambarella: s3l: append a board DTB to the uImage. This follows the Anyka kernel:
CONFIG_AMBARELLA_OPENIPC_DTBnames the board's DTB (without.dtb), and theuImagetarget then wraps the zImage plus that DTB (zImage-dtb), still calleduImage. It's empty by default, which leaves the uImage the plain zImage, so boards whose boot loader passes a DTB are unchanged.ambarella: s3l: Amcrest IP4M-1026E device tree (
ambarella-s3l-ip4m1026e.dts):Testing
On the IP4M-1026E:
CONFIG_AMBARELLA_OPENIPC_DTB="ambarella-s3l-ip4m1026e", the uImage is exactly the zImage plus the board DTB. It boots from TFTP (with an initramfs) and from SPI-NOR, flashed through the Dahua U-Boot.The board's OpenIPC profile (OpenIPC/builder, to follow) sets the option and uses this DTS. For a settings overlay on flash it also needs overlayfs (#177).