您尚未登录。

楼主 # 2022-01-28 22:51:06

TeveT
会员
注册时间: 2019-07-01
已发帖子: 149
积分: 92

因为不喜欢插拔TF卡,D1直接用PhoenixSuit烧录TF(SDNAND)

如题
因为不喜欢插拔卡搞来搞去,喜欢直接USB插上直接干活烧录到底,
那就,看下D1怎么搞TF直接通过PhoenixSuit烧录 TF卡或者SDNAND

第一步,看启动过程的LOG:

U-Boot 2018.05-g0a62f10 (Dec 31 2021 - 07:53:57 +0000) Allwinner Technology

[03.820]DRAM:  512 MiB
[03.825]Relocation Offset is: 1def0000
[03.847]secure enable bit: 0
[03.851]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=300Mhz
[03.858]flash init start
[03.860]workmode = 16,storage type = 0
try card 2
set card number 2
get card number 2
[03.867][mmc]: mmc driver ver uboot2018:2021-04-16 14:23:00-1
[03.876][mmc]: get sdc_type fail and use default host:tm4.
[03.900][mmc]: Is not Boot mode!
[03.903][mmc]: SUNXI SDMMC Controller Version:0x50310
[03.914][mmc]: ************Try SD card 2************
[03.919][mmc]: mmc 2 cmd timeout 100 status 100
[03.924][mmc]: smc 2 err, cmd 8,  RTO
[03.927][mmc]: mmc 2 close bus gating and reset
[03.932][mmc]: mmc 2 cmd timeout 100 status 100
[03.936][mmc]: smc 2 err, cmd 55,  RTO
[03.940][mmc]: mmc 2 close bus gating and reset
[03.944][mmc]: ************Try MMC card 2************
[03.953][mmc]: mmc 2 cmd timeout 100 status 100
[03.957][mmc]: smc 2 err, cmd 1,  RTO
[03.960][mmc]: mmc 2 close bus gating and reset
[03.965][mmc]: Card did not respond to voltage select!
[03.969][mmc]: ************SD/MMC 2 init error!************
[03.975][mmc]: mmc init product failed
MMC init failed
try emmc fail
[03.988]sunxi-spinand: AW SPINand MTD Layer Version: 1.5 20200407
[03.994]sunxi-spinand-phy: AW SPINand Phy Layer Version: 1.9 20200306
[04.041]sunxi-spinand-phy: request spi0 gpio ok
[04.045]sunxi-spinand-phy: request general tx dma channel ok!
[04.050]sunxi-spinand-phy: request general rx dma channel ok!
[04.056]sunxi-spinand-phy: set spic0 clk to 20 Mhz
[04.060]sunxi-spinand-phy: init spic0 clk ok
[04.085]sunxi-spinand-phy: read id failed : -110
try nand fail
[04.132]unrecognized JEDEC id bytes: ff, ff, ff
try spinor fail
initcall sequence 000000005ff948c8 failed at call 000000004200d70e (err=-1)
### ERROR ### Please RESET the board ###

看到关键的点
try card 2
set card number 2
get card number 2
这里默认从card 2 开始
那么咱就先试试看,直接从card 0 行不行?
直接搜索到代码中定位到的是:
tina_d1_open_v1.0.1\lichee\brandy-2.0\u-boot-2018\drivers\sunxi_flash\mmc\sdmmc.c
中的接口:

int sunxi_sprite_mmc_probe(void)
{
#ifndef CONFIG_MACH_SUN50IW11
	return sdmmc_init_for_sprite(0, 2);
#else
	int workmode = uboot_spare_head.boot_data.work_mode;
	if (workmode == WORK_MODE_CARD_PRODUCT)
		return -1;
	else
		return sdmmc_init_for_sprite(0, 0);
#endif
}

这里 CONFIG_MACH_SUN50IW11 没有定义
默认是执行 return sdmmc_init_for_sprite(0, 2);

那么咱就是说,直接改return sdmmc_init_for_sprite(0, 0); 试试看?

好的说改就改了。

int sunxi_sprite_mmc_probe(void)
{
#ifndef CONFIG_MACH_SUN50IW11
	return sdmmc_init_for_sprite(0, 0);
#else
	int workmode = uboot_spare_head.boot_data.work_mode;
	if (workmode == WORK_MODE_CARD_PRODUCT)
		return -1;
	else
		return sdmmc_init_for_sprite(0, 0);
#endif
}

改动了下,直接烧录测一下:

U-Boot 2018.05-g0a62f10-dirty (Jan 28 2022 - 22:35:17 +0800) Allwinner Technology

[03.804]DRAM:  512 MiB
[03.809]Relocation Offset is: 1def0000
[03.831]secure enable bit: 0
[03.835]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=300Mhz
[03.842]flash init start
[03.844]workmode = 16,storage type = 0
running in sunxi_sprite_mmc_probe try card
sdmmc_init_for_sprite try card 0
set card number 0
get card number 0
[03.857][mmc]: mmc driver ver uboot2018:2021-04-16 14:23:00-1
[03.866][mmc]: get sdc_type fail and use default host:tm1.
[03.891][mmc]: can't find node "mmc0",will add new node
[03.896][mmc]: fdt err returned <no error>
[03.900][mmc]: Using default timing para
[03.904][mmc]: SUNXI SDMMC Controller Version:0x50310
[03.922][mmc]: card_caps:0x3000000a
[03.925][mmc]: host_caps:0x3000003f
[03.933]Loading Environment from SUNXI_FLASH... OK
[03.939]try to burn key
[03.943]out of usb burn from boot: not need burn key
Hit any key to stop autoboot:  0
sunxi work mode=0x10
run usb efex
delay time 2500
weak:otg_phy_config
usb init ok
set address 0x30
set address 0x30 ok
set address 0x31
set address 0x31 ok
SUNXI_EFEX_ERASE_TAG
erase_flag = 0x12
origin_erase_flag = 0x1
FEX_CMD_fes_verify_status
FEX_CMD_fes_verify last err=0
the 0 mbr table is ok
the 1 mbr table is ok
the 2 mbr table is ok
the 3 mbr table is ok
*************MBR DUMP***************
total mbr part 9

part[0] name      :boot-resource
part[0] classname :DISK
part[0] addrlo    :0x1f8
part[0] lenlo     :0x1f80
part[0] user_type :32768
part[0] keydata   :0
part[0] ro        :0

part[1] name      :env
part[1] classname :DISK
part[1] addrlo    :0x2178
part[1] lenlo     :0x1f8
part[1] user_type :32768
part[1] keydata   :0
part[1] ro        :0

part[2] name      :env-redund
part[2] classname :DISK
part[2] addrlo    :0x2370
part[2] lenlo     :0x1f8
part[2] user_type :32768
part[2] keydata   :0
part[2] ro        :0

part[3] name      :boot
part[3] classname :DISK
part[3] addrlo    :0x2568
part[3] lenlo     :0x50b8
part[3] user_type :32768
part[3] keydata   :0
part[3] ro        :0

part[4] name      :dsp0
part[4] classname :DISK
part[4] addrlo    :0x7620
part[4] lenlo     :0x3f0
part[4] user_type :32768
part[4] keydata   :0
part[4] ro        :0

part[5] name      :recovery
part[5] classname :DISK
part[5] addrlo    :0x7a10
part[5] lenlo     :0x6e40
part[5] user_type :32768
part[5] keydata   :0
part[5] ro        :0

part[6] name      :rootfs
part[6] classname :DISK
part[6] addrlo    :0xe850
part[6] lenlo     :0x1000000
part[6] user_type :32768
part[6] keydata   :0
part[6] ro        :0

part[7] name      :rootfs_data
part[7] classname :DISK
part[7] addrlo    :0x100e850
part[7] lenlo     :0x6400
part[7] user_type :32768
part[7] keydata   :0
part[7] ro        :0

part[8] name      :UDISK
part[8] classname :DISK
part[8] addrlo    :0x1014c50
part[8] lenlo     :0x0
part[8] user_type :33024
part[8] keydata   :0
part[8] ro        :0

total part: 10
mbr 0, 1f8, 8000
boot-resource 1, 1f80, 8000
env 2, 1f8, 8000
env-redund 3, 1f8, 8000
boot 4, 50b8, 8000
dsp0 5, 3f0, 8000
recovery 6, 6e40, 8000
rootfs 7, 1000000, 8000
rootfs_data 8, 6400, 8000
UDISK 9, 0, 8100
[07.119]erase all part start
need erase flash: 18
[07.125][mmc]: mmc_mmc_erase: sd card don't support erase
[07.130]read item0 copy0
[07.132][mmc]: memalign dst_align is NULL!
read first backup failed in fun sunxi_sprite_mmc_secread line 468
[07.142][mmc]: memalign dst_align is NULL!
read first backup failed in fun sunxi_sprite_mmc_secread line 468
[07.152]unknown error happen in item 0 read
[07.155]get secure storage map err
[07.159][mmc]: memalign src_align is NULL!
write first backup failed in fun sunxi_sprite_mmc_secwrite line 533
[07.168]erase secure storage block 0 err
SUNXI_EFEX_MBR_TAG
mbr size = 0x10000
write primary GPT success
write Backup GPT success
[08.043]update partition map
FEX_CMD_fes_verify_status
FEX_CMD_fes_verify last err=0
running in sunxi_sprite_mmc_init try card 2
******Has init
FEX_CMD_fes_verify_value, start 0x1f8, size high 0x0:low 0x2f8c00
FEX_CMD_fes_verify_value 0x3481d9f0
FEX_CMD_fes_verify_value, start 0x2178, size high 0x0:low 0x20000
FEX_CMD_fes_verify_value 0xcb347ad3
FEX_CMD_fes_verify_value, start 0x2370, size high 0x0:low 0x20000
FEX_CMD_fes_verify_value 0xcb347ad3
FEX_CMD_fes_verify_value, start 0x2568, size high 0x0:low 0x91d000
FEX_CMD_fes_verify_value 0xe5a32b17
FEX_CMD_fes_verify_value, start 0x7620, size high 0x0:low 0x4059c
FEX_CMD_fes_verify_value 0x413a5c54
FEX_CMD_fes_verify_value, start 0xe850, size high 0x0:low 0x6400000
FEX_CMD_fes_verify_value 0x87284509
bootfile_mode=4
SUNXI_EFEX_BOOT1_TAG
boot1 size = 0xfc000, max size = 0x200000
uboot size = 0xfc000
storage type = 7
FEX_CMD_fes_verify_status
FEX_CMD_fes_verify last err=0
bootfile_mode=4
SUNXI_EFEX_BOOT0_TAG
boot0 size = 0x10000
[36.353][mmc]: write mmc 0 info ok
dram para[0] = 318
dram para[1] = 3
dram para[2] = 7b7bfb
dram para[3] = 1
dram para[4] = 10f210f2
dram para[5] = 4001000
dram para[6] = 1c70
dram para[7] = 42
dram para[8] = 18
dram para[9] = 0
dram para[10] = 4a2195
dram para[11] = 2423190
dram para[12] = 8b061
dram para[13] = b4787896
dram para[14] = 0
dram para[15] = 48484848
dram para[16] = 48
dram para[17] = 1620121e
dram para[18] = 0
dram para[19] = 0
dram para[20] = 0
dram para[21] = 870000
dram para[22] = 24
dram para[23] = b4056103
dram para[24] = 0
dram para[25] = 0
dram para[26] = 0
dram para[27] = 0
dram para[28] = 0
dram para[29] = 0
dram para[30] = 0
dram para[31] = 0
storage type = 7
FEX_CMD_fes_verify_status
FEX_CMD_fes_verify last err=0
sunxi_efex_next_action=2
exit usb
next work 2
▒[33]HELLO! BOOT0 is starting!T
[36]BOOT0 commit : 603490b
[38]set pll start
[40]periph0 has been enabled
[43]set pll end
[44][pmu]: bus read error
[47]board init ok
[49]DRAM only have internal ZQ!!
[52]get_pmu_exist() = -1
[54]DRAM BOOT DRIVE INFO: V0.24
[57]DRAM CLK = 792 MHz
[59]DRAM Type = 3 (2:DDR2,3:DDR3)
[62]DRAMC ZQ value: 0x7b7bfb
[65]DRAM ODT value: 0x42.
[67]ddr_efuse_type: 0x0
[70]DRAM SIZE =1024 M
[74]DRAM simple test OK.
[76]dram size =1024
[78]card no is 0
[79]sdcard 0 line count 4
[82][mmc]: mmc driver ver 2021-04-2 16:45
[91][mmc]: Wrong media type 0x0
[94][mmc]: ***Try SD card 0***
[103][mmc]: HSSDR52/SDR25 4 bit
[106][mmc]: 50000000 Hz
[108][mmc]: 15280 MB
[110][mmc]: ***SD/MMC 0 init OK!!!***
[158]Loading boot-pkg Succeed(index=0).
[162]Entry_name        = opensbi
[165]Entry_name        = u-boot
[169]Entry_name        = dtb
[171]mmc not para
[173]Jump to second Boot.

23333 还真就烧录进去了,也不知道这会有什么隐患没,反正我用着很舒服,不用插拔卡了。若有啥隐患还请大佬们指正。
同时呢,这个烧录口USB还能做adb shell调试用,美滋滋了。

而且呢额外挂载的 /mnt/SDCARD 空间等可以在烧录后保留,不会被擦除。


芜湖,起飞!

最近编辑记录 TeveT (2022-01-28 22:53:27)

离线

楼主 #2 2022-01-29 22:46:29

TeveT
会员
注册时间: 2019-07-01
已发帖子: 149
积分: 92

Re: 因为不喜欢插拔TF卡,D1直接用PhoenixSuit烧录TF(SDNAND)

拉轰的脚踏车 说:

楼主牛逼, 这是利用 uboot 烧录吗?那如何开机自动进入烧录模式呢?

D1芯片有个腿的, FEL ,接上一个按键,按住再上电即可
我都是瞎看log瞎改,所以也不知道我改的这个烧录靠谱不靠谱,还得等各位大佬检验

离线

楼主 #4 2022-02-26 12:19:59

TeveT
会员
注册时间: 2019-07-01
已发帖子: 149
积分: 92

Re: 因为不喜欢插拔TF卡,D1直接用PhoenixSuit烧录TF(SDNAND)

李泓辰 说:

楼主牛逼,期待大佬们的验证

已经玩过烧录测试过不下1000次,每次都成功,放心食用。
tina 2.2版本依然舒适

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn