Jump to content

Recommended Posts

Posted
https://github.com/orangepi-xunlong/orangepi-build/tree/next

The build script does not include OPI4a. The build for OPI4, as expected, does not run.
Or i'm too lame, and don't understand, how i could duild it for OPT4a

Posted (edited)

For some reason i'v got this error during build
 


[ error ] ERROR in function compile_uboot [ ./build.sh:305 -> scripts/main.sh:638 -> scripts/main.sh:524 -> scripts/compilation.sh:247 -> scripts/general.sh:0 ]
[ error ] U-boot compilation failed

 

Upd: 

Found an open issue with a response stating that the script does not work in Docker:

https://github.com/orangepi-xunlong/orangepi-build/issues/163

Try run in WSL, but also has an error, telling WSL is not supported by skript

I'll try to install Ubuntu on my old laptop and run it there.

Edited by ZlobniyDaemon
Posted (edited)

Can’t really tell if the image works without a boot log. You would need a USB to TTL serial adapter connected to your uart pins. 

Edited by Nick A
Posted (edited)

@Nick A Image based on the "apritzel" kernel for a527, I have compiled the image and it works on my board. The you just to chage  "dev" to "edge" and add the clean patches for the board (I will take the time to learn and send).

this is very edge and has no video, ethernet, wifi, etc...
@Igor is it applicable to send to the armbian/build repository?
Add Radxa Cubie A5E (sun55i-a527)

Armbian Radxa Cubie A5E Debian BookWorm (Image)

Edited by JuanEsf
Posted
2 hours ago, JuanEsf said:

is it applicable to send to the armbian/build repository?


Sure, the rest can be adjusted on PR itself. I still wait / hope we will manage to switch CURRENT to 6.12.y with this release, otherwise this will stick at edge until.

Posted (edited)
Quote

this is very edge and has no video, ethernet, wifi, etc...

 

Yes, the warpme patches adds a lot more features. Apritzel sources will mostly likely be mainlined. You can use Apritzel's kernel source and add warpme patches on top. I took the quickest route and just added all of warpme's patches. 

 

warpme:

    aliases {
        serial0 = &uart0;
        mmc0 = &mmc0;
        mmc1 = &mmc1;
        mmc2 = &mmc2;
        ethernet0 = &gmac0;
        ethernet1 = &gmac1;
        ethernet2 = &wlan;
    };

 

apritzel:

    aliases {
        serial0 = &uart0;
    };

 

&mmc0 {
    vmmc-supply = <&reg_cldo3>;
    cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN)>; /* PF6 */
    bus-width = <4>;
    status = "okay";
};

 

Edited by Nick A
Posted

This board is very new and not mature in any way. If you use the radxa bsp kernel (debian) you have video, audio, wifi, etc... but with a modified version of the kernel with drivers and binaries closed in some cases. Mainline support is being worked on but it will take some time for the developers to add the necessary drivers and some may not arrive and even free and proprietary drivers may be mixed to make some specific features of each board work.

warpme is merging Andre's work (mainline kernel) with drivers that are in the radxa cubie a5e bsp to enable network ports for example.

in the sunxi kernel repo revisions of the "Display Engine 3.3" are being sent which adds video support for the new generation of allwinner (h616) soc among them.

The GPU drivers for the Cubie A5e board are present in the mainline kernel, so once the graphics engine is enabled, it should be easy to enable GPU video acceleration.

Posted
On 2/22/2025 at 8:28 PM, JuanEsf said:

If you use the radxa bsp kernel (debian) you have video, audio, wifi, etc... but with a modified version of the kernel with drivers and binaries closed in some cases.

Tell me where to get a radxa image to test on orange pi 4a?

Posted (edited)

@JuanEsf Thank you for your work! I was able to give that image a go during my lunch break on my Opi 4a. So far, it does not boot. Just the standard standby power light. 

Edited by MisterSBC
Posted (edited)

@JuanEsf Have this :

 

it gets stuck there :

 

U-Boot 2025.01-armbian-2025.01-S2ebd-Pe2be-H8869-V77e1-Bb703-R448a+ (Feb 24 2025 - 23:31:20 -0300) Allwinner Technology

CPU:   Allwinner A523 (SUN55I)
Model: OrangePi 4A
DRAM:  4 GiB
sunxi_set_gate: (CLK#32) unhandled
Core:  52 devices, 20 uclasses, devicetree: separate
WDT:   Not starting watchdog@2050000
MMC:   mmc@4020000: 0
Loading Environment from FAT... Unable to use mmc 0:1...
In:    serial@2500000
Out:   serial@2500000
Err:   serial@2500000
Net:   No ethernet found.
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
4641 bytes read in 5 ms (906.3 KiB/s)
## Executing script at 4fc00000
U-boot loaded from SD
Boot script loaded from mmc
156 bytes read in 3 ms (50.8 KiB/s)
Load fdt: /boot/dtb/allwinner/sun55i-t527-orangepi-4a.dtb
17256 bytes read in 13 ms (1.3 MiB/s)
Working FDT set to 4fa00000
Failed to load '/boot/dtb/allwinner/overlay/sun55i-t527-fixup.scr'
8116855 bytes read in 2781 ms (2.8 MiB/s)
42523136 bytes read in 14555 ms (2.8 MiB/s)
Moving Image from 0x40080000 to 0x40200000, end=0x42b40000
## Loading init Ramdisk from Legacy Image at 4ff00000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    8116791 Bytes = 7.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Ramdisk to 49842000, end 49fffa37 ... OK
   Loading Device Tree to 00000000497d5000, end 0000000049841fff ... OK
Working FDT set to 497d5000

Starting kernel ...


 

 

Edited by JamesCL
Update Code
Posted

@JamesCL
When u-boot finishes and starts booting the kernel it takes a minute and shows no messages on the console until it runs the kernel and launches the Armbian setup wizard. can you re-run it and wait a couple of minutes on the console please.

Posted (edited)

@JamesCL
 

Changes:

 git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   config/boards/radxa-cubie-a5e.conf
        modified:   config/sources/families/sun55iw3.conf

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        config/boards/orangepi4a.conf
        patch/kernel/archive/sunxi-dev-6.12/Add-sun55iw3-OrangePi-4A.patch
        patch/u-boot/sunxi-dev-u-boot-a523/

you should skip the cubie board changes:
config/boards/radxa-cubie-a5e.conf

 

config/sources/families/sun55iw3.conf

#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#
enable_extension "sunxi-tools"
declare -g ARCH=arm64
declare -g ATFSOURCE='https://github.com/jernejsk/arm-trusted-firmware'
declare -g ATF_TARGET_MAP="PLAT=sun55i_a523 DEBUG=1 bl31;;build/sun55i_a523/debug/bl31.bin"
declare -g ATFBRANCH="branch:a523"
declare -g BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
declare -g BOOTDELAY=1
declare -g BOOTSOURCE='https://github.com/jernejsk/u-boot/'
declare -g BOOTPATCHDIR="sunxi-dev-${BOOTPATCHDIR:-"u-boot-a523"}"
declare -g BOOTBRANCH="${BOOTBRANCH:-"branch:a523"}"
declare -g BOOTENV_FILE='sunxi.txt'
declare -g UBOOT_TARGET_MAP="${UBOOT_TARGET_MAP:-BINMAN_ALLOW_MISSING=1;;u-boot-sunxi-with-spl.bin}"
declare -g OVERLAY_DIR="/boot/dtb/allwinner/overlay"
declare -g LINUXFAMILY="sun55iw3"

case "${BRANCH}" in

	dev)
		declare -g KERNELSOURCE='https://github.com/apritzel/linux'
		declare -g KERNELBRANCH='branch:a523-v2-WIP'
		declare -g KERNEL_MAJOR_MINOR="6.12" # Major and minor versions of this kernel.
		KERNELPATCHDIR="archive/sunxi-dev-${KERNEL_MAJOR_MINOR}"
		;;

esac

family_tweaks() {
	# execute specific tweaks function if present
	[[ $(type -t family_tweaks_s) == function ]] && family_tweaks_s
	cp $SRC/packages/blobs/splash/armbian-u-boot-24.bmp $SDCARD/boot/boot.bmp
}

write_uboot_platform() {
	dd if=/dev/zero of=$2 bs=512 count=1023 seek=1 status=noxfer > /dev/null 2>&1
	dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=512 seek=256 status=noxfer > /dev/null 2>&1
}

setup_write_uboot_platform() {
	local tmp part dev
	if grep -q "ubootpart" /proc/cmdline; then
		# mainline with new boot script
		tmp=$(cat /proc/cmdline)
		tmp="${tmp##*ubootpart=}"
		tmp="${tmp%% *}"
		[[ -n $tmp ]] && part=$(findfs PARTUUID=$tmp 2> /dev/null)
		[[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null)
		[[ -n $dev ]] && DEVICE="/dev/$dev"
	else
		# legacy or old boot script
		tmp=$(cat /proc/cmdline)
		tmp="${tmp##*root=}"
		tmp="${tmp%% *}"
		[[ -n $tmp ]] && part=$(findfs $tmp 2> /dev/null)
		[[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null)
		# do not try to write u-boot to USB devices
		[[ -n $dev && $dev == mmcblk* ]] && DEVICE="/dev/$dev"
	fi
}

 

config/boards/orangepi4a.conf
 

# Allwinner Cortex-A55 octa core SoC
BOARD_NAME="Orange Pi 4A"
BOARDFAMILY="sun55iw3"
BOARD_MAINTAINER=""
BOOTCONFIG="orangepi-4a_defconfig"
OVERLAY_PREFIX="sun55i-t527"
#BOOT_LOGO="desktop"
KERNEL_TARGET="dev"

 

patch/kernel/archive/sunxi-dev-6.12/Add-sun55iw3-OrangePi-4A.patch
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Doe <john.doe@somewhere.on.planet>
Date: Mon, 24 Feb 2025 21:37:29 -0300
Subject: Add sun55i-t527-orangepi-4a dts file

Signed-off-by: John Doe <john.doe@somewhere.on.planet>
---
 arch/arm64/boot/dts/allwinner/Makefile                    |   2 +
 arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts | 375 ++++++++++
 2 files changed, 377 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 9d5e14695af0..b409e491bf73 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -53,5 +53,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-h.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-plus.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-sp.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun55i-a527-radxa-a5e.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun55i-h728-x96qpro+.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-avaota-a1.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-orangepi-4a.dtb
+
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts
new file mode 100644
index 000000000000..06046e2555af
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts
@@ -0,0 +1,375 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+// Copyright (C) 2024 Arm Ltd.
+
+/dts-v1/;
+
+#include "sun55i-a523.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "OrangePi 4A";
+	compatible = "xunlong,orangepi-4a", "allwinner,sun55i-t527";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	/* For now, until we have mainline components living in SRAM */
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* 128 KiB reserved for Trusted Firmware-A (BL31). */
+		secmon@48000000 {
+			reg = <0x0 0x48000000 0x0 0x20000>;
+			no-map;
+		};
+
+		/* 256 KiB reserved for the SCP. */
+		secmon@48100000 {
+			reg = <0x0 0x48100000 0x0 0x40000>;
+			no-map;
+		};
+	};
+
+	leds: gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		status = "okay";
+
+		status_led@0 {
+			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			label = "status_led";
+			linux,default-trigger = "heartbeat";
+			linux,default-trigger-delay-ms = <0>;
+		};
+	};
+
+	reg_vcc5v: vcc5v {
+		/* board wide 5V supply from the 12V->5V regulator */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	reg_exxt_vbus: exxt-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "exxxxt-vbus";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+
+	reg_usb0_vbus: usb0-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb0-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 4 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 12 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+};
+
+&mmc0 {
+	vmmc-supply = <&reg_cldo3>;
+	vqmmc-supply = <&reg_cldo1>;
+	cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN)>; /* PF6 */
+	bus-width = <4>;
+	max-frequency = <20000000>;
+	status = "okay";
+};
+
+&pio {
+	vcc-pb-supply = <&reg_cldo3>;
+	vcc-pc-supply = <&reg_cldo1>;
+	vcc-pd-supply = <&reg_dcdc4>;
+	vcc-pe-supply = <&reg_dcdc4>;
+	vcc-pf-supply = <&reg_cldo3>;
+	vcc-pg-supply = <&reg_bldo1>;
+	vcc-ph-supply = <&reg_cldo3>;
+	vcc-pi-supply = <&reg_dcdc4>;
+	vcc-pj-supply = <&reg_dcdc4>;
+	vcc-pk-supply = <&reg_bldo3>;
+};
+
+&r_i2c0 {
+	status = "okay";
+
+	axp717: pmic@35 {
+		compatible = "x-powers,axp717";
+		reg = <0x35>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+		vin4-supply = <&reg_vcc5v>;
+		aldoin-supply = <&reg_vcc5v>;
+		bldoin-supply = <&reg_vcc5v>;
+		cldoin-supply = <&reg_vcc5v>;
+
+		regulators {
+			/* Supplies the "little" cluster (1.4 GHz cores) */
+			reg_dcdc1: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-cpu0-3";
+			};
+
+			reg_dcdc2: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-gpu-sys";
+			};
+
+			reg_dcdc3: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1160000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-dram";
+			};
+
+			reg_dcdc4: dcdc4 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vdd-io";
+			};
+
+			reg_aldo1: aldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "axp2202-aldo1";
+			};
+
+			reg_aldo2: aldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "axp2202-aldo2";
+			};
+
+			reg_aldo3: aldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc-pl-pm";
+			};
+
+			reg_aldo4: aldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pll-dxco-avcc";
+			};
+
+			reg_bldo1: bldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pg-wifi-lvds";
+			};
+
+			reg_bldo2: bldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-dram-1v8";
+			};
+
+			reg_bldo3: bldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-cvp-pk-vid1v8";
+			};
+
+			reg_bldo4: bldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-name = "axp2202-bldo4";
+			};
+
+			reg_cldo1: cldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pc";
+			};
+
+			reg_cldo2: cldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-efuse";
+			};
+
+			reg_cldo3: cldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc-mmc-eth-codec";
+			};
+
+			reg_cldo4: cldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "axp2202-cldo4";
+			};
+
+			reg_cpusldo: cpusldo {
+				/* supplies the management core */
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-name = "vdd-cpus";
+			};
+		};
+	};
+
+	axp323: pmic@36 {
+		compatible = "x-powers,axp323";
+		reg = <0x36>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		status = "okay";
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+
+		regulators {
+			/* Supplies the "big" cluster (1.8 GHz cores) */
+			reg_dcdc1_323: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-cpu4-7";
+			};
+
+			reg_dcdc2_323: dcdc2 {
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-name = "axp323-dcdc2";
+			};
+
+			reg_dcdc3_323: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-name = "vdd-npu";
+			};
+	
+			reg_aldo1_323: aldo1 {
+				regulator-name = "axp323-aldo1";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			reg_dldo1_323: dldo1 {
+				regulator-name = "axp323-dldo1";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&r_pio {
+/*
+ * Specifying the supply would create a circular dependency.
+ *
+ *	vcc-pl-supply = <&reg_aldo3>;
+ */
+	vcc-pm-supply = <&reg_aldo3>;
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
+
+&ehci0 {
+	drvvbus-supply = <&reg_usb0_vbus>;
+	status = "okay";
+};
+
+&ohci0 {
+	drvvbus-supply = <&reg_usb0_vbus>;
+	status = "okay";
+};
+
+&ehci1 {
+	drvvbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
+
+&ohci1 {
+	drvvbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
+
+&gmac1 {
+	phy-mode = "rgmii";
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&gmac1_pins_default>;
+	pinctrl-1 = <&gmac1_pins_sleep>;
+	aw,soc-phy25m;
+	tx-delay = <1>;
+	rx-delay = <3>;
+	dwmac3v3-supply = <&reg_cldo3>;
+	phy3v3-supply = <&reg_cldo3>;
+	status = "okay";
+};
+
+&gmac1_phy0 {
+	compatible = "ethernet-phy-ieee802.3-c22";
+	reg = <1>;
+	reset-gpios = <&pio 8 15 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <15000>;
+	reset-deassert-us = <100000>;
+};
-- 
Created with Armbian build tools https://github.com/armbian/build

 

patch/u-boot/sunxi-dev-u-boot-a523/Add-u-boot-OrangePi4A-defconfig.patch
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Doe <john.doe@somewhere.on.planet>
Date: Mon, 24 Feb 2025 22:04:53 -0300
Subject: Add u-boot orangepi-4a_defconfig

Signed-off-by: John Doe <john.doe@somewhere.on.planet>
---
 arch/arm/dts/sun55i-t527-orangepi-4a.dts | 375 ++++++++++
 configs/orangepi-4a_defconfig            |  26 +
 2 files changed, 401 insertions(+)

diff --git a/arch/arm/dts/sun55i-t527-orangepi-4a.dts b/arch/arm/dts/sun55i-t527-orangepi-4a.dts
new file mode 100644
index 0000000000..06046e2555
--- /dev/null
+++ b/arch/arm/dts/sun55i-t527-orangepi-4a.dts
@@ -0,0 +1,375 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+// Copyright (C) 2024 Arm Ltd.
+
+/dts-v1/;
+
+#include "sun55i-a523.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "OrangePi 4A";
+	compatible = "xunlong,orangepi-4a", "allwinner,sun55i-t527";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	/* For now, until we have mainline components living in SRAM */
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* 128 KiB reserved for Trusted Firmware-A (BL31). */
+		secmon@48000000 {
+			reg = <0x0 0x48000000 0x0 0x20000>;
+			no-map;
+		};
+
+		/* 256 KiB reserved for the SCP. */
+		secmon@48100000 {
+			reg = <0x0 0x48100000 0x0 0x40000>;
+			no-map;
+		};
+	};
+
+	leds: gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		status = "okay";
+
+		status_led@0 {
+			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			label = "status_led";
+			linux,default-trigger = "heartbeat";
+			linux,default-trigger-delay-ms = <0>;
+		};
+	};
+
+	reg_vcc5v: vcc5v {
+		/* board wide 5V supply from the 12V->5V regulator */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	reg_exxt_vbus: exxt-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "exxxxt-vbus";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+
+	reg_usb0_vbus: usb0-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb0-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 4 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-enable-ramp-delay = <1000>;
+		gpio = <&r_pio 0 12 GPIO_ACTIVE_HIGH>;
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+	};
+};
+
+&mmc0 {
+	vmmc-supply = <&reg_cldo3>;
+	vqmmc-supply = <&reg_cldo1>;
+	cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN)>; /* PF6 */
+	bus-width = <4>;
+	max-frequency = <20000000>;
+	status = "okay";
+};
+
+&pio {
+	vcc-pb-supply = <&reg_cldo3>;
+	vcc-pc-supply = <&reg_cldo1>;
+	vcc-pd-supply = <&reg_dcdc4>;
+	vcc-pe-supply = <&reg_dcdc4>;
+	vcc-pf-supply = <&reg_cldo3>;
+	vcc-pg-supply = <&reg_bldo1>;
+	vcc-ph-supply = <&reg_cldo3>;
+	vcc-pi-supply = <&reg_dcdc4>;
+	vcc-pj-supply = <&reg_dcdc4>;
+	vcc-pk-supply = <&reg_bldo3>;
+};
+
+&r_i2c0 {
+	status = "okay";
+
+	axp717: pmic@35 {
+		compatible = "x-powers,axp717";
+		reg = <0x35>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+		vin4-supply = <&reg_vcc5v>;
+		aldoin-supply = <&reg_vcc5v>;
+		bldoin-supply = <&reg_vcc5v>;
+		cldoin-supply = <&reg_vcc5v>;
+
+		regulators {
+			/* Supplies the "little" cluster (1.4 GHz cores) */
+			reg_dcdc1: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-cpu0-3";
+			};
+
+			reg_dcdc2: dcdc2 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-gpu-sys";
+			};
+
+			reg_dcdc3: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1160000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-dram";
+			};
+
+			reg_dcdc4: dcdc4 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vdd-io";
+			};
+
+			reg_aldo1: aldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "axp2202-aldo1";
+			};
+
+			reg_aldo2: aldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "axp2202-aldo2";
+			};
+
+			reg_aldo3: aldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc-pl-pm";
+			};
+
+			reg_aldo4: aldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pll-dxco-avcc";
+			};
+
+			reg_bldo1: bldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pg-wifi-lvds";
+			};
+
+			reg_bldo2: bldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-dram-1v8";
+			};
+
+			reg_bldo3: bldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-cvp-pk-vid1v8";
+			};
+
+			reg_bldo4: bldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-name = "axp2202-bldo4";
+			};
+
+			reg_cldo1: cldo1 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-pc";
+			};
+
+			reg_cldo2: cldo2 {
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc-efuse";
+			};
+
+			reg_cldo3: cldo3 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc-mmc-eth-codec";
+			};
+
+			reg_cldo4: cldo4 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "axp2202-cldo4";
+			};
+
+			reg_cpusldo: cpusldo {
+				/* supplies the management core */
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-name = "vdd-cpus";
+			};
+		};
+	};
+
+	axp323: pmic@36 {
+		compatible = "x-powers,axp323";
+		reg = <0x36>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		status = "okay";
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+
+		regulators {
+			/* Supplies the "big" cluster (1.8 GHz cores) */
+			reg_dcdc1_323: dcdc1 {
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-name = "vdd-cpu4-7";
+			};
+
+			reg_dcdc2_323: dcdc2 {
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-name = "axp323-dcdc2";
+			};
+
+			reg_dcdc3_323: dcdc3 {
+				regulator-always-on;
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-name = "vdd-npu";
+			};
+	
+			reg_aldo1_323: aldo1 {
+				regulator-name = "axp323-aldo1";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			reg_dldo1_323: dldo1 {
+				regulator-name = "axp323-dldo1";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&r_pio {
+/*
+ * Specifying the supply would create a circular dependency.
+ *
+ *	vcc-pl-supply = <&reg_aldo3>;
+ */
+	vcc-pm-supply = <&reg_aldo3>;
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
+
+&ehci0 {
+	drvvbus-supply = <&reg_usb0_vbus>;
+	status = "okay";
+};
+
+&ohci0 {
+	drvvbus-supply = <&reg_usb0_vbus>;
+	status = "okay";
+};
+
+&ehci1 {
+	drvvbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
+
+&ohci1 {
+	drvvbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
+
+&gmac1 {
+	phy-mode = "rgmii";
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&gmac1_pins_default>;
+	pinctrl-1 = <&gmac1_pins_sleep>;
+	aw,soc-phy25m;
+	tx-delay = <1>;
+	rx-delay = <3>;
+	dwmac3v3-supply = <&reg_cldo3>;
+	phy3v3-supply = <&reg_cldo3>;
+	status = "okay";
+};
+
+&gmac1_phy0 {
+	compatible = "ethernet-phy-ieee802.3-c22";
+	reg = <1>;
+	reset-gpios = <&pio 8 15 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <15000>;
+	reset-deassert-us = <100000>;
+};
diff --git a/configs/orangepi-4a_defconfig b/configs/orangepi-4a_defconfig
new file mode 100644
index 0000000000..5a9422535c
--- /dev/null
+++ b/configs/orangepi-4a_defconfig
@@ -0,0 +1,26 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SUNXI_ARMV8_32BIT_BUILD=y
+CONFIG_DEFAULT_DEVICE_TREE="sun55i-a527-orangepi-4a"
+CONFIG_SPL=y
+CONFIG_DRAM_SUNXI_DX_ODT=0x07070707
+CONFIG_DRAM_SUNXI_DX_DRI=0x0d0d0d0d
+CONFIG_DRAM_SUNXI_CA_DRI=0x0e0e
+CONFIG_DRAM_SUNXI_ODT_EN=0x84848484
+CONFIG_DRAM_SUNXI_TPR0=0x80808080
+CONFIG_DRAM_SUNXI_TPR1=0x06060606
+CONFIG_DRAM_SUNXI_TPR6=0x38000000
+CONFIG_DRAM_SUNXI_TPR10=0x802f3333
+CONFIG_DRAM_SUNXI_TPR11=0xc6c4c2c0
+CONFIG_DRAM_SUNXI_TPR12=0x3a373233
+CONFIG_MACH_SUN55I_A523=y
+CONFIG_R_I2C_ENABLE=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL_I2C=y
+CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_SYS_I2C_SLAVE=0x7f
+CONFIG_SYS_I2C_SPEED=400000
+CONFIG_AXP717_POWER=y
+CONFIG_AXP_DCDC2_VOLT=920
+CONFIG_AXP_DCDC3_VOLT=1100
-- 
Created with Armbian build tools https://github.com/armbian/build

 

patch/u-boot/sunxi-dev-u-boot-a523/Fix-uboot-sun55iw3-orangepi4a.patch

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Doe <john.doe@somewhere.on.planet>
Date: Mon, 24 Feb 2025 23:29:02 -0300
Subject: Fix u-boot sun55iw3-orangepi-4a

Signed-off-by: John Doe <john.doe@somewhere.on.planet>
---
 arch/arm/dts/sun55i-t527-orangepi-4a.dts | 21 ----------
 configs/orangepi-4a_defconfig            |  2 +-
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/arch/arm/dts/sun55i-t527-orangepi-4a.dts b/arch/arm/dts/sun55i-t527-orangepi-4a.dts
index 06046e2555..d6e291c3b1 100644
--- a/arch/arm/dts/sun55i-t527-orangepi-4a.dts
+++ b/arch/arm/dts/sun55i-t527-orangepi-4a.dts
@@ -350,26 +350,5 @@
 };
 
 &usbphy {
 	status = "okay";
 };
-
-&gmac1 {
-	phy-mode = "rgmii";
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&gmac1_pins_default>;
-	pinctrl-1 = <&gmac1_pins_sleep>;
-	aw,soc-phy25m;
-	tx-delay = <1>;
-	rx-delay = <3>;
-	dwmac3v3-supply = <&reg_cldo3>;
-	phy3v3-supply = <&reg_cldo3>;
-	status = "okay";
-};
-
-&gmac1_phy0 {
-	compatible = "ethernet-phy-ieee802.3-c22";
-	reg = <1>;
-	reset-gpios = <&pio 8 15 GPIO_ACTIVE_LOW>;
-	reset-assert-us = <15000>;
-	reset-deassert-us = <100000>;
-};
diff --git a/configs/orangepi-4a_defconfig b/configs/orangepi-4a_defconfig
index 5a9422535c..10901edfc7 100644
--- a/configs/orangepi-4a_defconfig
+++ b/configs/orangepi-4a_defconfig
@@ -1,9 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SUNXI_ARMV8_32BIT_BUILD=y
-CONFIG_DEFAULT_DEVICE_TREE="sun55i-a527-orangepi-4a"
+CONFIG_DEFAULT_DEVICE_TREE="sun55i-t527-orangepi-4a"
 CONFIG_SPL=y
 CONFIG_DRAM_SUNXI_DX_ODT=0x07070707
 CONFIG_DRAM_SUNXI_DX_DRI=0x0d0d0d0d
 CONFIG_DRAM_SUNXI_CA_DRI=0x0e0e
 CONFIG_DRAM_SUNXI_ODT_EN=0x84848484
-- 
Created with Armbian build tools https://github.com/armbian/build

 

Those were the changes I made, I don't have the board to be able to test and try to repair the compilation, if someone has the board and can make the missing changes maybe this will help.

 

You need to clone the following repository to apply the above changes:
https://github.com/juanesf/build.git

 

Edited by JuanEsf

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines