首页 > 代码库 > Uboot裁剪

Uboot裁剪

  U-boot内核移植步骤

 

Linux 3.3.5系统移植

  1. 将arch/arm/mach-s3c6410/下的,mach-smdk6410.c cp为mach-my6410.c;
  2. 打开arch/arm/mach-s3c6410/下的Kconfig,仿照MACH_SMDK6410做一个菜单项:

config MACH_MY6410

    bool "MY6410"

    select CPU_S3C6410

    select SAMSUNG_DEV_ADC

    select S3C_DEV_HSMMC

    select S3C_DEV_HSMMC1

    select S3C_DEV_I2C1

    select SAMSUNG_DEV_IDE

    select S3C_DEV_FB

    select S3C_DEV_RTC

    select SAMSUNG_DEV_TS

    select S3C_DEV_USB_HOST

    select S3C_DEV_USB_HSOTG

    select S3C_DEV_WDT

    select SAMSUNG_DEV_BACKLIGHT

    select SAMSUNG_DEV_KEYPAD

    select SAMSUNG_DEV_PWM

    select HAVE_S3C2410_WATCHDOG if WATCHDOG

    select S3C64XX_SETUP_SDHCI

    select S3C64XX_SETUP_I2C1

    select S3C64XX_SETUP_IDE

    select S3C64XX_SETUP_FB_24BPP

    select S3C64XX_SETUP_KEYPAD

    help

     Machine support for the Pillar MY6410

  1. 打开arch/arm/tools/mach-types文件,这里面存的是机器ID必须要和uboot里面的ID保持一致,将其283行复制添加在后面并修改为:

smdk6410        MACH_SMDK6410        SMDK6410        1626

xx6410  MACH_XX6410  XX6410  1626 这个机器ID和UBOOT里的机器ID相同时才能启动内核;

  1. 修改BSP文件mach-my6410.c,内容如下:

将mach-mach-my6410.c文件中的所有smdk6410改成my6410(不要改大写SMDK6410的)

MACHINE_START(MY6410, "MY6410")//这个要和Kconfig里的MACH-MY6410匹配 

  1. 在当前目录的Makefile最后一行加上 obj-$(CONFIG_MACH_MY6410) += mach-my6410.o
  2.  修改顶层的Makefile:

 ARCH ?= arm

 CROSS_COMPILE ?= /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

  1. 复制arch/arm/configs/下的s3c6400-defconfig文件,然后将其保存为.config,配置内核支持EABI,再选中XX6410 board这一项,保存退出;
  2. 执行make menuconfig对内核进行配置:

Uboot裁剪