T113S3使用spinand启动进不了kernel问题
-
使用evb1板卡的配置,跟随下方链接配置为spi nand启动后,发现进不了kernel
https://bbs.aw-ol.com/topic/1701/tina-linux-存储介质切换-emmc-spi-nand-spi-nor-sd-card-sd-nand?_=1699127558925使用的flash是1Gbit的XT26G04CWSIGA,看到id.c中有这个芯片的支持。
完整日志如下:
HELLO! BOOT0 is starting! [09:59:25.488] [140]BOOT0 commit : 1417090655 [09:59:25.498] [143]set pll start [09:59:25.498] [149]periph0 has been enabled [09:59:25.498] [152]set pll end [09:59:25.508] [154][pmu]: bus read error [09:59:25.508] [157]board init ok [09:59:25.508] [159]enable_jtag [09:59:25.508] [160]ZQ value = 0x30 [09:59:25.519] [162]get_pmu_exist() = -1 [09:59:25.519] [165]DRAM BOOT DRIVE INFO: V0.33 [09:59:25.519] [168]DRAM CLK = 792 MHz [09:59:25.519] [170]DRAM Type = 3 (2:DDR2,3:DDR3) [09:59:25.529] [174]DRAMC read ODT off. [09:59:25.529] [176]DRAM ODT value: 0x42. [09:59:25.529] [179]ddr_efuse_type: 0xa [09:59:25.529] [182]DRAM SIZE =128 M [09:59:25.539] [184]dram_tpr4:0x0 [09:59:25.539] [186]PLL_DDR_CTRL_REG:0xf8004100 [09:59:25.539] [189]DRAM_CLK_REG:0xc0000000 [09:59:25.539] [192][TIMING DEBUG] MR2= 0x18 [09:59:25.549] [200]DRAM simple test OK. [09:59:25.549] [202]rtc standby flag is 0x0, super standby flag is 0x0 [09:59:25.559] [208]dram size =128 [09:59:25.559] [211]spinand UBOOT_START_BLK_NUM 8 UBOOT_LAST_BLK_NUM 32 [09:59:25.569] [216]block from 8 to 32 [09:59:25.569] [300]Check is correct. [09:59:25.648] [302]dma 0x2ac4c int is not used yet [09:59:25.658] [305]dma 0x2ac4c int is free, you do not need to free it again [09:59:25.658] [311]Entry_name = u-boot [09:59:25.668] [318]Entry_name = optee [09:59:25.668] [322]Entry_name = dtb [09:59:25.678] [325]Jump to second Boot. [09:59:25.678] M/TC: OP-TEE version: 8b49ce62-dirty (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)) #1 Fri Aug 12 08:24:15 UTC 2022 arm [09:59:25.718] [09:59:25.718] [09:59:25.718] U-Boot 2018.07-gd9e6718-dirty (Aug 20 2024 - 01:08:36 +0000) Allwinner Technology [09:59:25.728] [09:59:25.728] [00.377]CPU: Allwinner Family [09:59:25.728] [00.380]Model: sun8iw20 [09:59:25.738] [00.382]DRAM: 128 MiB [09:59:25.738] [00.386]Relocation Offset is: 04ec4000 [09:59:25.738] [00.413]secure enable bit: 0 [09:59:25.768] E/TC:0 fdt_getprop_u32:343 prop trace_level not found [09:59:25.778] [00.426]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz MBus=300Mhz [09:59:25.788] [00.432]gic: sec monitor mode [09:59:25.788] sunxi flash map init [09:59:25.788] SPI ALL: ready [09:59:25.788] [00.439]flash init start [09:59:25.798] [00.442]workmode = 0,storage type = 0 [09:59:25.798] [00.448]sunxi-spinand-phy: spinand sample_mode:2 sample_delay:8 [09:59:25.808] [09:59:25.808] device nand0 <nand>, # parts = 4 [09:59:25.818] #: name size offset mask_flags [09:59:25.818] 0: boot0 0x00200000 0x00000000 1 [09:59:25.818] 1: uboot 0x00600000 0x00200000 1 [09:59:25.818] 2: secure_storage 0x00200000 0x00800000 1 [09:59:25.828] 3: sys 0x1f600000 0x00a00000 0 [09:59:25.828] [09:59:25.828] active partition: nand0,0 - (boot0) 0x00200000 @ 0x00000000 [09:59:25.838] [09:59:25.838] defaults: [09:59:25.838] mtdids : nand0=nand [09:59:25.838] mtdparts: mtdparts=nand:2048k@0(boot0)ro,6144k@2097152(uboot)ro,2048k@8388608(secure_storage)ro,-(sys) [09:59:25.848] [00.894]ubi0: attaching mtd4 [09:59:26.249] [01.443]ubi0: scanning is finished [09:59:26.798] [01.450]ubi0: attached mtd4 (name "sys", size 502 MiB) [09:59:26.809] [01.455]ubi0: PEB size: 524288 bytes (512 KiB), LEB size: 516096 bytes [09:59:26.819] [01.461]ubi0: min./max. I/O unit sizes: 8192/8192, sub-page size 4096 [09:59:26.819] [01.467]ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192 [09:59:26.829] [01.474]ubi0: good PEBs: 999, bad PEBs: 5, corrupted PEBs: 0 [09:59:26.829] [01.479]ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128 [09:59:26.839] [01.486]ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0 [09:59:26.849] [01.493]ubi0: available PEBs: 0, total reserved PEBs: 999, PEBs reserved for bad PEB handling: 35 [09:59:26.849] [01.502]sunxi flash init ok [09:59:26.859] [01.505]line:703 init_clocks [09:59:26.859] [01.508]drv_disp_init [09:59:26.859] [01.512]handle_num : 6 [09:59:26.869] request pwm success, pwm7:pwm7:0x2000c00. [09:59:26.879] [01.523]drv_disp_init finish [09:59:26.879] [01.568]Loading Environment from SUNXI_FLASH... Can't find env-redund partition [09:59:26.949] *** Warning - no device, using default environment [09:59:26.949] [09:59:26.949] Failed (-19) [09:59:26.959] [01.603]boot_gui_init:start [09:59:26.959] [01.606]set disp.dev2_output_type fail. using defval=0 [09:59:26.959] [01.612]set disp.fb0_rot_used fail. using defval=0 [09:59:26.969] [01.617]set disp.fb0_rot_degree fail. using defval=0 [09:59:26.969] [01.622]boot_gui_init:finish [09:59:26.979] partno erro : can't find partition bootloader [09:59:26.989] partno erro : can't find partition boot-resource [09:59:27.009] [01.660]Get bootloader and boot-resource partition number fail! [09:59:27.018] [01.668]Item0 (Map) magic is bad [09:59:27.028] [01.671]usb burn from boot [09:59:27.028] delay time 0 [09:59:27.028] weak:otg_phy_config [09:59:27.028] [01.682]usb prepare ok [09:59:27.038] [01.793]LCD open finish [09:59:27.148] [01.869]usb sof ok [09:59:27.218] [01.871]usb probe ok [09:59:27.228] [01.873]usb setup ok [09:59:27.228] set address 0x3e [09:59:27.258] set address 0x3e ok [09:59:27.258] set address 0x3f [09:59:27.449] set address 0x3f ok [09:59:27.449] try to update [09:59:27.488] [02.278]do_burn_from_boot usb : have no handshake [09:59:27.639] cann't get the boot_base from the env [09:59:27.639] [02.300]update bootcmd [09:59:27.649] [02.334]change working_fdt 0x45e83e70 to 0x45e63e70 [09:59:27.689] [02.353]update dts [09:59:27.709] Hit any key to stop autoboot: 2 1 0 [09:59:29.718] ## Error: "distro_bootcmd" not defined
env.cfg如下
#kernel command arguments earlyprintk=sunxi-uart,0x02500000 initcall_debug=0 console=ttyS0,115200 nand_root=/dev/ubiblock0_5 mmc_root=/dev/mmcblk0p5 mtd_name=sys rootfstype=squashfs root_partition=rootfs boot_partition=boot init=/init loglevel=8 cma=4M mac= wifi_mac= bt_mac= specialstr= #keybox_list=widevine,ec_key,ec_cert1,ec_cert2,ec_cert3,rsa_key,rsa_cert1,rsa_cert2,rsa_cert3 dsp0_partition=dsp0 #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this setargs_nand=setenv bootargs ubi.mtd=${mtd_name} ubi.block=0,${root_partition} earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} rootfstype=${rootfstype} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1 setargs_nand_ubi=setenv bootargs ubi.mtd=${mtd_name} ubi.block=0,${root_partition} earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} rootfstype=${rootfstype} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1 setargs_mmc=setenv bootargs earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${mmc_root} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1 #nand command syntax: sunxi_flash read address partition_name read_bytes #0x4007f800 = 0x40080000(kernel entry) - 0x800(boot.img header 2k) #boot_dsp0=sunxi_flash read 43000000 ${dsp0_partition};bootr 43000000 0 0 #boot_normal=sunxi_flash read 43000000 ${boot_partition};bootm 43000000 boot_dsp0=sunxi_flash read 43000000 ${dsp0_partition};bootr 43000000 0 0 boot_normal=sunxi_flash read 43000000 ${boot_partition};bootm 43000000 boot_recovery=sunxi_flash read 43000000 recovery;bootm 43000000 boot_fastboot=fastboot #uboot system env config bootdelay=2 #default bootcmd, will change at runtime according to key press #default nand boot #bootcmd=run setargs_nand boot_dsp0 boot_normal bootcmd=run setargs_nand boot_normal
sys_config.fex中storage_type = 5
看日志似乎和分区表sys_partition.fex有点关系?
麻烦各位大佬帮忙看看,提供点思路。 -
看日志说的是找不发到env-redund分区
Loading Environment from SUNXI_FLASH... Can't find env-redund partition
[17:26:53.990] *** Warning - no device, using default environment但是我的sys_partition.fex已经了加了这个分区来着
[code] ;--------------------------------------------------------------------------------------------------- ; 说明: 脚本中的字符串区分大小写,用户可以修改"="后面的数值,但是不要修改前面的字符串 ;--------------------------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------------------------- ; 固件下载参数配置 ;--------------------------------------------------------------------------------------------------- ;*************************************************************************************************** ; mbr的大小, 以Kbyte为单位 ;*************************************************************************************************** [mbr] size = 252 ;*************************************************************************************************** ; 分区配置 ; ; ; partition 定义范例: ; [partition] ; //表示是一个分区 ; name = USERFS2 ; //分区名称 ; size = 16384 ; //分区大小 单位: 扇区.分区表示个数最多2^31 * 512 = 2T ; downloadfile = "123.fex" ; //下载文件的路径和名称,可以使用相对路径,相对是指相对于image.cfg文件所在分区。也可以使用绝对路径 ; keydata = 1 ; //私有数据分区,重新量产数据将不丢失 ; encrypt = 1 ; //采用加密方式烧录,将提供数据加密,但损失烧录速度 ; user_type = ? ; //私有用法 ; verify = 1 ; //要求量产完成后校验是否正确 ; ; 注:1、name唯一, 不允许同名 ; 2、name最大12个字符 ; 3、size = 0, 将创建一个无大小的空分区 ; 4、align to logical block size(504 sectors), leb size = 2*(1 nand phy block size - 1 phy page size) ;*************************************************************************************************** [partition_start] [partition] name = boot-resource size = 504 downloadfile = "boot-resource.fex" user_type = 0x8000 [partition] name = env size = 504 downloadfile = "env.fex" user_type = 0x8000 [partition] name = env-redund size = 504 downloadfile = "env.fex" user_type = 0x8000 [partition] name = boot size = 20160 downloadfile = "boot.fex" user_type = 0x8000 [partition] name = rootfs size = 61440 downloadfile = "rootfs.fex" user_type = 0x8000 [partition] name = private size = 10080 user_type = 0x8000 [partition] name = recovery size = 23184 ;downloadfile = "recovery.fex" user_type = 0x8000 [/code]
-
对比下能够正常启动的固件,和不能正常启动的日志,差异如下,目前还没找到问题的解决办法来着。
正常 [17:24:57.908] [01.880]Loading Environment from SUNXI_FLASH... OK 异常 [11:12:03.078] [01.569]Loading Environment from SUNXI_FLASH... Can't find env-redund partition [11:12:03.158] *** Warning - no device, using default environment 正常 [17:24:57.698] partno erro : can't find partition bootloader 异常 [11:12:03.178] partno erro : can't find partition bootloader [11:12:03.199] partno erro : can't find partition boot-resource [11:12:03.219] [01.662]Get bootloader and boot-resource partition number fail! 正常 [17:24:59.469] List file under ULI/factory [17:24:59.469] ** Unrecognized filesystem type ** 异常 [11:12:03.838] cann't get the boot_base from the env
-
看一下openWRT配置,在根目录执行make menuconfig,搜索redund看看
Symbol: SUNXI_MAKE_REDUNDANT_ENV [=y] │ │ Type : bool │ │ Defined at target/linux/generic/image/Config.in:223 │ │ Prompt: sunxi make redundant env data │ │ Location: │ │ (1) -> Target Images │ │ │ │ │ │ Symbol: SUNXI_REDUNDANT_ENV_SIZE [=0x20000] │ │ Type : string │ │ Defined at target/linux/generic/image/Config.in:229 │ │ Prompt: redundant env data size │ │ Depends on: SUNXI_MAKE_REDUNDANT_ENV [=y] │ │ Location: │ │ -> Target Images │ │ (2) -> sunxi make redundant env data (SUNXI_MAKE_REDUNDANT_ENV [=y])
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号