全志平台Tina系统安全设备验证rotpk是否烧写成功的方法

客户在安全设备烧写rotpk后可能需要验证烧写是否成功,在全志提供的《校验信息存放的说明文档.txt》中提供了一个方法:

文件/sys/class/sunxi_info/key_info使用方法,先echo,再cat。
  echo <key_name> > /sys/class/sunxi_info/key_info
  cat /sys/class/sunxi_info/key_info
 对于R18来说,key_name当前只能是“chipid”。因此不能用此方法读取rotpk。

可以用如下方法验证:

1.设备启动时串口按住PC键盘的“s”键,进入uboot控制台;

2.执行“efuse_read rotpk”命令,将读出的内容与rotpk.bin文件进行对比。

U-Boot 2014.07 (Jun 07 2018 - 11:17:01) Allwinner Technology                    
                                                                                
uboot commit : 5da40074ea73113eb81c6d33b2c2445a74bfb08a                         
                                                                                
secure mode: with secureos                                                      
I2C:   [I2C-ERROR]:twi_send_clk_9pulse() 205 [i2c] SDA is still Stuck Low, fail.
ready                                                                           
rsb: secure monitor exist                                                       
[1.924]pmbus:   ready                                                           
[1.926][ARISC] :arisc initialize                                                
[1.951][ARISC] :arisc para ok                                                   
[SCP] :sunxi-arisc driver begin startup 2                                       
[SCP] :arisc version: [sun8iw5_v0.03.00-399-g9fac845]                           
[SCP] :sunxi-arisc driver v1.10 is starting                                     
[1.966][ARISC] :sunxi-arisc driver startup succeeded                            
boot0 probe pmu_type = 0x11                                                     
[1.968]bat_vol=0, ratio=100                                                     
[1.971]set power on vol to default                                              
[1.974]dcdc1_vol = 3000, onoff=1                                                
[1.977]dcdc2_vol = 1100, onoff=1                                                
[1.980]dcdc3_vol = 1100, onoff=1                                                
[1.983]dcdc4_vol = 1100, onoff=0                                                
[1.985]dcdc5_vol = 1500, onoff=1                                                
[1.988]dcdc6_vol = 1100, onoff=1                                                
[1.991]aldo1_vol = 3000, onoff=1                                                
[1.994]aldo2_vol = 3000, onoff=1                                                
[1.997]aldo3_vol = 3000, onoff=1                                                
[2.000]dldo1_vol = 3300, onoff=1                                                
[2.003]dldo2_vol = 3300, onoff=0                                                
[2.006]dldo3_vol = 3300, onoff=0                                                
[2.009]dldo4_vol = 3300, onoff=0                                                
[2.012]eldo1_vol = 1800, onoff=1                                                
[2.015]eldo2_vol = 1800, onoff=1                                                
[2.018]eldo3_vol = 1800, onoff=0                                                
[2.021]fldo1_vol = 1200, onoff=0                                                
[2.024]fldo2_vol = 1100, onoff=1                                                
[2.027]gpio0_vol = 3000, onoff=0                                                
[2.030]gpio1_vol = 2800, onoff=0                                                
[2.033]find power_sply to end                                                   
[2.035]PMU: cpux 1008 Mhz,AXI=336 Mhz                                           
PLL6=600 Mhz,AHB1=100 Mhz, APB1=50Mhz AHB2=100Mhz MBus=400Mhz                   
DRAM:  1 GiB                                                                    
[2.047]fdt addr: 0x79cd86f0                                                     
[2.048]gd->fdt_size: 0x13bc0                                                    
Relocation Offset is: 34dc2000                                                  
gic: sec monitor mode                                                           
[2.106]power on cpu1                                                            
[2.106][cpu1]task entry                                                         
[2.106][cpu1]PowerBus = 2( 2:vBus 3:acBus other: not exist)                     
[2.111][cpu1]no battery exist                                                   
[2.114][cpu1]display init start                                                 
[2.116]power on cpu2                                                            
[cpu1]drv_disp_init                                                             
[2.119][cpu2]task entry                                                         
[2.123][cpu2]ready to work                                                      
[2.123]flash init start                                                         
[cpu2]bmp lzma decode err                                                       
[cpu1]init_clocks: finish init_clocks.                                          
workmode = 0,storage type = 2                                                   
[2.130][cpu2]cpu 2 enter wfi mode                                               
[cpu1]pwm_request:pwm number = 1                                                
[2.136]MMC:      2                                                              
[cpu1]request pwm success, spwm0:pwm16:0x1f03800.                               
[2.143][mmc]: mmc driver ver 2018-5-23 16:07:00                                 
[cpu1]Failed to parse hdmi_mode from dts                                        
[2.154][mmc]: get sdc2 sdc_wp fail.                                             
[cpu1]fetch hdmi pixel clk err.                                                 
[2.159][mmc]: get sdc2 sdc_hc_cap_unit fail.                                    
[2.166][mmc]: get sdc_ex_dly_used 2, use auto tuning sdly                       
[2.169][cpu1]enable power vcc-hdmi-33, ret=0                                    
[2.171][mmc]: get sdc2 sdc_ffu_en fail.                                         
SUNXI SD/MMC: 2                                                                 
[2.185][mmc]: media type 0x8000000                                              
[2.185][mmc]: Try MMC card 2                                                    
[2.203][mmc]: *****grp info 4000 4000 400 400                                   
[2.203][mmc]: def wp_grp_size 4000                                              
[2.205][mmc]: wp_grp_size 0x4000                                                
[2.208][mmc]: *****grp info 4000 4000 400 400                                   
[2.218][mmc]: host caps: 0x6f                                                   
[2.220][mmc]: MID 000045 PSN 89d61600                                           
[2.220][mmc]: PNM DG4008 -- 0x44-47-34-30-30                                    
[2.222][mmc]: PRV 0.1                                                           
[2.224][mmc]: MDT m-6 y-2017                                                    
[2.227][mmc]: MMC v5.1                                                          
[2.229][mmc]: user capacity  : 7457 MB                                          
[2.233][mmc]: wp_grp_size: 0x4000 sector                                        
[2.236][mmc]: don't support write protect operation!!                           
[2.241][mmc]: SD/MMC 2 init OK!!!                                               
[2.247][mmc]: Best spd md: 2-HSDDR52/DDR50, freq: 2-50000000                    
[2.250][mmc]: Bus width 8                                                       
[2.252][mmc]: EOL Info(Rev blks): Normal                                        
[2.255][mmc]: Wear out(type A): [2.258][mmc]: 0%-10% life time used             
[2.261][mmc]: Wear out(type B): [2.264][mmc]: 0%-10% life time used             
[2.267][mmc]: End mmc_init_boot                                                 
[2.270]sunxi flash init ok                                                      
[2.274]GPT partition init ok                                                    
read item0 copy0                                                                
the secure storage item0 copy0 is good                                          
no item name widevine in the map                                                
sunxi storage read fail                                                         
secure storage read widevine fail                                               
[cpu1]drv_disp_init finish                                                      
[2.288]secure storage read fail                                                 
[2.292][cpu1]boot_disp.output_disp=0                                            
[2.294]Widevine key install fail !!!                                            
[2.297][cpu1]boot_disp.output_type=1                                            
no item name ec_key in the map                                                  
[2.304][cpu1]boot_disp.output_mode=4                                            
sunxi storage read fail                                                         
[2.310][cpu1]fetch script data boot_disp.auto_hpd fail                          
secure storage read ec_key fail                                                 
[2.317][cpu1]disp0 device type(1) enable                                        
no item name rsa_key in the map                                                 
sunxi storage read fail                                                         
secure storage read rsa_key fail                                                
[2.330][cpu1]enable power vcc-dsi-33, ret=0                                     
no item name ec_cert1 in the map                                                
[2.335][cpu1]disp 0, clk: pll(497000000),clk(497000000),dclk(71000000) dsi_rate)
     clk real:pll(495000000),clk(495000000),dclk(70714285) dsi_rate(0)          
sunxi storage read fail                                                         
[2.353][cpu1]enable power vcc-lcd, ret=0                                        
secure storage read ec_cert1 fail                                               
[2.358][cpu1]display init end                                                   
no item name ec_cert2 in the map                                                
sunxi storage read fail                                                         
secure storage read ec_cert2 fail                                               
no item name ec_cert3 in the map                                                
sunxi storage read fail                                                         
secure storage read ec_cert3 fail                                               
no item name rsa_cert1 in the map                                               
sunxi storage read fail                                                         
secure storage read rsa_cert1 fail                                              
no item name rsa_cert2 in the map                                               
sunxi storage read fail                                                         
secure storage read rsa_cert2 fail                                              
no item name rsa_cert3 in the map                                               
sunxi storage read fail                                                         
secure storage read rsa_cert3 fail                                              
[2.405]keymasters key install finish                                            
[2.408]flash init end                                                           
** Unrecognized filesystem type **                                              
Get boardid faile                                                               
check boardid faile,will used default soccfg and dtb!                           
[2.420]try to burn key                                                          
no item name key_burned_flag in the map                                         
sunxi storage read fail                                                         
sunxi secure storage has no flag                                                
[2.430]usb burn from boot                                                       
delay time 0                                                                    
[2.513]usb prepare ok                                                           
[cpu1]FDT ERROR:fdt_get_all_pin:get property handle pinctrl-0 error:<unknown er>
[cpu1]sunxi_pwm_pin_set_state, fdt_set_all_pin, ret=-1                          
[3.314]overtime                                                                 
[3.344]do_burn_from_boot usb : no usb exist                                     
name in map device_unlock                                                       
the secure storage item2 copy0 is good                                          
name in map fastboot_status_flag                                                
the secure storage item1 copy0 is good                                          
find fastboot locked flag                                                       
root_partition is rootfs                                                        
--------fastboot partitions--------                                             
-total partitions:9-                                                            
-name-        -start-       -size-                                              
UDISK       : 11400000      bf9cbc00                                            
boot-res    : 1000000       100000                                              
env         : 1100000       100000                                              
boot        : 1200000       1000000                                             
rootfs      : 2200000       a000000                                             
rootfs_data : c200000       3000000                                             
private     : f200000       100000                                              
recovery    : f300000       2000000                                             
misc        : 11300000      100000                                              
-----------------------------------                                             
set root to /dev/mmcblk0p5                                                      
[3.411]base bootcmd=run setargs_nand boot_normal                                
[3.415]bootcmd set setargs_mmc                                                  
[3.418]key -1                                                                   
[3.419]recovery key high 12, low 10                                             
[3.422]fastboot key high 6, low 4                                               
[3.425]misc partition found                                                     
[3.431]to be run cmd=run setargs_mmc boot_normal                                
[3.433][mmc]: hsddr 2-50000000                                                  
[3.435][mmc]: get max-frequency ok 100000000 Hz                                 
[3.439][mmc]: 1 1 0: 1 1 0                                                      
[3.442][mmc]: delete mmc-hs400-1_8v from dtb                                    
[3.446][mmc]: delete mmc-hs200-1_8v from dtb                                    
[3.450][mmc]: get max-frequency ok 50000000 Hz                                  
[3.456]drm_base=0x7c000000                                                      
[3.456]drm_size=0x4000000                                                       
[3.459]update dtb dram start                                                    
[3.462]update dtb dram  end                                                     
no item name ota in the map                                                     
sunxi storage read fail                                                         
no item name boot_partition in the map                                          
sunxi storage read fail                                                         
no item name rootwait init in the map                                           
sunxi storage read fail                                                         
no item name rdinit in the map                                                  
sunxi storage read fail                                                         
[3.484]sunxi_serial: sn_filename is not set                                     
[3.488]serial num is: 940503441101c03074b                                       
[3.492]inter uboot shell                                                        
Hit any key to stop autoboot:  0                                                
sunxi#ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
Unknown command 'ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss'
sunxi#                                                                          
Unknown command 'ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss'
sunxi#                                                                          

Unknown command 'ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss'

一直按住这里,进入到了uboot控制台

输入命令Xefuse_read rotpk 

sunxi#efuse_read rotpk                                                          
try to read rotpk                                                               
buffer addr=0x79c89578                                                          
read key start                                                                  
key name = rotpk                                                                
key index = 0x64                                                                
90 fa 80 f1 54 49 51 2a 8a 4 23 97 6 6f 5f 78                                   
b 6c 8f 89 21 98 e8 d1 ba a4 2e b6 ce d1 76 f3                                  
(输出rotpk里的值)                                                                                
read efuse key [rotpk] failed                                                   
sunxi#

在pc上dexdump出原来的的rotpk中的值,比对是否是一样的(duxdump记得加参数-C,否则可能会乱码)

比对发现值是一样的,OK,验证完毕。

猜你喜欢

转载自blog.csdn.net/weixin_43094346/article/details/82989045