Porting u-boot


If you want to port u-boot to a new board, you need to care these aspects. This article is based on snowball u8500.


Directory structure

board  ------------  Platform, board-levels files. The board directory contains all the specific board initialization functions, which are called from lib_arm/board.c.

for samsung/smdk2410/flash.c, will call nand_init(). For snowball, directory is board/st/u8500, there are mcde(LCD driver) and emmc(dirver)  in it.


common ---------- All the commands; i.e. cmd_boots.c, cmd_date.c, environment, evn.c, main.c.etc.  Source code is included or not that depends on the the configuration definition in include/configs/<board name>.h


cpu ---------- CPU specific information; i.e. arm925t, mpc8220. Snowball is arm_cortexa9. contains cpu.c, cpu_init.c, interrupts.c start.S etc.


drivers --------- Various device drivers; i.e. dma, net, power, usb, video etc.

inlcudes ---------  Vraious header files; i.e. console.h, version.h, usb.h, pci.h, version.h has the version display header #define u-boot_VERSION "xxx"; include/configs contains the configurations for all the various boards.


lib_* ---------- processor specific libraries; i.e. bat_rw.c, board.c(memory sizes, baud rates, and calls board specific routines in u-boot/board

dtt ---------- Temperature sensor code

fs ----------------- File system directories and code; i.e. fat, fdos, jffs2.

rtc  -------------- Real time clock code; i.e. date.c, mpc8xx.c, etc.

tools ---------- Various tool directories and files; i.e. env, gdb. logos, scripts, mkimage.c, etc.


u-boot-8500/Makefile,

u8500_snowball_config:

           $(MKCONFIG) -a u8500 arm arm_cortexa9 u8500 st db8500 ;


Generate 2 files,

u-boot-8500/include/config.h

/* steconfig:u8500_snowball_config */
#ifndef  CONFIG_SKIP_LOWLEVEL_INIT
#define  CONFIG_SKIP_LOWLEVEL_INIT 1
#endif
#define  CONFIG_SNOWBALL 1

/* Automatically generated - do not edit */
#define CONFIG_BOARDDIR board/st/u8500
#include <configs/u8500.h>
#include <asm/config.h>


u-boot-8500/include/config.mk,

ARCH   = arm                  #architecture
CPU    = arm_cortexa9  #processor
BOARD  = u8500             #target board
VENDOR = st                 # vendor
SOC    = db8500             #chip system
   


After this, u-boot establishes the target platform.


include/configs/<boardname>.h

For snowball, it is u8500.h. Define UART(Universal Asynchronous Receiver/Transmitter), devices and file systems, commands, baudrate, bus rate, memory map etc. Common source code depend on this configuration.



u-boot-8500/board/st/u8500

config.mk

# mop500/href:
#
#    Valid values for TEXT_BASE are:
#
#       Standard configuration - all models
#       0x0560_0000    run from SDRAM
#
#    Test configuraton
#    0x4001_0000    run from eSRAM


board/st/u8500/config.mk
sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp

ifndef TEXT_BASE
TEXT_BASE = 0x05608000
endif

PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)

# Use board specific linker script
LDSCRIPT := $(SRCTREE)/board/st/u8500/u-boot.lds




cpu/arm_cortexa9

config.mk  cpu.c  db8500  libarm_cortexa9.a  Makefile  start.S  u-boot.lds

cpu/arm_cortexa9/db8500

clock.c  cpu.c  cspsa_fp.c  interrupts.c  itp.c  libdb8500.a  Makefile  prcmu.c  prcmu-fw-defs_v1.h  sec_bridge.c  timer.c


 

Compile

$make distclean

$make u8500_snowball_config

$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-


The result of these command sequence will build the following targets.

1. u-boot is an ELF file of the code.

2. u-boot.bin is the binary image. used for download and debugging.

3. u-boot.srec is the S-Recored image.

4. u-boot.map has the global addresses for symbols. etc.


startup

http://www.igloocommunity.org/support/Android_Getting_started_with_ICS

$ tar xf startupfiles_xyz.tar.gz
$ ls startupfiles/
  boot_image_issw.bin  boot_image_x-loader.bin  debian  license.txt  mem_init.bin
  power_management.bin  startfiles.cfg  u-boot-env.bin

$ cat  startfiles.cfg

# section     relative file name        align    address    load address
# The address is the exact offset into the image.
# Partition 2 (VFAT) starts at 0x400000
ISSW                   boot_image_issw.bin           -1       0                  -1
X-LOADER        boot_image_x-loader.bin    -1       0                  -1
MEM_INIT          mem_init.bin                           0       0x080000    0
PWR_MGT         power_management.bin      0       0x090000    0
UBOOT_ENV     u-boot-env.bin                        0       0x0F8000    0
NORMAL            u-boot.bin                                0       0x100000    0



http://igloocommunity.org/support/Snowflash



 Key words,

Peripheral device

kernel device

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值