Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image | Radxa ZERO 3 #7024

Closed
SelfhostedPro opened this issue Apr 16, 2024 · 72 comments · Fixed by #7033 or #7042
Closed

Image | Radxa ZERO 3 #7024

SelfhostedPro opened this issue Apr 16, 2024 · 72 comments · Fixed by #7033 or #7042
Milestone

Comments

@SelfhostedPro
Copy link

Creating an image request

Formal device information

Is the SBC officially supported by the Debian installer?

  • It appears to but with some caviats described in the image download url

If not, is a reliable 3rd party Debian image available for this SBC?

  • ...

If not, are there install instructions for Debian available?

Here are the official instructions for installing an OS: https://docs.radxa.com/en/zero/zero3/getting-started/install-os

@SelfhostedPro
Copy link
Author

Also, I am happy to get a board for whoever needs it to test. Just reach out to me on discord or email and ping me here. @SelfhostedPro on discord and my email is on my profile.

@SelfhostedPro
Copy link
Author

I've been working on building this myself but have been running into the following issue and am not fully sure why/how to resolve it:

[  OK  ] DietPi-Imager | Creating minified image from:
- Image: build/output/images/Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img
- Root device: /dev/loop3p2
- Via dd to DietPi_RadxaZero3-server-bookworm-vendor.img
- With intermediate mounting turned Off
[ INFO ] DietPi-Imager | GPT partition table detected, moving GPT backup partition table to end of drive...
[ INFO ] DietPi-Imager | Checking for required APT packages: gdisk
[ INFO ] DietPi-Imager | sgdisk -e /dev/loop3, please wait...

Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.
[FAILED] DietPi-Imager | sgdisk -e /dev/loop3

https://github.com/SelfhostedPro/radxa-zero3w/actions/runs/8768056685/job/24062001873#step:10:37

I'm building out some actions to clone/build armbian as well as diet pi. I also run into this same issue trying to build with imager on my pi5.

@MichaIng
Copy link
Owner

MichaIng commented Apr 20, 2024

Seems the image was cut after the partition table was generated, so that the secondary/backup partition table was cut off. A little unclean, but it is a backup partition table only. We assure it is present and at the right position since it otherwise throws warnings whenever touching the partition table. But probably those can be ignored, as we do the same after everything has been done, so the final image will have the backup partition table present and correctly located in any case.

Can you try this version of the script: https://raw.githubusercontent.com/MichaIng/DietPi/imager/.build/images/dietpi-imager
Would be interesting to know whether you see additional warnings by some of the commands, especially sfdisk.

@SelfhostedPro
Copy link
Author

SelfhostedPro commented Apr 20, 2024

I believe that's the version I'm using here: https://github.com/SelfhostedPro/radxa-zero3w/blob/98020929a55d62b304dc053b6a40d72ca6a1ce6f/.github/workflows/armbian_custom.yml#L153
(unless you meant to recommend one other than what's in the master branch of your repo)

I'm also going to try to have armbian use mbr for the partition table and see if that helps. edit: armbian seems to ignore me passing through the IMAGE_PARTITION_TABLE variable so I guess I won't.

Here is the action if you're curious of the context:
https://github.com/SelfhostedPro/radxa-zero3w/blob/98020929a55d62b304dc053b6a40d72ca6a1ce6f/.github/workflows/armbian_custom.yml

The dietpi side of things is currently here:
https://github.com/SelfhostedPro/radxa-zero3w/blob/98020929a55d62b304dc053b6a40d72ca6a1ce6f/.github/workflows/armbian_custom.yml#L142-L153

@SelfhostedPro
Copy link
Author

Ah, latest one got much further but runs into the same error: https://github.com/SelfhostedPro/radxa-zero3w/actions/runs/8768856129/job/24063717270#step:11:192

@SelfhostedPro
Copy link
Author

SelfhostedPro commented Apr 21, 2024

I've tried a few variations of options but am still running into similar errors.

https://github.com/SelfhostedPro/radxa-zero3w/actions/workflows/armbian_custom.yml

These are the actions. Arabian builds fine but still having the same issue with the diet-pi imager.

Would you be opposed to me rewriting it in python? Feel like it has enough functionality that it would be beneficial to have the debugging features and readability.

@MichaIng
Copy link
Owner

Ah, I didn't know that workflow. Please try to replace master with imager branch here: https://github.com/SelfhostedPro/radxa-zero3w/blob/98020929a55d62b304dc053b6a40d72ca6a1ce6f/.github/workflows/armbian_custom.yml#L153

An alternative would be indeed to use MBR instead of GPT partition table, but there are bootloader builds which do not support MBR, so it might then fail to boot. A matter of testing.

@SelfhostedPro
Copy link
Author

Hey, sorry. I have tried that in my latest runs and it got further than with master but still fails:

https://github.com/SelfhostedPro/radxa-zero3w/blob/main/.github/workflows/armbian_custom.yml

https://github.com/SelfhostedPro/radxa-zero3w/actions/runs/8770310869/job/24066758618#step:11:169

(Also tried messing around the dos partition variables).

@MichaIng
Copy link
Owner

MichaIng commented Apr 21, 2024

Ah I see, this is on the final sgdisk call now, which we definitely want to keep:

Warning! Disk size is smaller than the main header indicates!
...
Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.

I wonder whether the partition table is (much!) larger than the 34 sectors we expect. This is the default, covering 128 partition entries: https://en.wikipedia.org/wiki/GUID_Partition_Table
The last line however seems to indicate that the table covers more than 8056 entries. Each entry has 128 bytes. Hence this would be 8056*128=1031168 bytes, which is exactly 1031168/512=2014 sectors, surely meant by "blocks" in the second last line. This partition table hence is sized to cover 8184 entries, for whatever reason. Since the error message with the original dietpi-imager was the same, where sfdisk did not touch the partition table yet, the Armbian image itself comes with this GPT size, and sfdisk does not change it but keeps what is given (reasonably).

I see no evidence in the Armbian scripts that a non-default partition table size is used: https://github.com/armbian/build/blob/main/lib/functions/image/partitioning.sh
Do you add any customisations which could lead to this?

I wonder whether there is a way to read the GPT size (number of possible entries). gdisk at least has a command s to resize it, also indicated in the error message, but I cannot find such for sgdisk, sfdisk or parted, hence it is not nice (but possible) to script this: https://manpages.debian.org/bookworm/gdisk/gdisk.8.en.html#s~2

@SelfhostedPro
Copy link
Author

This is the commit that added board support to Armbian:

https://github.com/armbian/build/blob/main/config/boards/radxa-zero3.wip

This is the command I'm using for the build: https://github.com/SelfhostedPro/radxa-zero3w/blob/acd31e2c4b010296a3ccf5e3af4819a6eca6dd36/.github/workflows/armbian_custom.yml#L108

I don't think anything would modify the partition tables from standard from looking though.

@MichaIng
Copy link
Owner

MichaIng commented Apr 21, 2024

Looks all good, nothing which should affect the partition table size generated on the fresh loop device for image generation. It is too late for today here, but I'll add the gdisk command to our script tomorrow, to resize the GPT to 128 entries, right before moving the backup partition table. I hope I also find a way to print that size instead, so we could also keep it and adjust the image size accordingly. Though, reading through the sgdisk man page, which supports 128 entries only, any other size can cause issues with other programs as well, so it might have some benefit to enforce 128.

Makes sense to test a recent official Armbian image as well, whether it has the same GPT size.

@SelfhostedPro
Copy link
Author

Sounds good. Have a good night and I appreciate your help with this!

@MichaIng
Copy link
Owner

MichaIng commented Apr 21, 2024

I played with this image, too curious:

root@dietpi:/tmp# sgdisk -p Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img
Disk Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img: 5185536 sectors, 2.5 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 8FE29520-29EE-AB4D-B92F-A6C93E1B2D6F
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 5185502
Partitions will be aligned on 2048-sector boundaries
Total free space is 30720 sectors (15.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           32768          557055   256.0 MiB   EA00  bootfs
   2          557056         5185502   2.2 GiB     8300  rootfs
root@dietpi:/tmp# sgdisk -e Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img

Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.
root@dietpi:/tmp# ls -l Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img
-rw-r--r-- 1 root root 2654994432 Apr 21 23:05 Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img
2024-04-22 00:43:41 root@dietpi:/tmp# gdisk Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): x

Expert command (? for help): s
Current partition table size is 128.
Enter new size (4 up, default 128): 128

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
root@dietpi:/tmp# sgdisk -e Armbian-unofficial_24.5.0-trunk.434_Radxa-zero3_bookworm_vendor_6.1.43.img

Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.
root@dietpi:/tmp#

This is so weird: The GPT table has the expected 128 entries size. With the end of the last partition, the required image size is hence 2.654.994.432 bytes, which is exactly (to the exact byte) the size of the image file. So it is exactly as we expect, the last partition is expanded (by Armbian script auto-sizing of last partition) exactly to leave the last 34 sectors free for the backup partition table. And still, even after resetting the size and rewriting the table, it still shows this weird error about the overlap. I do not wonder whether this is a bug in sgdisk, since neither sfdisk, fdisk, gdisk or parted show any error when printing or writing the partition table. However, I did just generated another new image successfully today, which is sized the exact same way, and above sgdisk version is 1.0.10 while Ubuntu Jammy (GitHub Actions runner) is 1.0.8, hence this would not be a recent bug and it would still affect specific images only.

One thing to check is whether the bootloader is probably flashed a way that it is interpreted by sgdisk as part of the GPT. That ~1 MiB size is at least within the range of U-Boot images/binaries.

@SelfhostedPro
Copy link
Author

SelfhostedPro commented Apr 21, 2024

Would there be an alternative command to sgdisk that we could utilize? Or something I could run in the armbian customization process to enable another command to use if it is an error? I’ll be able to mess with the image file some tomorrow to see if I can find a workaround.

How would I go about checking that the bootloader is flashed that way?

@SelfhostedPro
Copy link
Author

Also, just wanting to link the pr in armbian that added support: armbian/build#6420

@disablewong
Copy link

em.... it seems there is a problem with the image creation script, I am not sure if it is similar to my previous case with Orangepi 3B.
The problem gone after I switched to different base image with newer kernel version with different partition table structure.

https://dietpi.com/forum/t/failure-in-creating-image-through-imager-script/18035

@SelfhostedPro
Copy link
Author

It looks like someone had success using the official radxa image here: https://forum.radxa.com/t/share-of-unofficial-dietpi-image-for-radxa-zero-3w/20430/5

@MichaIng
Copy link
Owner

Interesting, @disablewong I did not remember your identical report from last year. I just tested the community maintained Orange Pi 3B image, and it is the same: https://github.com/armbian/community/releases/download/24.5.0-trunk.433/Armbian_community_24.5.0-trunk.433_Orangepi3b_bookworm_vendor_6.1.43_minimal.img.xz

root@dietpi:/tmp# sgdisk -e Armbian_community_24.5.0-trunk.433_Orangepi3b_bookworm_vendor_6.1.43_minimal.img

Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.

Same with officially supported Orange Pi 5 image, so all Armbian images with GPT partition table are affected. I am just not sure why, since our own GPT images go through it fine, and the partition table definitely has the default 128 entries and GPT overall 34 sectors size. The Armbian scripts seem to do something on their partitioning which makes sgdisk think it would be 2048 sectors or 1 MiB. Strangely, when using the tool to print the partition table, it as well says 34 sectors:

root@dietpi:/tmp# sgdisk -p Armbian_24.2.1_Orangepi5_jammy_legacy_5.10.160_minimal.img
Disk Armbian_24.2.1_Orangepi5_jammy_legacy_5.10.160_minimal.img: 3203072 sectors, 1.5 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 1718C59C-EE29-C949-AA5C-4CC4048AC17C
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 3203038
Partitions will be aligned on 2048-sector boundaries
Total free space is 30720 sectors (15.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           32768          557055   256.0 MiB   EA00  bootfs
   2          557056         3203038   1.3 GiB     8300  rootfs

This caught my eyes:

First usable sector is 2048, last usable sector is 3203038
Partitions will be aligned on 2048-sector boundaries

Let's compare with our image:

root@dietpi:/tmp# sgdisk -p DietPi_OrangePi5-ARMv8-Bookworm.img
Disk DietPi_OrangePi5-ARMv8-Bookworm.img: 2097185 sectors, 1024.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 75DABD45-859D-4B22-BC6C-615235F05849
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 2097151
Partitions will be aligned on 2048-sector boundaries
Total free space is 32734 sectors (16.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           32768         2095103   1007.0 MiB  8300  root
   2         2095104         2097151   1024.0 KiB  0700

The partitions in our case are 2048 sectors aligned as well, but in case of Armbian, this seems to apply for the GPT as well. And there it is: https://manpages.debian.org/bookworm/fdisk/sfdisk.8.en.html#Header_lines

first-lba

Specify the first usable sector for GPT partitions.

And fdisk/sfdisk use 2048 by default:

root@dietpi:/tmp# fdisk DietPi_OrangePi5-ARMv8-Bookworm.img
Command (m for help): g
Created a new GPT disklabel (GUID: 1D1C8CDB-7107-4CED-9993-337EB5552081).
Command (m for help): w
The partition table has been altered.
Syncing disks.
root@dietpi:/tmp# sgdisk -p DietPi_OrangePi5-ARMv8-Bookworm.img
Disk DietPi_OrangePi5-ARMv8-Bookworm.img: 2097185 sectors, 1024.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 1D1C8CDB-7107-4CED-9993-337EB5552081
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 2097151
Partitions will be aligned on 2048-sector boundaries
Total free space is 2095104 sectors (1023.0 MiB)
root@dietpi:/tmp# sfdisk DietPi_OrangePi5-ARMv8-Bookworm.img -N1 <<< ',+'
root@dietpi:/tmp# truncate -s $(( (2095103+34) * 512 )) DietPi_OrangePi5-ARMv8-Bookworm.img
root@dietpi:/tmp# sgdisk -e DietPi_OrangePi5-ARMv8-Bookworm.img
...
Warning! Secondary partition table overlaps the last partition by
2014 blocks!
Try reducing the partition table size by 8056 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.

So this is how to obtain the value:

root@dietpi:/tmp# sgdisk -p DietPi_OrangePi5-ARMv8-Bookworm.img 2>&1 | mawk -F[\ ,] '/^First usable sector/{print $5}'
2048

@MichaIng
Copy link
Owner

MichaIng commented Apr 22, 2024

I updated dietpi-imager on the imager branch. @SelfhostedPro can you just rerun your workflow?

Glad to have finally found the underlying reason. Though sgdisk shows a pretty misleading error, suggesting to reduce the number of GPT entries, while the actual reason is the first LBA, which is not necessarily related to the number of entries, definitely not for partition tables generated with fdisk.

For reference: https://sourceforge.net/p/gptfdisk/discussion/939590/thread/da2435b5a8/

@MichaIng MichaIng linked a pull request Apr 22, 2024 that will close this issue
@MichaIng
Copy link
Owner

Ah my fault, copy&paste error. Now it should work.

@MichaIng
Copy link
Owner

@SelfhostedPro
Copy link
Author

Yeah! It went through!
I'll go ahead and test it out on my zero 3 w once this next run finishes (provided it uploads the artifacts correctly).

@MichaIng
Copy link
Owner

Okay, I merged it into dev branch, which you can now use in the workflow instead. Once DietPi v9.4 has been released (planned for Mai 10th), you can switch back to master.

@MichaIng MichaIng linked a pull request Apr 25, 2024 that will close this issue
@MichaIng MichaIng changed the title Radxa Zero 3 W Support Image | Radxa ZERO 3 Apr 25, 2024
@SelfhostedPro
Copy link
Author

Hey, as a note. For at least the imager branch I'm using it doesn't create a separate boot partition with config files in it even with ADD_DOS_PART: 1 and CONFIGS_TO_BOOT: 1 set. Is there a good way to go about doing that?

I'll go ahead and change to dev in the meantime, thanks! Got to mess with it a bit today and it boots which is cool.

@MichaIng
Copy link
Owner

I am about to add native support for this device: #7042

Here a first image to test: https://dietpi.com/downloads/images/testing/DietPi_RadxaZERO3-ARMv8-Bookworm.img.xz
Since is uses stable DietPi code instead of dev, it is detected as "Generic device" (e.g. in login banner), so this is just to see whether it generally boots and hardware features are available as intended.

So instead of converting an Armbian image, you could then also use our build script: https://github.com/MichaIng/DietPi/blob/newimages/.build/images/dietpi-build

Please use only ADD_DOS_PART. CONFIGS_TO_BOOT overrides the first and is only required for those new RPi images, where a FAT boot partition already exists, but is not mounted to /boot, but /boot/firmware.

Ah, and the script actually sets those to 0 and only enables them internally when passing the related CLI argument --add-dos-part resp. --configs-to-boot. At some point I wanted to move to explicit CLI args only, since env vars can overlap and be theoretically present without knowledge. However, I see the benefit of using env vars in GitHub workflows, easier to manage there than CLI args. So I can change the script to accept those env vars.

@MichaIng
Copy link
Owner

MichaIng commented May 1, 2024

Great!

I'm also building a Trixie image now, as this is currently possible. But again, I am 99.99% sure that is has no effect on GPU/display driver issues, Radxa simply will have more differences between their images, than the Debian userland version alone. Also, while builds go currently through, on my Trixie systems, I still face a lot of errors coming and going due to 64-bit time_t transition, i.e. one or more packages are hold back due to dependency conflicts. Running forces full-upgrade, result in unwanted purged packages to resolve those conflicts, which can potentially result in a broken system on/after first boot of DietPi.

Hence, I strongly recommend to not use Trixie for any production case for the next month(s), until time_t transition has fully finished. But of course, it does not hurt to test/verify whether the Bookworm system really has no GPU/display issue, which the Trixie system does not have.

@MichaIng
Copy link
Owner

MichaIng commented May 2, 2024

So, since the wrong device tree was the reason (indeed I just found that Radxa's kernel sources provide that one, while Armbian's kernel sources do not, but their default DTS matches the AIC8800 one from Radxa), probably it works actually well with Linux 6.1, when defining the device tree explicitly. I'll recreate an image with that: https://github.com/MichaIng/DietPi/actions/runs/8924902271

Will be available again here: https://dietpi.com/downloads/images/testing/
With _Linux6.1 suffix.

EDIT: Okay, the Linux 6.1 image seems to have no HDMI output and throws mali/panfrost kernel errors with stack trace at reboot. Hence for now we'll stick with legacy Linux 5.10 kernel, and will generate Linux 6.1 kernel packages by times, or in case we see some related commit at Armbian or Radxa (who did not add ZERO 3 support to their 6.1 branch either).

@disablewong
Copy link

em.... it sound strange to me.... my board can use HDMI with kernel 6.1.43....
IMG_20240503_145211

The current problem is the wifi was not detected during the first boot, it only show up after rebooting...
IMG_20240503_150206

@MichaIng
Copy link
Owner

MichaIng commented May 3, 2024

Interesting, when testing the Radxa ZERO 3E with @StephanStS, it did not work, but worked when just placing the SD card with 5.10 build. Not sure whether 3E and 3W have some other differences in this regards?

Does WiFi not work on any cold boot, or is it only missing on the very first boot? And does it work immediately with the 5.10 image? And when it is missing, does the kernel log dmesg contain any hints?

I was looking through Armbian implementation. Strange is, regarding the device tree, that U-Boot is configured to select the correct one:

Confusing why it was still trying to load rk3566-radxa-zero-3w-aic8800ds2.dtb. Probably there is some code in the bootloader which changes the variable, depending on the actually detected WiFi chip. And the problem is that Armbian replaced the default device tree with the AIC8800 one, and removed that dedicated one from the kernel. However, it does not hurt to have the intended one defined in /boot/dietpiEnv.txt. The option being revealed indirectly points to other device trees, like the AP6212 related one.

The bigger problem now is, that the ZERO 3W comes with two different onboard WiFi chips: AP6212 and AIC8800. In our images/with Armbian kernel, the default supports AIC8800. AP6212 requires a switch to the rk3566-radxa-zero3-ap6212.dtb device tree.

I mixed it up, ignore ... , but according to your [forum](https://dietpi.com/forum/t/share-of-unofficial-dietpi-radxa-zero-3w/18661/46?u=michaing) post, AIC8800 requires additional firmware. AP6212 requires a switch to the `rk3566-radxa-zero3-ap6212.dtb` device tree, but the firmware seems to be present OOTB: https://github.com/armbian/firmware/tree/master/ap6212 Strange is, that there are several AIC8800 firmware blobs as well: https://github.com/armbian/firmware/tree/master/aic8800 ![image](https://github.com/MichaIng/DietPi/assets/28480705/230fb88b-86e9-4074-aef1-29a384143056)

@disablewong which files were missing? Probably they are only at a wrong path. dmesg should reveal where the driver is looking for (and does not find) the firmware.

EDIT: Ah, I mixed it up: You required additional firmware for AP6212, not AIC8800. And of course, the converted Radxa Debian image does not contain armbian-firmware, but likely some Radxa-specific package, which was removed by the installer. So I guess with out image(s), firmware for both variants is present, and only the device tree needs to be switched.

_________

And, I hope there is a way to detect the used WiFi chip e.g. via board revision/serial number:

cat /proc/device-tree/serial-number

@msanaullahsahar
Copy link

msanaullahsahar commented May 3, 2024

The output of this command cat /proc/device-tree/serial-number is e360f71969ed8035. So, what kind of Wi-Fi chip my ZERO 3W has? Also what image do you want me to test? This DietPi_RadxaZERO3-ARMv8-Bookworm.img.xz or this: DietPi_RadxaZERO3-ARMv8-Bookworm_Linux6.1.img.xz.

@MichaIng
Copy link
Owner

MichaIng commented May 3, 2024

I hope that the serial number follows some pattern to differentiate between the revisions. So far it does not like it does, but let's see how those of the others look like.

Would be good if you could test both images. Especially check whether WiFi works, i.e. whether the adapter shows up in ip l, and dmesg should reveal which WiFi chip is used.

@MichaIng
Copy link
Owner

MichaIng commented May 4, 2024

Found the code which overrides the device tree based some hardware ID ranges: https://github.com/radxa/u-boot/pull/45/files

We can do the following in our /boot/boot.scr:

  • If fdtfile is rockchip/rk3566-radxa-zero-3w-aic8800ds2.dtb, change it to rockchip/rk3566-radxa-zero-3.dtb.
  • If fdtfile is rockchip/rk3566-radxa-zero-3e.dtb, change it to rockchip/rk3566-radxa-zero-3.dtb as well, since the Armbian kernel has no dedicated 3E variant one. That could actually be related to the HDMI issue with the 6.1 kernel.
  • If fdtfile is rockchip/rk3566-radxa-zero-3w-ap6212.dtb, change it to rockchip/rk3566-radxa-zero3-ap6212.dtb.
  • Read dietpiEnv.txt afterwards, so users can always override it.

👍.

@disablewong
Copy link

disablewong commented May 4, 2024

I hope that the serial number follows some pattern to differentiate between the revisions. So far it does not like it does, but let's see how those of the others look like.

Would be good if you could test both images. Especially check whether WiFi works, i.e. whether the adapter shows up in ip l, and dmesg should reveal which WiFi chip is used.

The wifi in my case show-up in both ip l and dietpi-config.
For the the serial number cat /proc/device-tree/serial-number, it returns 40a812228830f789

In my opinion, I would give compatibility with ap6212 a lower priority, cause this batch of board should be in small quantity (~500 pcs), and will not be produced again as I learnt from Radxa.

Now it is in Labor's Day holidays in China and they would return to work next week.
Maybe I can help request some support from Radxa if needed.

@MichaIng
Copy link
Owner

MichaIng commented May 6, 2024

Thanks, this basically verifies that Armbian did no wrong decision to make the AIC8800 device tree the default. Instead of checking and adjusting fdtfile in the U-Boot script, much better is to patch the Radxa U-Boot sources (via Armbian build patch system) to use the dtb's from Armbian kernel.

I'll implement this tomorrow. Even if the batch is small, it is sufficiently simple to keep supporting the boards of those early adopters. So far, no need for help from Radxa, as the code is self-explaining, but thanks for the offer to ask 🙂.

@MichaIng
Copy link
Owner

Totally forgot about the U-Boot patch. Done now: MichaIng/build@084efdc
Please test everyone on all Radxa ZERO 3W/3E variants you have with AIC8800 and AP6212 onboard WiFi chip:

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-u-boot-radxa-zero3-legacy.deb
dpkg -i linux-u-boot-radxa-zero3-legacy.deb
/boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc
sed -i '/^[[:blank:]]*fdtfile=/s/^/#/' /boot/dietpiEnv.txt
reboot

If it does not boot anymore, still trying to load the wrong device tree, the revert the change in /boot/dietpiEnv.txt, i.e. uncomment the fdtfile= line again. But based on the serial console output we saw, the patched code should be pretty much the relevant one here.

@MichaIng
Copy link
Owner

Is anyone able to test the above? So I can merge those builds into our APT repo.

@disablewong
Copy link

yes Michalng, thanks for the hard works.
I would test it today and report here.

@disablewong
Copy link

I've tested the image, with some strange output at a glance.
I summarize the findings as below for your investigation.

  1. UART debug port with some funny outputs, like
[   18.483035] mpp_rkvenc fdf40000.rkvenc: Failed to get leakage
[   18.483093] mpp_rkvenc fdf40000.rkvenc: pvtm = 87560, from nvmem
[   18.483112] mpp_rkvenc fdf40000.rkvenc: pvtm-volt-sel=1
[   18.483292] mpp_rkvenc fdf40000.rkvenc: avs=0
[   18.483419] mpp_rkvenc fdf40000.rkvenc: failed to find power_model node
[   18.483435] mpp_rkvenc fdf40000.rkvenc: failed to initialize power model
[   18.483447] mpp_rkvenc fdf40000.rkvenc: failed to get dynamic-coefficient
[   18.484034] mpp_rkvenc fdf40000.rkvenc: probing finish
[   18.484502] mpp_rkvdec2 fdf80200.rkvdec: Adding to iommu group 5
[   18.484745] mpp_rkvdec2 fdf80200.rkvdec: rkvdec, probing start
[   18.485080] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_a is not found!
[   18.485097] rkvdec2_init:1022: No niu aclk reset resource define
[   18.485111] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_h is not found!
[   18.485123] rkvdec2_init:1025: No niu hclk reset resource define
[   18.485425] mpp_rkvdec2 fd▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒?▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒?▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  1. HDMI out works
  2. First boot take long time as it presume I have ethernet (radxa 3E?)
  3. Wifi is not detected (I am on AP6212 chip)

The image I've tested was Trixie, kernel version was 5.10.xx

@MichaIng
Copy link
Owner

First boot take long time as it presume I have ethernet (radxa 3E?)

The device tree supports both: ZERO 3W and ZERO 3E. But it should not take longer to boot because of this. First boot takes long because DietPi is doing some first boot setup stuff: https://github.com/MichaIng/DietPi/blob/master/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash

Hmm, how to find out which device tree was picked. Can you check this:

find /proc/device-tree -name 'wireless[-_]wlan'

It should return a directory. If so, that should contain a file named wifi_chip_type. Can you check its content?

Alternative:

sed -i '/^setenv bootargs/s/"$/ fdtfile=${fdtfile}"/' /boot/boot.cmd
mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr

Then, after reboot, you can read back the variable via

cat /proc/cmdline

@MichaIng
Copy link
Owner

MichaIng commented Jun 2, 2024

@StephanStS
When you find time, could you test whether the automatic device tree choice works in your case, with the new U-Boot build?

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-u-boot-radxa-zero3-legacy.deb
dpkg -i linux-u-boot-radxa-zero3-legacy.deb
/boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc
sed -i '/^[[:blank:]]*fdtfile=/s/^/#/' /boot/dietpiEnv.txt
reboot

@StephanStS
Copy link
Collaborator

@StephanStS When you find time, could you test whether the automatic device tree choice works in your case, with the new U-Boot build?

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-u-boot-radxa-zero3-legacy.deb
dpkg -i linux-u-boot-radxa-zero3-legacy.deb
/boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc
sed -i '/^[[:blank:]]*fdtfile=/s/^/#/' /boot/dietpiEnv.txt
reboot

I used the image from there for my Radxa ZERO 3E: https://dietpi.com/downloads/images/DietPi_RadxaZERO3-ARMv8-Bookworm.img.xz and executed the commands given.

The boot process failed (no output on HDMI).
The serial console gives this output:

U-Boot 2024.01-armbian (May 13 2024 - 16:10:34 +0000)

Model: Radxa ZERO 3
DRAM:  2 GiB
PMIC:  RK8170 (on=0x40, off=0x00)
fan53555_probe: FAN53555 option 8 rev 1 detected
fan53555_rk860_calibration>>>>>>hardware have rk860-0, reg[0x0e] = 0x4
fan53555_rk860_calibration>>>>>>hardware do not have rk860-1
fan53555_rk860_calibration>>>>>rk860_type = 1
Core:  310 devices, 29 uclasses, devicetree: separate
MMC:   mmc@fe2b0000: 1, mmc@fe2c0000: 2, mmc@fe310000: 0
Loading Environment from nowhere... OK
Override default fdtfile to rockchip/rk3566-radxa-zero-3.dtb
In:    serial@fe660000
Out:   serial@fe660000
Err:   serial@fe660000
Model: Radxa ZERO 3
Net:   No ethernet found.
starting USB...
Bus usb@fd000000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@fd800000: USB EHCI 1.00
Bus usb@fd840000: USB OHCI 1.0
Bus usb@fd880000: USB EHCI 1.00
Bus usb@fd8c0000: USB OHCI 1.0
scanning bus usb@fd000000 for devices... 1 USB Device(s) found
scanning bus usb@fd800000 for devices... 1 USB Device(s) found
scanning bus usb@fd840000 for devices... ERROR:  USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
not provide a handshake (OUT) (5)
ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
not provide a handshake (OUT) (5)
unable to get device descriptor (error=-1)
1 USB Device(s) found
scanning bus usb@fd880000 for devices... 1 USB Device(s) found
scanning bus usb@fd8c0000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit Ctrl+C key in 0 seconds to stop autoboot...
** Booting bootflow 'mmc@fe2b0000.bootdev.part_1' with script
368 bytes read in 5 ms (71.3 KiB/s)
35054080 bytes read in 3317 ms (10.1 MiB/s)
7503065 bytes read in 717 ms (10 MiB/s)
Failed to load '/boot/dtb/rockchip/rk3566-radxa-zero-3.dtb'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Moving Image from 0x2080000 to 0x2200000, end=4420000
## Loading init Ramdisk from Legacy Image at 0a200000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    7503001 Bytes = 7.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Boot failed (err=-14)
Card did not respond to voltage select! : -110
scanning bus for devices...
No ethernet found.
No ethernet found.
## Error: "distro_bootcmd" not defined
Boot failed. Reset in 3 seconds...
resetting ...
DDR Version V1.10 20210810
ln
ddrconfig:0
LP4 MR14:0x4d
LPDDR4, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=2048MB
tdqss: cs0 dqs0: 434ps, dqs1: 313ps, dqs2: 361ps, dqs3: 313ps,

change to: 324MHz
PHY drv:clk:38,ca:38,DQ:30,odt:0
vrefinner:41%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 528MHz
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x6e

change to: 780MHz
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 1056MHz(final freq)
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:29%
dram drv:40,odt:80
vref_ca:00000068
clk skew:0x2c
cs 0:
the read training result:
DQS0:0x3b, DQS1:0x38, DQS2:0x3a, DQS3:0x3c,
min  : 0xd  0xf  0xf  0xd  0x4  0x5  0xa  0x1 , 0x6  0x5  0x3  0x2  0x8  0xa 0x10  0x8 ,
       0x5  0x3  0x4  0x5  0x3  0x4  0x4  0x5 , 0x4  0x5  0x8  0x1  0x6  0x9  0x5  0x4 ,
mid  :0x29 0x2b 0x2b 0x29 0x20 0x21 0x26 0x1e ,0x22 0x21 0x1f 0x1d 0x25 0x25 0x2b 0x24 ,
      0x21 0x22 0x20 0x23 0x20 0x21 0x22 0x22 ,0x22 0x23 0x26 0x1f 0x24 0x26 0x22 0x20 ,
max  :0x46 0x47 0x48 0x45 0x3c 0x3e 0x43 0x3b ,0x3e 0x3e 0x3b 0x39 0x43 0x41 0x47 0x41 ,
      0x3e 0x41 0x3d 0x41 0x3e 0x3e 0x40 0x3f ,0x41 0x42 0x44 0x3e 0x42 0x44 0x40 0x3d ,
range:0x39 0x38 0x39 0x38 0x38 0x39 0x39 0x3a ,0x38 0x39 0x38 0x37 0x3b 0x37 0x37 0x39 ,
      0x39 0x3e 0x39 0x3c 0x3b 0x3a 0x3c 0x3a ,0x3d 0x3d 0x3c 0x3d 0x3c 0x3b 0x3b 0x39 ,
the write training result:
DQS0:0x66, DQS1:0x56, DQS2:0x5c, DQS3:0x56,
min  :0x93 0x93 0x94 0x92 0x89 0x8b 0x8f 0x8c 0x8c ,0x7f 0x7f 0x7d 0x7b 0x82 0x85 0x87 0x85 0x7f ,
      0x87 0x87 0x86 0x87 0x85 0x85 0x86 0x88 0x81 ,0x7c 0x7e 0x7e 0x79 0x7d 0x7f 0x7c 0x7d 0x7e ,
mid  :0xb0 0xb0 0xb1 0xaf 0xa5 0xa8 0xac 0xa7 0xa8 ,0x9b 0x9b 0x99 0x97 0x9e 0xa0 0xa0 0x9f 0x9a ,
      0xa4 0xa4 0xa0 0xa3 0x9f 0xa0 0xa0 0xa1 0x9c ,0x98 0x9a 0x9a 0x95 0x99 0x9b 0x98 0x99 0x9a ,
max  :0xcd 0xcd 0xcf 0xcc 0xc2 0xc5 0xc9 0xc3 0xc4 ,0xb8 0xb8 0xb6 0xb3 0xba 0xbb 0xb9 0xba 0xb6 ,
      0xc1 0xc1 0xbb 0xc0 0xba 0xbb 0xba 0xbb 0xb7 ,0xb4 0xb6 0xb6 0xb1 0xb5 0xb7 0xb4 0xb5 0xb6 ,
range:0x3a 0x3a 0x3b 0x3a 0x39 0x3a 0x3a 0x37 0x38 ,0x39 0x39 0x39 0x38 0x38 0x36 0x32 0x35 0x37 ,
      0x3a 0x3a 0x35 0x39 0x35 0x36 0x34 0x33 0x36 ,0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 ,
CA Training result:
cs:0 min  :0x45 0x40 0x3f 0x33 0x3d 0x33 0x43 ,0x47 0x40 0x3d 0x2d 0x3c 0x32 0x45 ,
cs:0 mid  :0x81 0x83 0x79 0x76 0x77 0x75 0x6f ,0x82 0x82 0x77 0x71 0x77 0x73 0x70 ,
cs:0 max  :0xbd 0xc7 0xb4 0xb9 0xb2 0xb8 0x9b ,0xbd 0xc4 0xb1 0xb6 0xb2 0xb5 0x9b ,
cs:0 range:0x78 0x87 0x75 0x86 0x75 0x85 0x58 ,0x76 0x84 0x74 0x89 0x76 0x83 0x56 ,
out

U-Boot SPL 2024.01-armbian (May 13 2024 - 16:10:34 +0000)
Trying to boot from MMC2
## 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
INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-167-g81e0b993a-dirty:xsf
NOTICE:  BL31: Built : 11:20:08, Sep  6 2021
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    pmu v1 is valid
INFO:    dfs DDR fsp_param[0].freq_mhz= 1056MHz
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

@MichaIng
Copy link
Owner

MichaIng commented Jun 2, 2024

Thanks, I found it, rk3566-radxa-zero-3.dtb => rk3566-radxa-zero3.dtb. Other than Orange Pi's device tree names, those from Armbian do not have the dash between "zero" and "3".

I just did a rebuild, would be great if you could test it again. As alternatively to flashing a new image, you could also edit the /boot/dietpiEnv.txt from another Linux system and re-add the fdtfile=rockchip/rk3566-radxa-zero3.dtb.

@StephanStS
Copy link
Collaborator

The new downloaded image now works (UART console output as well as HDMI output.

@MichaIng
Copy link
Owner

MichaIng commented Jun 2, 2024

Okay great, thanks for testing. I'll merge this into our APT repository then for the next images to have it fixed.

@MichaIng
Copy link
Owner

MichaIng commented Aug 1, 2024

Can someone replicate that HDMI does NOT work anymore when upgrading to vendor kernel?

apt update
apt install linux-{image,dtb}-vendor-rk35xx

@StephanStS faced this issue on Radxa ZERO 3E, so would be interesting to know whether its the case on 3W as well. I also just pushed an updated package version, so maybe that was even fixed.

@teddeebare
Copy link

I just downloaded the latest image and used on my Zero3W. No display from HDMI. Will have console output later, other work I have to resolve first.

@MichaIng
Copy link
Owner

Okay, good to know. Then we will keep using the legacy kernel for now, until we find time to further investigate why HDMI is not working, or a fix has been found/done at Armbian or mainline side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants