ophub / amlogic-s9xxx-armbian

Support for Armbian 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
5.7k stars 1.83k forks source link

魔百盒CM211-1-CH 可以U盘启动,写入EMMC失败 #986

Closed mengliwunian closed 1 year ago

mengliwunian commented 1 year ago

Standard chat template, no routine, no chat. 标准聊天模板,无套路不聊天。

Device Information | 设备信息

Armbian Version | 系统版本

Describe the bug | 问题描述 Describe the problem in detail and attach screenshots if necessary. 详细描述问题,并在必要时附上屏幕截图。

使用Armbian_23.02.0_amlogic_s905l2_jammy_6.1.8_server_2023.01.28 固件

dtb 尝试了很多个, meson-gxl-s905l2-ipbs9505.dtb、 meson-gxl-s905l2-x7-5g.dtb、 meson-gxl-s905l3b-e900v22e.dtb

能识别EMMC,但是写入EMMC失败,尝试过降频到100的meson-gxl-s905l2-e900v21e能识别,还是写不进去

EMMC型号是康佳KAS03111,见后图

3

lsblk

EMMC型号: 康佳EMMC

康佳EMMC1

官方安卓提取dtb及dts: gxlx2_p291_2g.zip

附上错误日志:


croot@armbian:/proc# armbian-install
[ STEPS ] Start install Armbian to eMMC...
[ STEPS ] Start checking dependencies...
[ INFO ] Dependency check completes, Start installing Armbian.
[ STEPS ] Start initializing the environment...
[ INFO ] Use mainline u-boot: [ no ]
[ INFO ] Using the Ampart tool: [ yes ]
[ INFO ] Show all lists: [ no ]
[ INFO ] The device eMMC name: [ /dev/mmcblk2 ]
[ STEPS ] Start selecting device...
--------------------------------------------------------------------------------------
ID    SOC        MODEL                          DTB                             
--------------------------------------------------------------------------------------
101   s905d      Phicomm-N1                     meson-gxl-s905d-phicomm-n1.dtb  
102   s905d      Phicomm-N1(DMA-thresh)         meson-gxl-s905d-phicomm-n1-thresh.dtb
103   s905x      HG680P                         meson-gxl-s905x-p212.dtb        
104   s905w      TX3-Mini                       meson-gxl-s905w-tx3-mini.dtb    
105   s905d      MECOOL-KI-Pro                  meson-gxl-s905d-mecool-ki-pro.dtb
106   s905x      T95                            meson-gxl-s905x-p212.dtb        
107   s905x      B860H                          meson-gxl-s905x-b860h.dtb       
108   s905x      TBee                           meson-gxl-s905x-tbee.dtb        
109   s905w      W95                            meson-gxl-s905w-p281.dtb        
110   s905w      X96-Mini                       meson-gxl-s905w-x96-mini.dtb    
111   s905x      TX9                            meson-gxl-s905x-tx9.dtb         
112   s905l3b    M302A/M304A                    meson-gxl-s905l3b-m302a.dtb     
113   s905l2     MGV2000/MGV3000                meson-gxl-s905l2-x7-5g.dtb      
114   s905l2     Wojia-TV-IPBS9505              meson-gxl-s905l2-ipbs9505.dtb   
115   s905l-b    Q96-mini                       meson-gxl-s905x-p212.dtb        
116   s905l3     CM311-1/HG680-LC               meson-gxl-s905l2-x7-5g.dtb      
117   s905l3b    E900V22E                       meson-gxl-s905l3b-e900v22e.dtb  
0     Other      Customize                      Enter-custom-dtb-name           
--------------------------------------------------------------------------------------
[ OPTIONS ] Please Input ID: 117
[ INFO ] Input Box ID: [ 117 ]
[ INFO ] FDTFILE: [ meson-gxl-s905l3b-e900v22e.dtb ]
[ INFO ] MAINLINE_UBOOT: [  ]
[ INFO ] BOOTLOADER_IMG:  [  ]
[ INFO ] UBOOT_OVERLOAD: [ u-boot-s905x-s912.bin ]
[ INFO ] K510: [ 1 ]
[ STEPS ] Start selecting file system type...
-----------------------------------------------
ID  TYPE
-----------------------------------------------
1   ext4
2   btrfs
-----------------------------------------------
[ OPTIONS ] Please Input ID: 1
[ INFO ] Input Type ID: [ 1 ]
[ INFO ] The type of file system: [ ext4 ]
[ STEPS ] Start creating eMMC partition...
[ INFO ] Start backup default bootloader.
4+0 records in
4+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.350547 s, 12.0 MB/s
[  284.338449] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
[  284.341544] Buffer I/O error on dev mmcblk2, logical block 0, lost async page write
[  284.446972] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
[  284.450074] Buffer I/O error on dev mmcblk2, logical block 0, lost async page write
[  284.497746] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
[  284.500871] Buffer I/O error on dev mmcblk2, logical block 0, lost async page write
dd: fsync failed for '/dev/mmcblk2': Input/output error
1+0 records in
1+0 records out
512 bytes copied, 0.035841 s, 14.3 kB/s
[ INFO ] Start create MBR and partittion.
[  284.639974] I/O error, dev mmcblk2, sector 15106024 op 0x1:(WRITE) flags 0x800 phys_seg 3 prio class 2
[  284.643714] Buffer I/O error on dev mmcblk2, logical block 1888253, lost async page write
[  284.651797] Buffer I/O error on dev mmcblk2, logical block 1888254, lost async page write
[  284.659907] Buffer I/O error on dev mmcblk2, logical block 1888255, lost async page write
[  284.672893] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 3 prio class 2
[  284.676616] Buffer I/O error on dev mmcblk2, logical block 0, lost async page write
[  284.684236] Buffer I/O error on dev mmcblk2, logical block 1, lost async page write
[  284.691840] Buffer I/O error on dev mmcblk2, logical block 2, lost async page write
[  284.729089] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
[  284.732179] Buffer I/O error on dev mmcblk2, logical block 0, lost async page write
Error: Input/output error during write on /dev/mmcblk2
[  284.808830] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Error: Input/output error during write on /dev/mmcblk2
[  284.878375] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Error: Input/output error during write on /dev/mmcblk2
[ INFO ] Restore the mybox bootloader: [ /usr/lib/u-boot/mybox-bootloader.img ]
[  284.924794] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
dd: fsync failed for '/dev/mmcblk2': Input/output error
444+0 records in
444+0 records out
444 bytes copied, 0.0286846 s, 15.5 kB/s
[  285.619031] I/O error, dev mmcblk2, sector 0 op 0x1:(WRITE) flags 0x4800 phys_seg 63 prio class 2
dd: fsync failed for '/dev/mmcblk2': Input/output error
8191+0 records in
8191+0 records out
4193792 bytes (4.2 MB, 4.0 MiB) copied[  285.691080]  mmcblk2: p1 p2
, 0.753828 s, 5.6 MB/s
[ STEPS ] Start processing the bootfs partition...
[ INFO ] Formatting BOOTFS partition.
mkfs.fat 4.2 (2021-01-31)
mkfs.vfat: unable to synchronize /dev/mmcblk2p1:Input/output error
[  285.872853] FAT-fs (mmcblk2p1): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1)
[  285.876037] FAT-fs (mmcblk2p1): error, fat_get_cluster: invalid cluster chain (i_pos 1)
[  285.883762] FAT-fs (mmcblk2p1): Filesystem has been set read-only
mount: /ddbr/install: can't read superblock on /dev/mmcblk2p1.
[ ERROR ] Failed to mount BOOTFS partition
root@armbian:/proc#

安卓分区信息:
NTD:
dev:    size   erasesize  name
inand01:    400000     80000 "bootloader"
inand02:   4000000     80000 "reserved"
inand03:  2d000000     80000 "cache"
inand04:    800000     80000 "env"
inand05:   2000000     80000 "logo"
inand06:   2000000     80000 "recovery"
inand07:    800000     80000 "rsv"
inand08:    800000     80000 "tee"
inand09:   2000000     80000 "crypt"
inand10:   2000000     80000 "misc"
inand11:  20000000     80000 "instaboot"
inand12:   2000000     80000 "boot"
inand13:  40000000     80000 "system"
inand14:   4000000     80000 "params"
inand15:  2d000000     80000 "bootfiles"
inand16:  f6400000     80000 "data"

partitions:
 253        0     512000 zram0
 179        0    7553024 mmcblk0
 179        1       4096 mmcblk0p1
 179        2      65536 mmcblk0p2
 179        3     737280 mmcblk0p3
 179        4       8192 mmcblk0p4
 179        5      32768 mmcblk0p5
 179        6      32768 mmcblk0p6
 179        7       8192 mmcblk0p7
 179        8       8192 mmcblk0p8
 179        9      32768 mmcblk0p9
 179       10      32768 mmcblk0p10
 179       11     524288 mmcblk0p11
 179       12      32768 mmcblk0p12
 179       13    1048576 mmcblk0p13
 179       14      65536 mmcblk0p14
 179       15     737280 mmcblk0p15
 179       16    4034560 mmcblk0p16
 179       96       4096 mmcblk0rpmb
 179       64       4096 mmcblk0boot1
 179       32       4096 mmcblk0boot0

block:
brw------- root     root     179,  12 2015-01-01 08:00 boot
brw------- root     root     179,  15 2015-01-01 08:00 bootfiles
brw------- root     root     179,   1 2015-01-01 08:00 bootloader
brw------- root     root     179,   3 2015-01-01 08:00 cache
brw------- root     root     179,   9 2015-01-01 08:00 crypt
brw------- root     root     179,  16 2015-01-01 08:00 data
brw------- root     root     179,   4 2015-01-01 08:00 env
brw------- root     root     179,  11 2015-01-01 08:00 instaboot
brw------- root     root     179,   5 2015-01-01 08:00 logo
brw------- root     root       7,   0 2015-01-01 08:00 loop0
brw------- root     root       7,   1 2015-01-01 08:00 loop1
brw------- root     root       7,   2 2015-01-01 08:00 loop2
brw------- root     root       7,   3 2015-01-01 08:00 loop3
brw------- root     root       7,   4 2015-01-01 08:00 loop4
brw------- root     root       7,   5 2015-01-01 08:00 loop5
brw------- root     root       7,   6 2015-01-01 08:00 loop6
brw------- root     root       7,   7 2015-01-01 08:00 loop7
brw------- root     root     179,  10 2015-01-01 08:00 misc
brw------- root     root     179,   0 2015-01-01 08:00 mmcblk0
brw------- root     root     179,  32 2015-01-01 08:00 mmcblk0boot0
brw------- root     root     179,  64 2015-01-01 08:00 mmcblk0boot1
brw------- root     root     179,  96 2015-01-01 08:00 mmcblk0rpmb
brw------- root     root     179,  14 2015-01-01 08:00 params
drwxr-xr-x root     root              2023-01-29 23:30 platform
brw------- root     root     179,   6 2015-01-01 08:00 recovery
brw------- root     root     179,   2 2015-01-01 08:00 reserved
brw------- root     root     179,   7 2015-01-01 08:00 rsv
brw------- root     root       8,   0 2023-01-29 23:30 sda
brw------- root     root       8,   1 2023-01-29 23:30 sda1
brw------- root     root     179,  13 2015-01-01 08:00 system
brw------- root     root     179,   8 2015-01-01 08:00 tee
drwxr--r-- root     root              2023-01-29 23:30 vold
brw------- root     root     253,   0 2015-01-01 08:00 zram0
mengliwunian commented 1 year ago

@7Ji 按上面分区信息写入EMMC后启动不了,是不是需要把logo分区保留

gxl_p211_v1#reboot
reboot use default mode: normal
INFO:    PSCI Affinity Map:
INFO:      AffInst: Level 0, MPID 0x0, State ON
INFO:      AffInst: Level 0, MPID 0x1, State OFF
INFO:      AffInst: Level 0, MPID 0x2, State OFF
INFO:      AffInst: Level 0, MPID 0x3, State OFF
bl31 reboot reason: 0x1
bl31 reboot reason: 0x1
ERROR:   gxbb System Reset: SCP error 1.
GXLX2:BL1:3cfee7:42a5ae;FEAT:ADFD318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 39460

BL2 Built : 13:35:42, Jun  1 2021.
gxl g49d5acc - liqiang.hou@droid07-sz

Board ID = 12, adc=918
set vcck to 1070 mv
set vddee to 1070 mv
CPU clk: 1200MHz

DDR4 chl: Rank0+1 @ 912MHz - FAIL
DDR4 chl: Rank0 @ 912MHz
bist_test rank: 0 1e 00 3d 31 17 4c 1d 00 3a 36 1b 52 1b 00 37 3b 20 56 19 00 33 39 20 52 630   - PASS

Rank0: 2048MB(auto)-2T-18
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: 0x013c0000, size: 0x00007600
Load bl301 from eMMC, src: 0x00018200, des: 0x01380000, size: 0x00002600
Load bl31 from eMMC, src: 0x0001c200, des: 0x10100000, size: 0x00019600
Load bl33 from eMMC, src: 0x00038200, des: 0x01000000, size: 0x0004dc00
NOTICE:  BL3-1: v1.0(debug):27617c8a4
NOTICE:  BL3-1: Built : 18:02:23, Aug 18 2021
NOTICE:  BL31: GXL normal boot!
NOTICE:  BL31: BL33 decompress pass
[Image: gxl_v1.1.3103-923400455-dirty 2020-12-28 18:42:52 xingyu.chen@droid12-sz]
efuse init ops = c5
efuse init hdcp = c, cf9=7
x2_hp_e = 0
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: 0 0 3 c c 0 b6 b3 60 a0 0 c5 not ES chip
[0.560601 Inits done]
INFO:    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

U-Boot 2015.01 (Oct 21 2021 - 04:30:34), Build: jenkins-J_CMCC_HG680-LY_2_S905L_CMCCGUANGDONG-194

DRAM:  2 GiB
Relocation Offset is: 76edf000
gpio: pin GPIODV_25 (gpio 44) value is 1
register usb cfg[0][1] = 0000000077f5d738
[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 = 0x0000000073ecfac0
aml_priv->desc_buf = 0x0000000073ed1de0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
dtb magic 00088b1f
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      unified board, board id = 12
      Multi dtb tool version: v2 .
      Support 6 dtbs.
        aml_dt soc: gxlx2 platform: p291 variant: 2g
        dtb 0 soc: gxlx2   plat: p291   vari: 1g
        dtb 1 soc: gxlx2   plat: p291   vari: 2g
        dtb 2 soc: gxlx2   plat: p291   vari: 3g
        dtb 3 soc: gxlx2   plat: p295   vari: 1g
        dtb 4 soc: gxlx2   plat: p295   vari: 2g
        dtb 5 soc: gxlx2   plat: p295   vari: 3g
      Find match dtb: 1
start dts,buffer=0000000073ed4610,dt_addr=0000000073ed4610
      Amlogic multi-dtb tool
      Single dtb detected
parts: 1
00:      data   ffffffffffffffff 4
init_part() 278: PART_TYPE_DOS
eMMC/TSD partition table have been checked OK!
check pattern success
mmc env offset: 0x7400000
In:    serial
Out:   serial
Err:   serial
board id is : 12
hpd_state=0
do_hpd_detect: hdmimode=720p50hz
do_hpd_detect: colorattribute=444,8bit
cvbs performance type = 7, table = 2
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-924: calc 20a349c7, store 20a349c7
_verify_dtb_checksum()-924: calc 20a349c7, store 20a349c7
dtb_read()-1046: total valid 2
dtb_read()-1113: do nothing
      Amlogic multi-dtb tool
      GZIP format, decompress...
      Multi dtb detected
      unified board, board id = 12
      Multi dtb tool version: v2 .
      Support 6 dtbs.
        aml_dt soc: gxlx2 platform: p291 variant: 2g
        dtb 0 soc: gxlx2   plat: p291   vari: 1g
        dtb 1 soc: gxlx2   plat: p291   vari: 2g
        dtb 2 soc: gxlx2   plat: p291   vari: 3g
        dtb 3 soc: gxlx2   plat: p295   vari: 1g
        dtb 4 soc: gxlx2   plat: p295   vari: 2g
        dtb 5 soc: gxlx2   plat: p295   vari: 3g
      Find match dtb: 1
Net:   eth_initialize:396 dwmac.c9410000 idx:0
amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0

wipe_data=successful
wipe_cache=successful
_get_part_index_by_name()-165: do not find match in table vendor
Err imgread(L536):invalid partition name(vendor)
ext4logoLoadCmd=ext4load mmc 1:${logoPart} ${logoLoadAddr} ${ext4LogoPath}
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Err imgread(L543):Fail in load logo cmd
logo part bootup
_find_partition_by_name()-188: do not find match in table logo
Cannot find dev.
amlmmc cmd <NULL> failed

store - STORE sub-system

Usage:
store store init flag
store read name addr off|partition size
    read 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store write name addr off|partition size
    write 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store rom_write add off size.
        write uboot to the boot device
store erase boot/data:
        erase the area which is uboot or data
store erase partition <partition_name>:
        erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
        scrub the area from offset and size
store dtb iread/read/write addr <size>
        read/write dtb, size is optional
store key read/write addr <size>
        read/write key, size is optional
store mbr addr
   update mbr/partition table by dtb

cmd store failed
Err imgread(L336):Fail to read 0x2000B from part[logo] at offset 0
There is no valid bmp file at the given address
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f800000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f800000
[CANVAS]addr=0x7f800000 width=3840, height=2160
There is no valid bmp file at the given address
upgrade_step=0
upgrade_step12=0
amlkey_init() enter!
amlkey_init() 70: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[KM]Error:f[key_manage_query_size]L507:key[cmei] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[authkey] not programed yet
key1 = 7d82dd22
key2 = 7e81dd22
key3 = 728ddd22
time_out = 7a120
ir init
irkey - irkey key_value1 key_value2 key_value3 time_value

Usage:
irkey
rebootmode=normal
Hit any key to stop autoboot:  0
_find_partition_by_name()-188: do not find match in table boot
Cannot find dev.
amlmmc cmd <NULL> failed

store - STORE sub-system

Usage:
store store init flag
store read name addr off|partition size
    read 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store write name addr off|partition size
    write 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store rom_write add off size.
        write uboot to the boot device
store erase boot/data:
        erase the area which is uboot or data
store erase partition <partition_name>:
        erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
        scrub the area from offset and size
store dtb iread/read/write addr <size>
        read/write dtb, size is optional
store key read/write addr <size>
        read/write key, size is optional
store mbr addr
   update mbr/partition table by dtb

cmd store failed
Err imgread(L135):Fail to read 0x100000B from part[boot] at offset 0
Enter USB burn
Try connect time out 1001, 1000, 1387
card out
[MSG]mmcinfo failed!
(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 **
** File not found /recovery/dtb.img **
** File not found /recovery/recovery.img **
_find_partition_by_name()-188: do not find match in table recovery
Cannot find dev.
amlmmc cmd <NULL> failed

store - STORE sub-system

Usage:
store store init flag
store read name addr off|partition size
    read 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store write name addr off|partition size
    write 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store rom_write add off size.
        write uboot to the boot device
store erase boot/data:
        erase the area which is uboot or data
store erase partition <partition_name>:
        erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
        scrub the area from offset and size
store dtb iread/read/write addr <size>
        read/write dtb, size is optional
store key read/write addr <size>
        read/write key, size is optional
store mbr addr
   update mbr/partition table by dtb

cmd store failed
Err imgread(L135):Fail to read 0x100000B from part[recovery] at offset 0
gxl_p211_v1#
7Ji commented 1 year ago

parts: 1 00: data ffffffffffffffff 4

ampart已经把你的盒子的布局调整成只有data了,上面的参数根本是不需要的

上面失败的是安卓启动的流程,env可能被你用ampart却写了这种布局导致损坏了,所以回退到了默认启动参数。能用ampart调整分区的话不要用这里的表格推算,你现在再看分区表绝对和之前的不一样。

U-boot 命令行打 reboot update再加载一下外面U盘或者sd卡的启动脚本,然后用纯默认的armbian-install装