Skip to contentSkip to conversation

Can't get U-Boot working on Geniatech XPI-3566-ZERO

DISCUSSION Mizsei Zoltán 2 participants 4 messages Apr 8, 2024 – Feb 15, 2025 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO RK3566 based SBC [1], but all my attempts have failed so far.

The SBC doesn't have any SD-Card slot, please keep this in mind!

I can build U-Boot, but when I write the resulting binary to the eMMC using rkdeveloptool, the boot stops and I see no output on the UART pins using 1500000 baud transfer rate.

My steps were the following:

- git clone https://github.com/u-boot/u-boot
- cd u-boot
- CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig
- ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin' BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- make
- rkdeveloptool db MiniLoaderAll.bin
- rkdeveloptool wl 64 u-boot-rockchip.bin

After that I can no longer communicate with the board via UART and it no longer boots.

I've built uboot countless times, I've followed all sorts of guides, I've tried modifying FDT and transplanting the DTS from the official SDK, I have tried vanilla defconfigs and tried to modify them aswell, I think I've tried everything, but no matter what I do I just can't get it working. The vendored U-Boot works ok, but I plant to run OpenBSD, for which an upstream U-Boot would be better situated (according to the OBSD mailing list).

Please give me some hints because I'm running out of ideas. I've spent countless hours trying to get this to work but haven't succeeded.

Thank You very much!

Best Regards,

--Z--

[1] https://www.geniatech.com/product/xpi-3566-zero/

#1 lore raw

Hi Z,

Quoted 6 lines · Mizsei Zoltán

Hi,

I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO RK3566 based SBC [1], but all my attempts have failed so far.

The SBC doesn't have any SD-Card slot, please keep this in mind!

Quoted 7 lines

I can build U-Boot, but when I write the resulting binary to the eMMC using rkdeveloptool, the boot stops and I see no output on the UART pins using 1500000 baud transfer rate.

My steps were the following:

- git clone https://github.com/u-boot/u-boot
- cd u-boot
- CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig

There is no rk3568_defconfig target but generic-rk3568_defconfig may work better.

Quoted 5 lines

- ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin' BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- make
- rkdeveloptool db MiniLoaderAll.bin
- rkdeveloptool wl 64 u-boot-rockchip.bin

After that I can no longer communicate with the board via UART and it no longer boots.

After looking at the specification for this board it looks like GPIO pin 8 and 10 is connected to uart1 and not uart2 that is typically used for debug uart on rockchip devices.

Quoted 5 lines

I've built uboot countless times, I've followed all sorts of guides, I've tried modifying FDT and transplanting the DTS from the official SDK, I have tried vanilla defconfigs and tried to modify them aswell, I think I've tried everything, but no matter what I do I just can't get it working. The vendored U-Boot works ok, but I plant to run OpenBSD, for which an upstream U-Boot would be better situated (according to the OBSD mailing list).

Please give me some hints because I'm running out of ideas. I've spent countless hours trying to get this to work but haven't succeeded.

You can try changing stdout-path to "serial1:1500000n8" and enable the uart1 node in generic-rk3568.dts. Also change to CONFIG_DEBUG_UART_BASE=0xFE650000, and also use rkbin tools/ddrbin_tool and change to use uart1 on ddr bin.

After that you should probably start seeing something on uart and that may help you get a little bit further.

Regards,
Jonas

Quoted 8 lines

Thank You very much!

Best Regards,

--Z--

[1] https://www.geniatech.com/product/xpi-3566-zero/

#2 lore raw

Hi Jonas,

thank You, i tried my best to follow your hints as good as possible. This is what i did:

- git clone https://github.com/rockchip-linux/rkbin
- git clone https://github.com/u-boot/u-boot
- modified the following files:

```
diff --git a/arch/arm/dts/rk3568-generic.dts b/arch/arm/dts/rk3568-generic.dts
index 88eb1bfd..847ebd51 100644
--- a/arch/arm/dts/rk3568-generic.dts
+++ b/arch/arm/dts/rk3568-generic.dts
@@ -16,7 +16,7 @@
        };
 
        chosen {
-               stdout-path = "serial2:1500000n8";
+               stdout-path = "serial1:1500000n8";
        };
 };
 
@@ -43,6 +43,7 @@
        status = "okay";
 };
 
-&uart2 {
+&uart1 {
        status = "okay";
 };
+
diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig
index e7d5e55b..aeb117e7 100644
--- a/configs/generic-rk3568_defconfig
+++ b/configs/generic-rk3568_defconfig
@@ -6,7 +6,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="rk3568-generic"
 CONFIG_ROCKCHIP_RK3568=y
 CONFIG_SPL_SERIAL=y
-CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_BASE=0xFE650000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
```

- modified this file:

```
diff --git a/tools/ddrbin_param.txt b/tools/ddrbin_param.txt
index 0dfdd31..826f927 100644
--- a/tools/ddrbin_param.txt
+++ b/tools/ddrbin_param.txt
@@ -9,7 +9,7 @@ lp4_freq=
 lp4x_freq=
 lp5_freq=
 
-uart id=
+uart id=1
 uart iomux=
 uart baudrate=
```

- Runned the following command:

# ./ddrbin_tool rk3566 ddrbin_param.txt ~/rkbin/bin/rk35/rk3566_ddr_920MHz_v1.21.bin 
version v1.19 20240117
chip rk3566
version 5

new bin config:
uart id: 1
modify end

The file modification date changed, so i assume it should be ok.

- Runned the following commands:
# CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make generic-rk3568_defconfig O="build/generic-rk3568_defconfig" #ROCKCHIP_TPL='~/rkbin/bin/rk35/rk3566_ddr_920MHz_v1.21.bin' BL31='~/rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- make O="build/generic-rk3568_defconfig"

I have acquired the MiniLoaderAll.bin via extracting the official update.img from the vendor.

# rkdeveloptool db MiniLoaderAll.bin
# rkdeveloptool wl 64 '~/u-boot/build/generic-rk3568_defconfig/u-boot-rockchip.bin'

- Then i have connected my USB-UART adapter to
BOARD PIN 8 (GND) -> USB UART PIN GND
BOARD PIN 10 (UART1_TX) -> USB UART PIN RX
BOARD PIN 12 (UART1_RX) -> USB UART PIN TX

- Started minicom:

# minicom -D /dev/ttyUSB0 -b 1500000

But i still don't get any output at all.

Any idea what iam i doing wrong here?

Best Regards,
-- ext

Jonas Karlman írta 2024. ápr.. 8, H-n 21:31 órakor:

Quoted 55 lines

Hi Z,

Quoted 6 lines · Mizsei Zoltán

Hi,

I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO RK3566 based SBC [1], but all my attempts have failed so far.

The SBC doesn't have any SD-Card slot, please keep this in mind!

Quoted 7 lines

I can build U-Boot, but when I write the resulting binary to the eMMC using rkdeveloptool, the boot stops and I see no output on the UART pins using 1500000 baud transfer rate.

My steps were the following:

- git clone https://github.com/u-boot/u-boot
- cd u-boot
- CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig

There is no rk3568_defconfig target but generic-rk3568_defconfig may work better.

Quoted 5 lines

- ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin' BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- make
- rkdeveloptool db MiniLoaderAll.bin
- rkdeveloptool wl 64 u-boot-rockchip.bin

After that I can no longer communicate with the board via UART and it no longer boots.

After looking at the specification for this board it looks like GPIO pin 8 and 10 is connected to uart1 and not uart2 that is typically used for debug uart on rockchip devices.

Quoted 5 lines

I've built uboot countless times, I've followed all sorts of guides, I've tried modifying FDT and transplanting the DTS from the official SDK, I have tried vanilla defconfigs and tried to modify them aswell, I think I've tried everything, but no matter what I do I just can't get it working. The vendored U-Boot works ok, but I plant to run OpenBSD, for which an upstream U-Boot would be better situated (according to the OBSD mailing list).

Please give me some hints because I'm running out of ideas. I've spent countless hours trying to get this to work but haven't succeeded.

You can try changing stdout-path to "serial1:1500000n8" and enable the uart1 node in generic-rk3568.dts.
Also change to CONFIG_DEBUG_UART_BASE=0xFE650000, and also use rkbin tools/ddrbin_tool and change to use uart1 on ddr bin.

After that you should probably start seeing something on uart and that may help you get a little bit further.

Regards,
Jonas

Quoted 8 lines

Thank You very much!

Best Regards,

--Z--

[1] https://www.geniatech.com/product/xpi-3566-zero/

Signature · 1 line
--Z--
#3 lore raw
In reply to Jonas Karlman

Hi,

I have managed to get output from the board using UART7 GPIO pins!
My USB-UART adapter is not reliable at 1.5M baud, therefore I had to reduce the baudrate.
However while I get output from the board, my inputs are silently ignored, eg. I can't type anything in the U-boot console. I suspect the &uart7m0_xfer is the issue but I can be wrong.

I have selected UART7, because UART1 is used by bluetooth, UART2 is not available on the GPIO pins (i found some RX/TX/GND marked testpads on the board, that might be that) and all other UARTs are muxed except UART7, so it seems to be a good alternative. My soldering skills are non-existent.

The pinout ( https://file.geniatech.com/download/xpi/XPI-3566-ZERO_Specification_V1.4_EN.pdf )shows the following:

PIN 36: UART7_RX_M2/ GPIO4_A3_d
PIN 37: UART7_TX_M2/ GPIO4_A2_d

Therefore I have tried to add

&uart7m2_xfer {
        bootph-all;
};

to rk356x-u-boot.dtsi but it didn't made any difference. I probably miss some tiny details somewhere, but I can't seem to find it.

I would greatly appreciate any help.

Thank You!

My current patchset:

--- a/arch/arm/dts/rk3568-generic.dts
+++ b/arch/arm/dts/rk3568-generic.dts
- stdout-path = "serial2:1500000n8";
+ stdout-path = "serial7:112500n8";

(....)

-&uart2 {

+&uart7 {
        status = "okay";
arch/arm/dts/rk356x-u-boot.dtsi +2 -2
@@ -161,12 +161,12 @@
        u-boot,spl-sfc-no-dma;
 };
 
-&uart2 {
+&uart7 {
        bootph-all;
        clock-frequency = <24000000>;
 };
 
-&uart2m0_xfer {
+&uart7m2_xfer {
        bootph-all;
 };
 
configs/generic-rk3568_defconfig +2 -2
@@ -9,7 +9,8 @@ CONFIG_ROCKCHIP_SPI_IMAGE=y
-CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_BASE=0xfe6b0000
-CONFIG_BAUDRATE=1500000
+CONFIG_BAUDRATE=112500
 

I get the following output:

U-Boot SPL 2025.04-rc2-g9b35357b95e3-dirty (Feb 15 2025 - 18:46:05 +0000) Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
## Checking hash(es) for Image atf-4 ... sha256+ OK
## Checking hash(es) for Image atf-5 ... sha256+ OK
## Checking hash(es) for Image atf-6 ... sha256+ OK

INFO:    Preloader serial: 7                                                            
NOTICE:  BL31: v2.3():v2.3-645-g8cea6ab0b:cl, fwver: v1.44                              
NOTICE:  BL31: Built : 16:36:43, Sep 19 2023                                            
INFO:    GICv3 without legacy support detected.                                         
INFO:    ARM GICv3 driver initialized in EL3                                            
INFO:    pmu v1 is valid 220114                                                         
INFO:    l3 cache partition cfg-0                                                       
INFO:    dfs DDR fsp_param[0].freq_mhz= 920MHz                                          
INFO:    dfs DDR fsp_param[1].freq_mhz= 324MHz                                          
INFO:    dfs DDR fsp_param[2].freq_mhz= 528MHz                                          
INFO:    dfs DDR fsp_param[3].freq_mhz= 780MHz                                          
INFO:    Using opteed sec cpu_context!                                                  
INFO:    boot cpu mask: 0                                                               
INFO:    BL31: Initializing runtime services                                            
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0xa00000
INFO:    SPSR = 0x3c9

U-Boot 2025.04-rc2-g9b35357b95e3-dirty (Feb 15 2025 - 18:46:05 +0000)

Model: Generic RK3566/RK3568
SoC:   RK3566
DRAM:  2 GiB
Core:  249 devices, 23 uclasses, devicetree: separate
MMC:   mmc@fe2b0000: 1, mmc@fe310000: 0
Loading Environment from nowhere... OK
In:    serial@fe6b0000
Out:   serial@fe6b0000
Err:   serial@fe6b0000
Hit any key to stop autoboot:  0 
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------  ----------------

Scanning global bootmeth 'efi_mgr':
Card did not respond to voltage select! : -110
Cannot persist EFI variables without system partition
Missing RNG device for EFI_RNG_PROTOCOL
0 efi_mgr ready (none) 0 <NULL>
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'mmc 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)
Scanning bootdev '[email protected]':
Card did not respond to voltage select! : -110
Scanning bootdev '[email protected]':
Unknown uclass 'nvme' in label
Unknown uclass 'scsi' in label
Unknown uclass 'pxe' in label
Unknown uclass 'dhcp' in label
No more bootdevs
--- ----------- ------ -------- ---- ------------------------ ---------------- (1 bootflow, 1 valid)
=>

Quoted 50 lines · On Mon, 8 Apr 2024 21:31:28 +0200 Jonas Karlman <[email protected]> wrote:

Hi Z,

Quoted 6 lines · Mizsei Zoltán

Hi,

I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO RK3566 based SBC [1], but all my attempts have failed so far.

The SBC doesn't have any SD-Card slot, please keep this in mind!

Quoted 7 lines

I can build U-Boot, but when I write the resulting binary to the eMMC using rkdeveloptool, the boot stops and I see no output on the UART pins using 1500000 baud transfer rate.

My steps were the following:

- git clone https://github.com/u-boot/u-boot
- cd u-boot
- CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig

There is no rk3568_defconfig target but generic-rk3568_defconfig may work better.

Quoted 5 lines

- ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin' BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- make
- rkdeveloptool db MiniLoaderAll.bin
- rkdeveloptool wl 64 u-boot-rockchip.bin

After that I can no longer communicate with the board via UART and it no longer boots.

After looking at the specification for this board it looks like GPIO pin 8 and 10 is connected to uart1 and not uart2 that is typically used for debug uart on rockchip devices.

Quoted 5 lines

I've built uboot countless times, I've followed all sorts of guides, I've tried modifying FDT and transplanting the DTS from the official SDK, I have tried vanilla defconfigs and tried to modify them aswell, I think I've tried everything, but no matter what I do I just can't get it working. The vendored U-Boot works ok, but I plant to run OpenBSD, for which an upstream U-Boot would be better situated (according to the OBSD mailing list).

Please give me some hints because I'm running out of ideas. I've spent countless hours trying to get this to work but haven't succeeded.

You can try changing stdout-path to "serial1:1500000n8" and enable the uart1 node in generic-rk3568.dts. Also change to CONFIG_DEBUG_UART_BASE=0xFE650000, and also use rkbin tools/ddrbin_tool and change to use uart1 on ddr bin.

After that you should probably start seeing something on uart and that may help you get a little bit further.

Regards,
Jonas

Quoted 8 lines

Thank You very much!

Best Regards,

--Z--

[1] https://www.geniatech.com/product/xpi-3566-zero/

Signature · 1 line
MIZSEI Zoltán <[email protected]>