Test

移植uboot 2016年01月版本到itop4412上

1. uboot下载

git clone git://git.denx.de/u-boot.git

2. 开始移植

cp -adr board/samsung/origen/ board/samsung/itop4412
mv board/samsung/itop4412/origen.c board/samsung/itop4412/itop4412.c
cp include/configs/origen.h include/configs/itop4412.h
cp configs/origen_defconfig configs/itop4412_defconfig
cp arch/arm/dts/exynos4412-odroid.dts arch/arm/dts/exynos4412-itop4412.dts
mv board/samsung/itop4412/tools/mkorigenspl.c board/samsung/itop4412/tools/mkitop4412spl.c

修改arch/arm/dts/Makefile编译itop4412设备树:

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 64b8371..4c4efbf 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -9,7 +9,8 @@ dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
        exynos4210-universal_c210.dtb \
        exynos4210-trats.dtb \
        exynos4412-trats2.dtb \
-       exynos4412-odroid.dtb
+       exynos4412-odroid.dtb \
+       exynos4412-itop4412.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
        exynos5250-snow.dtb \

修改arch/arm/include/asm/mach-types.h,增加itop4412的machine ID

diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h
index d51be0b..08a2392 100644
--- a/arch/arm/include/asm/mach-types.h
+++ b/arch/arm/include/asm/mach-types.h
@@ -57,6 +57,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_IQ80321              169
 #define MACH_TYPE_KS8695               180
 #define MACH_TYPE_SMDK2410             193
+#define MACH_TYPE_ITOP4412             123
 #define MACH_TYPE_CEIVA                200
 #define MACH_TYPE_VOICEBLUE            218
 #define MACH_TYPE_H5400                220

修改arch/arm/mach-exynos/Kconfig,添加make menuconfig选项:

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index a6a7597..772a6e9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -19,6 +19,10 @@ config TARGET_ORIGEN
        bool "Exynos4412 Origen board"
        select SUPPORT_SPL
 
+config TARGET_ITOP4412
+       bool "Exynos4412 itop4412 board"
+       select SUPPORT_SPL
+
 config TARGET_TRATS2
        bool "Exynos4412 Trat2 board"
 
@@ -76,6 +80,7 @@ source "board/samsung/smdkv310/Kconfig"
 source "board/samsung/trats/Kconfig"
 source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
+source "board/samsung/itop4412/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
 source "board/samsung/arndale/Kconfig"

修改 board/samsung/itop4412/Kconfig

diff --git a/board/samsung/itop4412/Kconfig b/board/samsung/itop4412/Kconfig
new file mode 100644
index 0000000..8dfef9a
--- /dev/null
+++ b/board/samsung/itop4412/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_ITOP4412
+
+config SYS_BOARD
+       default "itop4412"
+
+config SYS_VENDOR
+       default "samsung"
+
+config SYS_CONFIG_NAME
+       default "itop4412"
+
+endif

修改board/samsung/itop4412/Makefile

diff --git a/board/samsung/itop4412/Makefile b/board/samsung/itop4412/Makefile
new file mode 100644
index 0000000..9697620
--- /dev/null
+++ b/board/samsung/itop4412/Makefile
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2011 Samsung Electronics
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+
+hostprogs-y := tools/mkitop4412spl
+always := $(hostprogs-y)
+
+# omit -O2 option to suppress
+#   warning: dereferencing type-punned pointer will break strict-aliasing rules
+#
+# TODO:
+# Fix the root cause in tools/mkorigenspl.c and delete the following work-around
+$(obj)/tools/mkitop4412spl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
+else
+obj-y  += itop4412.o
+endif
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 8542f89..dabc7c4 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_EXYNOS5420)      += sec_boot.o
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_EXYNOS5)  += clock_init_exynos5.o
 obj-$(CONFIG_EXYNOS5)  += dmc_common.o dmc_init_ddr3.o
-obj-$(CONFIG_EXYNOS4210)+= dmc_init_exynos4.o clock_init_exynos4.o
+obj-$(CONFIG_EXYNOS4412)+= dmc_init_exynos4.o clock_init_exynos4.o
 obj-y  += spl_boot.o
 obj-y  += lowlevel_init.o
 endif

 

你可能感兴趣的:(Test)