Chinaunix首页 | 论坛 | 博客
  • 博客访问: 641138
  • 博文数量: 75
  • 博客积分: 7001
  • 博客等级: 少将
  • 技术积分: 1465
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-11 17:39
文章分类

全部博文(75)

文章存档

2010年(1)

2009年(25)

2008年(49)

我的朋友

分类: LINUX

2008-08-07 20:28:27

Construt the outline of porting linux kernel to 0015B
=============================================================================================================
===================================================
steps:
 
step1: Register a platform ID
       [linux/arch/arm/tools/mach-types]
 
 # machine_is_xxx CONFIG_xxxx  MACH_TYPE_xxx  number
 #
 ebsa110   ARCH_EBSA110  EBSA110   0
 riscpc   ARCH_RPC  RISCPC   1
 nexuspci  ARCH_NEXUSPCI  NEXUSPCI  3
 ebsa285   ARCH_EBSA285  EBSA285   4
 netwinder  ARCH_NETWINDER  NETWINDER  5
 cats   ARCH_CATS  CATS   6
 tbox   ARCH_TBOX  TBOX   7
 co285   ARCH_CO285  CO285   8
 ................
 hme_pxa   MACH_HME_PXA  HME_PXA   1145
 deisterdca  MACH_DEISTERDCA  DEISTERDCA  1146
 evb3504b  MACH_EVB3504B           EVB3504B  1148 <-------------
 
 
step2: Create platform/machine specific files
       [linux/arch/arm/mach-evb3504b]
 
In the folder, the initializations for clock, timer, irq and memory are all located herein.It's a heavy work, unfortunately,
 However, you can choose the platform closest with your platform, which has already been supported by kernel.Just copy it to your folder.
 eg:  cp arch/arm/mach-xxxx/* arch/arm/mach-evb3504b/
 
 
step3: Create platform/machine specific header files
       [linux/include/asm/arm/arch-evb3504b]
Place all the platform-related header files such as register definitions to this folder.
 
 
step4: Hook your platform to the linux build system, by modifying the config files and the Makefile under the arch/arm/ directory
 
-- [arch/arm/Kconfig]
  menu "System Type"
  choice
   prompt "ARM system type"
   default ARCH_EVB3504B <--------
  config ARCH_EVB3504B  <--------
   bool "ARM Ltd. Evb3504b family"
   select ARM_AMBA
   select ARM_VIC
   select ICST307
   select GENERIC_TIME
   select GENERIC_CLOCKEVENTS
   help
     This enables support for ARM Ltd Evb3504b board.
 
 -- [arch/arm/Makefile]  [line:125]
  machine-$(CONFIG_ARCH_EDWIN)       := evb3504b <---
 The name must be same with the suffix of folder name created in step3. 
 For the kbuild will create a link "include/asm-arm/arch" to
 "include/asm-arm/arch- evb3504b" achieved by "arch/arm/Makefile" line:191 in following form:
$(Q)ln -fsn $(srctree)/include/asm-arm/$(INCDIR) include/asm-arm/arch
Also, the link "include/asm" to "include/asm-arm" is created by the top level Makefile [line:844] in the form of
"$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm"

 -- [arch/arm/mm/Kconfig]
  provide support to ARM926T CPU
  # ARM926T
  config CPU_ARM926T
   bool "Support ARM926T processor"
   depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB ||
ARCH_PNX4008     || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_EVB3504B <--------
   default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 ||
ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_EVB3504B <--------
   select CPU_32v5
   select CPU_ABRT_EV5TJ
   select CPU_CACHE_VIVT
   select CPU_CP15_MMU
   select CPU_COPY_V4WB if MMU
   select CPU_TLB_V4WBI if MMU
   help
      This is a variant of the ARM920.  It has slightly different
      instruction sequences for cache and TLB operations.  Curiously,
     there is no documentation on it at the ARM corporate website.
      Say Y if you want support for the ARM926T processor.
      Otherwise, say N.

step5: Create EVB3504B default configuration file
 [arch/arm/configs/evb3504b_defconfig]
 The creation of this file could refer to the platform similar to yours.
 
 
step6: Change into cross complier
 [linux/Makefile] [line:176]
 ARCH := arm
 CROSS_COMPILE   =  arm_v5t_le-
 
 
step7: Build uImage
 make evb3504b_defconfig & save
 make uImage
 to save compile message using below command:
 make uImage 2>&1|tee porting.log
 
 
阅读(2187) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~