Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] board/orangepi/orangepi-zero3: add SPI-NOR image support
@ 2026-09-25 16:52 Vladimir Savelev
  2026-09-25 16:52 ` [Buildroot] [PATCH 2/2] board/orangepi/orangepi-zero2w, orangepi-zero3: set the hostname Vladimir Savelev
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Savelev @ 2026-09-25 16:52 UTC (permalink / raw)
  To: buildroot; +Cc: Marcin Niestroj, Vladimir Savelev, Sergey Matyukevich

The board can boot from its 16 MiB SPI-NOR flash in addition to the SD
card.  Add the board files needed to build the SPI-NOR image, leaving the
existing SD card image unchanged.

The SPI-NOR image is assembled with genimage, like the Zero 2W does:

  - genimage-spi.cfg describes the raw flash layout (U-Boot, FIT kernel
    and squashfs rootfs at fixed offsets, no partition table) and is fed
    to the generic genimage wrapper;

  - post-image.sh LZMA-compresses the kernel, because the uncompressed
    Image does not fit the 5376K kernel partition, wraps the kernel and
    the DTB into a FIT image, and then assembles both the SD card and the
    SPI-NOR images;

  - linux.fragment trims the generic arm64 defconfig so that the
    compressed kernel fits in the 5376K partition, and linux-net.fragment
    enables the board's on-board Gigabit Ethernet (emac0 + Motorcomm
    PHY);

  - uboot.fragment sets CONFIG_BOOTCOMMAND to boot the FIT from SPI and
    fall back to the default distro boot (SD card), so that the same
    U-Boot boots both images.

Both images are built by the same defconfig; the SPI-NOR image uses the
squashfs rootfs, while the SD card image keeps the ext2 rootfs.

Signed-off-by: Vladimir Savelev <anykey196@gmail.com>
---
 board/orangepi/orangepi-zero3/fit.its         |  38 ++
 .../orangepi/orangepi-zero3/genimage-spi.cfg  |  42 ++
 .../orangepi-zero3/linux-net.fragment         |   8 +
 board/orangepi/orangepi-zero3/linux.fragment  | 567 ++++++++++++++++++
 board/orangepi/orangepi-zero3/post-image.sh   |  34 ++
 board/orangepi/orangepi-zero3/uboot.fragment  |   6 +
 configs/orangepi_zero3_defconfig              |   8 +-
 7 files changed, 701 insertions(+), 2 deletions(-)
 create mode 100644 board/orangepi/orangepi-zero3/fit.its
 create mode 100644 board/orangepi/orangepi-zero3/genimage-spi.cfg
 create mode 100644 board/orangepi/orangepi-zero3/linux-net.fragment
 create mode 100644 board/orangepi/orangepi-zero3/linux.fragment
 create mode 100755 board/orangepi/orangepi-zero3/post-image.sh
 create mode 100644 board/orangepi/orangepi-zero3/uboot.fragment

diff --git a/board/orangepi/orangepi-zero3/fit.its b/board/orangepi/orangepi-zero3/fit.its
new file mode 100644
index 0000000000..cdd5afe05c
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/fit.its
@@ -0,0 +1,38 @@
+/dts-v1/;
+
+/ {
+	description = "OrangePi Zero 3 - Linux kernel + FDT (SPI-NOR)";
+	#address-cells = <1>;
+
+	images {
+		kernel {
+			description = "Linux kernel";
+			data = /incbin/("kernel.lzma");
+			type = "kernel";
+			arch = "arm64";
+			os = "linux";
+			compression = "lzma";
+			load = <0x41000000>;
+			entry = <0x41000000>;
+		};
+
+		fdt {
+			description = "OrangePi Zero 3 device tree";
+			data = /incbin/("dtb.bin");
+			type = "flat_dt";
+			arch = "arm64";
+			compression = "none";
+			load = <0x43000000>;
+		};
+	};
+
+	configurations {
+		default = "config";
+
+		config {
+			description = "OrangePi Zero 3";
+			kernel = "kernel";
+			fdt = "fdt";
+		};
+	};
+};
diff --git a/board/orangepi/orangepi-zero3/genimage-spi.cfg b/board/orangepi/orangepi-zero3/genimage-spi.cfg
new file mode 100644
index 0000000000..59dba5e202
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/genimage-spi.cfg
@@ -0,0 +1,42 @@
+# OrangePi Zero 3 - SPI-NOR image (16 MiB, zb25vq128).
+#
+# The layout is dictated by the U-Boot environment in
+# board/orangepi/orangepi-zero2w/uboot.fragment: the mtdparts/bootcmd there use
+# the very same offsets, so both files must be kept in sync.
+#
+#   u-boot @ 0        (896K)
+#   kernel @ 896K     (5376K)   FIT: LZMA-compressed kernel + DTB
+#   rootfs @ 6272K    (10112K)  squashfs (XZ)
+#
+# The kernel partition only needs to hold the FIT (~4.8 MiB); the rest of the
+# 16 MiB is given to the rootfs, which carries WiFi (iwd), dropbear and the
+# local credentials.
+
+flash nor-16M-256 {
+	pebsize = 4K
+	numpebs = 4K
+	minimum-io-unit-size = 256
+}
+
+image spi.img {
+	flash {
+	}
+	flashtype = "nor-16M-256"
+
+	partition u-boot {
+		image = "u-boot-sunxi-with-spl.bin"
+		size = 896K
+	}
+
+	partition kernel {
+		image = "fit.itb"
+		offset = 896K
+		size = 5376K
+	}
+
+	partition rootfs {
+		image = "rootfs.squashfs"
+		offset = 6272K
+		size = 10112K
+	}
+}
diff --git a/board/orangepi/orangepi-zero3/linux-net.fragment b/board/orangepi/orangepi-zero3/linux-net.fragment
new file mode 100644
index 0000000000..7d1c59c943
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/linux-net.fragment
@@ -0,0 +1,8 @@
+# Zero 3 networking on top of the trimmed kernel (linux.fragment disables
+# Ethernet): the board has an on-board Gigabit PHY (Motorcomm YT8531) on emac0.
+CONFIG_ETHERNET=y
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
+CONFIG_DWMAC_SUN8I=y
+CONFIG_MOTORCOMM_PHY=y
diff --git a/board/orangepi/orangepi-zero3/linux.fragment b/board/orangepi/orangepi-zero3/linux.fragment
new file mode 100644
index 0000000000..df52d70141
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/linux.fragment
@@ -0,0 +1,567 @@
+# Kernel fragment for the OrangePi Zero 2W 16 MiB SPI-NOR image.
+#
+# The generic arm64 defconfig is far too large for the 6400K kernel partition,
+# so the heaviest unused subsystems are disabled here to keep the
+# LZMA-compressed kernel within that budget.  The filesystems used on the
+# board (squashfs for the SPI image, ext4 for the SD card, overlayfs for the
+# writable overlay) are enabled.
+
+# --- Filesystems and MTD used on the board ---
+CONFIG_SQUASHFS_XZ=y
+CONFIG_OVERLAY_FS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+
+# --- Heavy unused subsystems ---
+# CONFIG_DRM is not set
+# CONFIG_DRM_SUN4I is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_MEDIA_SUPPORT is not set
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_SOUND is not set
+# CONFIG_SND is not set
+# CONFIG_SOUNDWIRE is not set
+# CONFIG_BT is not set
+# CONFIG_LEDS_TRIGGER_ACTS_RL is not set
+
+# --- Filesystems not used on an SPI flash board ---
+# CONFIG_BTRFS_FS is not set
+# CONFIG_UBIFS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_FAT_FS is not set
+
+# --- Network filesystems ---
+# CONFIG_NFS_FS is not set
+# CONFIG_9P_FS is not set
+# CONFIG_NFS_V4 is not set
+
+# --- Network protocol extras / big NICs ---
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_INTEGRITY is not set
+
+# --- Storage controllers not present on H618 ---
+# CONFIG_ATA is not set
+# CONFIG_SCSI is not set
+# CONFIG_NVME_CORE is not set
+# CONFIG_MMC_DW is not set
+# CONFIG_MMC_DW_EXYNOS is not set
+# CONFIG_MMC_DW_PLTFM is not set
+# CONFIG_MMC_DW_HI3798CV200 is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SDHCI_PLTFM is not set
+# CONFIG_MMC_SDHCI_OF_ESD is not set
+# CONFIG_MMC_SDHCI_OF_DWCMSHC is not set
+
+# --- Misc heavy stuff ---
+# CONFIG_INPUT is not set
+# CONFIG_IIO is not set
+# CONFIG_PCI is not set
+# CONFIG_COREBUILD_RUN is not set
+
+# ============================================================
+# Required features for this board (override if defconfig lacks)
+# --- Restrict to Allwinner (Orangepi Zero 2W) only ---
+# CONFIG_ARCH_ACTIONS is not set
+# CONFIG_ARCH_AIROHA is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_APPLE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AXIADO is not set
+# CONFIG_ARCH_BCM2835 is not set
+# CONFIG_ARCH_BCM_IPROC is not set
+# CONFIG_ARCH_BCMBCA is not set
+# CONFIG_ARCH_BRCMSTB is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_BLAIZE is not set
+# CONFIG_ARCH_BST is not set
+# CONFIG_ARCH_CIX is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_K3 is not set
+# CONFIG_ARCH_LG1K is not set
+# CONFIG_ARCH_HISI is not set
+# CONFIG_ARCH_KEEMBAY is not set
+# CONFIG_ARCH_MEDIATEK is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_LAN969X is not set
+# CONFIG_ARCH_SPARX5 is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_LAYERSCAPE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_S32 is not set
+# CONFIG_ARCH_MA35 is not set
+# CONFIG_ARCH_NPCM is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALTEK is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SEATTLE is not set
+# CONFIG_ARCH_INTEL_SOCFPGA is not set
+# CONFIG_ARCH_SOPHGO is not set
+# CONFIG_ARCH_STM32 is not set
+# CONFIG_ARCH_SYNQUACER is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_TESLA_FSD is not set
+# CONFIG_ARCH_SPRD is not set
+# CONFIG_ARCH_THUNDER is not set
+# CONFIG_ARCH_THUNDER2 is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_VISCONTI is not set
+# CONFIG_ARCH_XGENE is not set
+# CONFIG_ARCH_ZYNQMP is not set
+
+# --- Disable driver modules not needed on this board ---
+# (keep only cfg80211/mac80211 as modules for the out-of-tree UWE5622 driver)
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+# CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM is not set
+# CONFIG_ACPI_CPPC_CPUFREQ is not set
+# CONFIG_NET_IP_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_IPV6_SIT is not set
+# CONFIG_NF_CONNTRACK is not set
+# CONFIG_NF_LOG_SYSLOG is not set
+# CONFIG_NETFILTER_XTABLES is not set
+# CONFIG_NETFILTER_XT_MARK is not set
+# CONFIG_NETFILTER_XT_TARGET_LOG is not set
+# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set
+# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
+# CONFIG_NETFILTER_XT_MATCH_IPVS is not set
+# CONFIG_IP_VS is not set
+# CONFIG_NF_DEFRAG_IPV4 is not set
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_NF_LOG_IPV6 is not set
+# CONFIG_IP6_NF_IPTABLES is not set
+# CONFIG_NF_DEFRAG_IPV6 is not set
+# CONFIG_STP is not set
+# CONFIG_GARP is not set
+# CONFIG_MRP is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_SCH_CBS is not set
+# CONFIG_NET_SCH_ETF is not set
+# CONFIG_NET_SCH_MQPRIO_LIB is not set
+# CONFIG_NET_SCH_TAPRIO is not set
+# CONFIG_NET_SCH_MQPRIO is not set
+# CONFIG_NET_SCH_INGRESS is not set
+# CONFIG_NET_CLS_BASIC is not set
+# CONFIG_NET_CLS_FLOWER is not set
+# CONFIG_NET_ACT_GACT is not set
+# CONFIG_NET_ACT_MIRRED is not set
+# CONFIG_NET_ACT_GATE is not set
+# CONFIG_QRTR is not set
+# CONFIG_QRTR_SMD is not set
+# CONFIG_QRTR_TUN is not set
+# CONFIG_QRTR_MHI is not set
+# CONFIG_CAN is not set
+# CONFIG_CAN_RAW is not set
+# CONFIG_CAN_BCM is not set
+# CONFIG_CAN_GW is not set
+# CONFIG_NFC is not set
+# CONFIG_NFC_NCI is not set
+# CONFIG_NFC_NXP_NCI_I2C is not set
+# CONFIG_NFC_S3FWRN5 is not set
+# CONFIG_NFC_S3FWRN5_I2C is not set
+# CONFIG_REGMAP_SLIMBUS is not set
+# CONFIG_REGMAP_SPMI is not set
+# CONFIG_MHI_BUS is not set
+# CONFIG_GOOGLE_CBMEM is not set
+# CONFIG_GOOGLE_COREBOOT_TABLE is not set
+# CONFIG_GNSS is not set
+# CONFIG_GNSS_SERIAL is not set
+# CONFIG_GNSS_MTK_SERIAL is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_BRCMNAND_BCMBCA is not set
+# CONFIG_MTD_NAND_BRCMNAND_BRCMSTB is not set
+# CONFIG_MTD_NAND_BRCMNAND_IPROC is not set
+# CONFIG_MTD_UBI is not set
+# CONFIG_MTD_HYPERBUS is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_TPS6594_ESM is not set
+# CONFIG_TPS6594_PFSM is not set
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_UACCE is not set
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_BLK_DEV_DM is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_ZERO is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_MACVTAP is not set
+# CONFIG_TAP is not set
+# CONFIG_VETH is not set
+# CONFIG_MHI_NET is not set
+# CONFIG_BCMGENET is not set
+# CONFIG_SYSTEMPORT is not set
+# CONFIG_QCOM_EMAC is not set
+# CONFIG_RMNET is not set
+# CONFIG_STMMAC_ETH is not set
+# CONFIG_STMMAC_PLATFORM is not set
+# CONFIG_DWMAC_GENERIC is not set
+# CONFIG_DWMAC_SUNXI is not set
+# CONFIG_DWMAC_SUN8I is not set
+# CONFIG_DWMAC_SUN55I is not set
+# CONFIG_XILINX_AXI_EMAC is not set
+# CONFIG_AX88796B_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_BCM54140_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM_NET_PHYLIB is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_DP83869_PHY is not set
+# CONFIG_CAN_DEV is not set
+# CONFIG_CAN_FLEXCAN is not set
+# CONFIG_CAN_M_CAN is not set
+# CONFIG_CAN_M_CAN_PLATFORM is not set
+# CONFIG_CAN_MCP251XFD is not set
+# CONFIG_PCS_XPCS is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_RTL8152 is not set
+# CONFIG_USB_LAN78XX is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_NET_AX8817X is not set
+# CONFIG_USB_NET_AX88179_178A is not set
+# CONFIG_USB_NET_CDCETHER is not set
+# CONFIG_USB_NET_CDC_NCM is not set
+# CONFIG_USB_NET_DM9601 is not set
+# CONFIG_USB_NET_SR9800 is not set
+# CONFIG_USB_NET_SMSC75XX is not set
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_NET1080 is not set
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_MCS7830 is not set
+# CONFIG_USB_NET_CDC_SUBSET_ENABLE is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+# CONFIG_USB_NET_ZAURUS is not set
+# CONFIG_USB_RTL8153_ECM is not set
+# CONFIG_ATH_COMMON is not set
+# CONFIG_ATH10K is not set
+# CONFIG_ATH10K_SDIO is not set
+# CONFIG_WCN36XX is not set
+# CONFIG_ATH11K is not set
+# CONFIG_ATH11K_AHB is not set
+# CONFIG_BRCMUTIL is not set
+# CONFIG_BRCMFMAC is not set
+# CONFIG_MWIFIEX is not set
+# CONFIG_MWIFIEX_SDIO is not set
+# CONFIG_RTL_CARDS is not set
+# CONFIG_RSI_91X is not set
+# CONFIG_RSI_SDIO is not set
+# CONFIG_RSI_USB is not set
+# CONFIG_WL18XX is not set
+# CONFIG_WLCORE is not set
+# CONFIG_WLCORE_SDIO is not set
+# CONFIG_WWAN is not set
+# CONFIG_MHI_WWAN_CTRL is not set
+# CONFIG_MHI_WWAN_MBIM is not set
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_KEYBOARD_MTK_PMIC is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
+# CONFIG_TOUCHSCREEN_GOODIX is not set
+# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_CORE is not set
+# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
+# CONFIG_TOUCHSCREEN_ELAN is not set
+# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
+# CONFIG_INPUT_AW86927 is not set
+# CONFIG_INPUT_TPS65219_PWRBUTTON is not set
+# CONFIG_INPUT_TPS6594_PWRBUTTON is not set
+# CONFIG_INPUT_PWM_BEEPER is not set
+# CONFIG_INPUT_PWM_VIBRA is not set
+# CONFIG_INPUT_RK805_PWRKEY is not set
+# CONFIG_INPUT_DA9063_ONKEY is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+# CONFIG_IPMI_SI is not set
+# CONFIG_TCG_TIS_CORE is not set
+# CONFIG_TCG_TIS is not set
+# CONFIG_TCG_TIS_SPI is not set
+# CONFIG_TCG_TIS_I2C_CR50 is not set
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_CADENCE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_DW_MMIO is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_PINCTRL_DA9062 is not set
+# CONFIG_PINCTRL_RK805 is not set
+# CONFIG_PINCTRL_TPS6594 is not set
+# CONFIG_GPIO_REGMAP is not set
+# CONFIG_GPIO_ALTERA is not set
+# CONFIG_GPIO_WCD934X is not set
+# CONFIG_GPIO_ADP5585 is not set
+# CONFIG_GPIO_BD9571MWV is not set
+# CONFIG_GPIO_MAX77759 is not set
+# CONFIG_GPIO_AGGREGATOR is not set
+# CONFIG_NVMEM_REBOOT_MODE is not set
+# CONFIG_POWER_SEQUENCING_QCOM_WCN is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX77759 is not set
+# CONFIG_CHARGER_MT6360 is not set
+# CONFIG_CHARGER_BQ25890 is not set
+# CONFIG_CHARGER_BQ25980 is not set
+# CONFIG_CHARGER_RK817 is not set
+# CONFIG_SENSORS_GPIO_FAN is not set
+# CONFIG_SENSORS_JC42 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_PWM_FAN is not set
+# CONFIG_SENSORS_INA2XX is not set
+# CONFIG_SENSORS_INA3221 is not set
+# CONFIG_SUNXI_WATCHDOG is not set
+# CONFIG_MFD_ADP5585 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_MAX77759 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS6594 is not set
+# CONFIG_MFD_TPS6594_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_WCD934X is not set
+# CONFIG_REGULATOR_DA9211 is not set
+# CONFIG_REGULATOR_LP873X is not set
+# CONFIG_REGULATOR_MAX20411 is not set
+# CONFIG_REGULATOR_MT6315 is not set
+# CONFIG_REGULATOR_QCOM_PM8008 is not set
+# CONFIG_REGULATOR_QCOM_USB_VBUS is not set
+# CONFIG_REGULATOR_TPS65132 is not set
+# CONFIG_REGULATOR_TPS6594 is not set
+# CONFIG_REGULATOR_VCTRL is not set
+# CONFIG_RC_CORE is not set
+# CONFIG_RC_MAP is not set
+# CONFIG_IR_GPIO_CIR is not set
+# CONFIG_IR_SUNXI is not set
+# CONFIG_CEC_CORE is not set
+# CONFIG_CEC_NXP_TDA9950 is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_I2C_HID_ACPI is not set
+# CONFIG_I2C_HID_OF is not set
+# CONFIG_I2C_HID_OF_ELAN is not set
+# CONFIG_I2C_HID_CORE is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_CDNS_SUPPORT is not set
+# CONFIG_USB_CDNS3 is not set
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_CP210X is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_WWAN is not set
+# CONFIG_USB_SERIAL_OPTION is not set
+# CONFIG_USB_ONBOARD_DEV is not set
+# CONFIG_USB_LIBCOMPOSITE is not set
+# CONFIG_USB_F_ACM is not set
+# CONFIG_USB_U_SERIAL is not set
+# CONFIG_USB_U_ETHER is not set
+# CONFIG_USB_F_SERIAL is not set
+# CONFIG_USB_F_OBEX is not set
+# CONFIG_USB_F_NCM is not set
+# CONFIG_USB_F_ECM is not set
+# CONFIG_USB_F_EEM is not set
+# CONFIG_USB_F_SUBSET is not set
+# CONFIG_USB_F_RNDIS is not set
+# CONFIG_USB_F_MASS_STORAGE is not set
+# CONFIG_USB_F_FS is not set
+# CONFIG_USB_CONFIGFS is not set
+# CONFIG_USB_MASS_STORAGE is not set
+# CONFIG_TYPEC is not set
+# CONFIG_TYPEC_TCPM is not set
+# CONFIG_TYPEC_TCPCI is not set
+# CONFIG_TYPEC_FUSB302 is not set
+# CONFIG_TYPEC_UCSI is not set
+# CONFIG_UCSI_CCG is not set
+# CONFIG_CROS_EC_UCSI is not set
+# CONFIG_TYPEC_TPS6598X is not set
+# CONFIG_TYPEC_HD3SS3220 is not set
+# CONFIG_TYPEC_MUX_FSA4480 is not set
+# CONFIG_TYPEC_MUX_GPIO_SBU is not set
+# CONFIG_TYPEC_MUX_NB7VPQ904M is not set
+# CONFIG_TYPEC_MUX_PS883X is not set
+# CONFIG_TYPEC_MUX_WCD939X_USBSS is not set
+# CONFIG_LEDS_CLASS_MULTICOLOR is not set
+# CONFIG_LEDS_CROS_EC is not set
+# CONFIG_LEDS_LM3692X is not set
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_QCOM_LPG is not set
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_HYM8563 is not set
+# CONFIG_RTC_DRV_RK808 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_PCF85363 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_BQ32K is not set
+# CONFIG_RTC_DRV_TPS6594 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RV3028 is not set
+# CONFIG_RTC_DRV_RV8803 is not set
+# CONFIG_RTC_DRV_PCF2127 is not set
+# CONFIG_RTC_DRV_PCF85063 is not set
+# CONFIG_RTC_DRV_DA9063 is not set
+# CONFIG_RTC_DRV_MT6397 is not set
+CONFIG_DMA_SUN6I=y
+# CONFIG_GREYBUS_BEAGLEPLAY is not set
+# CONFIG_CROS_EC_RPMSG is not set
+# CONFIG_CROS_KBD_LED_BACKLIGHT is not set
+# CONFIG_CROS_EC_CHARDEV is not set
+# CONFIG_CROS_EC_TYPEC is not set
+# CONFIG_CROS_TYPEC_SWITCH is not set
+# CONFIG_COMMON_CLK_BD718XX is not set
+# CONFIG_RPMSG_CHAR is not set
+# CONFIG_RPMSG_CTRL is not set
+# CONFIG_QCOM_QMI_HELPERS is not set
+# CONFIG_QCOM_PBS is not set
+# CONFIG_DEVFREQ_GOV_PASSIVE is not set
+# CONFIG_EXTCON_PTN5150 is not set
+# CONFIG_PWM_ADP5585 is not set
+# CONFIG_PWM_CROS_EC is not set
+# CONFIG_PWM_SUN4I is not set
+# CONFIG_RESET_GPIO is not set
+# CONFIG_PHY_CAN_TRANSCEIVER is not set
+# CONFIG_PHY_NXP_PTN3222 is not set
+# CONFIG_PHY_SUN6I_MIPI_DPHY is not set
+# CONFIG_PHY_CADENCE_TORRENT is not set
+# CONFIG_PHY_CADENCE_DPHY_RX is not set
+# CONFIG_PHY_CADENCE_SIERRA is not set
+# CONFIG_PHY_CADENCE_SALVO is not set
+# CONFIG_PHY_QCOM_USB_HS is not set
+# CONFIG_ARM_CCI_PMU is not set
+# CONFIG_ARM_CCN is not set
+# CONFIG_ARM_CMN is not set
+# CONFIG_ARM_SMMU_V3_PMU is not set
+# CONFIG_ARM_DSU_PMU is not set
+# CONFIG_ARM_SPE_PMU is not set
+# CONFIG_ARM_DMC620_PMU is not set
+# CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set
+# CONFIG_NVIDIA_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set
+# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set
+# CONFIG_NVMEM_MAX77759 is not set
+# CONFIG_NVMEM_RMEM is not set
+# CONFIG_NVMEM_SPMI_SDAM is not set
+# CONFIG_STM is not set
+# CONFIG_FPGA_BRIDGE is not set
+# CONFIG_ALTERA_FREEZE_BRIDGE is not set
+# CONFIG_FPGA_REGION is not set
+# CONFIG_OF_FPGA_REGION is not set
+# CONFIG_MUX_GPIO is not set
+# CONFIG_SLIMBUS is not set
+# CONFIG_COUNTER is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_CUSE is not set
+# CONFIG_PSTORE_RAM is not set
+# CONFIG_CRYPTO_KPP2 is not set
+# CONFIG_CRYPTO_KPP is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_BENCHMARK is not set
+# CONFIG_CRYPTO_ENGINE is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECC is not set
+# CONFIG_CRYPTO_ECDH is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_SM4 is not set
+# CONFIG_CRYPTO_SM4_GENERIC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_SM3 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZSTD is not set
+# CONFIG_CRYPTO_USER_API is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set
+# CONFIG_CRYPTO_AES_ARM64_BS is not set
+# CONFIG_CRYPTO_DEV_SUN8I_CE is not set
+# CONFIG_CRYPTO_DEV_CCREE is not set
+# CONFIG_CRYPTO_DEV_HISI_TRNG is not set
+# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRYPTO_LIB_ARC4 is not set
+# CONFIG_CRYPTO_LIB_DES is not set
+# CONFIG_CRYPTO_LIB_GF128HASH is not set
+# CONFIG_CRYPTO_LIB_MD5 is not set
+# CONFIG_CRYPTO_LIB_SHA512 is not set
+# CONFIG_CRYPTO_LIB_SHA3 is not set
+# CONFIG_CRYPTO_LIB_SM3 is not set
+# CONFIG_LZ4_COMPRESS is not set
+# CONFIG_ZSTD_COMPRESS is not set
+# CONFIG_REED_SOLOMON is not set
+# CONFIG_CORESIGHT is not set
+# CONFIG_CORESIGHT_LINKS_AND_SINKS is not set
+# CONFIG_CORESIGHT_LINK_AND_SINK_TMC is not set
+# CONFIG_CORESIGHT_CATU is not set
+# CONFIG_CORESIGHT_SINK_TPIU is not set
+# CONFIG_CORESIGHT_SINK_ETBV10 is not set
+# CONFIG_CORESIGHT_STM is not set
+# CONFIG_CORESIGHT_CPU_DEBUG is not set
+# CONFIG_CORESIGHT_CTI is not set
+
+# --- Surplus subsystems on this board (disable to shrink kernel) ---
+# CONFIG_KVM is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_HIBERNATION is not set
+# CONFIG_AUDIT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_DEVPORT is not set
+# CONFIG_DRM_DEBUG_SELFTEST is not set
+
+# --- Drop block/SCSI/NVME (SPI NOR + squashfs is enough) ---
+# CONFIG_BLK_DEV_NVME is not set
+
+# --- Networking: keep only what wpa_supplicant/hostapd/dnsmasq/dropbear need ---
+# CONFIG_IPV6 is not set
+# CONFIG_INET6 is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_XFRM is not set
+# CONFIG_SCTP is not set
+# CONFIG_DCCP is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS is not set
+CONFIG_IPV4=y
+
+# --- USB: dwc3 not needed (WiFi is SDIO), keep minimal ---
+# CONFIG_USB is not set
+# CONFIG_PHY_SUN4I_USB is not set
+
+# --- Ethernet: none on Zero 2W ---
+# CONFIG_ETHERNET is not set
+
+# --- Input/HID: not needed (headless) ---
+# CONFIG_HID is not set
+
+# --- Trim crypto: only what dropbear/ssh/wireless require ---
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CMAC=n
+CONFIG_CRYPTO_CCM=n
+CONFIG_CRYPTO_GCM=n
+CONFIG_CRYPTO_CURVE25519=n
+
+# --- Kernel debug/bloat: strip for tiny kernel ---
+# CONFIG_KALLSYMS is not set
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_BASE_RELATIVE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
+# CONFIG_DEBUG_INFO_REDUCED is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_IKCONFIG_PROC is not set
+# CONFIG_FRAME_POINTER is not set
+# CONFIG_GCC_PLUGINS is not set
+# CONFIG_ARM64_PTR_AUTH is not set
+# CONFIG_ARM64_BTI is not set
+# CONFIG_ARM64_MTE is not set
diff --git a/board/orangepi/orangepi-zero3/post-image.sh b/board/orangepi/orangepi-zero3/post-image.sh
new file mode 100755
index 0000000000..588e25bbb7
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/post-image.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# OrangePi Zero 3 — build the FIT image, then assemble the SD card and the
+# SPI-NOR images.
+#
+# The kernel is LZMA-compressed so that it fits the 5376K kernel partition.
+# A FIT image is a device tree, so fit.its is compiled with dtc (as mkimage
+# would do internally, but Buildroot's host-uboot-tools is built with an empty
+# CONFIG_MKIMAGE_DTC_PATH, so mkimage cannot invoke dtc here).
+#
+# The raw 16 MiB flash layout is described in genimage-spi.cfg; both images are
+# assembled by the generic genimage wrapper (support/scripts/genimage.sh).
+
+set -e
+
+BOARD_DIR="$(dirname "$0")"
+
+# FIT: LZMA-compressed kernel + DTB.
+xz --format=lzma -9 -c "${BINARIES_DIR}/Image" > "${BINARIES_DIR}/kernel.lzma"
+
+DTB="${BINARIES_DIR}/allwinner/sun50i-h618-orangepi-zero3.dtb"
+[ -f "${DTB}" ] || { echo "ERROR: DTB not found: ${DTB}" >&2; exit 1; }
+cp "${DTB}" "${BINARIES_DIR}/dtb.bin"
+
+# The /incbin/ paths in fit.its are relative to the working directory.
+cp "${BOARD_DIR}/fit.its" "${BINARIES_DIR}/fit.its"
+(cd "${BINARIES_DIR}" && \
+	"${HOST_DIR}/bin/dtc" -I dts -O dtb -p 500 -o fit.itb fit.its)
+
+# SD card image (genimage.cfg is generated by the common OrangePi post-build).
+support/scripts/genimage.sh -c "${BINARIES_DIR}/genimage.cfg"
+
+# SPI-NOR image.
+support/scripts/genimage.sh -c "${BOARD_DIR}/genimage-spi.cfg"
diff --git a/board/orangepi/orangepi-zero3/uboot.fragment b/board/orangepi/orangepi-zero3/uboot.fragment
new file mode 100644
index 0000000000..070a0b7fbb
--- /dev/null
+++ b/board/orangepi/orangepi-zero3/uboot.fragment
@@ -0,0 +1,6 @@
+# Boot the SPI-NOR image first: read the FIT from offset 0xE0000 and bootm it.
+# If that fails, fall back to the default boot flow (distro boot: SD card, USB,
+# network).  Setting CONFIG_BOOTCOMMAND only replaces the default 'bootcmd',
+# while keeping distro_bootcmd available.
+CONFIG_BOOTCOMMAND="sf probe; if sf read 0x48000000 0xE0000 0x540000; then setenv bootargs console=ttyS0,115200 root=/dev/mtdblock2 rootfstype=squashfs mtdparts=spi0.0:896k(u-boot),5376k(kernel),10112k(rootfs); bootm 0x48000000; fi; run distro_bootcmd"
+CONFIG_BOOTDELAY=2
diff --git a/configs/orangepi_zero3_defconfig b/configs/orangepi_zero3_defconfig
index c6aa9c991a..bfaec7ebd5 100644
--- a/configs/orangepi_zero3_defconfig
+++ b/configs/orangepi_zero3_defconfig
@@ -7,8 +7,8 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to Orangepi Zero3"
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
 BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/orangepi/orangepi-zero3/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS=""
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.6"
@@ -18,9 +18,12 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h618-orangepi-zero3"
 BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
 BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero3/linux.fragment board/orangepi/orangepi-zero3/linux-net.fragment"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_ROOTFS_EXT2_SIZE="130M"
+BR2_TARGET_ROOTFS_SQUASHFS=y
+BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
@@ -39,5 +42,6 @@ BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero3/uboot.fragment"
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-11 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25 16:52 [Buildroot] [PATCH 1/2] board/orangepi/orangepi-zero3: add SPI-NOR image support Vladimir Savelev
2026-09-25 16:52 ` [Buildroot] [PATCH 2/2] board/orangepi/orangepi-zero2w, orangepi-zero3: set the hostname Vladimir Savelev
2026-10-11 13:27   ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox