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.91k stars 1.69k forks source link

OpenWRT重启有可能导致无法正常启动 #614

Closed xRetia closed 3 months ago

xRetia commented 4 months ago

Device Information | 设备信息

OpenWrt Version | 系统版本

Describe the bug | 问题描述

在 OpenWRT 运行一段时间后,重启动设备(含 reboot 软件重启、以及按开关硬重启),可能导致 u-boot 丢失部分 Env 而无法正常启动,另外 reboot_mode 会设置为 cold_boot。丢失的 Env 环境变量如下:

如果插入 U 盘,运行完 U 盘上的 aml_autoscript 后,可以正常从 eMMC 启动系统。

'Vࢯ_j³  …        žIŽ䅂                                   }    if printenv bootfromsd; then exit; else setenv ab 0; fi;
setenv bootcmd 'run start_autoscript; run storeboot'
setenv start_autoscript 'if mmcinfo; then run start_mmc_autoscript; fi; if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript'
setenv start_emmc_autoscript 'if fatload mmc 1 1020000 emmc_autoscript; then autoscr 1020000; fi;'
setenv start_mmc_autoscript 'if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;'
setenv start_usb_autoscript 'for usbdev in 0 1 2 3; do if fatload usb ${usbdev} 1020000 s905_autoscript; then autoscr 1020000; fi; done'
setenv upgrade_step 2
saveenv
sleep 1
reboot

无法启动的日志

GXL:BL1:9ac50e:bb16dc;FEAT:ADFD318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 158928

BL2 Built : 14:55:32, Mar 24 2017.
gxl g4bbe26f - shuiyuan.huang@droid10-sz

Board ID = 7, adc=548
set vcck to 1070 mv
set vddee to 1070 mv
CPU clk: 1200MHz
2layers board, use ddr_set[0]
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 792MHz - FAIL
DDR3 chl: Rank0 @ 792MHz - PASS
Rank0: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x00007400
Load bl301 from eMMC, src: 0x00018200, des: 0x01200000, size: 0x00002200
Load bl31 from eMMC, src: 0x0001c200, des: 0x10100000, size: 0x00019400
Load bl33 from eMMC, src: 0x00038200, des: 0x01000000, size: 0x00086a00
NOTICE:  BL3-1: v1.0(debug):27d2eea5
NOTICE:  BL3-1: Built : 14:56:35, Mar 24 2017
aml log : bl31 normal boot !
[Image: gxl_v1.1.3089-661026e 2017-01-10 18:34:56 qiufang.dai@droid07]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: 0 0 3 c c 0 30 b4 98 a0 0 c4 not ES chip
efuse init ops = c4
efuse init hdcp = c, cf9=7
[0.596556 Inits done]
sINFO:    BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9
ecure task start!
 igh
at
0sUk -sBtoaortt !2
115lo.w0 1t a(sOkc ts t3a0r t2!0
 7 - 10:10:34)

DRAM:  1 GiB
Relocation Offset is: 36eec000
register usb cfg[0][1] = 0000000037f617c8
[CANVAS]canvas init
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpp: vpp_init
MMC:   aml_priv->desc_buf = 0x0000000033edc630
aml_priv->desc_buf = 0x0000000033ede950
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
[mmc_init] mmc init success
mmc read lba=0x14000, blocks=0x400
      Amlogic multi-dtb tool
      Multi dtb detected
      2layers board, board id use 7
      Multi dtb tool version: v2 .
      Support 6 dtbs.
        aml_dt soc: gxl platform: p211 variant: 1g
        dtb 0 soc: gxbb   plat: p201   vari: 1g
        dtb 1 soc: gxbb   plat: p201   vari: 2g
        dtb 2 soc: gxl   plat: p211   vari: 1g
        dtb 3 soc: gxl   plat: p211   vari: 2g
        dtb 4 soc: gxl   plat: p215   vari: 1g
        dtb 5 soc: gxl   plat: p215   vari: 2g
      Find match dtb: 2
start dts,buffer=0000000033ee11f0,dt_addr=0000000033ef29f0
parts: 12
00:      logo   0000000002000000 1
01:  recovery   0000000002000000 1
02:       rsv   0000000000800000 1
03:       tee   0000000000800000 1
04:     crypt   0000000002000000 1
05:      misc   0000000002000000 1
06:      boot   0000000002000000 1
07:    system   0000000040000000 1
08:     cache   0000000020000000 2
09:    params   0000000004000000 2
10: bootfiles   0000000020000000 2
11:      data   ffffffffffffffff 4
get_dtb_struct: Get emmc dtb OK!
overide_emmc_partition_table: overide cache
[mmc_get_partition_table] skip partition cache.
Partition table get from SPL is :
        name                        offset              size              flag
===================================================================================
   0: bootloader                         0            400000                  0
   1: reserved                     2400000           4000000                  0
   2: cache                        6c00000          20000000                  2
   3: env                         27400000            800000                  0
   4: logo                        28400000           2000000                  1
   5: recovery                    2ac00000           2000000                  1
   6: rsv                         2d400000            800000                  1
   7: tee                         2e400000            800000                  1
   8: crypt                       2f400000           2000000                  1
   9: misc                        31c00000           2000000                  1
  10: boot                        34400000           2000000                  1
  11: system                      36c00000          40000000                  1
  12: params                      77400000           4000000                  2
  13: bootfiles                   7bc00000          20000000                  2
  14: data                        9c400000         135dd0000                  4
mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!
mmc env offset: 0x27400000
In:    serial
Out:   serial
Err:   serial
board id is : 7
hpd_state=0
cvbs performance type = 7, table = 0
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
read emmc dtb
      Amlogic multi-dtb tool
      Multi dtb detected
      2layers board, board id use 7
      Multi dtb tool version: v2 .
      Support 6 dtbs.
        aml_dt soc: gxl platform: p211 variant: 1g
        dtb 0 soc: gxbb   plat: p201   vari: 1g
        dtb 1 soc: gxbb   plat: p201   vari: 2g
        dtb 2 soc: gxl   plat: p211   vari: 1g
        dtb 3 soc: gxl   plat: p211   vari: 2g
        dtb 4 soc: gxl   plat: p215   vari: 1g
        dtb 5 soc: gxl   plat: p215   vari: 2g
      Find match dtb: 2
Net:   dwmac.c9410000
wipe_data=successful
wipe_cache=successful
Err imgread(L340):Logo header err.
There is no valid bmp file at the given address
[CANVAS]addr=0x3d800000 width=3840, height=2160
There is no valid bmp file at the given address
upgrade_step=0
amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[KM]Error:f[key_manage_query_size]L507:key[deviceid] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[model] not programed yet
gpio: pin GPIOAO_2 (gpio 102) value is 1
rebootmode=cold_boot
Enter USB burn
Try connect time out 701, 700, 744
Hit any key to stop autoboot:  0
Err imgread(L139):Fmt unsupported!genFmt 0x0 != 0x3
Enter USB burn
Try connect time out 1001, 1000, 1499
card out
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
emmc/sd response timeout, cmd1, status=0x1ff2800
[MSG]mmcinfo failed!
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
emmc/sd response timeout, cmd1, status=0x1ff2800
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
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 0 **
Err imgread(L139):Fmt unsupported!genFmt 0x0 != 0x3
gxl_p211_v1#