Chinaunix首页 | 论坛 | 博客
  • 博客访问: 82288
  • 博文数量: 19
  • 博客积分: 325
  • 博客等级: 一等列兵
  • 技术积分: 197
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-29 11:51
文章分类

全部博文(19)

文章存档

2013年(1)

2012年(18)

我的朋友

分类: 嵌入式

2012-12-02 19:09:35

1、代码复用(smdk6400)

点击(此处)折叠或打开

  1. //从这里开始
  2.  2020 tar -jxvf u-boot-2012.10.tar.bz2
  3.  2021 cd u-boot-2012.10/
  4.  2022 git init
  5.  2023 git add .
  6.  2024 git commit -a
  7.  2025 make clean
  8.  2026 make smdk6400_config
  9.  2027 make -j8
  10.  2028 cp board/samsung/smdk6400 board/samsung/smdk6410 -rf
  11.  2029 cp nand_spl/board/samsung/smdk6400 nand_spl/board/samsung/smdk6410 -rf
  12.  2030 cp include/configs/smdk6400.h include/configs/smdk6410.h
  13.  2031 cd board/samsung/smdk6410/
  14.  2032 mv smdk6400.c smdk6410.c
  15.  2033 mv smdk6400_nand_spl.c smdk6410_nand_spl.c
  16.  2034 cd -
  17.  2035 cd nand_spl/board/samsung/smdk6410/
  18.  2036 mv smdk6400_nand_spl.c smdk6410_nand_spl.c
  19.  2041 make clean
  20.  2042 git add .
  21.  2043 git commit -a
  22.  2044 vi board/samsung/smdk6410/Makefile
  23.  2046 which arm-linux-gcc
  24.  2047 vi Makefile
  25.  2048 vi arch/arm/cpu/arm1176/s3c64xx/Makefile
  26.  2049 vi include/configs/smdk6410.h
  27.  2051 git commit -a
  28.  2052 make smdk6410_config
  29.  2053 make -j8

2、修改对应Makefile等文件保证编译通过

点击(此处)折叠或打开

  1. //git log (查看commit tag)
  2. //git format-patch XXXXXX350ea54c2d787 (从某次提交作的修改进行打补丁)
  3. From 2ace1acaa8135d1019cfa32b26750fd648325d8d Mon Sep 17 00:00:00 2001
  4. From: mark <hacker.do@163.com>
  5. Date: Sun, 2 Dec 2012 19:03:44 +0800
  6. Subject: [PATCH]     Fixme 4 file.

  7. ---
  8.  Makefile | 19 ++++++++++---------
  9.  arch/arm/cpu/arm1176/s3c64xx/Makefile | 2 +-
  10.  board/samsung/smdk6410/Makefile | 2 +-
  11.  include/configs/smdk6410.h | 6 +++---
  12.  4 files changed, 15 insertions(+), 14 deletions(-)

  13. diff --git a/Makefile b/Makefile
  14. index 09456e0..8f90da1 100644
  15. --- a/Makefile
  16. +++ b/Makefile
  17. @@ -164,7 +164,8 @@ export    ARCH CPU BOARD VENDOR SOC
  18.  
  19.  # set default to nothing for native builds
  20.  ifeq ($(HOSTARCH),$(ARCH))
  21. -CROSS_COMPILE ?=
  22. +CROSS_COMPILE ?= /usr/local/build/arm/4.3.2/bin//arm-linux-
  23. +export CROSS_COMPILE
  24.  endif
  25.  
  26.  # load other configuration
  27. @@ -742,18 +743,18 @@ SX1_config:        unconfig
  28.  #########################################################################
  29.  ## ARM1176 Systems
  30.  #########################################################################
  31. -smdk6400_noUSB_config    \
  32. -smdk6400_config    :    unconfig
  33. -    @mkdir -p $(obj)include $(obj)board/samsung/smdk6400
  34. -    @mkdir -p $(obj)nand_spl/board/samsung/smdk6400
  35. +smdk6410_noUSB_config    \
  36. +smdk6410_config    :    unconfig
  37. +    @mkdir -p $(obj)include $(obj)board/samsung/smdk6410
  38. +    @mkdir -p $(obj)nand_spl/board/samsung/smdk6410
  39.      @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
  40.      @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
  41. -    @if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then            \
  42. -        echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
  43. +    @if [ -z "$(findstring smdk6410_noUSB_config,$@)" ]; then            \
  44. +        echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6410/config.tmp;\
  45.      else                                        \
  46. -        echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
  47. +        echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6410/config.tmp;\
  48.      fi
  49. -    @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
  50. +    @$(MKCONFIG) smdk6410 arm arm1176 smdk6410 samsung s3c64xx
  51.      @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
  52.  
  53.  #########################################################################
  54. diff --git a/arch/arm/cpu/arm1176/s3c64xx/Makefile b/arch/arm/cpu/arm1176/s3c64xx/Makefile
  55. index 0785b19..48f8b33 100644
  56. --- a/arch/arm/cpu/arm1176/s3c64xx/Makefile
  57. +++ b/arch/arm/cpu/arm1176/s3c64xx/Makefile
  58. @@ -30,7 +30,7 @@ LIB    = $(obj)lib$(SOC).o
  59.  
  60.  SOBJS    = reset.o
  61.  
  62. -COBJS-$(CONFIG_S3C6400)    += cpu_init.o speed.o
  63. +COBJS-$(CONFIG_S3C6410)    += cpu_init.o speed.o
  64.  COBJS-y    += timer.o
  65.  
  66.  OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
  67. diff --git a/board/samsung/smdk6410/Makefile b/board/samsung/smdk6410/Makefile
  68. index 0d3e63b..a57f833 100644
  69. --- a/board/samsung/smdk6410/Makefile
  70. +++ b/board/samsung/smdk6410/Makefile
  71. @@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
  72.  
  73.  LIB    = $(obj)lib$(BOARD).o
  74.  
  75. -COBJS-y    := smdk6400.o
  76. +COBJS-y    := smdk6410.o
  77.  SOBJS    := lowlevel_init.o
  78.  
  79.  SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
  80. diff --git a/include/configs/smdk6410.h b/include/configs/smdk6410.h
  81. index d4dc8ef..e5a20be 100644
  82. --- a/include/configs/smdk6410.h
  83. +++ b/include/configs/smdk6410.h
  84. @@ -36,9 +36,9 @@
  85.   * High Level Configuration Options
  86.   * (easy to change)
  87.   */
  88. -#define CONFIG_S3C6400        1    /* in a SAMSUNG S3C6400 SoC */
  89. +#define CONFIG_S3C6410        1    /* in a SAMSUNG S3C6400 SoC */
  90.  #define CONFIG_S3C64XX        1    /* in a SAMSUNG S3C64XX Family */
  91. -#define CONFIG_SMDK6400        1    /* on a SAMSUNG SMDK6400 Board */
  92. +#define CONFIG_SMDK6410        1    /* on a SAMSUNG SMDK6400 Board */
  93.  
  94.  #define CONFIG_PERIPORT_REMAP
  95.  #define CONFIG_PERIPORT_BASE    0x70000000
  96. @@ -128,7 +128,7 @@
  97.   * Miscellaneous configurable options
  98.   */
  99.  #define CONFIG_SYS_LONGHELP                /* undef to save memory     */
  100. -#define CONFIG_SYS_PROMPT        "SMDK6400 # "    /* Monitor Command Prompt */
  101. +#define CONFIG_SYS_PROMPT        "SMDK6410 # "    /* Monitor Command Prompt */
  102.  #define CONFIG_SYS_CBSIZE        256        /* Console I/O Buffer Size */
  103.  #define CONFIG_SYS_PBSIZE        384        /* Print Buffer Size */
  104.  #define CONFIG_SYS_MAXARGS        16        /* max number of command args */
  105. --
  106. 1.7.9.5


阅读(1093) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~