ophub / amlogic-s9xxx-openwrt

Support for OpenWrt in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
1.71k stars 1.51k forks source link

X96max 2G 100Mb not start after flash U-BOOT #382

Closed Spine74 closed 1 year ago

Spine74 commented 1 year ago

X96max 2G/16G 100Mb openwrt_official_s905x2_k6.1.10_2023.02.06.img.gz FDT=/dtb/amlogic/meson-g12a-x96-max-rmii.dtb

After install on EMMC and flash mainline bootloader box not started. Flash Android firmware through testpoint returns the box to working condition.

Debug log via com-port:

G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;0.0
                                                                      l2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0xff
bl2_stage_init 0xff
bl2_stage_init 0x02

L0:00000000
L1:00000703
L2:00008067
L3:04000000
S1:00000000
B2:00002000
B1:e0f83180

TE: 165532

BL2 Built : 10:15:09, Sep  5 2019. g12a ga536e8b - luan.yuan@droid15-sz

Board ID = 1
Set cpu clk to 24M
Set clk81 to 24M
CPU clk: 1200 MHz
Set clk81 to 166.6M
eMMC boot @ 0
sw8 s
sd/emmc cmd 8 arg 0x00000000 status a1ff3000
DDR driver_vesion: LPDDR4_PHY_V_0_1_11 build time: Sep  5 2019 10:15:06
board id: 1
Load FIP HDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
fw parse done
Load ddrfw from eMMC, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0
Load ddrfw from eMMC, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0
PIEI prepare done
Cfg max: 5, cur: 1. Board id: 255. Force loop cfg
DDR4 probe
ddr clk to 912MHz
Load ddrfw from eMMC, src: 0x00014200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : STREAM 0x0049000 - 0x0000000 0x0000000
INFO : STREAM 0x0402000 -
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 5, cur: 2. Board id: 255. Force loop cfg
DDR3 probe
Firmware does not exist!
Cfg max: 5, cur: 3. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 912MHz
Load ddrfw from eMMC, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : STREAM 0x00b0000 - 0x0000100
INFO : STREAM 0x00a7000 - 0x0000001
INFO : STREAM 0x0054000 - 0x0000000 0x0000000 0x0000000
INFO : STREAM 0x0056000 - 0x0000000 0x0000000 0x0000100 0x0000000 0x0000000 0x0000072
INFO : STREAM 0x005b000 - 0x0000000 0x0000003 0x0000009 0x0000003 0x0000000
INFO : STREAM 0x00a1000 -
INFO : STREAM 0x0402000 -
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 5, cur: 4. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 1392MHz
Load ddrfw from eMMC, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : STREAM 0x00b0000 - 0x0000100
INFO : STREAM 0x00a7000 - 0x0000001
INFO : STREAM 0x0054000 - 0x0000000 0x0000000 0x0000000
INFO : STREAM 0x0056000 - 0x0000000 0x0000000 0x0000100 0x0000000 0x0000000 0x00000ae
INFO : STREAM 0x005b000 - 0x0000000 0x0000005 0x000000a 0x0000003 0x0000000
INFO : STREAM 0x00a1000 -
INFO : STREAM 0x0402000 -
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 5, cur: 5. Board id: 255. Force loop cfg
LPDDR3 probe
ddr clk to 792MHz
Load ddrfw from eMMC, src: 0x0006c200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : STREAM 0x00af000 - 0x0000100
INFO : STREAM 0x0054000 - 0x0000000 0x0000000 0x0000000
INFO : STREAM 0x0055000 - 0x0000000 0x0000000 0x0000100 0x0000000 0x0000000 0x0000063
INFO : STREAM 0x005a000 - 0x0000000 0x0000004 0x0000001 0x0000000 0x0000000
INFO : STREAM 0x00a1000 -
INFO : STREAM 0x0402000 -
INFO : ERROR : Training has failed!
1D training failed
All ddr config failed...
Reset...
ophub commented 1 year ago

First restore the Android system, and then write to emmc, do not choose the mainline u-boot

Spine74 commented 1 year ago

Log witch original bootloader:

=>
=> G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;0.0
                                                                         l2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0001 - pwm id 0x00
bl2_stage_init 0xc0
bl2_stage_init 0x02

L0:00000000
L1:00000703
L2:00008067
L3:04000000
S1:00000000
B2:00002000
B1:e0f83180

TE: 112544

BL2 Built : 20:29:41, Jun 18 2019. g12a ga659aac - luan.yuan@droid15-sz

Board ID = 1
Set cpu clk to 24M
Set clk81 to 24M
CPU clk: 1200 MHz
Set clk81 to 166.6M
eMMC boot @ 0
sw8 s
DDR driver_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:37
board id: 1
Load FIP HDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
fw parse done
Load ddrfw from eMMC, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0
Load ddrfw from eMMC, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0
PIEI prepare done
fastboot data load
00000000
emmc switch 1 ok
ddr saved addr:00016000
Load ddr parameter from eMMC, src: 0x02c00000, des: 0xfffd0000, size: 0x00001000, part: 0
00000000
emmc switch 0 ok
fastboot data verify
verify result: 255
Cfg max: 5, cur: 1. Board id: 255. Force loop cfg
DDR4 probe
ddr clk to 912MHz
Load ddrfw from eMMC, src: 0x00014200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0000
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 5, cur: 2. Board id: 255. Force loop cfg
DDR3 probe
ddr clk to 792MHz
Load ddrfw from eMMC, src: 0x0002c200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0000
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of Write leveling coarse delay
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:43
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 0MB
DMC_DDR_CTRL: 0000002cDDR size: 2048MB
cs0 DataBus test pass
cs0 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 444
result report
boot times 0Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from eMMC, src: 0x00078200, des: 0x01768000, size: 0x000c8000, part: 0
bl2z: ptr: 05129330, size: 00001e40
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12a_v1.1.3389-92241b5 2019-07-02 17:22:49 luan.yuan@droid15-sz]
OPS=0x40
ring efuse init
28 0b 40 00 01 29 1c 00 00 0c 35 35 4b 48 4b 50
[0.017149 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE:  BL31: v1.3(release):4fc40b1
NOTICE:  BL31: Built : 15:57:33, May 22 2019
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast

U-Boot 2015.01 (Oct 09 2019 - 12:14:06)

DRAM:  2 GiB
Relocation Offset is: 76e5f000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 0000000077f3f380
NAND:  get_sys_clk_rate_mtd() 290, clock setting 200!
NAND device id: 0 ff ff ff ff ff
No NAND device found!!!
nand init failed: -6
get_sys_clk_rate_mtd() 290, clock setting 200!
NAND device id: 0 ff ff ff ff ff
No NAND device found!!!
nand init failed: -6
MMC:   aml_priv->desc_buf = 0x0000000073e4fa70
aml_priv->desc_buf = 0x0000000073e51db0
SDIO Port B: 0, SDIO Port C: 1
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x3, tx-dly 0, clock 400000
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
co-phase 0x3, tx-dly 0, clock 400000
co-phase 0x3, tx-dly 0, clock 40000000
aml_sd_retry_refix[983]:delay = 0x0,gadjust =0x182000
[mmc_startup] mmc refix success
init_part() 282: PART_TYPE_DOS
[mmc_init] mmc init success
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 4 dtbs.
        aml_dt soc: g12a platform: u212 variant: 2g
        dtb 0 soc: g12a   plat: u212   vari: 2g
        dtb 1 soc: g12a   plat: u212   vari: 4g
        dtb 2 soc: sm1   plat: ac213   vari: 2g
        dtb 3 soc: sm1   plat: ac213   vari: 4g
      Find match dtb: 0
start dts,buffer=0000000073e54620,dt_addr=0000000073e54620
get_partition_from_dts() 91: ret 0
      Amlogic multi-dtb tool
      Single dtb detected
parts: 17
00:      logo   0000000000800000 1
01:  recovery   0000000001800000 1
02:      misc   0000000000800000 1
03:      dtbo   0000000000800000 1
04:  cri_data   0000000000800000 2
05:     param   0000000001000000 2
06:      boot   0000000001000000 1
set has_boot_slot = 0
07:       rsv   0000000001000000 1
08:  metadata   0000000001000000 1
09:    vbmeta   0000000000200000 1
10:       tee   0000000002000000 1
11:    vendor   0000000046000000 1
12:       odm   0000000008000000 1
13:    system   0000000050000000 1
14:   product   0000000008000000 1
15:     cache   0000000046000000 2
16:      data   ffffffffffffffff 4
init_part() 282: PART_TYPE_DOS
eMMC/TSD partition table have been checked OK!
crc32_s:0x1577dad == storage crc_pattern:0x1577dad!!!
crc32_s:0xee152b83 == storage crc_pattern:0xee152b83!!!
crc32_s:0x79f50f07 == storage crc_pattern:0x79f50f07!!!
mmc env offset: 0x4d400000
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-3406: calc 9897d9fd, store 9897d9fd
_verify_dtb_checksum()-3406: calc 9897d9fd, store 9897d9fd
dtb_read()-3623: total valid 2
update_old_dtb()-3604: do nothing
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 4 dtbs.
        aml_dt soc: g12a platform: u212 variant: 2g
        dtb 0 soc: g12a   plat: u212   vari: 2g
        dtb 1 soc: g12a   plat: u212   vari: 4g
        dtb 2 soc: sm1   plat: ac213   vari: 2g
        dtb 3 soc: sm1   plat: ac213   vari: 4g
      Find match dtb: 0
amlkey_init() enter!
[EFUSE_MSG]keynum is 4
vpu: clk_level in dts: 7
vpu: vpu_power_on
vpu: set clk: 666667000Hz, readback: 666666667Hz(0x100)
vpu: vpu_module_init_config
vpp: vpp_init
vpp: vpp osd2 matrix rgb2yuv..............
cvbs: cpuid:0x28
aml_config_dtb 633
aml_config_dtb 663
co_phase = <0x00000003>
caps2 = "MMC_CAP2_HS200"
f_max = "
         ▒▒"
status = "disabled"
status = "okay"
Net:   dwmac.ff3f0000amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
MACADDR:02:00:00:1c:29:01(from chipid)

CONFIG_AVB2: null
Start read misc partition datas!
info->magic =
info->version_major = 1
info->version_minor = 0
info->slots[0].priority = 15
info->slots[0].tries_remaining = 7
info->slots[0].successful_boot = 0
info->slots[1].priority = 14
info->slots[1].tries_remaining = 7
info->slots[1].successful_boot = 0
info->crc32 = -1075449479
active slot = 0
wipe_data=successful
wipe_cache=successful
upgrade_step=2
reboot_mode:::: cold_boot
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[KM]Error:f[key_manage_query_size]L515:key[usid] not programed yet
[KM]Error:f[key_manage_query_size]L515:key[mac] not programed yet
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
hpd_state=0
edid preferred_mode is <NULL>[0]
hdr mode is 0
dv  mode is ver:0  len: 0
hdr10+ mode is 0
[OSD]load fb addr from dts:/meson-fb
[OSD]set initrd_high: 0x7f800000
[OSD]fb_addr for logo: 0x7f800000
[OSD]load fb addr from dts:/meson-fb
[OSD]fb_addr for logo: 0x7f800000
[OSD]VPP_OFIFO_SIZE:0xfff01fff
[CANVAS]canvas init
[CANVAS]addr=0x7f800000 width=3840, height=2160
[OSD]osd_hw.free_dst_data: 0,719,0,575
[OSD]osd1_update_disp_freescale_enable
vpp: vpp_matrix_update: 2
cvbs performance type = 9, table = 0
cvbs_config_hdmipll_g12a
cvbs_set_vid2_clk
vpp: sdr_mode = 2
vpp: Rx hdr_info.hdr_sup_eotf_smpte_st_2084 = 0
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[KM]Error:f[key_manage_query_size]L515:key[usid] not programed yet
[KM]Error:f[key_manage_query_size]L515:key[mac] not programed yet
[KM]Error:f[key_manage_query_size]L515:key[deviceid] not programed yet
gpio: pin GPIOAO_3 (gpio 3) value is 1
saradc - saradc sub-system

Usage:
saradc saradc open <channel>    - open a SARADC channel
saradc close    - close the SARADC
saradc getval   - get the value in current channel
saradc test     - test the SARADC by channel-7
saradc get_in_range <min> <max> - return 0 if current value in the range of current channel

Command: bcb uboot-command
Start read misc partition datas!
BCB hasn't any datas,exit!
InUsbBurn
noSof
sof timeout, reset usb phy tuning
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
card out
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 3000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
reading emmc_autoscript
831 bytes read in 4 ms (202.1 KiB/s)
## Executing script at 01020000
reading u-boot.emmc
748175 bytes read in 25 ms (28.5 MiB/s)
## Starting application at 0x01000000 ...

U-Boot 2021.07-rc3-00183-gd6e1cdad51-dirty (May 31 2021 - 22:37:26 +0800) x96-max

Model: AMedia X96 Max
SoC:   Amlogic Meson G12A (S905X2) Revision 28:b (40:2)
DRAM:  2 GiB
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@ff3f0000
Hit any key to stop autoboot:  0
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
unable to select a mode : -110
DMA reset timeout
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-aa-74-05-a4-3a-b8
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-meson-ac2xx
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-meson
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
DMA reset timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
DMA reset timeout
Config file not found
DMA reset timeout
DMA reset timeout
ophub commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/4a307b832e8197a2860e627e89e0c6126038cbe6/make-openwrt/openwrt-files/common-files/etc/model_database.conf#L74

You test the firmware of the 5.15 kernel, this does not need u-boot support, as long as the correct dtb is selected, it can be used.

/boot/uEnv.txt