全志A64 修改uboot环境变量及内核调试级别

版权声明:本文为博主原创文章,未经博主允许转载。 https://blog.csdn.net/jklinux/article/details/82180063

通过uboot输出的启动信息:

--------fastboot partitions--------
-total partitions:15-
-name-        -start-       -size-      
bootloader  : 1000000       2000000     
env         : 3000000       1000000     
boot        : 4000000       2000000     
system      : 6000000       80000000    
verity_block: 86000000      2000000     
misc        : 88000000      1000000     
recovery    : 89000000      2000000     
cache       : 8b000000      30000000    
metadata    : bb000000      1000000     
private     : bc000000      1000000     
frp         : bd000000      80000       
empty       : bd080000      f80000      
alog        : be000000      5000000     
media_data  : c3000000      1000000     
UDISK       : c4000000      0  

板上的emmc分成14个分区,其中环境变量单独存放在一个分区,所以修改uboot环境变量时无须重编译uboot源码.


环境变量存放的文件在: /lichee/tools/pack/chips/sun50iw1p1/configs/default/env.cfg
里面的内容:


#kernel command arguments
earlyprintk=sunxi-uart,0x01c28000
initcall_debug=0
console=ttyS0,115200
nand_root=/dev/system
mmc_root=/dev/mmcblk0p7
init=/init
loglevel=1
cma=256M
selinux=enforcing
#set kernel cmdline if boot.img or recovery.img has no cmdline we will use this
setargs_nand=setenv bootargs earlyprintk=${earlyprintk} initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} init=${init} partitions=${partitions} cma=${cma} androidboot.selinux=${selinux}
setargs_mmc=setenv  bootargs earlyprintk=${earlyprintk} initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${mmc_root}  init=${init} partitions=${partitions} cma=${cma} androidboot.selinux=${selinux}
#nand command syntax: sunxi_flash read address partition_name read_bytes
#0x4007f800 = 0x40080000(kernel entry) - 0x800(boot.img header 2k)
boot_normal=sunxi_flash read 4507f800 boot;boota 4507f800 boot
boot_recovery=sunxi_flash read 4507f800 recovery;boota 4507f800 recovery
boot_fastboot=fastboot
#recovery key
recovery_key_value_max=0x13
recovery_key_value_min=0x10
#fastboot key
fastboot_key_value_max=0x8
fastboot_key_value_min=0x2

#uboot system env config
bootdelay=0
#default bootcmd, will change at runtime according to key press
bootcmd=run setargs_nand boot_normal#default nand boot

从上面的内容可以看出,uboot启动后直接执行”run setargs_nand boot_normal”.

环境变量partitions=bootloader@mmcblk0p2:env@mmcblk0p5:boot@mmcblk0p6:system@mmcblk0p7:verity_block@mmcblk0p8:misc@mmcblk0p9:recovery@mmcblk0p10:cache@mmcblk0p11:metadata@mmcblk0p12:private@mmcblk0p13:frp@mmcblk0p14:empty@mmcblk0p15:alog@mmcblk0p16:media_data@mmcblk0p17:UDISK@mmcblk0p1
setenv bootargs earlyprintk=sunxi-uart,0x01c28000 initcall_debug=0 console=ttyS0,115200 loglevel=1 root=/dev/system init=/init partitions=...

其中loglevel为printk调试输出级别,如需要捕捉内核调试输出,则需要修改loglevel的值.

如需要在uboot上操作,则需要把环境变量bootdelay的值改为非0即可.


 9 loglevel=8
 ...
 28 bootdelay=6

修改完成后,进入android源码目录下操作:

    . ./build/envsetup.sh 

      lunch
        //选择22. tulip_p1-eng

      pack   //重新打包镜像

重新烧写新镜像lichee/tools/pack/sun50iw1p1_android6.0_p1_uart0_bv3.img即修改生效.

猜你喜欢

转载自blog.csdn.net/jklinux/article/details/82180063