'2016/05'에 해당되는 글 1건

coreboot

development 2016. 5. 13. 10:28

Coreboot


바로 빌드 가능하도록 팩키지로 만들었습니다.

Let free use.

rangeley_coreboot_build.tar.bz2



ENV

  platform : Atom C2000 rangeley

  EVB : Mohon peak CRB



필요 팩키지


1. Intel FSP package

  Intel 에서 배포하는 펌웨어 팩키지입니다.

  FSP 는 Firmware Support Package 의 약자입니다. 

 

  FSP 는 x86 cpu 를 초기화 하는 펌웨어 바이너리와 microcode 가 헤더 형태로 제공 됩니다. coreboot 같은 bios 용 SW 들은 빌드 단계에서 microcode 를 참조하고 링크 단계에서 펌웨어를 가져다 사용하기 때문에 반드시 필요합니다.


 

2. coreboot source

  HomePage : https://www.coreboot.org/

  WIKI : https://ko.wikipedia.org/wiki/%EC%BD%94%EC%96%B4%EB%B6%80%ED%8A%B8

  BUILD HOW-TO : https://www.coreboot.org/Build_HOWTO


  Coreboot 는 x86  에서 BIOS 를 대신할 수 있는 opensource 프로젝트입니다.



Worklog


1. Intel FSP

  다운로드 : http://www.intel.com/content/www/us/en/intelligent-systems/intel-firmware-support-package/intel-fsp-overview.html

 

  다운로드 사이트에 들어가 보면, intel 에서 판매하는 여러 cpu 들의 목록이 나옵니다. 이 중에서 원하는 cpu 의 링크를 따라 가면 됩니다.

  

  제가 사용할 플랫폼은 atom rangeley 여서 관련 FSP 를 다운로드 받았습니다.


  fsp(333407_RANGELEY_POSTGOLD_4_001US.tgz) 를 다 받았으면 아래와 같이 압축을 풀어 줍니다. 


poplinux@raw FSP $ > ls

333407_RANGELEY_POSTGOLD_4_001US.tgz


poplinux@raw FSP $> tar zxvf 333407_RANGELEY_POSTGOLD_4_001US.tgz RANGELEY_POSTGOLD_4.se

Readme_Extract.txt


poplinux@raw FSP $ > ls

333407_RANGELEY_POSTGOLD_4_001US.tgz

RANGELEY_POSTGOLD_4.se

Readme_Extract.txt


  압축을 풀고 난 후, 아래와 같이 ./RANGELEY_POSTGOLD_4.se 를 실행하면 압축이 추가로 풀리면서 필요한 파일을 얻을 수 있습니다. 

  자세한 내용은 ./Readme_Extract.txt 를 읽어 보면 됩니다.


poplinux@raw FSP $ > cat Readme_Extract.txt

Readme Notes on how to extract the contents of the *.se file in Linux: 


1.             Run the following command to make the *.se file executable


                chmod +x .se


2.             Run the following command to extract the contents of the *.se file


                 ./<filename>.se


3.             Page through the license using the space bar. At the end enter 'y'

and press ENTER to accept the license. 


4.             The contents of the *.se file will be extracted into a directory with the same name as the *.se file (without the .se extension).


poplinux@raw FSP $> chmod 777 RANGELEY_POSTGOLD_4.se

 

poplinux@raw FSP $ > ./RANGELEY_POSTGOLD_4.se 


poplinux@raw FSP $ > ls

333407_RANGELEY_POSTGOLD_4_001US.tgz

./RANGELEY_POSTGOLD_4

RANGELEY_POSTGOLD_4.se

Readme_Extract.txt 


poplinux@raw FSP $ > cd RANGELEY_POSTGOLD_4


poplinux@raw RANGELEY_POSTGOLD_4 $ > ls

./DOCUMENTATION

./FSP

FSP Kit Production RULAC click-through License.pdf

./Microcode

ReadMe.pdf

 


압축 해제를 완료하면 몇가지 파일과 디렉토리가 생성되는데, ./FSP ./Microcode 가 가장 중요합니다. 


./FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd => 펌웨어

./Microcode/microcode-m01406d000e.h => 마이크로 코드

./Microcode/microcode-m01406d8128.h => 마이크로 코드


펌웨어와 마이크로 코드들은 coreboot 에서 직접 가져다 사용하게 됩니다.



2. coreboot

2-1. 소스 준비


  빌드 준비는 아래와 같이 진행합니다.


# 빌드 환경 준비

poplinux@raw work $ > sudo aptitude install gnat-4.8 libncurses5-dev m4 bison flex iasl build-essential zlib1g-dev libftdi-dev pciutils-dev libusb-dev libpci-dev


# git 소스 다운로드

poplinux@raw work $ > git clone http://review.coreboot.org/coreboot.git ./coreboot


# 추가 모듈 다운로드

poplinux@raw work $ > cd coreboot

poplinux@raw work $ > git submodule update --init --checkout

Submodule 'arm-trusted-firmware' (http://review.coreboot.org/arm-trusted-firmware.git) registered for path '3rdparty/arm-trusted-firmware'

Submodule '3rdparty' (http://review.coreboot.org/blobs.git) registered for path '3rdparty/blobs'

Submodule 'vboot' (http://review.coreboot.org/vboot.git) registered for path '3rdparty/vboot'

Submodule 'util/nvidia-cbootimage' (http://review.coreboot.org/nvidia-cbootimage.git) registered for path 'util/nvidia/cbootimage'



2.2 컴파일러 준비

  컴파일러는 아래와 같이 준비 합니다. 빌드 시간은 한참 걸립니다.


poplinux@raw coreboot $ > make crossgcc-i386

Welcome to the coreboot cross toolchain builder v1.39 (April 16th, 2016)


Target architecture is now i386-elf

Downloading tarballs ...

 * gmp-6.1.0.tar.xz (cached)



2.3 설정

  아래와 같이 rangeley 를 위한 설정을 합니다.

 

poplinux@ raw coreboot $ > make menuconfig

   Mainboard  --->

        Mainboard vendor (Intel)  --->

        Mainboard model (Mohon Peak CRB)  --->

        [*] Configure defaults for the Intel FSP package

       ROM chip size (2048 KB (2 MB))  --->


   Chipset  --->

        Include CPU microcode in CBFS (Include external microcode header files)  ---> (../intel/cpu/rangeley/microcode/microcode-m01406d000e.h ../intel/cpu/rangeley/microcode/microcode-m01406d8128.h) 

        -*- Use Intel Firmware Support Package

        (../intel/fsp/rangeley/FvFsp.bin) Intel FSP binary path and filename (NEW)


  Generic Drivers  --->

        -*- Use Intel Firmware Support Package

        (../intel/fsp/rangeley/FvFsp.bin) Intel FSP binary path and filename (NEW)


Mainboard  --->

  Mainboard vendor (Intel) : Intel 로 설정함

  Mainboard model (Mohon Peak CRB) : Intel EVB 이름이 "Mohon Peak CRB" 임

  [*] Configure defaults for the Intel FSP package : Intel FSP 사용하는 것으로 설정함.

  ROM chip size (2048 KB (2 MB)) : 최종 이미지 사이즈를 결정하는 것인데, 이 설정이 잘못되어서 부팅이 안되는 경우가 있습니다.

 

  다른 Embedded 제품들은 flash memory 0x00 번지부터 BIOS(or bootloader) 코드가 위치하는 것을 기본으로 하고 있는데 x86 은 flash memory 의 마지막 부분에 BIOS(or bootloader) 가 존재하는 것을 기반으로 하고 있습니다. 


  예를 들어, flash memory 16MByte 크기이고 coreboot 를 2MB 사이즈로 빌드했아며 coreboot 는 0x00 이 아니라 0xE00000(14Mbyte) 에 write 해야 합니다.


Chipset  --->

  Include CPU microcode in CBFS (Include external microcode header files)  : intel FSP 중에서 microcode 의 위치를 지정해 줍니다. 


  -*- Use Intel Firmware Support Package : intel FSP 중에서 firmware 의 위치를 지정해 줍니다. intel FSP 압축을 풀면 "RANGELEY_POSTGOLD_4/FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd" 가 생기는데 이 경로를 상대 경로로 지정해 주면 됩니다.


Generic Drivers  --->

  -*- Use Intel Firmware Support Package : intel FSP 중에서 firmware 의 위치를 지정해 줍니다. intel FSP 압축을 풀면 "RANGELEY_POSTGOLD_4/FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd" 가 생기는데 이 경로를 상대 경로로 지정해 주면 됩니다.


2.4 빌드


  아래와 같이 빌드를 진행합니다.


poplinux@ raw coreboot $ > make


Performing operation on 'COREBOOT' region...

Name                        Offset       Type           Size 

cbfs master header        0x0          cbfs header   32

fallback/romstage          0x80        stage           24348

config                        0x6000     raw             452 

revision                      0x6200     raw             570 

cmos_layout.bin            0x6480     cmos_layout   1316 

fallback/dsdt.aml           0x6a00     raw             8074 

payload_config             0x8a00     raw             1574 

payload_revision           0x9080     raw             244 

(empty)                      0x91c0     null             27864

mrc.cache                   0xfec0      mrc_cache     65536 

cpu_microcode_blob.bin  0x1ff00     microcode     167936 

fallback/ramstage          0x48f80    stage           48158 

fallback/payload            0x54c00   payload        61326 

(empty)                      0x63c00    null             1163928 

fsp.bin                       0x17fec0   fsp              389120 

(empty)                      0x1def00   null             133528

bootblock                   0x1ff8c0    bootblock     1528 

          HOSTCC cbfstool/rmodtool.o

          HOSTCC cbfstool/rmodtool (link) 


Built intel/mohonpeak (Mohon Peak CRB)


poplinux@ raw coreboot $ > ls -lah build/coreboot.rom

-rw-r--r-- 1 poplinux develp 2.0M  5월 13 14:03 build/coreboot.rom



최종 생성 이미지는 build/coreboot.rom 입니다.





'development' 카테고리의 다른 글

How to use serial console on Intel rangeley platform  (0) 2016.03.18
How to install ubuntu to rangeley  (1) 2016.01.21
[gcc] -march, -mtune 옵션  (0) 2016.01.08
[gcc] __attribute__((......)) 키워드  (0) 2016.01.06
openwrt  (0) 2015.02.24
블로그 이미지

김유석0

,