CPU Booting is
본문 바로가기
Booting

CPU Booting is

by bsp-martin 2021. 12. 17.

Let's talk about booting.

We should know basic concept how to boot. but most case we don't know the basic concept.

 

AP is applicated with the application processor as a process for certain applications in embedded.
AP는 application processor 로 임베디드에서 특정 application 을 위한  process로 알면된다.

 

AP chip contains interfaces for CPU and peripheral conferences

So it will be CPU Plus Peripheral combination.
AP칩은 CPU와 주변회로를 위한 인터페이스들을 포함하고있다
그래서 CPU plus peripheral 이 되겠다.

 

The Intel or AMD process we use is the CPU, and CPU Plus Main Boards can be similarly thinked by AP. (It is not the same, but if it is comparable)
우리가 사용하는 인텔이나 AMD 프로세스는 CPU에 해당되고 CPU 플러스 메인보드가 유사하게 AP로 생각하면된다. (같지는않지만 비유하면)

AP칩부팅은 전원과 부트코드가 필요하다

AP chip boot is required for power and boot code

 

1. 전원이 인가되고 Reset 이 동작한다.

  Power is applied and RESET operates.

 

2. Reset시 AP에서는 내부의 internal ROM 영역이 존재하는데 이를 이용한 최초 코드가실행된다.

 At the RESET, the AP is executed in the AP in which the internal internal ROM region exists, and the first code using it is executed.

 

3. AP칩에는  internal ROM 과 sRAM 이 존재하는데 둘다 사용가능한 크기가 작다.

  The AP chip exists in both the Internal ROM and the SRAM. Size for both of them is very small.

 

AP칩의 ROM 코드의 최종목표는 미디어로부터 sRAM 에 부트로더 코드를 올리는것이다.

The final goal of the ROM code of the AP chip is to load the boot loader code from the media to the SRAM.
미디어는 외부의 periphiral 에 존재하게되는데 internal ROM 에서 지정하거나 또는  Bootstrap 으로 미디어가 정해진다.

The media exists in the external periphiral, specified by the Internal ROM, or the media is determined by Bootstrap.
미디어의 종류는 SD, eMMc, NAND, NOR, 그리고 SSD, 또는 HDD가 있다. 이또한 AP칩의 ROM에서 정해진 미디어여야만 한다.
The type of media is one of either SD, EMMC, NAND, NOR, and SSD, or HDD. It is necessary to be mediated by the ROM of this AP chip.

 

 

IROM is

(IROM) Introduction

To start AP Chip
1. AP Chip Power in Plus Clk source is in.
2. Reset(POR type or need external reset IC)

이후 최초에 구동되는 SW/HW 프로그램이 필요함 이 프로그램은 IROM 에 있음
The first sw/hw program is stored on IROM in the AP.

Bootstrap stage

(IROM) Boot strapping (HW pin combination which indicate specific media like NOR-flash/NAND flash)

Media -> Load bootloader to the IRAM from the MEDIA.
Media(NAND/NOR/EMMC/SSD/SD) from reserved address IRAM size load Bootloader to the IRAM.

IROM selet media

(IROM) Boot strapping -> Select Media(Storage)

Storage(NAND/NOR/EMMC/SD)
SPI_NAND 를 SPI를 사용하는 Boot Strapping 을 가정함

 

(IROM) Boot Strapping 세팅에 따라 Media(SD/NAND )에서 1st Bootloader Internal SRAM Load

이후 1st Bootloader Jump

(IROM) According to Bootstrapping, IROM load 1st Bootloader from Media(SD/NAND) to the Internal SRAM.

After then, jump to 1st Bootloader (sRAM).

 

 

(1st Bootloader)

Now 1st bootloader is loaded and PC is on 1st bootloader by jumping from IROM.

The main mission for 1st Bootloader are

1. Initialize DDR and SPI NAND.

  - DDR initialization is for use DDR as main RAM.

  - SPI NAND initialization is for use 2nd bootloader and load it to the DDR.

2. 2nd Bootloader load to DDR.
3. Jump to the 2nd Bootloader.

 

 

 

(2nd Bootloader)

-2nd Bootloader is Mostly Uboot (but some platform is using its specific bootloader instead)
- After Uboot, all programs are going to loaded on DDR and run.

 

 

 

- Uboot initialize Media(NAND/SD/EMMC) again to load Kernel.
- Uboot provide CLI environment which is very powerful including env variable.
- Uboot also provides utilis to set/get and save special environment variable boot argument and bootcmd which are needed to load kernel.
- Jump Kernel with using bootargs(Boot Argument).

 

After kernel boot, You can see rootfs is loaded and start first kernel program which is probably "/init or /linuxrc".

 

반응형

댓글