From 8146e0570e47c3777b756916a44cbb4356fefd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 28 Jul 2025 23:27:17 +0200 Subject: [PATCH 1/4] gen-interfaces: Fix bug when generating on boards with mounted Wi-Fi chipsets These should not appear in a generated factory-config or failure-config. --- src/confd/bin/gen-interfaces | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confd/bin/gen-interfaces b/src/confd/bin/gen-interfaces index cfe3b6c0b..cad922c23 100755 --- a/src/confd/bin/gen-interfaces +++ b/src/confd/bin/gen-interfaces @@ -96,8 +96,8 @@ filter_iface_ports() iface_devs="" for phy in $ifaces; do found="" + [ -d "/sys/class/net/${phy}/wireless" ] && continue for port in $ports; do - [ -d "/sys/class/net/${port}/wireless" ] && continue if [ "$port" = "$phy" ]; then found=true break From 399894e9a1db8ad5d68eb39bb364b09cba062d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Wed, 6 Aug 2025 10:58:07 +0200 Subject: [PATCH 2/4] Add new board banana pi r3 The Banana Pi R3 is a high-performance networking board featuring: - MediaTek MT7986 ARM Cortex-A53 quad-core processor - 4x Gigabit LAN ports (lan1-lan4) - 1x Gigabit WAN port - 2x SFP ports (sfp1, sfp2) for fiber connectivity - Dual WiFi interfaces (wifi0 for 2.4GHz, wifi1 for 5GHz) - USB support - SD card boot support --- board/aarch64/README.md | 47 +--- board/aarch64/banana-pi-r3/README.md | 27 ++ board/aarch64/raspberry-pi-4/README.md | 46 ++++ configs/aarch64_defconfig | 1 + configs/mt7986_sd_boot_defconfig | 43 +++ doc/ChangeLog.md | 3 + package/board/Config.in | 2 + package/board/banana-pi-r3/Config.in | 45 ++++ package/board/banana-pi-r3/banana-pi-r3.mk | 73 +++++ .../arm-trusted-firmware.hash | 3 + src/board/banana-pi-r3/LICENSE | 13 + src/board/banana-pi-r3/dts/Makefile | 1 + .../mediatek/mt7986a-bananapi-bpi-r3-sd.dts | 2 + .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi | 16 ++ .../dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi | 59 +++++ src/board/banana-pi-r3/genimage.cfg.in | 76 ++++++ src/board/banana-pi-r3/mkimage.sh | 27 ++ .../bananapi,bpi-r3/etc/factory-config.cfg | 250 ++++++++++++++++++ .../etc/product/init.d/S01-trigger-udev.sh | 3 + .../udev/rules.d/90-bpi-r3-rename-eth1.rules | 1 + src/board/banana-pi-r3/uboot/extras.config | 12 + src/board/banana-pi-r3/uboot/mt7986-env.dtsi | 25 ++ .../banana-pi-r3/uboot/mt7986-sd-env.dtsi | 5 + src/board/banana-pi-r3/uboot/sd-extras.config | 1 + 24 files changed, 736 insertions(+), 45 deletions(-) create mode 100644 board/aarch64/banana-pi-r3/README.md create mode 100644 board/aarch64/raspberry-pi-4/README.md create mode 100644 configs/mt7986_sd_boot_defconfig create mode 100644 package/board/banana-pi-r3/Config.in create mode 100644 package/board/banana-pi-r3/banana-pi-r3.mk create mode 100644 src/board/banana-pi-r3/LICENSE create mode 100644 src/board/banana-pi-r3/dts/Makefile create mode 100644 src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts create mode 100644 src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi create mode 100644 src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi create mode 100644 src/board/banana-pi-r3/genimage.cfg.in create mode 100755 src/board/banana-pi-r3/mkimage.sh create mode 100644 src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg create mode 100755 src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh create mode 100644 src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules create mode 100644 src/board/banana-pi-r3/uboot/extras.config create mode 100644 src/board/banana-pi-r3/uboot/mt7986-env.dtsi create mode 100644 src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi create mode 100644 src/board/banana-pi-r3/uboot/sd-extras.config diff --git a/board/aarch64/README.md b/board/aarch64/README.md index ce7e20e5d..8d3e10898 100644 --- a/board/aarch64/README.md +++ b/board/aarch64/README.md @@ -4,51 +4,8 @@ aarch64 Board Specific Documentation ---------------------------- +- [Banana Pi R3](banana-pi-r3/) - [Marvell CN9130-CRB](cn9130-crb/) - [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/) - [NanoPi R2S](r2s/) -- [Raspberry Pi 4 b](#raspberry-pi-4-b) - -# Raspberry Pi 4 b - -## Support level -Full support for base board but not any extension board on the -GPIOs. - -### Touch screen -The [Raspberry Pi touch display v1][RPI-TOUCH] is supported, including -touch functionality. There are multiple touchscreens on the market for -Raspberry Pi, but only the official (first version with 800x480 -resolution) is currently supported. Infix supplies all drivers -required to utilize the hardware, but you need to add the actual -graphical application in a container. - -There are some important considerations you need to know about when -using Infix for graphical applications. The container needs access to -/dev/dri/ to be able to access the graphics card, and it also needs -access to /run/udev to be able to find the input devices. - -Example of running Doom in Infix: - -```cli - admin@example:/> configure - admin@example:/config/> edit container doom - admin@example:/config/container/doom/> set image docker://mattiaswal/alpine-doom:latest - admin@example:/config/container/doom/> set privileged - admin@example:/config/container/doom/> edit mount udev - admin@example:/config/container/doom/mount/udev/> set type bind - admin@example:/config/container/doom/mount/udev/> set target /run/udev/ - admin@example:/config/container/doom/mount/udev/> set source /run/udev/ - admin@example:/config/container/doom/mount/udev/> end - admin@example:/config/container/doom/mount/xorg.conf/> set content U2VjdGlvbiAiT3V0cHV0Q2xhc3MiCiAgSWRlbnRpZmllciAidmM0IgogIE1hdGNoRHJpdmVyICJ2YzQiCiAgRHJpdmVyICJtb2Rlc2V0dGluZyIKICBPcHRpb24gIlByaW1hcnlHUFUiICJ0cnVlIgpFbmRTZWN0aW9uCg== - admin@example:/config/container/doom/mount/xorg.conf/> set target /etc/X11/xorg.conf - admin@example:/config/container/doom/mount/xorg.conf/> end - admin@example:/config/container/doom/> edit volume var - admin@example:/config/container/doom/volume/var/> set target /var - admin@example:/config/container/doom/volume/var/> leave - admin@example:/> - -``` - - -[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/ +- [Raspberry Pi 4 b](raspberry-pi-4/) diff --git a/board/aarch64/banana-pi-r3/README.md b/board/aarch64/banana-pi-r3/README.md new file mode 100644 index 000000000..2417412ad --- /dev/null +++ b/board/aarch64/banana-pi-r3/README.md @@ -0,0 +1,27 @@ +# Banana Pi R3 + +## Support level +Full support for all Infix enabled features including switched ethernet ports, WiFi, +and SFP interfaces. The board includes comprehensive hardware support for +MediaTek MT7986 SoC features. + +### Hardware features +The Banana Pi R3 is a high-performance networking board featuring: +- MediaTek MT7986 ARM Cortex-A53 quad-core processor +- 4x Gigabit LAN ports (lan1-lan4) +- 1x Gigabit WAN port +- 2x SFP ports (sfp1, sfp2) for fiber connectivity +- Dual WiFi interfaces (wifi0 for 2.4GHz, wifi1 for 5GHz) +- USB support +- SD card boot support + +### Network configuration +The board comes preconfigured with: +- 4 switched LAN ports for internal networking +- Dedicated WAN port with DHCP client enabled +- SFP ports for high-speed fiber connections +- Dual WiFi interfaces for wireless connectivity + +### Pre-built images +SD card image: [infix-bpi-r3-sdcard.img](https://github.com/kernelkit/infix/releases/download/latest-boot/infix-bpi-r3-sdcard.img) + diff --git a/board/aarch64/raspberry-pi-4/README.md b/board/aarch64/raspberry-pi-4/README.md new file mode 100644 index 000000000..e0fb9d267 --- /dev/null +++ b/board/aarch64/raspberry-pi-4/README.md @@ -0,0 +1,46 @@ +# Raspberry Pi 4 b + +## Support level +Full support for base board but not any extension board on the +GPIOs. + +### Touch screen +The [Raspberry Pi touch display v1][RPI-TOUCH] is supported, including +touch functionality. There are multiple touchscreens on the market for +Raspberry Pi, but only the official (first version with 800x480 +resolution) is currently supported. Infix supplies all drivers +required to utilize the hardware, but you need to add the actual +graphical application in a container. + +There are some important considerations you need to know about when +using Infix for graphical applications. The container needs access to +/dev/dri/ to be able to access the graphics card, and it also needs +access to /run/udev to be able to find the input devices. + +Example of running Doom in Infix: + +```cli + admin@example:/> configure + admin@example:/config/> edit container doom + admin@example:/config/container/doom/> set image docker://mattiaswal/alpine-doom:latest + admin@example:/config/container/doom/> set privileged + admin@example:/config/container/doom/> edit mount udev + admin@example:/config/container/doom/mount/udev/> set type bind + admin@example:/config/container/doom/mount/udev/> set target /run/udev/ + admin@example:/config/container/doom/mount/udev/> set source /run/udev/ + admin@example:/config/container/doom/mount/udev/> end + admin@example:/config/container/doom/mount/xorg.conf/> set content U2VjdGlvbiAiT3V0cHV0Q2xhc3MiCiAgSWRlbnRpZmllciAidmM0IgogIE1hdGNoRHJpdmVyICJ2YzQiCiAgRHJpdmVyICJtb2Rlc2V0dGluZyIKICBPcHRpb24gIlByaW1hcnlHUFUiICJ0cnVlIgpFbmRTZWN0aW9uCg== + admin@example:/config/container/doom/mount/xorg.conf/> set target /etc/X11/xorg.conf + admin@example:/config/container/doom/mount/xorg.conf/> end + admin@example:/config/container/doom/> edit volume var + admin@example:/config/container/doom/volume/var/> set target /var + admin@example:/config/container/doom/volume/var/> leave + admin@example:/> + +``` + +### Pre-built images +SD card image: [infix-rpi4-sdcard.img](https://github.com/kernelkit/infix/releases/download/latest-boot/infix-rpi4-sdcard.img) + + +[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/ diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index 06e97a911..c4a238357 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -138,6 +138,7 @@ BR2_PACKAGE_MARVELL_CN9130_CRB=y BR2_PACKAGE_MARVELL_ESPRESSOBIN=y BR2_PACKAGE_STYX_DCP_SC_28P=y BR2_PACKAGE_RASPBERRY_PI_4=y +BR2_PACKAGE_BANANA_PI_R3=y BR2_PACKAGE_FEATURE_WIFI_DONGLE_REALTEK=y BR2_PACKAGE_CONFD=y BR2_PACKAGE_CONFD_TEST_MODE=y diff --git a/configs/mt7986_sd_boot_defconfig b/configs/mt7986_sd_boot_defconfig new file mode 100644 index 000000000..7b76f885e --- /dev/null +++ b/configs/mt7986_sd_boot_defconfig @@ -0,0 +1,43 @@ +BR2_aarch64=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y +BR2_DL_DIR="$(BR2_EXTERNAL_INFIX_PATH)/dl" +BR2_CCACHE=y +BR2_CCACHE_DIR="$(BR2_EXTERNAL_INFIX_PATH)/.ccache" +BR2_ENABLE_DEBUG=y +BR2_PACKAGE_OVERRIDE_FILE="$(BR2_EXTERNAL_INFIX_PATH)/local.mk" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_INFIX_PATH)/patches" +BR2_SSP_NONE=y +BR2_INIT_NONE=y +BR2_SYSTEM_BIN_SH_NONE=y +# BR2_PACKAGE_BUSYBOX is not set +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/mtk-openwrt/arm-trusted-firmware-mtk.git" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="78a0dfd927bb00ce973a1f8eb4079df0f755887a" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="mt7986" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="BOOT_DEVICE=sdmmc DRAM_USE_DDR4=1 USE_MKIMAGE=1 MKIMAGE=$(HOST_DIR)/bin/mkimage" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.img *.bin" +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2025.01" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="mt7986a_bpir3_sd" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/sd-extras.config" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_FORMAT_DTB=y +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/*.dtsi" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_RAUC=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y +TRUSTED_KEYS=y +TRUSTED_KEYS_DEVELOPMENT=y +DISK_IMAGE_BOOT_BIN=y +DISK_IMAGE_BOOT_DATA="${BINARIES_DIR}/flash-image.bin" +DISK_IMAGE_BOOT_OFFSET=0x00200000 diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index a4f93e39a..a43b32ec6 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -9,9 +9,12 @@ All notable changes to the project are documented in this file. ### Changes - Upgrade Buildroot to 2025.02.6 (LTS) - Upgrade Linux kernel to 6.12.46 (LTS) +- Add support for [Banana Pi R3][BPI-R3], a 7 port switch with 2 WiFi chip. ### Fixes +[BPI-R3]: https://wiki.banana-pi.org/Banana_Pi_BPI-R3 + [v25.08.0][] - 2025-09-01 ------------------------- diff --git a/package/board/Config.in b/package/board/Config.in index ceb2fde2c..40e7c5e1e 100644 --- a/package/board/Config.in +++ b/package/board/Config.in @@ -7,5 +7,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/board/marvell-espressobin/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/microchip-sparx5-pcb135/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/styx-dcp-sc-28p/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/raspberry-pi-4/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/package/board/banana-pi-r3/Config.in" + endmenu diff --git a/package/board/banana-pi-r3/Config.in b/package/board/banana-pi-r3/Config.in new file mode 100644 index 000000000..6b944b694 --- /dev/null +++ b/package/board/banana-pi-r3/Config.in @@ -0,0 +1,45 @@ +config BR2_PACKAGE_BANANA_PI_R3 + bool "Banana Pi R3" + depends on BR2_aarch64 + select BR2_PACKAGE_FEATURE_WIFI + select BR2_PACKAGE_LINUX_FIRMWARE + select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK + select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK_MT7986 + #select BR2_PACKAGE_BANANA_PI_R3_SDCARD + select SDCARD_AUX + # select BR2_TARGET_ARM_TRUSTED_FIRMWARE + # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT # Does not work, needs a hook in the .mk file + # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP + # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 + # select BR2_TARGET_UBOOT + # select BR2_TARGET_UBOOT_FORMAT_CUSTOM + # select BR2_TARGET_UBOOT_NEEDS_DTC + # select BR2_TARGET_UBOOT_NEEDS_UBOOT_TOOLS + # select BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG + help + Build Banana PI R3 support + +# Don't redefine - just set conditional defaults +# config BR2_TARGET_UBOOT_BOARD_DEFCONFIG +# default "mt7986a_bpir3_sd" + +# config BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES +# default "${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/extras.config" + +# config BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME +# default "arch/arm/dts/infix-key.dtbo arch/arm/dts/rpi-env.dtbo" + +# config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH +# default "${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/rpi-env.dtso" + +# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL +# default "https://github.com/mtk-openwrt/arm-trusted-firmware.git" + +# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION +# default "78a0dfd927bb00ce973a1f8eb4079df0f755887a" + +# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM +# default "mt7986" + +# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES +# default "BOOT_DEVICE=sdmmc USE_COHERENT_MEM=1" diff --git a/package/board/banana-pi-r3/banana-pi-r3.mk b/package/board/banana-pi-r3/banana-pi-r3.mk new file mode 100644 index 000000000..d5fa28d10 --- /dev/null +++ b/package/board/banana-pi-r3/banana-pi-r3.mk @@ -0,0 +1,73 @@ +GENIMAGE_CFG="$(BUILD_DIR)/genimage.cfg" +GENIMAGE_TMP="$(BUILD_DIR)/genimage.tmp" +BOARD_DIR="$(BR2_EXTERNAL_INFIX_PATH)/src/board/banana-pi-r3" +BOOTLOADER_NAME=fip.bin +BOOTLOADER2_NAME=bl2.img + +BOOTLOADER_PATH=/home/lazzer/Documents/github.com/kernelkit/infix3/output-bootloader/images + +define BANANA_PI_R3_LINUX_CONFIG_FIXUPS + $(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_MEDIATEK) + $(call KCONFIG_ENABLE_OPT,CONFIG_MACH_MT7986) + $(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_MT7986) + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_MT6577) + $(call KCONFIG_SET_OPT,CONFIG_I2C_GPIO,y) + $(call KCONFIG_SET_OPT,CONFIG_MTK_THERMAL,m) + $(call KCONFIG_ENABLE_OPT,CONFIG_MTK_UART) + $(call KCONFIG_ENABLE_OPT,CONFIG_MTK_WATCHDOG) + $(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_GE_PHY) + $(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY) + $(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_MEDIATEK) + $(call KCONFIG_ENABLE_OPT,CONFIG_NET_MEDIATEK_SOC) + $(call KCONFIG_SET_OPT,CONFIG_NET_DSA_MT7530,m) + $(call KCONFIG_SET_OPT,CONFIG_MT7915E,m) + $(call KCONFIG_SET_OPT,CONFIG_PCIE_MEDIATEK_GEN3,m) + $(call KCONFIG_ENABLE_OPT,CONFIG_MTK_SCPSYS) + $(call KCONFIG_ENABLE_OPT,CONFIG_MMC_MTK) + $(call KCONFIG_ENABLE_OPT,CONFIG_MTK_HSDMA) + $(call KCONFIG_SET_OPT,CONFIG_MT7915E,m) + $(call KCONFIG_ENABLE_OPT,CONFIG_MT798X_WMAC) + $(call KCONFIG_SET_OPT,CONFIG_MTK_SOC_THERMAL,m) + $(call KCONFIG_SET_OPT,CONFIG_I2C_MT65XX,m) + $(call KCONFIG_SET_OPT,CONFIG_USB_XHCI_MTK,m) + $(call KCONFIG_SET_OPT,CONFIG_PHY_MTK_TPHY,m) + $(call KCONFIG_SET_OPT,CONFIG_PHY_MTK_XSPHY,m) + $(call KCONFIG_SET_OPT,CONFIG_REGULATOR_GPIO,m) + $(call KCONFIG_SET_OPT,CONFIG_REGULATOR_MT6380,m) + $(call KCONFIG_SET_OPT,CONFIG_PWM_MEDIATEK,m) + $(call KCONFIG_SET_OPT,CONFIG_SENSORS_PWM_FAN,m) + $(call KCONFIG_SET_OPT,CONFIG_NVMEM_MTK_EFUSE,m) + $(call KCONFIG_SET_OPT,CONFIG_CRYPTO_DEV_SAFEXCEL,m) +endef + +ifeq ($(BR2_PACKAGE_BANANA_PI_R3),y) +define GENERATE_SD_CARD + VERSION="-$(INFIX_RELEASE)" + cp "$(BOOTLOADER_PATH)/$(BOOTLOADER_NAME)" "$(BINARIES_DIR)" + cp "$(BOOTLOADER_PATH)/$(BOOTLOADER2_NAME)" "$(BINARIES_DIR)" + sed "s|#VERSION#|$(RELEASE)|" "$(BOARD_DIR)/genimage.cfg.in" | \ + sed "s|#INFIX_ID#|$(INFIX_ID)|" > "$(GENIMAGE_CFG)" + # Create temporary root path + ROOTPATH_TMP=$(mktemp -d) + trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT + + # Clean previous genimage temp directory + rm -rf "${GENIMAGE_TMP}" + + # Generate the SD card image + $(HOST_DIR)/bin/genimage \ + --rootpath "${ROOTPATH_TMP}" \ + --tmppath "$(GENIMAGE_TMP)" \ + --inputpath "$(BINARIES_DIR)" \ + --outputpath "$(BINARIES_DIR)" \ + --config "${GENIMAGE_CFG}" +endef +endif +.PHONY: generate-sdcard-image +all: generate-sdcard-image +generate-sdcard-image: target-post-image + $(call GENERATE_SD_CARD) + + +$(eval $(ix-board)) +$(eval $(generic-package)) diff --git a/patches/arm-trusted-firmware/arm-trusted-firmware.hash b/patches/arm-trusted-firmware/arm-trusted-firmware.hash index 8b69a5a96..714ba7950 100644 --- a/patches/arm-trusted-firmware/arm-trusted-firmware.hash +++ b/patches/arm-trusted-firmware/arm-trusted-firmware.hash @@ -1,2 +1,5 @@ # Locally calculated sha256 06d32acf42808b682859008292f0591d2d872f19aa1a8021bfcd1c1c626285e6 arm-trusted-firmware-v2.9.tar.gz +sha256 42faea115c2f249ca47a8dd3b035591ff55482f267b64b84867521c8b021253d arm-trusted-firmware-78a0dfd927bb00ce973a1f8eb4079df0f755887a-git4.tar.gz +sha256 fb138bd3a4ad0bc0860896ebb8acd7f239c81e05cd4eb1aa1c59c440bfe66f24 arm-trusted-firmware-master-git4.tar.gz + diff --git a/src/board/banana-pi-r3/LICENSE b/src/board/banana-pi-r3/LICENSE new file mode 100644 index 000000000..019521754 --- /dev/null +++ b/src/board/banana-pi-r3/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2025 The KernelKit Authors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/src/board/banana-pi-r3/dts/Makefile b/src/board/banana-pi-r3/dts/Makefile new file mode 100644 index 000000000..0c3becfbb --- /dev/null +++ b/src/board/banana-pi-r3/dts/Makefile @@ -0,0 +1 @@ +dtb-y += mediatek/mt7986a-bananapi-bpi-r3-sd.dtb diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts new file mode 100644 index 000000000..725f7b4e2 --- /dev/null +++ b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts @@ -0,0 +1,2 @@ +#include "mt7986a-bananapi-bpi-r3.dtsi" +#include "mt7986a-bananapi-bpi-r3-sd.dtsi" diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi new file mode 100644 index 000000000..6d2ff675a --- /dev/null +++ b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +/* +This is copied from linux where it is an overlay, unfortunatly it is not +possible to use dtbo in sysboot unless present in syslinux.conf +*/ +&{/soc/mmc@11230000} { + bus-width = <4>; + max-frequency = <52000000>; + cap-sd-highspeed; + status = "okay"; +}; diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi new file mode 100644 index 000000000..f4637d603 --- /dev/null +++ b/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi @@ -0,0 +1,59 @@ +#include + +/ { + chosen { + infix { + /* Default admin user password: 'admin' */ + factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"; + usb-ports = <&ssusb>; + usb-port-names = "USB"; + }; + }; +}; + +&cpu_thermal { + /delete-node/ trips; + /delete-node/ cooling-maps; + trips { + cpu_trip_active_cool: cpu-trip-active-cool { + temperature = <40000>; // 40°C + hysteresis = <2000>; // 2°C hysteresis + type = "active"; + }; + cpu_trip_active_low: cpu-trip-active-low { + temperature = <45000>; // 40°C + hysteresis = <2000>; // 2°C hysteresis + type = "active"; + }; + cpu_trip_active_med: cpu-trip-active-med { + temperature = <60000>; // 60°C + hysteresis = <2000>; // 2°C hysteresis + type = "active"; + }; + cpu_trip_hot: cpu-trip-hot { + temperature = <80000>; // 80°C + hysteresis = <2000>; // 2°C hysteresis + type = "hot"; + }; + cpu_trip_critical: cpu-trip-critical { + temperature = <90000>; // 90°C + hysteresis = <2000>; // 2°C hysteresis + type = "critical"; + }; + }; + + cooling-maps { + map-cpu-40deg { + cooling-device = <&fan 0 0>; + trip = <&cpu_trip_active_cool>; + }; + map-cpu-45deg { + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active_low>; + }; + map-cpu-60deg { + cooling-device = <&fan 2 2>; + trip = <&cpu_trip_active_med>; + }; + }; +}; diff --git a/src/board/banana-pi-r3/genimage.cfg.in b/src/board/banana-pi-r3/genimage.cfg.in new file mode 100644 index 000000000..ce6c84ccf --- /dev/null +++ b/src/board/banana-pi-r3/genimage.cfg.in @@ -0,0 +1,76 @@ + +image cfg.ext4 { + empty = true + temporary = true + size = 128M + ext4 { + label = "cfg" + } +} + +image var.ext4 { + empty = true + temporary = true + size = 1G + ext4 { + label = "var" + use-mke2fs = true + } +} + +image #INFIX_ID##VERSION#-bpi-r3-sdcard.img { + hdimage { + partition-table-type = "gpt" + + } + # BL2 bootloader partition (MediaTek official location) + partition bl2 { + image = "bl2.img" + offset = 1024s # 0x80000 = sector 1024 + size = 4M # 0x400000 + bootable = true + } + + # Factory/calibration data (sectors 9216-13311) + partition factory { + offset = 4608K # 0x480000 + size = 2M # 0x200000 + } + +# FIP partition - BL31 + U-Boot (sectors 13312-17407) + partition fip { + # partition-type = 0x83 # Linux filesystem + image = "fip.bin" + offset = 13312s + size = 4096s + } + + partition aux { + partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035 + image = "aux.ext4" + } + + partition primary { + partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + bootable = true + size = 250M + image = "rootfs.squashfs" + } + + partition secondary { + partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + bootable = true + size = 250M + image = "rootfs.squashfs" + } + + partition cfg { + partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105 + image = "cfg.ext4" + } + + partition var { + partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F + image = "var.ext4" + } +} diff --git a/src/board/banana-pi-r3/mkimage.sh b/src/board/banana-pi-r3/mkimage.sh new file mode 100755 index 000000000..b61cbabc0 --- /dev/null +++ b/src/board/banana-pi-r3/mkimage.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +TARGET=sd + +BOARD_DIR=$(dirname "$0") +GENIMAGE_CFG="${BUILD_DIR}/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +sed "s|#VERSION#|${RELEASE}|" "${BOARD_DIR}/genimage.cfg.in" | \ +sed "s|#TARGET#|${TARGET}|" | \ +sed "s|#INFIX_ID#|${INFIX_ID}|" > "${GENIMAGE_CFG}" + +# Create temporary root path +ROOTPATH_TMP=$(mktemp -d) +trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT + +# Clean previous genimage temp directory +rm -rf "${GENIMAGE_TMP}" + +# Generate the SD card image +genimage \ + --rootpath "${ROOTPATH_TMP}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg new file mode 100644 index 000000000..8eef6793a --- /dev/null +++ b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg @@ -0,0 +1,250 @@ +{ + "ieee802-dot1ab-lldp:lldp": { + "infix-lldp:enabled": true + }, + "ietf-hardware:hardware": { + "component": [ + { + "name": "USB", + "class": "infix-hardware:usb", + "state": { + "admin-state": "unlocked" + } + } + ] + }, + "ietf-interfaces:interfaces": { + "interface": [ + { + "name": "lan1", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "lan2", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "lan3", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "lan4", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "lo", + "type": "infix-if-type:loopback", + "ietf-ip:ipv4": { + "address": [ + { + "ip": "127.0.0.1", + "prefix-length": 8 + } + ] + }, + "ietf-ip:ipv6": { + "address": [ + { + "ip": "::1", + "prefix-length": 128 + } + ] + } + }, + { + "name": "sfp1", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "sfp2", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "wan", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} + }, + { + "name": "wifi0", + "type": "infix-if-type:wifi" + }, + { + "name": "wifi1", + "type": "infix-if-type:wifi" + } + ] + }, + "ietf-keystore:keystore": { + "asymmetric-keys": { + "asymmetric-key": [ + { + "name": "genkey", + "public-key-format": "infix-crypto-types:ssh-public-key-format", + "public-key": "", + "private-key-format": "infix-crypto-types:rsa-private-key-format", + "cleartext-private-key": "", + "certificates": {} + } + ] + } + }, + "ietf-netconf-acm:nacm": { + "enable-nacm": true, + "groups": { + "group": [ + { + "name": "admin", + "user-name": [ + "admin" + ] + } + ] + }, + "rule-list": [ + { + "name": "admin-acl", + "group": [ + "admin" + ], + "rule": [ + { + "name": "permit-all", + "module-name": "*", + "access-operations": "*", + "action": "permit", + "comment": "Allow 'admin' group complete access to all operations and data." + } + ] + }, + { + "name": "default-deny-all", + "group": [ + "*" + ], + "rule": [ + { + "name": "deny-password-read", + "module-name": "ietf-system", + "path": "/ietf-system:system/authentication/user/password", + "access-operations": "*", + "action": "deny" + } + ] + } + ] + }, + "ietf-netconf-server:netconf-server": { + "listen": { + "endpoints": { + "endpoint": [ + { + "name": "default-ssh", + "ssh": { + "tcp-server-parameters": { + "local-address": "::" + }, + "ssh-server-parameters": { + "server-identity": { + "host-key": [ + { + "name": "default-key", + "public-key": { + "central-keystore-reference": "genkey" + } + } + ] + } + } + } + } + ] + } + } + }, + "ietf-system:system": { + "hostname": "infix-00-00-00", + "authentication": { + "user": [ + { + "name": "admin", + "password": "$factory$", + "infix-system:shell": "bash" + } + ] + }, + "infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCBPUyDigJQgSW1tdXRhYmxlLkZyaWVuZGx5LlNlY3VyZQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQub3JnCictJy0tLSctJwo=" + }, + "infix-dhcp-client:dhcp-client": { + "client-if": [ + { + "if-name": "wan", + "option": [ + { + "id": "ntp-server" + }, + { + "id": "broadcast" + }, + { + "id": "domain" + }, + { + "id": "hostname" + }, + { + "id": "dns-server" + }, + { + "id": "router" + }, + { + "id": "netmask" + } + ] + } + ] + }, + "infix-meta:meta": { + "version": "1.5" + }, + "infix-services:mdns": { + "enabled": true + }, + "infix-services:ssh": { + "enabled": true, + "hostkey": [ + "genkey" + ], + "listen": [ + { + "name": "ipv4", + "address": "0.0.0.0", + "port": 22 + }, + { + "name": "ipv6", + "address": "::", + "port": 22 + } + ] + }, + "infix-services:web": { + "enabled": true, + "console": { + "enabled": true + }, + "netbrowse": { + "enabled": true + }, + "restconf": { + "enabled": true + } + } +} + diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh new file mode 100755 index 000000000..facaccd16 --- /dev/null +++ b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh @@ -0,0 +1,3 @@ +#!/bin/sh +udevadm control --reload-rules +udevadm trigger --subsystem-match=net --action=add diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules new file mode 100644 index 000000000..9f3681c3d --- /dev/null +++ b/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/15100000.ethernet/net/eth1", NAME="sfp1" diff --git a/src/board/banana-pi-r3/uboot/extras.config b/src/board/banana-pi-r3/uboot/extras.config new file mode 100644 index 000000000..24dbf5deb --- /dev/null +++ b/src/board/banana-pi-r3/uboot/extras.config @@ -0,0 +1,12 @@ +CONFIG_AUTOBOOT=y +CONFIG_BOOTDELAY=2 +# CONFIG_MMC_PCI is not set +CONFIG_ENV_IS_NOWHERE=y +# CONFIG_ENV_IS_IN_MMC is not set +CONFIG_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_MTK=y +CONFIG_USB_MTU3=y +CONFIG_CMD_USB=y +CONFIG_PHY=y +CONFIG_PHY_MTK_TPHY=y diff --git a/src/board/banana-pi-r3/uboot/mt7986-env.dtsi b/src/board/banana-pi-r3/uboot/mt7986-env.dtsi new file mode 100644 index 000000000..9e45f7696 --- /dev/null +++ b/src/board/banana-pi-r3/uboot/mt7986-env.dtsi @@ -0,0 +1,25 @@ +/ { + config { + env: environment { + /* After the MMC driver has enabled bus power, + * the controller seems to sometimes detect a + * card removal state , which causes it to + * disable power again. This hack re-enables the + * bus power in those cases. + */ + bootcmd = "run ixboot"; + boot_targets = "mmc0"; + ethprime = "eth0"; + fdt_addr_r = "0x43f00000"; + kernel_addr_r = "0x44000000"; + scriptaddr = "0x48000000"; + ramdisk_addr_r = "0x4A000000"; + + /* This is a development platform, keep + * developer mode statically enabled. + */ + ixbtn-devmode = "setenv dev_mode yes; echo Enabled"; + ixbtn-factory = "echo \"No button available, use bootmenu\""; + }; + }; +}; diff --git a/src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi b/src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi new file mode 100644 index 000000000..110e257dc --- /dev/null +++ b/src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi @@ -0,0 +1,5 @@ +#include + +&env { + fdtfile = "mediatek/mt7986a-bananapi-bpi-r3-sd.dtb"; +}; diff --git a/src/board/banana-pi-r3/uboot/sd-extras.config b/src/board/banana-pi-r3/uboot/sd-extras.config new file mode 100644 index 000000000..6bc2dece1 --- /dev/null +++ b/src/board/banana-pi-r3/uboot/sd-extras.config @@ -0,0 +1 @@ +CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi mt7986-sd-env.dtsi" From 56fce18d66951e6d9a8ac46927c975fa2c4ad8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 12 Aug 2025 15:15:16 +0200 Subject: [PATCH 3/4] workflows/build-boot: Add mt7976 bootloader It is the chipset used on banana pi r3. --- .github/workflows/build-boot.yml | 1 + package/board/banana-pi-r3/Config.in | 39 +------------------- package/board/banana-pi-r3/banana-pi-r3.mk | 33 ----------------- src/board/banana-pi-r3/genimage.cfg.in | 4 +- src/board/banana-pi-r3/uboot/mt7986-env.dtsi | 2 +- 5 files changed, 6 insertions(+), 73 deletions(-) diff --git a/.github/workflows/build-boot.yml b/.github/workflows/build-boot.yml index b43bc63be..708337dcb 100644 --- a/.github/workflows/build-boot.yml +++ b/.github/workflows/build-boot.yml @@ -20,6 +20,7 @@ jobs: - cn9130_crb_boot - aarch64_qemu_boot - rpi4_boot + - mt7986_sd_boot env: MAKEFLAGS: -j5 steps: diff --git a/package/board/banana-pi-r3/Config.in b/package/board/banana-pi-r3/Config.in index 6b944b694..6c7578cc0 100644 --- a/package/board/banana-pi-r3/Config.in +++ b/package/board/banana-pi-r3/Config.in @@ -5,41 +5,6 @@ config BR2_PACKAGE_BANANA_PI_R3 select BR2_PACKAGE_LINUX_FIRMWARE select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK_MT7986 - #select BR2_PACKAGE_BANANA_PI_R3_SDCARD - select SDCARD_AUX - # select BR2_TARGET_ARM_TRUSTED_FIRMWARE - # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT # Does not work, needs a hook in the .mk file - # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP - # select BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 - # select BR2_TARGET_UBOOT - # select BR2_TARGET_UBOOT_FORMAT_CUSTOM - # select BR2_TARGET_UBOOT_NEEDS_DTC - # select BR2_TARGET_UBOOT_NEEDS_UBOOT_TOOLS - # select BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG - help + select SDCARD_AUX + help Build Banana PI R3 support - -# Don't redefine - just set conditional defaults -# config BR2_TARGET_UBOOT_BOARD_DEFCONFIG -# default "mt7986a_bpir3_sd" - -# config BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES -# default "${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/extras.config" - -# config BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME -# default "arch/arm/dts/infix-key.dtbo arch/arm/dts/rpi-env.dtbo" - -# config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH -# default "${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/rpi-env.dtso" - -# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL -# default "https://github.com/mtk-openwrt/arm-trusted-firmware.git" - -# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION -# default "78a0dfd927bb00ce973a1f8eb4079df0f755887a" - -# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM -# default "mt7986" - -# config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES -# default "BOOT_DEVICE=sdmmc USE_COHERENT_MEM=1" diff --git a/package/board/banana-pi-r3/banana-pi-r3.mk b/package/board/banana-pi-r3/banana-pi-r3.mk index d5fa28d10..b4b2ae95f 100644 --- a/package/board/banana-pi-r3/banana-pi-r3.mk +++ b/package/board/banana-pi-r3/banana-pi-r3.mk @@ -1,10 +1,6 @@ GENIMAGE_CFG="$(BUILD_DIR)/genimage.cfg" GENIMAGE_TMP="$(BUILD_DIR)/genimage.tmp" BOARD_DIR="$(BR2_EXTERNAL_INFIX_PATH)/src/board/banana-pi-r3" -BOOTLOADER_NAME=fip.bin -BOOTLOADER2_NAME=bl2.img - -BOOTLOADER_PATH=/home/lazzer/Documents/github.com/kernelkit/infix3/output-bootloader/images define BANANA_PI_R3_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_MEDIATEK) @@ -40,34 +36,5 @@ define BANANA_PI_R3_LINUX_CONFIG_FIXUPS $(call KCONFIG_SET_OPT,CONFIG_CRYPTO_DEV_SAFEXCEL,m) endef -ifeq ($(BR2_PACKAGE_BANANA_PI_R3),y) -define GENERATE_SD_CARD - VERSION="-$(INFIX_RELEASE)" - cp "$(BOOTLOADER_PATH)/$(BOOTLOADER_NAME)" "$(BINARIES_DIR)" - cp "$(BOOTLOADER_PATH)/$(BOOTLOADER2_NAME)" "$(BINARIES_DIR)" - sed "s|#VERSION#|$(RELEASE)|" "$(BOARD_DIR)/genimage.cfg.in" | \ - sed "s|#INFIX_ID#|$(INFIX_ID)|" > "$(GENIMAGE_CFG)" - # Create temporary root path - ROOTPATH_TMP=$(mktemp -d) - trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT - - # Clean previous genimage temp directory - rm -rf "${GENIMAGE_TMP}" - - # Generate the SD card image - $(HOST_DIR)/bin/genimage \ - --rootpath "${ROOTPATH_TMP}" \ - --tmppath "$(GENIMAGE_TMP)" \ - --inputpath "$(BINARIES_DIR)" \ - --outputpath "$(BINARIES_DIR)" \ - --config "${GENIMAGE_CFG}" -endef -endif -.PHONY: generate-sdcard-image -all: generate-sdcard-image -generate-sdcard-image: target-post-image - $(call GENERATE_SD_CARD) - - $(eval $(ix-board)) $(eval $(generic-package)) diff --git a/src/board/banana-pi-r3/genimage.cfg.in b/src/board/banana-pi-r3/genimage.cfg.in index ce6c84ccf..9c9b695f6 100644 --- a/src/board/banana-pi-r3/genimage.cfg.in +++ b/src/board/banana-pi-r3/genimage.cfg.in @@ -24,8 +24,8 @@ image #INFIX_ID##VERSION#-bpi-r3-sdcard.img { } # BL2 bootloader partition (MediaTek official location) - partition bl2 { - image = "bl2.img" + partition bl2 { + image = "bl2.img" offset = 1024s # 0x80000 = sector 1024 size = 4M # 0x400000 bootable = true diff --git a/src/board/banana-pi-r3/uboot/mt7986-env.dtsi b/src/board/banana-pi-r3/uboot/mt7986-env.dtsi index 9e45f7696..20a532f22 100644 --- a/src/board/banana-pi-r3/uboot/mt7986-env.dtsi +++ b/src/board/banana-pi-r3/uboot/mt7986-env.dtsi @@ -14,7 +14,7 @@ kernel_addr_r = "0x44000000"; scriptaddr = "0x48000000"; ramdisk_addr_r = "0x4A000000"; - + /* This is a development platform, keep * developer mode statically enabled. */ From 33e873c2fa2d7d9a375500686b5023e58ce976b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Sun, 7 Sep 2025 20:39:24 +0200 Subject: [PATCH 4/4] workflows: create-image: add banana pi r3 as target board No eMMC support added yet, only SD card. --- .github/workflows/build-image.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 044a1510a..31ed52dd4 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -9,6 +9,7 @@ on: required: true options: - raspberry-pi-4 + - banana-pi-r3 default: 'raspberry-pi-4' use_latest_release: description: 'Use latest release artifacts instead of workflow artifacts' @@ -55,6 +56,10 @@ jobs: echo "BOOTLOADER=rpi4_boot" >> $GITHUB_ENV echo "TARGET=aarch64" >> $GITHUB_ENV ;; + banana-pi-r3) + echo "BOOTLOADER=mt7986_sd_boot" >> $GITHUB_ENV + echo "TARGET=aarch64" >> $GITHUB_ENV + ;; *) echo "Error: Unknown board ${{ inputs.board }}" exit 1 @@ -142,7 +147,7 @@ jobs: # Use the standardized mkimage.sh path for the selected board # BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh" - BOARD_SCRIPT="src/board/raspberry-pi-4/mkimage.sh" + BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh" if [ -f "$BOARD_SCRIPT" ]; then echo "Using board-specific image creation script: $BOARD_SCRIPT"