linux-sunxi / sunxi-tools

A collection of command line tools for ARM devices with Allwinner SoCs.
http://linux-sunxi.org/
GNU General Public License v2.0
579 stars 421 forks source link

support for a63 #156

Closed ChalesYu closed 3 years ago

ChalesYu commented 3 years ago

Hi, I'm trying to boot A63 board using fel , but seems support is missing. from linux-sunxi.org can know this soc is similar as h6 and a64. but now seems only BSP works. Is there anything I can help with to add support?

21.4.24 UPDATE:

mainline still not work , add some logs from BSP for reference :

uart0:

sunxi#reset
resetting ...
[99]HELLO! BOOT0 is starting!
[102]boot0 commit : 9b85be3bb076dd2b66eb6aeca66a659eef50dad1

[114]rsb_send_initseq: rsb clk 400Khz -> 3Mhz
[119]PMU: AXP803
[122]set pll start
[125]set pll end
[127]rtc[1] value = 0x00000063
[130]rtc[3] value = 0x0000b00d
[133]rtc[4] value = 0x00000001
[136]rtc[5] value = 0x00000001
[139]the chip id is 0x00000001
[142]the chip id is 0x00000001
[145]the chip id is 0x00000001
[148]the chip id is 0x00000001
[151]the chip id is 0x00000001
[154]chip id check OK
[156]DRAM BOOT DRIVE INFO: V0.576
[160]DRAM CLK = 720 MHZ
[162]DRAM Type = 7 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
[167]DRAM ZQ value: 0x003b3bfb
[172]DRAM SIZE =3072 M
[174]Disable Auto SR
[182]DRAM simple test OK.
[185]dram size =3072
[188]card no is 2
[189]sdcard 2 line count 8
[192][mmc]: mmc driver ver 2017-9-26 13:50
[196][mmc]: mmc 2 bias 00000004
[205][mmc]: ***Try MMC card 2***
[220][mmc]: MMC 5.1
[222][mmc]: HSDDR52/DDR50 8 bit
[225][mmc]: 50000000 Hz
[228][mmc]: 29600 MB
[230][mmc]: ***SD/MMC 2 init OK!!!***
[311]Loading boot-pkg Succeed(index=0).
[315]Entry_name        = scp
[324]set arisc reset to de-assert state
[328]Entry_name        = u-boot
[338]Entry_name        = monitor
[341]Entry_name        = soc-cfg
[344]Entry_name        = dtb
[348]Entry_name        = logo
[351]Entry_name        = shutdowncharge
[355]Entry_name        = androidcharge
[358]Ready to disable icache.
[361]0xffffffff 0xffffffff
[364]0xff1bffff 0xffffffff
[367]0xff0f18ff 0xffffffff
[369]0x1616ffff 0xffffff15
[372]0x0f1affff 0xffffffff
[375]0x1717ffff 0xffffffff
INFO:    Configuring SPC Controller
NOTICE:  BL3-1: v1.0(debug):f5e9dfc
NOTICE:  BL3-1: Built : 17:35:35, Oct 12 2017
NOTICE:  BL3-1 commit: f5e9dfc55fa1b4284b8e0cec6df0006456006fe2

INFO:    BL3-1: Initializing runtime services
ERROR:   Error initializing runtime service tspd_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x4a000000
INFO:    BL3-1: Next image spsr = 0x1d3

U-Boot 2014.07 (Aug 26 2019 - 10:57:34) Allwinner Technology 

uboot commit : 9cd79e664931aaf14ed5b1e67b9a44b8f453206a

[0.425]secure enable bit: 0
[0.425]normal mode: with secure monitor
I2C:   ready
[0.426]rsb init by cpus
[0.426]pmbus:   ready
[0.427][ARISC] :arisc initialize
[0.451][ARISC] :arisc para ok
[SCP] :sunxi-arisc driver begin startup 2
[SCP] :arisc version: [May 15 2019]
[SCP] :sunxi-arisc driver v1.30 is starting
[0.465][ARISC] :sunxi-arisc driver startup succeeded
[0.466]PMU: AXP803 found by boot0
[0.466]set power on vol to default
[0.466]dcdc1_vol = 3300, onoff=1
[0.467]dcdc2_vol = 900, onoff=1
[0.467]dcdc3_vol = 900, onoff=1
[0.467]dcdc4_vol = 900, onoff=1
[0.468]dcdc6_vol = 900, onoff=1
[0.469]aldo1_vol = 3300, onoff=1
[0.472]dldo4_vol = 1800, onoff=1
[0.475]eldo3_vol = 1800, onoff=0
[0.477]gpio0_vol = 3300, onoff=0
[0.480]gpio1_vol = 3300, onoff=0
[0.483]dc1sw_vol = 3300, onoff=1
[0.486]fldo3_vol = 900, onoff=0
[0.489]dcdc7_vol = 900, onoff=0
[0.492]find power_sply to end
axp=axp803, supply=eldo1, vol=1800 
[0.498]cpux 1008 Mhz,AXI=336 Mhz
[0.501]PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=400Mhz
DRAM:  3 GiB
[0.509]fdt addr: 0xf9cd54b8
[0.510]gd->fdt_size: 0x154e0
Relocation Offset is: b4d95000
gic: sec monitor mode
[0.591]power on cpu1
[0.591][cpu1]task entry
[0.592][cpu1]PowerBus = 0( 2:vBus 3:acBus other: not exist)
[cpu1]Battery Voltage=3719, Ratio=27
[0.593][cpu1]power on by key trigger
[cpu1]STATE_NORMAL_BOOT
[0.593][cpu1]display init start
[cpu1]drv_disp_init
[0.601]power on cpu2
[0.601][cpu2]task entry
[0.601]flash init start
[0.601][cpu2]ready to work
workmode = 0,storage type = 2
[0.605]MMC:      2
[0.606][mmc]: mmc driver ver 2017-09-26 13:29:00
[0.688][mmc]: get sdc_ex_dly_used 2, use auto tuning sdly
[0.688][mmc]: card2 io is 1.8V.
[0.690][mmc]: get sdc2 sdc_tm4_hs200_max_freq 150.
[0.690][mmc]: get sdc2 sdc_tm4_hs400_max_freq 100.
SUNXI SD/MMC: 2
[0.697][mmc]: media type 0x8000000
[0.698][mmc]: Try MMC card 2
[0.708][mmc]: host caps: 0x1ef
[0.708][mmc]: MID 000088 PSN ef0a0000
[0.708][mmc]: PNM SLD32G -- 0x53-4c-44-33-32
[0.709][mmc]: PRV 4.6
[0.709][mmc]: MDT m-6 y-2019
[0.709][mmc]: MMC v5.1
[0.709][mmc]: user capacity  : 29600 MB
[0.710][mmc]: SD/MMC 2 init OK!!!
[0.740][mmc]: Best spd md: 4-HS400, freq: 3-100000000
[0.741][mmc]: Bus width 8
[0.741][mmc]: EOL Info(Rev blks): Normal
[0.741][mmc]: Wear out(type A): [0.741][mmc]: 0%-10% life time used
[0.742][mmc]: Wear out(type B): [0.742][mmc]: Not defined
[0.742][mmc]: End mmc_init_boot
[0.742]sunxi flash init ok
[0.745]GPT partition init ok
[0.747]flash init end
[0.753][cpu2]bmp file buffer: 0x47400000, bmp_info.buffer: ff000000
[0.760][cpu2]cpu 2 enter wfi mode
[cpu1]init_clocks: finish init_clocks.
--------fastboot partitions--------
-total partitions:14-
-name-        -start-       -size-      
UDISK       : 11000000      27bfbc00    
bootloader  : 1000000       2000000     
env         : 3000000       1000000     
boot        : 4000000       1000000     
system      : 5000000       a0000000    
misc        : a5000000      1000000     
recovery    : a6000000      2000000     
cache       : a8000000      60000000    
metadata    : 8000000       1000000     
private     : 9000000       1000000     
frp         : a000000       80000       
empty       : a080000       f80000      
alog        : b000000       5000000     
media_data  : 10000000      1000000     
-----------------------------------
[0.852]base bootcmd=run try_mmc0_boot;run setargs_mmc boot_normal
[0.858]bootcmd set setargs_mmc
[0.860]key 0
[0.862]recovery key high 15, low 13
[0.865]fastboot key high 8, low 6
[0.868]to be run cmd=run try_mmc0_boot;run setargs_mmc boot_normal
[0.906][mmc]: hsddr 2-50000000
[0.906][mmc]: hs200 4-150000000
[0.906][mmc]: hs400 3-100000000
[0.906][mmc]: get max-frequency ok 150000000 Hz
[0.907][mmc]: 0 0 0: 0 0 0
[0.907][mmc]: get max-frequency ok 100000000 Hz
[0.995]update dtb dram start
[1.020]update dtb dram  end
read item0 copy0
Item0 (Map) magic is bad
the secure storage item0 copy0 is bad
read item0 copy1
Item0 (Map) magic is bad
the secure storage item0 copy0 == copy1, the data is good
the secure storage map is empty
no item name androidboot.selinux in the map
sunxi storage read fail
no item name androidboot.mac in the map
sunxi storage read fail
no item name snum in the map
sunxi storage read fail
[1.036]get_macaddr_from_secure, mac = XX:XX:XX:AA:BB:CC
[1.041]mac final = XX:XX:XX:AA:BB:CC
[1.044]try to burn key
out of usb burn from boot: without usb
[1.050]inter uboot shell
Hit any key to stop autoboot:  1 [cpu1]pwm_request: reg = 0x300a000. pwm = 0.
[cpu1]request pwm success, pwm = 0.
[cpu1]drv_disp_init finish
[1.140][cpu1]boot_disp.output_disp=0
[1.140][cpu1]boot_disp.output_type=1
[1.141][cpu1]boot_disp.output_mode=4
[1.141][cpu1]fetch script data boot_disp.auto_hpd fail
[1.141][cpu1]disp0 device type(1) enable
[1.143][cpu1]disp 0, clk: pll(548000000),clk(548000000),dclk(274000000) dsi_rate(274000000)
     clk real:pll(549000000),clk(549000000),dclk(274500000) dsi_rate(137250000)
 0 
sunxi#[1.355][cpu1]enable power vcc18-lcd, ret=0
[1.366][cpu1]enable power vcc33-lcd, ret=0
[1.464][cpu1]display init end
sunxi#[1.674][cpu1]fetch script data boot_disp.output_full fail
[1.674][cpu1]screen_id =0, screen_width =1600, screen_height =2560
[1.674][cpu1]frame buffer address ff000036
[1.676][cpu1]boot logo display ok
[2.080][cpu1]cpu 1 enter wfi mode
sunxi#

uart1:

IARISC UP 
Ddebugger system ok
Drsb driver ok
Dpmu driver ok
Dhwmsgbox driver ok
Dcpucfg driver ok
Darisc_para_get_message_pool_info: 48105000 1000
Dmessage_manager_init: message pool addr=48105000, size=1000
Dmessage manager ok
Dtimer driver ok
Ddvfs service driver ok
Dstandby service ok
Dwatchdog ok
Inotify 
Dfeedback startup result [0]
Iset paras 
Dstartup feedback ok
Inotify over 
Iar400 version : 130
Dar100 firmware version : 130
Dsystem daemon exit
Idate:May 15 2019,11:04:39
Impu init ok
Isystimer init ok
ISEOS Initializing
IReboot reason: 0x00000000
DInitializing task pool...
DSystem task is: 0x28194
DStarting internal apps...
DStarting external apps...

Dset nmi trigger request
IARISC UP 
Ddebugger system ok
Drsb driver ok
Dpmu driver ok
Dhwmsgbox driver ok
Dcpucfg driver ok
Darisc_para_get_message_pool_info: 48105000 1000
Dmessage_manager_init: message pool addr=48105000, size=1000
Dmessage manager ok
Dtimer driver ok
Ddvfs service driver ok
Dstandby service ok
Dwatchdog ok
Inotify 
Dfeedback startup result [0]
Iset paras 
Dstartup feedback ok
Inotify over 
Iar400 version : 130
Dar100 firmware version : 130
Dsystem daemon exit
Idate:May 15 2019,11:04:39
Impu init ok
Isystimer init ok
ISEOS Initializing
IReboot reason: 0x00000000
DInitializing task pool...
DSystem task is: 0x28194
DStarting internal apps...
DStarting external apps...

BSP boot0: boot0.bin.zip

21.4.19 UPDATE:

U-Boot SPL 2021.04-rc5-00004-g6ad9635b92-dirty (Apr 19 2021 - 08:08:08 +0800)   
error at pmic_bus_read() pmic_bus.c                                             
Failed at axp_init(), DRAM will failed!                                         
DRAM:testing 32-bit width, rank = 2                                             
Timeout initialising DRAM                                                       

resetting ...

seems have some progress ,but still fail in init I2C to talk to PMIC u-boot-a63-debug.patch.txt

21.3.30 UPDATE: find it's very close to a83t+axp813 but seems mainline u-boot doesn't support RSB on sun50i(H6) yet guess the SPL need to config PMIC on RSB to DRAM power on DCDC5 dump some file for people who interest

axp802_dump_screen_off.txt axp802_dump_screen_off_1.txt axp802_dump_screen_on_1.txt axp802_dump_screen_on_2.txt dump_dram_ctrl.txt dump_pio.txt dump_r_pio.txt

21.3.22 UPDATE: Just guess this A63+AXP802 can be treat as H6+AXP803 that board has a 3GB LPDDR3 RAM ,but although try to set CONFIG_SUNXI_DRAM_H6_LPDDR3 in u-boot still stuck at SPL , have same problem Timeout initialising DRAM

guess that AXP802 is not enable regulator for vdd-dram(dcdc5),but don't know how to enable it. from u-boot code can see the regulator of this PMIC is similar as AXP818(0x51) but don't know how to make this PMIC work in SPL (lazy to guess how it connect with(I2C/RSB),pin(PL0/PL1),chip id(0x51or 0x1 or 0x3) and regulator address etc. )

Maybe when H616 get full support this board can get some luck.

add some regulator from dmesg for reference

CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_AXP_DCDC2_VOLT=900
CONFIG_AXP_DCDC3_VOLT=900
CONFIG_AXP_DCDC4_VOLT=900
CONFIG_AXP_DCDC5_VOLT=1240
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_AXP_ALDO2_VOLT=1800
CONFIG_AXP_ALDO3_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO2_VOLT=2900
CONFIG_AXP_DLDO3_VOLT=2900
CONFIG_AXP_DLDO4_VOLT=1800
CONFIG_AXP_ELDO1_VOLT=1800
CONFIG_AXP_ELDO2_VOLT=700
CONFIG_AXP_ELDO3_VOLT=1800
CONFIG_AXP_FLDO1_VOLT=900
CONFIG_AXP_FLDO2_VOLT=1250

21.3.14 UPDATE: a guess work commit is here but stuck at DRAM:

U-Boot SPL 2021.01-00005-g010fc30041-dirty (Mar 13 2021 - 19:23:48 +0800)
DRAM:Timeout initialising DRAM

resetting ...
apritzel commented 3 years ago

What board is that? I have a Teclast M8 tablet, and from all I know the DRAM controller on the A63 is different from all of A64, H6 and H616, so it requires significant work to get support for that. Initial PMIC support for the DRAM voltage is only something we need for the H616 so far, all other PMICs have sensible default voltages set on DCDC5 (or whatever is meant to drive the DRAM chips), so DRAM power works on reset.

ChalesYu commented 3 years ago

@apritzel Thanks for your reply

Happily found that board can flash Teclast M8 firmware , but AFAIK, A63 only have one LPDDR3 variant, the main different should be the screen type, and other I/O port etc.

Here is a A63 core board. Althrough some board has a eMCP for memory , but this type is still LPDDR3. So, shouldn't different on software driver(init DRAM) part.

Initial PMIC support for the DRAM voltage is only something we need for the H616 so far, all other PMICs have sensible default voltages set on DCDC5 (or whatever is meant to drive the DRAM chips), so DRAM power works on reset.

That helps a lot. I know why I can't find PMIC init code for A64+AXP803 in u-boot finally. (and won't continue to figure out PMIC issue)

also, I found a early libdram code (not binary),maybe it can helps.

21.5.19 EDIT:

add some questions here, maybe off-topic :

ChalesYu commented 3 years ago

Okay , seems this SoC is only for business use, but vendor or official still want use BSP 3.10, I can't get any source code, and prepare to sell this board.

I even brought a H616 board (X96 mate), and have tried to replace aw859a with ap6330, but failed. stuck at probe axp305 . don't know how to fix it , now that h616 board has destroyed and lay in the trash.

So now game is over , hope others people have better luck play with these SoC .