summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-12-17 09:16:53 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-12-19 11:48:49 +0100
commit13cca63887cce9a73379d19029128fa60c36fc52 (patch)
tree038fc8e3f9d82a840dd3194890caf07640eb6f4d
parent767514154be31670df3f072c44537af64993a6a4 (diff)
Add support for Banana PI M2 Zero
-rw-r--r--package/u-boot/Makefile9
-rw-r--r--package/u-boot/files/boot.script.bpizero4
-rw-r--r--package/u-boot/patches/bananapi_m2_p2_zero_defconfig.patch28
-rwxr-xr-xscripts/install.sh13
-rw-r--r--target/arm/Makefile10
-rw-r--r--target/arm/banana-p2-zero/extlinux.conf4
-rw-r--r--target/arm/banana-p2-zero/genimage.cfg35
-rw-r--r--target/arm/kernel/banana-p2-zero323
-rw-r--r--target/arm/systems/banana-p2-zero25
-rw-r--r--target/config/Config.in.kernelfmt1
-rw-r--r--target/linux/Config.in.kernelcfg1
-rw-r--r--target/linux/config/Config.in.wireless8
-rw-r--r--target/linux/patches/6.0.11/enable-ethernet-bpi-m2-plus.patch15
13 files changed, 470 insertions, 6 deletions
diff --git a/package/u-boot/Makefile b/package/u-boot/Makefile
index b89f0fdef..0671a3fa3 100644
--- a/package/u-boot/Makefile
+++ b/package/u-boot/Makefile
@@ -16,7 +16,7 @@ PKG_SITES:= ftp://ftp.denx.de/pub/u-boot/
DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SYSTEM_DEPENDS:= beaglebone-black orange-pi0 raspberry-pi raspberry-pi2 raspberry-pi3 banana-pro solidrun-imx6 solidrun-clearfog raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64 rockpi4-plus phytec-imx6 pcduino-3b imgtec-ci20 st-stm32f746g
+PKG_SYSTEM_DEPENDS:= banana-p2-zero beaglebone-black orange-pi0 raspberry-pi raspberry-pi2 raspberry-pi3 banana-pro solidrun-imx6 solidrun-clearfog raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64 rockpi4-plus phytec-imx6 pcduino-3b imgtec-ci20 st-stm32f746g
include $(ADK_TOPDIR)/mk/host.mk
include $(ADK_TOPDIR)/mk/package.mk
@@ -66,6 +66,10 @@ ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
CONFIG:= Bananapro_defconfig
UBOOT:= u-boot-sunxi-with-spl.bin
endif
+ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
+CONFIG:= bananapi_m2_p2_zero_defconfig
+UBOOT:= u-boot-sunxi-with-spl.bin
+endif
ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
CONFIG:= orangepi_zero_defconfig
UBOOT:= u-boot-sunxi-with-spl.bin
@@ -134,6 +138,9 @@ endif
ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
$(INSTALL_BIN) ./files/boot.script.bpi $(FW_DIR)
endif
+ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
+ $(INSTALL_BIN) ./files/boot.script.bpizero $(FW_DIR)
+endif
ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
$(INSTALL_BIN) ./files/boot.script.opi $(FW_DIR)
endif
diff --git a/package/u-boot/files/boot.script.bpizero b/package/u-boot/files/boot.script.bpizero
new file mode 100644
index 000000000..1d7893b49
--- /dev/null
+++ b/package/u-boot/files/boot.script.bpizero
@@ -0,0 +1,4 @@
+setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait
+ext4load mmc 0:1 $fdt_addr_r boot/${fdtfile}
+ext4load mmc 0:1 $kernel_addr_r boot/kernel
+bootz $kernel_addr_r - $fdt_addr_r
diff --git a/package/u-boot/patches/bananapi_m2_p2_zero_defconfig.patch b/package/u-boot/patches/bananapi_m2_p2_zero_defconfig.patch
new file mode 100644
index 000000000..4de65441a
--- /dev/null
+++ b/package/u-boot/patches/bananapi_m2_p2_zero_defconfig.patch
@@ -0,0 +1,28 @@
+commit c14386c561d59fef8e3e47085ab494e2626f04d9
+Author: Martin Thomas <m.thomas@infodas.de>
+Date: Mon Oct 10 15:19:03 2022 +0200
+
+ added default config für the banana pi zero p2
+
+diff --git a/configs/bananapi_m2_p2_zero_defconfig b/configs/bananapi_m2_p2_zero_defconfig
+new file mode 100644
+index 0000000000..fcd7f636a5
+--- /dev/null
++++ b/configs/bananapi_m2_p2_zero_defconfig
+@@ -0,0 +1,15 @@
++CONFIG_ARM=y
++CONFIG_ARCH_SUNXI=y
++# CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-bananapi-m2-plus-v1.2"
++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-m2-zero"
++CONFIG_SPL=y
++CONFIG_MACH_SUN8I_H3=y
++CONFIG_DRAM_CLK=408
++CONFIG_MMC0_CD_PIN=""
++CONFIG_MMC_SUNXI_SLOT_EXTRA=2
++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
++CONFIG_PREBOOT=""
++# CONFIG_SYS_DEVICE_NULLDEV is not set
++CONFIG_SPL_STACK=0x8000
++CONFIG_SYS_PBSIZE=1024
++CONFIG_SUN8I_EMAC=y
++CONFIG_USB_EHCI_HCD=y
diff --git a/scripts/install.sh b/scripts/install.sh
index 1f721f050..7160cab34 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -155,7 +155,7 @@ tgt=$2
src=$3
case $target {
-(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|rockpi4-plus|solidrun-imx6|solidrun-clearfog|imgtec-ci20|default) ;;
+(banana-pro|banana-pro-zero|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|rockpi4-plus|solidrun-imx6|solidrun-clearfog|imgtec-ci20|default) ;;
(*)
print -u2 "Unknown target '$target', exiting"
exit 1 ;;
@@ -553,7 +553,7 @@ case $target {
dd if="$fwdir/u-boot-spl.bin" of="$tgt" obs=512 seek=1 > /dev/null 2>&1
dd if="$fwdir/u-boot-dtb.img" of="$tgt" obs=1k seek=14 > /dev/null 2>&1
;;
-(banana-pro|orange-pi0)
+(banana-pro|banana-pro-zero|orange-pi0)
dd if="$fwdir/u-boot-sunxi-with-spl.bin" of="$tgt" bs=1024 seek=8 > /dev/null 2>&1
;;
(solidrun-clearfog)
@@ -686,6 +686,15 @@ case $target {
-n "BananaPro" \
-d $fwdir/boot.script.bpi $R/boot/boot.scr.uimg
;;
+(banana-pro-zero)
+ for x in "$fwdir"/*.dtb; do
+ [[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/"
+ break
+ done
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+ -n "BananaProZero" \
+ -d $fwdir/boot.script.bpizero $R/boot/boot.scr.uimg
+ ;;
}
cd "$R"
diff --git a/target/arm/Makefile b/target/arm/Makefile
index 4f7ffc009..51fef7740 100644
--- a/target/arm/Makefile
+++ b/target/arm/Makefile
@@ -48,6 +48,7 @@ endif
# target helper text
ifeq ($(ADK_TARGET_FS),archive)
targethelp:
+ @echo "#################################################"
@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB)$(ADK_TARGET_SYSTEM_QEMU_ARM_TERRIER)$(ADK_TARGET_SYSTEM_QEMU_ARM_SPITZ),y)
@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
@@ -90,6 +91,12 @@ ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
@echo "Use following command to install with a writable data partition"
@echo "sudo ./scripts/install.sh -d 256 banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
endif
+ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
+ @echo "Use following command to install it on SD card:"
+ @echo "sudo ./scripts/install.sh banana-pro-zero /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
+ @echo "Use following command to install with a writable data partition"
+ @echo "sudo ./scripts/install.sh -d 256 banana-pro-zero /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
@echo "Use following command to install it on SD card:"
@echo "sudo ./scripts/install.sh orange-pi0 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
@@ -207,6 +214,9 @@ endif
ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
${KERNEL_MAKE} sun8i-h2-plus-orangepi-zero.dtb $(MAKE_TRACE)
endif
+ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
+ ${KERNEL_MAKE} sun8i-h2-plus-bananapi-m2-zero.dtb $(MAKE_TRACE)
+endif
ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
${KERNEL_MAKE} imx6q-cubox-i.dtb imx6dl-cubox-i.dtb \
imx6dl-hummingboard.dtb imx6q-hummingboard.dtb $(MAKE_TRACE)
diff --git a/target/arm/banana-p2-zero/extlinux.conf b/target/arm/banana-p2-zero/extlinux.conf
new file mode 100644
index 000000000..08a063d7f
--- /dev/null
+++ b/target/arm/banana-p2-zero/extlinux.conf
@@ -0,0 +1,4 @@
+label banana-p2-zero-openadk
+ kernel /kernel
+ devicetree /sun8i-h2-plus-bananapi-m2-zero.dtb
+ append console=ttyS0,115200n8 rw rootwait
diff --git a/target/arm/banana-p2-zero/genimage.cfg b/target/arm/banana-p2-zero/genimage.cfg
new file mode 100644
index 000000000..98c9de077
--- /dev/null
+++ b/target/arm/banana-p2-zero/genimage.cfg
@@ -0,0 +1,35 @@
+image boot.vfat {
+ vfat {
+ files = {
+ "kernel",
+ "sun8i-h2-plus-bananapi-m2-zero.dtb",
+ "boot.scr"
+ }
+ }
+
+ size = 64M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition u-boot {
+ in-partition-table = "no"
+ image = "u-boot-sunxi-with-spl.bin"
+ offset = 8K
+ size = 1016K # 1MB - 8KB
+ }
+
+ partition boot {
+ partition-type = 0xC
+ bootable = "true"
+ image = "boot.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext"
+ }
+
+}
diff --git a/target/arm/kernel/banana-p2-zero b/target/arm/kernel/banana-p2-zero
new file mode 100644
index 000000000..586bc605a
--- /dev/null
+++ b/target/arm/kernel/banana-p2-zero
@@ -0,0 +1,323 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN8I=y
+CONFIG_ARCH_SUNXI_MC_SMP=y
+CONFIG_ARM_THUMB=y
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_ATAGS=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+CONFIG_HAVE_CONTEXT_TRACKING_USER=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
+CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
+CONFIG_SOFTIRQ_ON_OWN_STACK=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS=8
+CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
+CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
+CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_HAVE_ARCH_VMAP_STACK=y
+CONFIG_VMAP_STACK=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
+CONFIG_STRICT_MODULE_RWX=y
+CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
+CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_FREEZER=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FLATMEM=y
+CONFIG_ARCH_KEEP_MEMBLOCK=y
+CONFIG_MEMORY_ISOLATION=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+CONFIG_CONTIG_ALLOC=y
+CONFIG_BOUNCE=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_CMA=y
+CONFIG_CMA_AREAS=7
+CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_KMAP_LOCAL=y
+CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y
+CONFIG_HAVE_PCI=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_EXTRA_FIRMWARE=""
+CONFIG_FW_CACHE=y
+CONFIG_ALLOW_DEV_COREDUMP=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CPU_VULNERABILITIES=y
+CONFIG_SOC_BUS=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_SPI=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_REGMAP_IRQ=y
+CONFIG_DMA_SHARED_BUFFER=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
+CONFIG_ARM_CCI=y
+CONFIG_ARM_CCI400_COMMON=y
+CONFIG_ARM_CCI400_PORT_CTRL=y
+CONFIG_SUNXI_RSB=y
+CONFIG_ARM_PSCI_FW=y
+CONFIG_HAVE_ARM_SMCCC=y
+CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y
+CONFIG_ARM_SMCCC_SOC_ID=y
+CONFIG_DTC=y
+CONFIG_OF=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_KOBJ=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_RESERVED_MEM=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_BLK_DEV=y
+CONFIG_NETDEVICES=y
+CONFIG_MII=y
+CONFIG_NET_CORE=y
+CONFIG_ETHERNET=y
+CONFIG_NET_VENDOR_ALACRITECH=y
+CONFIG_NET_VENDOR_ALLWINNER=y
+CONFIG_SUN4I_EMAC=y
+CONFIG_STMMAC_ETH=y
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_PLATFORM=y
+CONFIG_DWMAC_GENERIC=y
+CONFIG_DWMAC_SUNXI=y
+CONFIG_DWMAC_SUN8I=y
+CONFIG_PHYLINK=y
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+CONFIG_FIXED_PHY=y
+CONFIG_MICREL_PHY=y
+CONFIG_REALTEK_PHY=y
+CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_BUS=y
+CONFIG_FWNODE_MDIO=y
+CONFIG_OF_MDIO=y
+CONFIG_MDIO_DEVRES=y
+CONFIG_MDIO_SUN4I=y
+CONFIG_MDIO_BUS_MUX=y
+CONFIG_SERIAL_EARLYCON=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
+CONFIG_SERIAL_8250_16550A_VARIANTS=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_DMA=y
+CONFIG_SERIAL_8250_NR_UARTS=8
+CONFIG_SERIAL_8250_RUNTIME_UARTS=8
+CONFIG_SERIAL_8250_DWLIB=y
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_MCTRL_GPIO=y
+CONFIG_DEVMEM=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_MV64XXX=y
+CONFIG_I2C_SUN6I_P2WI=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_SUN4I=y
+CONFIG_SPI_SUN6I=y
+CONFIG_PTP_1588_CLOCK=y
+CONFIG_PTP_1588_CLOCK_OPTIONAL=y
+CONFIG_PTP_1588_CLOCK_KVM=y
+CONFIG_PINCTRL=y
+CONFIG_PINMUX=y
+CONFIG_PINCONF=y
+CONFIG_GENERIC_PINCONF=y
+CONFIG_PINCTRL_SUNXI=y
+CONFIG_PINCTRL_SUN4I_A10=y
+CONFIG_PINCTRL_SUN5I=y
+CONFIG_PINCTRL_SUN6I_A31=y
+CONFIG_PINCTRL_SUN6I_A31_R=y
+CONFIG_PINCTRL_SUN8I_A23=y
+CONFIG_PINCTRL_SUN8I_A33=y
+CONFIG_PINCTRL_SUN8I_A83T=y
+CONFIG_PINCTRL_SUN8I_A83T_R=y
+CONFIG_PINCTRL_SUN8I_A23_R=y
+CONFIG_PINCTRL_SUN8I_H3=y
+CONFIG_PINCTRL_SUN8I_H3_R=y
+CONFIG_PINCTRL_SUN8I_V3S=y
+CONFIG_PINCTRL_SUN9I_A80=y
+CONFIG_PINCTRL_SUN9I_A80_R=y
+CONFIG_PINCTRL_SUN20I_D1=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIOLIB_FASTPATH_LIMIT=512
+CONFIG_OF_GPIO=y
+CONFIG_GPIO_CDEV=y
+CONFIG_GPIO_CDEV_V1=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_HWMON=y
+CONFIG_CHARGER_AXP20X=y
+CONFIG_BATTERY_AXP20X=y
+CONFIG_AXP20X_POWER=y
+CONFIG_MFD_CORE=y
+CONFIG_MFD_AC100=y
+CONFIG_MFD_AXP20X=y
+CONFIG_MFD_AXP20X_I2C=y
+CONFIG_MFD_AXP20X_RSB=y
+CONFIG_MFD_SUN6I_PRCM=y
+CONFIG_MFD_SYSCON=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_AXP20X=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_RC_CORE=y
+CONFIG_RC_MAP=y
+CONFIG_RC_DEVICES=y
+CONFIG_IR_SUNXI=y
+CONFIG_CEC_CORE=y
+CONFIG_CEC_PIN=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_HID=y
+CONFIG_HID_GENERIC=y
+CONFIG_USB_HID=y
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB=y
+CONFIG_USB_DEFAULT_PERSIST=y
+CONFIG_USB_AUTOSUSPEND_DELAY=2
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_DUAL_ROLE=y
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_PHY=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
+CONFIG_MMC=y
+CONFIG_PWRSEQ_EMMC=y
+CONFIG_PWRSEQ_SIMPLE=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_SUNXI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_SYSTOHC=y
+CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
+CONFIG_RTC_NVMEM=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_DRV_AC100=y
+CONFIG_RTC_I2C_AND_SPI=y
+CONFIG_RTC_DRV_SUN6I=y
+CONFIG_RTC_DRV_SUNXI=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_VIRTUAL_CHANNELS=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_SUN4I=y
+CONFIG_DMA_SUN6I=y
+CONFIG_SYNC_FILE=y
+CONFIG_VIRTIO_MENU=y
+CONFIG_VHOST_MENU=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+CONFIG_CLK_SUNXI=y
+CONFIG_CLK_SUNXI_CLOCKS=y
+CONFIG_CLK_SUNXI_PRCM_SUN6I=y
+CONFIG_CLK_SUNXI_PRCM_SUN8I=y
+CONFIG_CLK_SUNXI_PRCM_SUN9I=y
+CONFIG_SUNXI_CCU=y
+CONFIG_SUN4I_A10_CCU=y
+CONFIG_SUN5I_CCU=y
+CONFIG_SUN6I_A31_CCU=y
+CONFIG_SUN6I_RTC_CCU=y
+CONFIG_SUN8I_A23_CCU=y
+CONFIG_SUN8I_A33_CCU=y
+CONFIG_SUN8I_A83T_CCU=y
+CONFIG_SUN8I_H3_CCU=y
+CONFIG_SUN8I_V3S_CCU=y
+CONFIG_SUN8I_DE2_CCU=y
+CONFIG_SUN8I_R40_CCU=y
+CONFIG_SUN9I_A80_CCU=y
+CONFIG_SUN8I_R_CCU=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_SUN4I_TIMER=y
+CONFIG_SUN5I_HSTIMER=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_MAILBOX=y
+CONFIG_SUN6I_MSGBOX=y
+CONFIG_SUNXI_MBUS=y
+CONFIG_SUNXI_SRAM=y
+CONFIG_PM_DEVFREQ=y
+CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
+CONFIG_PWM=y
+CONFIG_PWM_SYSFS=y
+CONFIG_PWM_SUN4I=y
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+CONFIG_SUN4I_INTC=y
+CONFIG_SUN6I_R_INTC=y
+CONFIG_SUNXI_NMI_INTC=y
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RESET_SIMPLE=y
+CONFIG_RESET_SUNXI=y
+CONFIG_GENERIC_PHY=y
+CONFIG_GENERIC_PHY_MIPI_DPHY=y
diff --git a/target/arm/systems/banana-p2-zero b/target/arm/systems/banana-p2-zero
new file mode 100644
index 000000000..8fd4c9f95
--- /dev/null
+++ b/target/arm/systems/banana-p2-zero
@@ -0,0 +1,25 @@
+config ADK_TARGET_SYSTEM_BANANA_P2_ZERO
+ bool "Banana P2 zero"
+ depends on ADK_TARGET_OS_LINUX
+ select ADK_TARGET_LITTLE_ENDIAN
+ select ADK_TARGET_CPU_ARM_CORTEX_A7
+ select ADK_TARGET_CPU_WITH_NEON
+ select ADK_TARGET_WITH_VGA
+ select ADK_TARGET_WITH_SERIAL
+ select ADK_TARGET_WITH_CPU_FREQ
+ select ADK_TARGET_WITH_USB
+ select ADK_TARGET_WITH_SD
+ select ADK_TARGET_WITH_SDIO
+ select ADK_TARGET_WITH_I2C
+ select ADK_TARGET_WITH_SPI
+ select ADK_TARGET_WITH_SMP
+ select ADK_TARGET_WITH_ROOT_RW
+ select ADK_TARGET_WITH_NET
+ select ADK_TARGET_WITH_NETDEVICE
+ select ADK_TARGET_WITH_BLOCK
+ select ADK_TARGET_KERNEL_ZIMAGE
+ select ADK_PACKAGE_U_BOOT
+ select ADK_HOST_BUILD_U_BOOT
+ help
+ Banana PI M2 Zero with Allwinner H3
+
diff --git a/target/config/Config.in.kernelfmt b/target/config/Config.in.kernelfmt
index f64eb32b2..1cc054c05 100644
--- a/target/config/Config.in.kernelfmt
+++ b/target/config/Config.in.kernelfmt
@@ -72,6 +72,7 @@ config ADK_TARGET_KERNEL_LOADADDR
hex
default 0x8000 if ADK_TARGET_SYSTEM_SYNOLOGY_DS414
default 0x40008000 if ADK_TARGET_SYSTEM_BANANA_PRO
+ default 0x44000000 if ADK_TARGET_SYSTEM_BANANA_P2_ZERO
default 0x40008000 if ADK_TARGET_SYSTEM_ORANGE_PI0
default 0xc0008000 if ADK_TARGET_SYSTEM_ST_STM32F746G
diff --git a/target/linux/Config.in.kernelcfg b/target/linux/Config.in.kernelcfg
index 3f70025a3..11e301e2b 100644
--- a/target/linux/Config.in.kernelcfg
+++ b/target/linux/Config.in.kernelcfg
@@ -43,6 +43,7 @@ config ADK_TARGET_LINUX_KERNEL_DEFCONFIG
default "am335x_phytec_defconfig" if ADK_TARGET_SYSTEM_PHYTEC_WEGA
default "j2_defconfig" if ADK_TARGET_SYSTEM_NUMATO_MIMASV2
default "sunxi_defconfig" if ADK_TARGET_SYSTEM_ORANGE_PI0
+ default "sunxi_defconfig" if ADK_TARGET_SYSTEM_BANANA_P2_ZERO
default "edosk2674_defconfig" if ADK_TARGET_SYSTEM_HITACHI_EDOSK2674
default "x86_64_defconfig" if ADK_TARGET_SYSTEM_GENERIC_X86_64
default "i386_defconfig" if ADK_TARGET_SYSTEM_GENERIC_X86
diff --git a/target/linux/config/Config.in.wireless b/target/linux/config/Config.in.wireless
index 382f412df..3649bae8b 100644
--- a/target/linux/config/Config.in.wireless
+++ b/target/linux/config/Config.in.wireless
@@ -149,15 +149,17 @@ config ADK_LINUX_KERNEL_BRCMFMAC
select ADK_LINUX_KERNEL_WLAN_VENDOR_BROADCOM
select ADK_LINUX_KERNEL_BRCMDBG
select ADK_PACKAGE_BRCMFMAC_FIRMWARE
+ default m if ADK_TARGET_SYSTEM_BANANA_P2_ZERO
+ default n
config ADK_LINUX_KERNEL_BRCMFMAC_SDIO
bool "Broadcom brcmfmac wireless driver (SDIO)"
- select ADK_LINUX_KERNEL_BRCMFMAC
depends on ADK_TARGET_WITH_SDIO
- default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 || \
- ADK_TARGET_SYSTEM_PHYTEC_IMX6
+ default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
+ default y if ADK_TARGET_SYSTEM_PHYTEC_IMX6
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI0
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
+ default y if ADK_TARGET_SYSTEM_BANANA_P2_ZERO
default n
help
Driver for Broadcom FullMac wireless cards (SDIO).
diff --git a/target/linux/patches/6.0.11/enable-ethernet-bpi-m2-plus.patch b/target/linux/patches/6.0.11/enable-ethernet-bpi-m2-plus.patch
new file mode 100644
index 000000000..7e9abd9ce
--- /dev/null
+++ b/target/linux/patches/6.0.11/enable-ethernet-bpi-m2-plus.patch
@@ -0,0 +1,15 @@
+diff -Nur linux-6.0.11.orig/arch/arm/boot/dts/sunxi-h3-h5.dtsi linux-6.0.11/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+--- linux-6.0.11.orig/arch/arm/boot/dts/sunxi-h3-h5.dtsi 2022-12-02 17:43:18.000000000 +0100
++++ linux-6.0.11/arch/arm/boot/dts/sunxi-h3-h5.dtsi 2022-12-19 08:06:16.836436057 +0100
+@@ -532,7 +532,10 @@
+ reset-names = "stmmaceth";
+ clocks = <&ccu CLK_BUS_EMAC>;
+ clock-names = "stmmaceth";
+- status = "disabled";
++ status = "okay";
++ phy-handle = <&int_mii_phy>;
++ phy-mode = "mii";
++ allwinner,leds-active-low;
+
+ mdio: mdio {
+ #address-cells = <1>;