레이블이 Allwinner인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Allwinner인 게시물을 표시합니다. 모든 게시물 표시

2019년 3월 27일 수요일

Allwinner H5 Memory Mapping

Allwinner H5 Memory Mapping

Allwinner H5 Memory Mapping

Module Address (for Cluster CPU) Size (byte)
N-BROM 0x0000 0000—0x0000 7FFF 32K
S-BROM 0x0000 0000—0x0000 FFFF 64K
SRAM A1 0x0001 0000—0x0001 7FFF 32K
SRAM C 0x0001 8000—0x0003 3FFF 112K
SRAM A2 0x0004 4000—0x0005 3FFF 64K
DE 0x0100 0000—0x013F FFFF 4M
Coresight Debug 0x0140 0000—0x0141 FFFF 128K
CPU MBIST 0x0150 2000—0x0150 2FFF 4K
CPU CFG 0x0170 0000—0x0170 03FF 1K
System Control 0x01C0 0000—0x01C0 0FFF 4K
DMA 0x01C0 2000—0x01C0 2FFF 4K
NFDC 0x01C0 3000—0x01C0 3FFF 4K
TSC 0x01C0 6000—0x01C0 6FFF 4K
Key Memory Space 0x01C0 B000—0x01C0 BFFF 4K
TCON 0 0x01C0 C000—0x01C0 CFFF 4K
TCON 1 0x01C0 D000—0x01C0 DFFF 4K
VE 0x01C0 E000—0x01C0 EFFF 4K
SMHC 0 0x01C0 F000—0x01C0 FFFF 4K
SMHC 1 0x01C1 0000—0x01C1 0FFF 4K
SMHC 2 0x01C1 1000—0x01C1 1FFF 4K
SID 0x01C1 4000—0x01C1 43FF 1K
Crypto Engine 0x01C1 5000—0x01C1 5FFF 4K
MSG_BOX 0x01C1 7000—0x01C1 7FFF 4K
SPINLOCK 0x01C1 8000—0x01C1 8FFF 4K
USB-OTG_Device 0x01C1 9000—0x01C1 9FFF 4K
USB-OTG_EHCI0/OHCI0 0x01C1 A000—0x01C1 AFFF 4K
USB-HCI1 0x01C1 B000—0x01C1 BFFF 4K
USB-HCI2 0x01C1 C000—0x01C1 CFFF 4K
USB-HCI3 0x01C1 D000—0x01C1 DFFF 4K
SMC 0x01C1 E000—0x01C1 EFFF 4K
CCU 0x01C2 0000—0x01C2 03FF 1K
PIO 0x01C2 0800—0x01C2 0BFF 1K
TIMER 0x01C2 0C00—0x01C2 0FFF 1K
OWA 0x01C2 1000—0x01C2 13FF 1K
PWM 0x01C2 1400—0x01C2 17FF 1K
KEYADC 0x01C2 1800—0x01C2 1BFF 1K
I2S/PCM 0 0x01C2 2000—0x01C2 23FF 1K
I2S/PCM 1 0x01C2 2400—0x01C2 27FF 1K
I2S/PCM 2 0x01C2 2800—0x01C2 2BFF 1K
Audio Codec 0x01C2 2C00—0x01C2 33FF 2K
SPC 0x01C2 3400—0x01C2 37FF 1K
THS 0x01C2 5000—0x01C2 53FF 1K
UART 0 0x01C2 8000—0x01C2 83FF 1K
UART 1 0x01C2 8400—0x01C2 87FF 1K
UART 2 0x01C2 8800—0x01C2 8BFF 1K
UART 3 0x01C2 8C00—0x01C2 8FFF 1K
TWI 0 0x01C2 AC00—0x01C2 AFFF 1K
TWI 1 0x01C2 B000—0x01C2 B3FF 1K
TWI 2 0x01C2 B400—0x01C2 B7FF 1K
SCR0 0x01C2 C400—0x01C2 C7FF 1K
SCR1 0x01C2 C800—0x01C2 CBFF 1K
EMAC 0x01C3 0000—0x01C3 FFFF 64K
HSTMR 0x01C6 0000—0x01C6 0FFF 4K
DRAMCOM 0x01C6 2000—0x01C6 2FFF 4K
DRAMCTL0 0x01C6 3000—0x01C6 3FFF 4K
DRAMPHY0 0x01C6 5000—0x01C6 5FFF 4K
SPI0 0x01C6 8000—0x01C6 8FFF 4K
SPI1 0x01C6 9000—0x01C6 9FFF 4K
SCU 0x01C80000
GIC_DIST: 0x01C80000 + 0x1000
GIC_CPUIF: 0x01C80000 + 0x2000
CSI 0x01CB 0000—0x01CF FFFF 320K
De-interlacer 0x01E0 0000—0x01E1 FFFF 128K
TVE 0x01E4 0000—0x01E4 FFFF 64K
GPU 0x01E8 0000—0x01EA FFFF 192K
HDMI 0x01EE 0000—0x01EF FFFF 128K
RTC 0x01F0 0000—0x01F0 03FF 1K
R_TIMER 0x01F0 0800—0x01F0 0BFF 1K
R_INTC 0x01F0 0C00—0x01F0 0FFF 1K
R_WDOG 0x01F0 1000—0x01F0 13FF 1K
R_PRCM 0x01F0 1400—0x01F0 17FF 1K
R_TWD 0x01F0 1800—0x01F0 1BFF 1K
R_CPUCFG 0x01F0 1C00—0x01F0 1FFF 1K
R_CIR-RX 0x01F0 2000—0x01F0 23FF 1K
R_TWI 0x01F0 2400—0x01F0 27FF 1K
R_UART 0x01F0 2800—0x01F0 2BFF 1K
R_PIO 0x01F0 2C00—0x01F0 2FFF 1K
R_PWM 0x01F0 3800—0x01F0 3BFF 1K
DDR 0x4000 0000—0xFFFF FFFF 3G

Allwinner H5 Boot Diagrams

Allwinner H5 Boot Diagrams

Allwinner H5 Boot Diagrams

개요

  • The system will boot in different ways based on whether its security features are enabled
  • Supports CPU-0 boot process and CPU-0+ boot process
  • Supports super standby wakeup process
  • USB OTG로 업그레이드 지원
  • Raw NAND, eMMC, SD/TF card ,and SPI NOR Flash에서 fast boot 지원

Normal Mode

아래 그림에서 CPU-0+는 CPU-0를 제외한 나머지 CPU들, 즉 CPU-1, CPU-2, CPU-3를 말한다.

CLUSTER 0 && CPU-0
Others
Hot Plug
Others
SS
Pass
No Pass
Others
unselected
selected
pass
No Pass
Pass
CPU-0 Boot
Read
CLUSTER ID
&& CPU ID
CPU-0+ Boot
Read
Hot Plug
flag
Boot from CPU-0+
Read
SS flag
Check SS
restore code
Run SS Restore
Fast Boot
process
UBOOT_SEL
Mandatory
Upgrade Process
Mandatory
Upgrade finishes
Run Boot0

전체 과정을 설명하면,

  1. Cluster ID와 CPU ID 체크
    • 둘 중 하나라도 0이 아니면 CPU-0+에서 부팅 수행
  2. Hot Plug 플래그 확인
    • Hot Plug이면 CPU-0+에서 부팅 수행
  3. SS 플래그 확인
    • 있으면 SS 복구 코드 확인
      • 통과 시 SS 복구 시작
      • 실패 시 Fastboot
  4. UBOOT_SEL
    • 선택되면 upgrade process
  5. Fastboot
    • 실패 시 upgrade process
  6. BOOT0 시작

Security Mode

전체 과정은 Normal Mode 와 같고, 마지막 6번 과정에서 BOOT0를 실행하는 대신 Security BROM을 실행한다.

CLUSTER 0 && CPU-0
Others
Hot Plug
Others
SS
Pass
No Pass
Others
unselected
selected
pass
No Pass
Pass
CPU-0 Boot
Read
CLUSTER ID
&& CPU ID
CPU-0+ Boot
Read
Hot Plug
flag
Boot from CPU-0+
Read
SS flag
Check SS
restore code
Run SS Restore
Fast Boot
process
UBOOT_SEL
Mandatory
Upgrade Process
Mandatory
Upgrade finishes
Run Security BROM Software

CPU-0+ Boot Process

CPU-0+에서 부팅할 때는 BROM이 CPU-0+ Boot Pointer에 지정된 multi-core system firmware 주소로 JUMP해서 실행시킨다.

yes
no
CPU-0+ Boot starts
Read CPU_ID
CPU_ID > 0?
Read 0x01F0 1C00 + 0x1A4 register
Get soft_entry_address
Run cpu0 code
Jump to the soft_entry_address
Run CPU-0+ code

CPU Hot Plug Process

Hot Plut 비트는 hot plug boot를 할지 결정한다.

yes
no
CPU0 Hot Plug starts
Read 0x01F0 1C00 + 0x1AC register
Get the value
0xFA50 392F ?
Read 0x01F0 1C00 + 0x1A4
Get hot_plug_entry_address
Jump to the hot_plug_entry_address
Run CPU0 code

Super Standby Wakeup Process

SS wakeup은 CPU-S에서 시작되고, CPU-0가 해제되면 CPU-0로 옮겨진다.

CPU-S starts the Super Standby wakeup process
DRAM exit Self refresh - optional
Move the BOOT0 code to SRAM A1 0x00
Release CPU-0 reset
CPU-0 boot

Mandatory Upgrade Process

시스템이 강제 업그레이드 과정으로 진입할지 결정할 때 UBOOT_SEL이 low면 이 프로세스로 진입한다.

Mandatory Upgrade starts
USB FEL
Mandatory Upgrade finish

Fast Boot Normal Process

시스템이 강제 업그레이드 과정으로 진입할지 결정할 때 UBOOT_SEL이 high면 이 프로세스로 진입한다.

pass
not pass
pass
not pass
pass
not pass
pass
not pass
pass
not pass
Fast boot process starts
SDC0 Boot
Operation
EMMC2 Boot
Operation
SDC2 Boot
Operation
NAND Boot
Operation
SPI_NOR Boot
Operation
Run BOOT0 Code
Mandatory Upgrade Process

Fast Boot Security Process

시스템이 강제 MP 프로세스로 진입할지 결정할 때 UBOOT_SEL이 high면 이 프로세스로 진입한다.

pass
not pass
pass
not pass
pass
not pass
pass
not pass
pass
not pass
Right
Wrong
Fast boot process starts
SDC0 Boot
Operation
EMMC2 Boot
Operation
SDC2 Boot
Operation
NAND Boot
Operation
SPI_NOR Boot
Operation
Run the TOC Certification
Read Security BROM Software in TOC
Check
Run Security BROM Software Code
Normal_fel