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

使用uEnv.txt配置文件和extlinux/extlinux.conf配置文件的区别是什么? #229

Closed
KryptonLee opened this issue Apr 9, 2022 · 6 comments

Comments

@KryptonLee
Copy link

E900V22C使用您发布的s905l3a镜像,内核5.15,不经修改的话,已经被多人试验证实过无法直接从tf卡启动,启动过程卡在了u-boot无法读取tf卡上。相关日志链接:E900V22C boot from tf

在BOOT分区中创建配置文件extlinux/extlinux.conf,内容如下:

LABEL Armbian
KERNEL /zImage
FDTDIR /dtb
APPEND initrd=/uInitrd root=UUID=ad6b1cca-97d6-47df-9b45-6bf6946cad98 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

从tf卡启动后可以达到内核启动的步骤,日志如下:

G12A:BL:0253b8:61aa2d;FEAT:E0F93180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;0.0;
                                                                                     bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

L0:00000000
L1:00000701
L2:00008267
L3:04000000
S1:00000000
B2:00002000
B1:e0f93180

TE: 138561

BL2 Built : 14:02:05, Nov 23 2020. g12a g966c864 - gongwei.chen@droid11-sz

Board ID = 4
Set cpu clk to 24M
Set clk81 to 24M
CPU clk: 1200 MHz
Set clk81 to 166.6M
eMMC boot @ 1
sw8 s
board id: 4
Load FIP HDR DDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 1
fw parse done
PIEI prepare done
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
result: 255
Cfg max: 12, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 15:59:30, May 25 2020. g12a gb6bfa83 - gongwei.chen@droid11-sz
ddr clk to 1176MHz
00000000
emmc switch 1 ok

dmc_version 0000
Check phy result
INFO : End of CA training
INFO : End of initialization
INFO : Training has run successfully!
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 read delay center optimization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of MPR read delay center optimization
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
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

soc_vref_reg_value 0x 00000027 00000029 00000028 00000023 00000027 00000026 00000029 00000026 00000027 00000025 00000027 00000027 0000002a 00000028 00000027 00000027 00000025 00000024 00000023 00000025 00000026 00000024 00000025 00000024 00000024 00000027 00000024 00000025 00000024 00000025 00000024 00000024 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004
 dram_vref_reg_value 0x 0000005f
2D training succeed
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 0MB
DMC_DDR_CTRL: 00c0002cDDR size: 2048MB
cs0 DataBus test pass
cs0 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 477
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 1 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 1
Load BL3X from eMMC, src: 0x00078200, des: 0x01768000, size: 0x000d6a00, part: 1
0.0;M3 CHK:0;cm4_sp_mode 0
[Image: g12a_v1.1.3394-7d43064d5 2020-05-07 15:37:06 gongwei.chen@droid11-sz]
OPS=0x70
ring efuse init
28 0c 70 00 01 21 1c 00 00 08 33 32 37 54 41 50
[0.014270 Inits done]
secure task start!
high task start!
low task start!
boot bl31
NOTICE:  BL31: v1.3(release):9d705ef56-dirty
NOTICE:  BL31: Built : 19:18:02, Jul 28 2021
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast


U-Boot 2015.01 (Sep 26 2021 - 14:35:31)

DRAM:  2 GiB
Relocation Offset is: 76e45000
mmu cfg end: 0x80000000
mmu cfg end: 0x80000000
spi_post_bind(spifc): req_seq = 0
register usb cfg[0][1] = 0000000077f3be68
gpio: pin GPIOAO_9 (gpio 9) value is 0
NAND:  get_sys_clk_rate_mtd() 292, clock setting 200!
bus cycle0: 6,timing: 7
NAND device id: 0 ff ff ff ff ff
No NAND device found!!!
nand init failed: -6
get_sys_clk_rate_mtd() 292, clock setting 200!
bus cycle0: 6,timing: 7
NAND device id: 0 ff ff ff ff ff
No NAND device found!!!
nand init failed: -6
MMC:   aml_priv->desc_buf = 0x0000000073e35d90
aml_priv->desc_buf = 0x0000000073e380d0
SDIO Port B: 0, SDIO Port C: 1
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
emmc/sd response timeout, cmd8, cmd->cmdarg=0x1aa, status=0x1ff2800
emmc/sd response timeout, cmd55, cmd->cmdarg=0x0, status=0x1ff2800
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
[set_emmc_calc_fixed_adj][875]find fixed adj_delay=20
init_part() 297: PART_TYPE_AML
[mmc_init] mmc init success
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 3 dtbs.
        aml_dt soc: g12a platform: u212 variant: 2g
        dtb 0 soc: g12a   plat: u212   vari: 1g
        dtb 1 soc: g12a   plat: u212   vari: 2g
        dtb 2 soc: sm1   plat: ac213   vari: 2g
      Find match dtb: 1
start dts,buffer=0000000073e3a920,dt_addr=0000000073e3a920
get_partition_from_dts() 92: ret 0
      Amlogic multi-dtb tool
      Single dtb detected
parts: 21
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   0000000014000000 1
12:     skmac   0000000000400000 1
13:       odm   0000000001000000 1
14:    system   0000000050000000 1
15:   product   0000000008000000 1
16:       ctc   0000000010000000 1
17:   skparam   0000000001000000 2
18:  skbackup   0000000030000000 2
19:     cache   0000000040000000 2
20:      data   ffffffffffffffff 4
init_part() 297: PART_TYPE_AML
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: 0x6c00000
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-3476: calc c5321a94, store c5321a94
_verify_dtb_checksum()-3476: calc c5321a94, store c5321a94
dtb_read()-3691: total valid 2
update_old_dtb()-3672: do nothing
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 3 dtbs.
        aml_dt soc: g12a platform: u212 variant: 2g
        dtb 0 soc: g12a   plat: u212   vari: 1g
        dtb 1 soc: g12a   plat: u212   vari: 2g
        dtb 2 soc: sm1   plat: ac213   vari: 2g
      Find match dtb: 1
amlkey_init() enter!
[EFUSE_MSG]keynum is 4
vpu: driver version: v20190313
vpu: detect chip type: 8
vpu: clk_level default: 7(666667000Hz), max: 7(666667000Hz)
vpu: clk_level in dts: 7
vpu: vpu_power_on
vpu: set_vpu_clk
vpu: set clk: 666667000Hz, readback: 666666667Hz(0x100)
vpu: set_vpu_clk finish
vpu: vpu_module_init_config
vpp: vpp_init
vpp: vpp osd2 matrix rgb2yuv..............
hdr_func 4, hdr_process_select 0x1
cvbs: cpuid:0x28
vdac_gsw_init: 0x0
cvbs: find clk_path: 0x0
cvbs: find performance_pal config
cvbs: find performance_ntsc config
aml_config_dtb 637
aml_config_dtb 667
co_phase = <0x00000003>
caps2 = "MMC_CAP2_HS200"
f_max = <0x02faf080>
status = "disabled"
status = "okay"
wipe_data=successful
wipe_cache=successful
upgrade_step=2
reboot_mode:::: cold_boot
ext4logoLoadCmd=ext4load mmc 1:${logoPart} ${logoLoadAddr} ${ext4LogoPath}
6220854 bytes read in 193 ms (30.7 MiB/s)
[imgread]load bmp from ext4 part okay
bmp pixel: 24
[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=5760, height=2160
[OSD]osd_hw.free_dst_data: 0,3839,0,2159
[OSD]osd1_update_disp_freescale_enable
cvbs: outputmode[2160p60hz] is invalid
vpp: vpp_matrix_update: 2
set hdmitx VIC = 97
aml_audio_init
config HPLL = 5940000 frac_rate = 0
HPLL: 0x3b3a04f7
HPLL: 0x1b3a04f7
HPLLv1: 0xdb3a04f7
config HPLL done
j = 11  vid_clk_div = 1
hdmitx: set enc for VIC: 353
hdmitx phy setting done
rx version is 2.0  div=10
hdmtix: set audio
hdmi_tx_set: save mode: 2160p60hz, attr: 420,8bit, hdmichecksum: <NULL>
Saving Environment to aml-storage...
mmc env offset: 0x6c00000
Writing to MMC(1)... done
hdr_packet
vpp: hdr_policy = 2
vpp: Rx hdr_info.hdr_sup_eotf_smpte_st_2084 = 0
time_out = 493e0
key[0] = 66994cb3
key[1] = 6699fd01
key[2] = 6699dd22
irkey - irkey <timeout> <key1> ...<keyN> - maximum value of N: 10

Usage:
irkey - No additional help available.
time_out = 0
key[0] = 3ec14cb3
key[1] = 3ec1fd01
key[2] = 3ec1dd22
irkey - irkey <timeout> <key1> ...<keyN> - maximum value of N: 10

Usage:
irkey - No additional help available.
Command: bcb uboot-command
Start read misc partition datas!
BCB hasn't any datas,exit!
InUsbBurn
wait for phy ready count is 0
noSof
sof timeout, reset usb phy tuning
rebootmode=cold_boot
Saving Environment to aml-storage...
mmc env offset: 0x6c00000
Writing to MMC(1)... done
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
card in
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
init_part() 282: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 1b
OEM: 534d
Name: EC2QT
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: (0xee8000000 Bytes) 59.6 GiB
mmc clock: 40000000
Bus Width: 4-bit
reading s905_autoscript
1654 bytes read in 5 ms (322.3 KiB/s)
## Executing script at 01020000
start amlogic old u-boot
## Error: "bootfromsd" not defined
reading boot_android
** Unable to read file boot_android **
** Bad device usb 0 **
reading u-boot.ext
694755 bytes read in 44 ms (15.1 MiB/s)
## Starting application at 0x01000000 ...


U-Boot 2021.04-00056-g13ac02db31-dirty (Apr 28 2021 - 22:44:20 +0800) u200

Model: Amlogic Meson G12A U200 Development Board
SoC:   Amlogic Meson G12A (Unknown) Revision 28:c (70:2)
DRAM:  2 GiB
MMC:   sd@ffe05000: 0, mmc@ffe07000: 1
Loading Environment from nowhere... OK
In:    serial@3000
Out:   serial@3000
Err:   serial@3000
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... Device NOT ready
   Request Sense returned 02 3A 00
2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
342 bytes read in 2 ms (167 KiB/s)
1:      Armbian
Retrieving file: /uInitrd
7463395 bytes read in 324 ms (22 MiB/s)
Retrieving file: /zImage
25848320 bytes read in 1116 ms (22.1 MiB/s)
append: initrd=/uInitrd root=UUID=ad6b1cca-97d6-47df-9b45-6bf6946cad98 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
Retrieving file: /dtb/amlogic/meson-g12a-u200.dtb
72049 bytes read in 6 ms (11.5 MiB/s)
Moving Image from 0x8080000 to 0x8200000, end=9b90000
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    7463331 Bytes = 7.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 08008000
   Booting using the fdt blob at 0x8008000
   Loading Ramdisk to 3f8e1000, end 3ffff1a3 ... OK
   Loading Device Tree to 000000003f8cc000, end 000000003f8e0970 ... OK

Starting kernel ...

但是在内核启动时最后会卡在tf卡初始化,一直不断出现
mmc1: error -84 whilst initialising SD card
无法进入到系统。

@ophub
Copy link
Owner

ophub commented Apr 9, 2022

label Armbian
    kernel /zImage
    initrd /uInitrd
    fdt /dtb/amlogic/meson-g12a-u200.dtb
    append root=UUID=ad6b1cca-97d6-47df-9b45-6bf6946cad98 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

试试这个,指定dtb

@ophub
Copy link
Owner

ophub commented Apr 9, 2022

extlinux.conf只适合纯主线uboot,例如rockchip或allwinner这些,例如我家云,贝壳云这几个就不需要额外的这个u-boot也可以使用。

只有晶晨是走闭源uboot路线的,所以才会这样,5.10以后的内核不能启动也是晶晨的锅,所以才需要uboot.ext。如果以后5.4停更了,又破解不了u-boot,这真成使用壁垒了,还有锁bl的问题。或许以后有高手能提供其他启动方案。

@KryptonLee
Copy link
Author

试过了,结果一样,上面的日志里也显示了加载的dtb是u200的。

append: initrd=/uInitrd root=UUID=ad6b1cca-97d6-47df-9b45-6bf6946cad98 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
Retrieving file: /dtb/amlogic/meson-g12a-u200.dtb
72049 bytes read in 6 ms (11.5 MiB/s)

另一方面,我将ROOTFS分区里的所有文件提换成Arch Linux Arm的ROOTFS文件,将BOOT分区的zImage和uInitrd提换成Arch Linux Arm的kernel和initramfs后,则能够启动Arch Linux Arm并正常使用

@KryptonLee
Copy link
Author

忘了说一下我用的Arch Linux Arm内核是5.16.13版本的

@ophub
Copy link
Owner

ophub commented Apr 9, 2022

启动分几个过程:先是BL1,这是cpu内置的,不依赖外部,然后是BL2,BL31,最后是BL33,BL33是真正编译出来的主线uboot,其它几个都是安卓原厂的。
BL2主要完成内存初始化,也就是acs.bin这个要做的,是从现在的安卓系统里提取的4千字节的内容,只有这个搞定了才能启动。f大上个月在群里指导过Calmact怎么提取测试,不知道目前测试的怎么样了。目前用的这个是通版的,不是这个盒子专用的。
目前推荐你使用usb吧,tf/sd卡有时会有电波干扰和驱动没加载的问题。

@KryptonLee
Copy link
Author

谢谢,我也在群里看到F大教的方法了,不过那天之后Calmact好像有其他事,没怎么折腾。我去尝试按照F大的方法提取acs.bin吧,看看能不能搞好。先在这谢谢O大了

@ophub ophub closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants