Site Tools


Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
Hotfix release available: 2018-04-22a "Greebo". upgrade now! [50.1] (what's this?)
New release available: 2018-04-22 "Greebo". upgrade now! [50] (what's this?)
Hotfix release available: 2017-02-19g "Frusterick Manners". upgrade now! [49.7] (what's this?)
Hotfix release available: 2017-02-19f "Frusterick Manners". upgrade now! [49.6] (what's this?)
Hotfix release available: 2017-02-19e "Frusterick Manners". upgrade now! [49.5] (what's this?)
Hotfix release available fixing CVE-2017-12979 and CVE-2017-12980: 2017-02-19d "Frusterick Manners". upgrade now! [49.4] (what's this?)
Hotfix release available fixing CVE-2017-12583: 2017-02-19c "Frusterick Manners". upgrade now! [49.3] (what's this?)
bootstrap

BootStrap

SAMA5Dx 에서는 전원이 공급되면 최초 실행되는 코드가 이미 ROM의 형태로 칩셋안에 내장되어 있다.
이 ROM 에 기록된 코드는 실행 코드가 들어 있을 저장 장치들을 차례로 찾아서 그 안에 특별한 형태를 가지고 있는 코드를 실행한다.
이 특별한 형태를 가진 코드를 Bootstrap이라 여기서는 표현을 하고 이 Bootstrap은 U-boot나 linux 커널을 실행 시키는 역할을 한다.
Bootstrap은 크기가 매우 제한적이므로 일반적으로는 저장 장치내에 있는 U-boot를 실행 시키고 U-boot에서 linux 커널을 실행 시키는 방식을 사용한다.
https://github.com/linux4sam/at91bootstrap/tree/master 에서 다운 받아 컴파일 한다.
at91bootstrap-master.zip 이란 파일이 다운 받아진다.

bootstap.jpg

at92bootstrap-master.zip 파일이 다운된다.

나는 이를 buildroot 시에 사용했던 ~/SAMA5D4 에 복사한후 여기에서 압축해제 했다.

bootstrap-unpack.jpg

SAMA5D4/at91bootstrap-master/board 의 내용을 보면 여러 개발 보드가 나온다
우리는 sama5d4_xplained를 기본으로 시작하자.
SAMA5D4/at91bootstrap-master/board/sama5d4_xplained 의 내용을 보면 3개의 config 파일을 볼 수 있다.

bootstrap-check-defconfig.jpg

sama5d4_xplaineddf_uboot_secure_defconfig → serial FLASH에서 부팅하는 설정
sama5d4_xplainednf_uboot_secure_defconfig → NAND FLASH에서 부팅하는 설정
sama5d4_xplainedsd_uboot_secure_defconfig → SD Card에서 부팅하는 설정

우리는 이중에 NAND FLASH에서 부팅하는 설정을 (sama5d4_xplainednf_uboot_secure_defconfig) 사용한다.

일단 초기화 한다.

cd SAMA5D4/at91bootstrap-master/
make mrproper

bootstrap-mrproper.jpg

SAMA5D4x에 xplained 보드의 NAND FLASH에서 부팅으로 설정을 한다.

make sama5d4_xplainednf_uboot_secure_defconfig

bootstrap-defconfig.jpg

menuconfig를 사용해 다시한번 설정을 확인하고 변경한다.
컴파일러를 어떤것을 쓸지 설정해야겠지.

make menuconfig

bootstrap-menuconfig.jpg

우선 기본설정인 xplaned board 와 우리 board 의 memory 크기가 틀리므로 이를 변경한다.

bootstrap-memory.jpg

DDR-RAM의 크기가 다르므로 이를 변경한다.

bootsrap-memory_set.jpg bootstrap-ddr-set.jpg

32KHz Crystal 을 사용하므로 이것도 변경한다.

bootstrap-clock.jpg

내부에 EEPROM도 없으므로 제거한다.

bootstrap-eeprom.jpg

완료되면 bootstrap을 컴파일 한다.

우선 어떤 컴파일러를 사용할지 결정한다.
우리는 3가지의 컴파일러를 사용할 수 있다.

  • Buildroot 에서 생성한 cross compiler
  • bare-metal cross compiler
  • linux cross compiler

위의 세가지 컴파일러의 위치는 나의 경우(연결된 문서 참조) 아래와 같다.

  • Buildroot 에서 생성한 cross compiler

> /home/stephanos/SAMA5D4/buildroot-2016.11.1/output/host/usr/bin/

  • bare-metal cross compiler

> /home/stephanos/SAMA5D4/gcc-arm-none-eabi-6_2-2016q4/bin/

  • linux cross compiler

> /home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/

at91bootstrap-master 폴더의 Makefile 의 상단에 아래의 내용을 추가하여 사용할 컴파일러를 선택한다.

  • Buildroot 에서 생성한 cross compiler 사용시
CROSS_COMPILE=/home/stephanos/SAMA5D4/buildroot-2016.11.1/output/host/usr/bin/arm-none-eabi-
  • bare-metal cross compiler 사용시
CROSS_COMPILE=/home/stephanos/SAMA5D4/gcc-arm-none-eabi-6_2-2016q4/bin/arm-none-eabi-
  • linux cross compiler 사용시
CROSS_COMPILE=/home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

나의 경우 linux cross compiler 사용하는 것으로 설정하였다.

bootstrap-makefile.jpg

완료되면 bootstrap을 컴파일 한다.

make

다음과 같은 내용이 출력되며 만들어진다.

stephanos@stephanos-VirtualBox:~/SAMA5D4/at91bootstrap-master$ make
CC
========
/home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc 6.2.1
as FLAGS
========
-g -Os -Wall -I/home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_xplained -Iinclude -Icontrib/include -DJUMP_ADDR=0x26F00000 -DTOP_OF_MEMORY=0x210000 -DMACH_TYPE=9999 -Dsama5d4_xplained -DMACH_TYPE=9999 -DTOP_OF_MEMORY=0x210000 -DCRYSTAL_12_000MHZ -DSAMA5D4 -mcpu=cortex-a5 -mtune=cortex-a5 -DCONFIG_CPU_V7 -DCONFIG_SAMA5D4_XPLAINED
gcc FLAGS
=========
-nostdinc -isystem /home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/include -ffunction-sections -g -Os -Wall -mno-unaligned-access -fno-stack-protector -fno-common -I/home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_xplained -Icontrib/include -Iinclude -Ifs/include -I/home/stephanos/SAMA5D4/at91bootstrap-master/config/at91bootstrap-config -DAT91BOOTSTRAP_VERSION="3.8.7" -DCOMPILE_TIME="2017. 01. 03. (화) 17:06:49 KST" -DIMG_ADDRESS=0x00040000 -DIMG_SIZE=0x00080000 -DJUMP_ADDR=0x26F00000 -DOF_OFFSET= -DOF_ADDRESS= -DMEM_BANK= -DMEM_SIZE= -DIMAGE_NAME="u-boot.bin" -DCMDLINE="" -DTOP_OF_MEMORY=0x210000 -DMACH_TYPE=9999 -DCONFIG_DEBUG -DBANNER="AT91Bootstrap " AT91BOOTSTRAP_VERSION " (" COMPILE_TIME ")" -DCONFIG_HW_DISPLAY_BANNER -DCONFIG_HW_INIT -Dsama5d4_xplained -DMACH_TYPE=9999 -DTOP_OF_MEMORY=0x210000 -DCRYSTAL_12_000MHZ -DSAMA5D4 -mcpu=cortex-a5 -mtune=cortex-a5 -DCONFIG_SCLK -DCONFIG_SCLK_BYPASS -DCONFIG_CRYSTAL_12_000MHZ -DCONFIG_CPU_CLK_600MHZ -DCONFIG_BUS_SPEED_200MHZ -DCPU_HAS_PIO3 -DCONFIG_CPU_V7 -DCONFIG_MATRIX -DCONFIG_REDIRECT_ALL_INTS_AIC -DCPU_HAS_H32MXDIV -DCONFIG_SAMA5D4_XPLAINED -DCONFIG_DDRC -DCONFIG_DDR2 -DCONFIG_RAM_128MB -DCONFIG_NANDFLASH -DCONFIG_USE_PMECC -DCONFIG_ONFI_DETECT_SUPPORT -DCONFIG_USE_ON_DIE_ECC_SUPPORT -DBOOTSTRAP_DEBUG_LEVEL=DEBUG_INFO -DCONFIG_DISABLE_WATCHDOG -DCONFIG_TWI -DCONFIG_TWI0 -DCONFIG_TWI1 -DCONFIG_TWI2 -DCONFIG_TWI3 -DCONFIG_ACT8865 -DCONFIG_ACT8865_SET_VOLTAGE -DCONFIG_DISABLE_ACT8865_I2C -DCONFIG_PM -DCONFIG_MACB -DCONFIG_MAC0_PHY -DCONFIG_HDMI -DCONFIG_PM_PMIC -DCONFIG_AUTOCONFIG_TWI_BUS -DCPU_HAS_HSMCI0
ld FLAGS
========
-nostartfiles -Map=/home/stephanos/SAMA5D4/at91bootstrap-master/binaries/sama5d4_xplained-nandflashboot-uboot-3.8.7.map --cref -static -T elf32-littlearm.lds --gc-sections -Ttext 0x200000
AS        /home/stephanos/SAMA5D4/at91bootstrap-master/crt0_gnu.S
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/main.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_xplained/sama5d4_xplained.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/string.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/eabi_utils.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/div.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/debug.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_slowclk.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/common.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_pio.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pmc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_pit.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_wdt.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_usart.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_rstc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/lp310_l2cc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/ddramc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/nandflash.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pmecc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/matrix.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pm.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_twi.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/act8865.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/macb.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/hdmi_SiI9022.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_aicredir.c
mkdir -p /home/stephanos/SAMA5D4/at91bootstrap-master/binaries
LD        sama5d4_xplained-nandflashboot-uboot-3.8.7.elf
Size of sama5d4_xplained-nandflashboot-uboot-3.8.7.bin is 17520 bytes
[Succeeded] It's OK to fit into SRAM area
[Attention] The space left for stack is 48016 bytes
stephanos@stephanos-VirtualBox:~/SAMA5D4/at91bootstrap-master$ 

bootstrap-make-end.jpg

결과물은 /home/stephanos/SAMA5D4/at91bootstrap-master/binaries/ 내에 생성된다.
.bin파일이다.

bootstrap-make-result.jpg

.bin파일은 아트멜툴(SAM-BA) 로 NAND에 저장 할 수 있다.
.pmcc 파일은 일반 ROM-Writer로 NAND에저장 할 때 쓰인다.

두 파일을 비교하면 아래와 같은 차이점이 있다.
이는 SAMA5D42 Data-sheet, Reference Manual에 내용이 나와 있다.

bootstrap-binary-compare.jpg

우리는 sama5d4_xplained를 기본으로 시작했다.
이는 ATMEL에서 제공하는 개발보드의 설정이다.
이 보드는 VI에서 앞으로 개발할 보드의 설정과 다른점이 있다.
이에 VI 개발 보드에 맞추어 설정을 변경 하였다.

at91bootstrap-vi.zip 이란 파일로 만들었다.

at91bootstrap-vi.zip

이파일을 다운 받고 압축을 풀면 board에 새로운 폴더가 있음을 확인 할 수 있다.

vi_bootstrip_list.jpg vi_bootstrip_board_list.jpg

SAMA5D4/at91bootstrap-vi/board/sama5d4_xplained 의 내용을 보면 3개의 config 파일을 볼 수 있다.

sama5d4_xplaineddf_uboot_secure_defconfig → serial FLASH에서 부팅하는 설정
sama5d4_xplainednf_uboot_secure_defconfig → NAND FLASH에서 부팅하는 설정
sama5d4_xplainedsd_uboot_secure_defconfig → SD Card에서 부팅하는 설정

우리는 이중에 NAND FLASH에서 부팅하는 설정을 (sama5d4_xplainednf_uboot_secure_defconfig) 사용한다.

일단 초기화 한다.

cd SAMA5D4/at91bootstrap-vi/
make mrproper

SAMA5D4x에 xplained 보드의 NAND FLASH에서 부팅으로 설정을 한다.

make sama5d4_xplainednf_uboot_secure_defconfig

중요 우리가 사용하는 NAND의 영향으로 CPU의 최대 스피드인 600MHz로 설정되면 NAND의 Access가 제대로 되지 않는다. 이에 우리는 CPU의 최대 스피드를 528MHz로 설정을 한다. 추후 이에 대한 수정이 있을 예정이다.

이에 따라 CPU의 최대 스피드 수정을 한다.

make menuconfig

bootstrap_menuconfig.jpg bootstrap_menuconfig_change_speed.jpg

완료되면 bootstrap을 컴파일 한다.

make

다음과 같은 내용이 출력되며 만들어진다.

CC
========
/home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc 6.2.1
as FLAGS
========
-g -Os -Wall -I/home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_vi_base -Iinclude -Icontrib/include -DJUMP_ADDR=0x26F00000 -DTOP_OF_MEMORY=0x210000 -DMACH_TYPE=9999 -Dsama5d4_vi_base -DMACH_TYPE=9999 -DTOP_OF_MEMORY=0x210000 -DCRYSTAL_12_000MHZ -DSAMA5D4 -mcpu=cortex-a5 -mtune=cortex-a5 -DCONFIG_CPU_V7 -DCONFIG_SAMA5D4_VI_BASE
gcc FLAGS
=========
-nostdinc -isystem /home/stephanos/SAMA5D4/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/include -ffunction-sections -g -Os -Wall -mno-unaligned-access -fno-stack-protector -fno-common -I/home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_vi_base -Icontrib/include -Iinclude -Ifs/include -I/home/stephanos/SAMA5D4/at91bootstrap-master/config/at91bootstrap-config -DAT91BOOTSTRAP_VERSION="3.8.7" -DCOMPILE_TIME="2017. 01. 11. (수) 11:48:50 KST" -DIMG_ADDRESS=0x00040000 -DIMG_SIZE=0x00080000 -DJUMP_ADDR=0x26F00000 -DOF_OFFSET= -DOF_ADDRESS= -DMEM_BANK= -DMEM_SIZE= -DIMAGE_NAME="u-boot.bin" -DCMDLINE="" -DTOP_OF_MEMORY=0x210000 -DMACH_TYPE=9999 -DCONFIG_DEBUG -DBANNER="AT91Bootstrap " AT91BOOTSTRAP_VERSION " (" COMPILE_TIME ")" -DCONFIG_HW_DISPLAY_BANNER -DCONFIG_HW_INIT -Dsama5d4_vi_base -DMACH_TYPE=9999 -DTOP_OF_MEMORY=0x210000 -DCRYSTAL_12_000MHZ -DSAMA5D4 -mcpu=cortex-a5 -mtune=cortex-a5 -DCONFIG_SCLK -DCONFIG_CRYSTAL_12_000MHZ -DCONFIG_CPU_CLK_600MHZ -DCONFIG_BUS_SPEED_200MHZ -DCPU_HAS_PIO3 -DCONFIG_CPU_V7 -DCONFIG_MATRIX -DCONFIG_REDIRECT_ALL_INTS_AIC -DCPU_HAS_H32MXDIV -DCONFIG_SAMA5D4_VI_BASE -DCONFIG_DDRC -DCONFIG_DDR2 -DCONFIG_RAM_128MB -DCONFIG_NANDFLASH -DCONFIG_USE_PMECC -DCONFIG_ONFI_DETECT_SUPPORT -DCONFIG_USE_ON_DIE_ECC_SUPPORT -DBOOTSTRAP_DEBUG_LEVEL=DEBUG_INFO -DCONFIG_DISABLE_WATCHDOG -DCONFIG_TWI -DCONFIG_TWI0 -DCONFIG_TWI1 -DCONFIG_TWI2 -DCONFIG_TWI3 -DCONFIG_ACT8865 -DCONFIG_ACT8865_SET_VOLTAGE -DCONFIG_DISABLE_ACT8865_I2C -DCONFIG_PM -DCONFIG_MACB -DCONFIG_MAC0_PHY -DCONFIG_HDMI -DCONFIG_PM_PMIC -DCONFIG_AUTOCONFIG_TWI_BUS -DCPU_HAS_HSMCI0
ld FLAGS
========
-nostartfiles -Map=/home/stephanos/SAMA5D4/at91bootstrap-master/binaries/sama5d4_vi_base-nandflashboot-uboot-3.8.7.map --cref -static -T elf32-littlearm.lds --gc-sections -Ttext 0x200000
AS        /home/stephanos/SAMA5D4/at91bootstrap-master/crt0_gnu.S
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/main.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/board/sama5d4_vi_base/sama5d4_vi_base.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/string.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/eabi_utils.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/lib/div.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/debug.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_slowclk.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/common.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_pio.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pmc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_pit.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_wdt.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_usart.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_rstc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/lp310_l2cc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/ddramc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/nandflash.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pmecc.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/matrix.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/pm.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_twi.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/act8865.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/macb.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/hdmi_SiI9022.c
CC        /home/stephanos/SAMA5D4/at91bootstrap-master/driver/at91_aicredir.c
mkdir -p /home/stephanos/SAMA5D4/at91bootstrap-master/binaries
LD        sama5d4_vi_base-nandflashboot-uboot-3.8.7.elf
Size of sama5d4_vi_base-nandflashboot-uboot-3.8.7.bin is 17540 bytes
[Succeeded] It's OK to fit into SRAM area
[Attention] The space left for stack is 47996 bytes

결과물은 /home/stephanos/SAMA5D4/at91bootstrap-vi/binaries/ 내에 생성된다.
.bin파일이다.

.bin파일은 아트멜툴(SAM-BA) 로 NAND에 저장 할 수 있다.
.pmcc 파일은 일반 ROM-Writer로 NAND에저장 할 때 쓰인다.

Atmel에서 제공하는 bootstrap 소스를 많이 수정하여 우리 보드에 맞추어 변경 하였다. BootStrap-VI.tar 이란 파일로 만들었다.

bootstrap-vi.tar

설정 파일은 sama5d4_vi_basenf_uboot_secure_defconfig 이다.

make mrproper
make sama5d4_vi_basenf_uboot_secure_defconfig

중요 우리가 사용하는 NAND의 영향으로 CPU의 최대 스피드인 600MHz로 설정되면 NAND의 Access가 제대로 되지 않는다. 이에 우리는 CPU의 최대 스피드를 528MHz로 설정을 한다. 추후 이에 대한 수정이 있을 예정이다.

이에 따라 CPU의 최대 스피드 수정을 한다.

make menuconfig

완료되면 bootstrap을 컴파일 한다.

make

이의 결과를 사용하면 된다.

이를 사용한 Booting 과정에 대한 Log 이다

RomBOOT
 Bank Address Offset Bits = 0xB ...
Target Board Initialized
Enabled 32.768KHz OSC


Atmel Boot Strap For VI 3.8.7 (2017. 07. 05. (수) 19:24:53 KST)

All interrupts redirected to AIC
Loading Image Initialized
NAND: ONFI not supported
NAND: Manufacturer ID: 0xc8, Chip ID: 0xda
NAND: Enable On-Die ECC
NAND : Bits Of ECC = 4
NAND : Bits Of Data = 8
NAND : Byte Size Of ECC Base = 512
NAND : Byte Size Of Spare = 64
NAND : Byte Size Of Page = 2048
NAND : Number Of Pages In Block = 64
NAND : Number Of Blocks In Unit = 2048
NAND : Number Of Units In Device = 1
NAND: Image: Copy 80000 bytes from 40000 to 26f00000
NAND: Done to load image
Jump to u-boot


U-Boot 2016.03-linux4sam_5.5 (Jun 30 2017 - 13:22:27 +0900)

CPU: SAMA5D42
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      176 MHz
I2C:   ready
DRAM:  128 MiB
NAND:  NAND chip is not ONFI compliant, assume ecc_bits is 2 in 512 bytes
256 MiB
MMC:   mci: 0
In:    serial
Out:   serial
Err:   serial
Net:   gmac0, usb_ether
Error: usb_ether address not set.

Hit any key to stop autoboot: 10  9  8  7  6  5  4  3  2  1  0 

NAND read: device 0 offset 0x180000, size 0x80000
 524288 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x600000
 6291456 bytes read: OK
Kernel image @ 0x22000000 [ 0x000000 - 0x3ab468 ]
## Flattened Device Tree blob at 21000000
   Booting using the fdt blob at 0x21000000
   Loading Device Tree to 27b21000, end 27b2c237 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.4.68 (stephanos@stephanos-VirtualBox) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #5 Tue Jun 27 14:12:33 KST 2017
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Atmel SAMA5D4 VI
cma: Failed to reserve 64 MiB
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 32512
Kernel command line: console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256K(env),256k(env_redundent),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 122024K/131072K available (5411K kernel code, 192K rwdata, 1692K rodata, 212K init, 190K bss, 9048K reserved, 0K cma-reserved)
Virtual kernel memory layout:
  vector  : 0xffff0000 - 0xffff1000   (   4 kB)
  fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
  vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
  lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
  modules : 0xbf000000 - 0xc0000000   (  16 MB)
    .text : 0xc0008000 - 0xc06f803c   (7105 kB)
    .init : 0xc06f9000 - 0xc072e000   ( 212 kB)
    .data : 0xc072e000 - 0xc075e280   ( 193 kB)
     .bss : 0xc075e280 - 0xc078da88   ( 191 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 10859434279 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 351.43 BogoMIPS (lpj=1757184)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20008200 - 0x20008258
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
AT91: Detected SoC family: sama5d4
AT91: Detected SoC: sama5d42, revision 0
gpio-at91 fc06a000.gpio: at address c885c000
gpio-at91 fc06b000.gpio: at address c885e000
gpio-at91 fc06c000.gpio: at address c8872000
gpio-at91 fc068000.gpio: at address c8874000
gpio-at91 fc06d000.gpio: at address c8876000
pinctrl-at91 ahb:apb:pinctrl@fc06a000: initialized AT91 pinctrl driver
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 173750949719 ns
at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc887c000
at_xdmac f0014000.dma-controller: 16 channels, mapped at 0xc887e000
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f8014000.i2c: AT91 i2c bus driver (hw version: 0x502).
media: Linux media interface: v0.10
Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
io scheduler noop registered (default)
backlight supply power not found, using dummy regulator
f8004000.serial: ttyS5 at MMIO 0xf8004000 (irq = 31, base_baud = 5500000) is a ATMEL_SERIAL
fc00c000.serial: ttyS0 at MMIO 0xfc00c000 (irq = 37, base_baud = 5500000) is a ATMEL_SERIAL
console [ttyS0] enabled
fc010000.serial: ttyS1 at MMIO 0xfc010000 (irq = 38, base_baud = 5500000) is a ATMEL_SERIAL
[drm] Initialized drm 1.1.0 20060810
panel supply power not found, using dummy regulator
brd: module loaded
loop: module loaded
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to create HLCDC outputs: -517
atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to initialize mode setting
atmel_nand_nfc 90000000.nfc: NFC is probed.
atmel_nand 80000000.nand: Cannot get PMECC lookup table offset, will build a lookup table in runtime.
atmel_nand 80000000.nand: Use On Flash BBT
atmel_nand 80000000.nand: Using dma0chan2 for DMA transfers.
nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xda
nand: ESMT NAND 256MiB 3,3V 8-bit
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
atmel_nand 80000000.nand: can't detect min. ECC, assume 2 bits in 512 bytes
atmel_nand 80000000.nand: Initialize PMECC params, cap: 4, sector: 512
atmel_nand 80000000.nand: Using NFC Sram read and write
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x00000ffe0000, version 0x01
Bad block table written to 0x00000ffc0000, version 0x01
8 cmdlinepart partitions found on MTD device atmel_nand
Creating 8 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "bootstrap"
0x000000040000-0x0000000c0000 : "uboot"
0x0000000c0000-0x000000100000 : "env"
0x000000100000-0x000000140000 : "env_redundent"
0x000000140000-0x000000180000 : "spare"
0x000000180000-0x000000200000 : "dtb"
0x000000200000-0x000000800000 : "kernel"
0x000000800000-0x000010000000 : "rootfs"
atmel_spi f8010000.spi: version: 0x221
atmel_spi f8010000.spi: Using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
atmel_spi f8010000.spi: Atmel SPI Controller at 0xf8010000 (irq 32)
m25p80 spi32766.0: unrecognized JEDEC id bytes: 00,  0,  0
atmel_spi fc018000.spi: version: 0x221
atmel_spi fc018000.spi: Using dma0chan5 (tx) and dma0chan6 (rx) for DMA transfers
atmel_spi fc018000.spi: Atmel SPI Controller at 0xfc018000 (irq 39)
CAN device driver interface
libphy: MACB_mii_bus: probed
macb f8020000.ethernet eth0: Cadence GEM rev 0x00020120 at 0xf8020000 irq 35 (ac:f1:df:5e:4d:3f)
macb f8020000.ethernet eth0: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8020000.etherne:01, irq=181)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 600000.ehci: EHCI Host Controller
atmel-ehci 600000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 600000.ehci: irq 25, io mem 0x00600000
atmel-ehci 600000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.4.68 ehci_hcd
usb usb1: SerialNumber: 600000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 500000.ohci: failed to find sfr node
at91_ohci 500000.ohci: USB Host Controller
at91_ohci 500000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 500000.ohci: irq 25, io mem 0x00500000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.4.68 ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
rtc rtc0: alarm rollover not handled
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc fc0686b0.rtc: rtc core: registered fc0686b0.rtc as rtc0
at91_rtc fc0686b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after wakeup
sama5d4_wdt fc068640.watchdog: initialized (timeout = 16 sec, nowayout = 0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci fc000000.mmc: version: 0x600
atmel_mci fc000000.mmc: using dma0chan7 for DMA transfers
VDD MCI1: supplied by VCC 3V3
atmel_mci fc000000.mmc: Atmel MCI controller at 0xfc000000 irq 36, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
leds-gpio leds: Led d10 renamed to d10_1 due to name collision
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes fc044000.aes: version: 0x201
atmel_aes fc044000.aes: Atmel AES - Using dma1chan0, dma1chan1 for DMA transfers
atmel_sha fc050000.sha: version: 0x420
atmel_sha fc050000.sha: using dma1chan2 for DMA transfers
atmel_sha fc050000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc04c000.tdes: version: 0x702
atmel_tdes fc04c000.tdes: using dma1chan3, dma1chan4 for DMA transfers
atmel_tdes fc04c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
iio iio:device0: Resolution used: 10 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
backlight supply power not found, using dummy regulator
panel supply power not found, using dummy regulator
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
atmel-hlcdc-display-controller atmel-hlcdc-dc: DRM device successfully registered
ubi0: default fastmap pool size: 95
ubi0: default fastmap WL pool size: 47
ubi0: attaching mtd7
random: nonblocking pool is initialized
ubi0: scanning is finished
ubi0: volume 0 ("rootfs") re-sized from 257 to 1938 LEBs
ubi0: attached mtd7 (name "rootfs", size 248 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 1980, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1513179009
ubi0: available PEBs: 0, total reserved PEBs: 1980, PEBs reserved for bad PEB handling: 36
input: gpio_keys as /devices/soc0/gpio_keys/input/input0
ubi0: background thread "ubi_bgt0d" started, PID 97
at91_rtc fc0686b0.rtc: setting system clock to 2012-01-01 00:00:18 UTC (1325376018)
ALSA device list:
  No soundcards found.
atmel_usart fc00c000.serial: using dma0chan8 for rx DMA transfers
atmel_usart fc00c000.serial: using dma0chan9 for tx DMA transfers
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS (ubi0:0): FS size: 244682752 bytes (233 MiB, 1927 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 4289B817-B849-426A-8EB4-54E811F89C16, small LPT model
VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
devtmpfs: mounted
Freeing unused kernel memory: 212K (c06f9000 - c072e000)
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 100
devpts: called with bogus options
Starting logging: OK
Populating /dev using udev: /etc/init.d/S10udev: line 47: can't create /proc/sys/kernel/hotplug: nonexistent directory
udevd[114]: starting version 3.2.1
udevd[115]: starting eudev-3.2.1
done
Initializing random number generator... done.
Starting system message bus: done
Starting network: OK
Starting dropbear sshd: OK
atmel-hlcdc-display-controller atmel-hlcdc-dc: fb0:  frame buffer device
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
Starting sshd: OK

Welcome to Buildroot 2017.02.1
buildroot login: 
bootstrap.txt · Last modified: 2017/07/05 19:54 by 1.241.172.144