Airoha AN7583 device. After writing the BL2 and FIP to the spi-nand and reboot I get the error (and no other text in console):
PANIC at PC : 0x81001473.
It looks like this is an ATF error. Please give me some ideas on how to fix it.
RAM boot is ok:
Press x
CCC
*** file: /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-preloader.bin
$ sx -vvX /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-preloader.bin
Sending /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-preloader.bin, 932 blocks: Give your local XMODEM receive command now.
Xmodem sectors/kbytes sent: 0/ 0kRetry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Bytes Sent: 119424 BPS:11057
Transfer complete
*** exit status: 0 ***
Press x to load BL31 + U-Boot FIP
C
*** file: /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-bl31-uboot.fip
$ sx -vvX /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-bl31-uboot.fip
Sending /an7583/openwrt-airoha-an7583-nokia_xg-040g-mf-ubi-bl31-uboot.fip, 2432 blocks: Give your local XMODEM receive command now.
Bytes Sent: 311424 BPS:9753
Transfer complete
*** exit status: 0 ***
INFO: GICv3 without legacy support detected.
INFO: ARM GICv3 driver initialized in EL3
INFO: Maximum SPI INTID supported: 287
U-Boot 2026.01-OpenWrt-r34881+4-ee02f6f16b (Jun 14 2026 - 05:50:24 +0000)
CPU: Airoha AN7583
DRAM: 512 MiB
Core: 32 devices, 19 uclasses, devicetree: embed
Loading Environment from UBI... spi-nand: spi_nand nand@0: GigaDevice SPI NAND was found.
spi-nand: spi_nand nand@0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
Read 126976 bytes from volume ubootenv to 000000009fae9d40
Read 126976 bytes from volume ubootenv2 to 000000009fb08d80
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net:
Warning: ethernet@1fb50000 (eth0) using random MAC address - 72:51:d8:04:fb:2a
eth0: ethernet@1fb50000
No size specified -> Using max size (380928)
Read 380928 bytes from volume ri to 0000000090000000
Error: ethernet@1fb50000 address ff:ff:ff:ff:ff:ff illegal value
Saving Environment to UBI... UBI partition 'ubi' already selected
Writing to UBI... done
OK
Saving Environment to UBI... UBI partition 'ubi' already selected
Writing to redundant UBI... done
OK
Button 'reset' not found (err=-19)
( ( ( OpenWrt ) ) ) U-Boot 2026.01-OpenWrt-r34881+4-ee02f6f16b (Jun 14 2026 - 05:50:24 +0000)
1. Run default boot command.
2. Boot system via TFTP
3. Boot production system from NAND
4. Load production system via TFTP then write to NAND
5. Load BL31+U-Boot FIP via TFTP then write to NAND
6. Load BL2 preloader via TFTP then write to NAND
7. Reboot
8. Reset all settings to factory defaults
0. Exit
Press UP/DOWN to move, ENTER to select, ESC to quit
git diff:
--- a/package/boot/uboot-airoha/Makefile
+++ b/package/boot/uboot-airoha/Makefile
@@ -44,6 +44,16 @@ define U-Boot/an7581_rfb
BL31_IMAGE:=an7581-bl31.bin
endef
+define U-Boot/an7583_nokia_xg-040g-mf
+ NAME:=Nokia XG-040G-MF
+ UBOOT_CONFIG:=an7583_nokia_xg-040g-mf
+ BUILD_DEVICES:=nokia_xg-040g-mf-ubi
+ BUILD_SUBTARGET:=an7583
+ UBOOT_IMAGE:=u-boot.fip
+ BL2_IMAGE:=an7583-bl2.bin
+ BL31_IMAGE:=an7583-bl31.bin
+endef
+
define U-Boot/an7583_rfb
NAME:=AN7583 Reference Board
UBOOT_CONFIG:=an7583_evb
@@ -68,6 +78,7 @@ UBOOT_TARGETS := \
an7581_gemtek_w1700k \
an7581_nokia_valyrian \
an7581_rfb \
+ an7583_nokia_xg-040g-mf \
an7583_rfb \
en7523_rfb
You should have the memory training output also. Did you get that before? And where did you get the binaries from?
I've never seen memory training with OpenWrt u-boot. The binaries prototypes are in the OpenWrt source tree: https://github.com/openwrt/openwrt/tree/main/package/boot/uboot-airoha/files
These files don't seem to fit to this board?
Stock:
Secure key does not exist
HWCONF is 1f
enable r2c_rd_bypass_wt
AN7583DRAMC V0.6
init_times = 0
MPLL setting done !!!
dram_type = PCDDR4, data_rate = 2133
DIV mode = 1
[Dramc] PCDDR AC Timing update
APHY RG Setting
DelayCellTimex100 (cell=1078)
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#3 = 0x200
MRW RK0 MR#1 = 0x101
MRW RK0 MR#4 = 0x800
MRW RK0 MR#5 = 0x400
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xc20
MRW RK0 MR#0 = 0xb44
[Dramc] PCDDR AC Timing update
DRVP driving setting info: 0x41
ODTP driving setting info: 0x41
DRVN driving setting info: 0x41
ODTN driving setting info: 0x41
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#1 = 0x181
MRW RK0 MR#1 = 0x101
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#3 = 0x204
MRW RK0 MR#3 = 0x200
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc00
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc82
MRW RK0 MR#6 = 0xc02
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc84
MRW RK0 MR#6 = 0xc04
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc86
MRW RK0 MR#6 = 0xc06
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc88
MRW RK0 MR#6 = 0xc08
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8a
MRW RK0 MR#6 = 0xc0a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8c
MRW RK0 MR#6 = 0xc0c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8e
MRW RK0 MR#6 = 0xc0e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc90
MRW RK0 MR#6 = 0xc10
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc92
MRW RK0 MR#6 = 0xc12
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc94
MRW RK0 MR#6 = 0xc14
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc96
MRW RK0 MR#6 = 0xc16
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc98
MRW RK0 MR#6 = 0xc18
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9a
MRW RK0 MR#6 = 0xc1a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9c
MRW RK0 MR#6 = 0xc1c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9e
MRW RK0 MR#6 = 0xc1e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xc20
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca2
MRW RK0 MR#6 = 0xc22
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca4
MRW RK0 MR#6 = 0xc24
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca6
MRW RK0 MR#6 = 0xc26
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca8
MRW RK0 MR#6 = 0xc28
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcaa
MRW RK0 MR#6 = 0xc2a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcac
MRW RK0 MR#6 = 0xc2c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcae
MRW RK0 MR#6 = 0xc2e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcb0
MRW RK0 MR#6 = 0xc30
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcb2
MRW RK0 MR#6 = 0xc32
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9f
MRW RK0 MR#6 = 0xc1f
-- init_times = 0
init_times = 1
MPLL setting done !!!
dram_type = PCDDR4, data_rate = 2666
DIV mode = 1
[Dramc] PCDDR AC Timing update
APHY RG Setting
DelayCellTimex100 (cell=1086)
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#3 = 0x200
MRW RK0 MR#1 = 0x101
MRW RK0 MR#4 = 0x800
MRW RK0 MR#5 = 0x400
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xc20
MRW RK0 MR#0 = 0xb44
[Dramc] PCDDR AC Timing update
DRVP driving setting info: 0x41
ODTP driving setting info: 0x41
DRVN driving setting info: 0x41
ODTN driving setting info: 0x41
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#1 = 0x181
MRW RK0 MR#1 = 0x101
MRW RK0 MR#2 = 0xf0
MRW RK0 MR#3 = 0x204
MRW RK0 MR#3 = 0x200
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc00
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc82
MRW RK0 MR#6 = 0xc02
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc84
MRW RK0 MR#6 = 0xc04
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc86
MRW RK0 MR#6 = 0xc06
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc88
MRW RK0 MR#6 = 0xc08
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8a
MRW RK0 MR#6 = 0xc0a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8c
MRW RK0 MR#6 = 0xc0c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc8e
MRW RK0 MR#6 = 0xc0e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc90
MRW RK0 MR#6 = 0xc10
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc92
MRW RK0 MR#6 = 0xc12
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc94
MRW RK0 MR#6 = 0xc14
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc96
MRW RK0 MR#6 = 0xc16
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc98
MRW RK0 MR#6 = 0xc18
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9a
MRW RK0 MR#6 = 0xc1a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9c
MRW RK0 MR#6 = 0xc1c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xc9e
MRW RK0 MR#6 = 0xc1e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xc20
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca2
MRW RK0 MR#6 = 0xc22
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca4
MRW RK0 MR#6 = 0xc24
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca6
MRW RK0 MR#6 = 0xc26
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca8
MRW RK0 MR#6 = 0xc28
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcaa
MRW RK0 MR#6 = 0xc2a
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcac
MRW RK0 MR#6 = 0xc2c
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcae
MRW RK0 MR#6 = 0xc2e
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcb0
MRW RK0 MR#6 = 0xc30
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xcb2
MRW RK0 MR#6 = 0xc32
MRW RK0 MR#6 = 0xc80
MRW RK0 MR#6 = 0xca0
MRW RK0 MR#6 = 0xc20
-- init_times = 1
RBUS out of order setting.
BG_num = 2
DRAM FLOW DONE!!!
diable auth
Secure key does not exist
L2C_type:256K_L2C
L1D cache size: 32 KB (with set/asso/line==128/4/64)
L1I cache size: 32 KB (with set/asso/line==256/2/64)
L2U cache size: 256 KB (with set/asso/line==256/16/64)
diable auth
U-Boot (Mar 01 2025 - 22:59:26)
DRAM: 512 MiB
AN7583DT
Now running in RAM - U-Boot at: 9fdd6000
spi_nand_probe: mfr_id=0xc8, dev_id=0x92
Support SPI NAND erase statistic.
Using Flash ECC.
Detected SPI NAND Flash : _SPI_NAND_DEVICE_ID_GD5F2GM7UExxG, Flash Size=0x10000000
bmt pool size: 143
BMT & BBT Init Success
FDT_MAGIC or IH_MAGIC check fail.
Parse second image fail.
NAND: 0 MiB
In: serial
Out: serial
Err: serial
CPU0: found redistributor 0 region 0:000000009fe36030
rfb_id1=0
rfb_id2=00
rfb_cfg=000,112,005,005,000,aaa,bbb
serdes_pon=000
serdes_ethernet=112
serdes_wifi1=005
serdes_wifi2=005
serdes_usb1=000
Net: ecnt_eth
I think the files you need are not redistributed in mainline Openwrt.
But the preloader boots uboot...
Look at Ansuels atf github repo to see if there is any information there.
It seems so. I managed to build a working u-boot for the an7581 device (My PR: https://github.com/openwrt/openwrt/pull/23569). So, I was hoping pre-compiled atf binaries would work with the an7583 as well.
It looks like we really need to dive deeper. I've already seen @Ansuel's atf github repo but haven't figured out how to compile it yet.
Cound be the version of the DRAM training also. Do a strings over the preloader to see what it uses. (strings | grep AN7583DRAMC)
AN7583DRAMC V0.6 in OpenWrt and Stock both.
Is the string in the BL2 binary image?
Exactly. 1st step - binwalk the bootloader image. The 2nd one - apply strings | grep AN7583DRAMC to the extracted binary artefacts.
Can you elaborate what artifacts you have and what you do with them?
The memory training code is part of the BL2 and should output the AN7583DRAMC string among other things when booting. But maybe Ansuel patched that away and that is why I'm getting confused.