linux-kernel-4.4 移植 (1)启动
作者:互联网
开发环境:win10 64位 + VMware12 + Ubuntu14.04 32位
工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi
要移植的kernel版本:linux-4.4
Tiny4412开发板硬件版本为:
底板: Tiny4412SDK 1312B
核心板:Tiny4412 - 1306
1、下载、解压内核
linux-4.4.tar.gz
2、配置
1)配置开发板类型及指定交叉编译链
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exyno index 4840bbd..048ae67 100644 --- a/arch/arm/boot/dts/exynos4412-tiny4412.dts +++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts @@ -21,6 +21,7 @@ ESCOD index 70dea02..42b0d63 100644 --- a/Makefile +++ b/Makefile @@ -248,8 +248,11 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_6 # "make" in the configured kernel build directory always uses that. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile -ARCH ?= $(SUBARCH) -CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) +#ARCH ?= $(SUBARCH) +#CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) + +ARCH ?= arm +CROSS_COMPILE ?= /usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi/bin/arm-linux-gnueabi- # Architecture as present in compile.h UTS_MACHINE := $(ARCH)
2)修改设备树
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exyno index 4840bbd..048ae67 100644 --- a/arch/arm/boot/dts/exynos4412-tiny4412.dts +++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts @@ -21,6 +21,7 @@ chosen { stdout-path = &serial_0; + bootargs="root=/dev/ram0 rw rootfstype=ext4 console=ttySAC0,115200 init=/linuxrc earlyprintk";
}; memory { @@ -78,7 +79,8 @@ bus-width = <4>; pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>; pinctrl-names = "default"; - status = "okay"; + /* status = "okay";*/ + status = "disabled"; }; &serial_0 {
3,配置内核支持Ramdisk
make menuconfig
File systems --->;
<*> Second extended fs support
Device Drivers
SCSI device support --->;
<*> SCSI disk support
Block devices --->;
<*>RAM block device support
(16)Default number of RAM disks
(8192) Default RAM disk size (kbytes) (修改为8M)
General setup --->;
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
这个exynos的默认配置就已经支持了。
4.配置内核支持Tmpfs
$ make menuconfig
File systems --->;
Pseudo filesystems --->
[*] Virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
这个exynos的默认配置也已经支持了。
5.编译内核
root@ubuntu:/home/arm/linux-4.4# cat build.sh #!/bin/bash echo "---------------" echo "rm ./ uImage and dtb" rm uImage exynos4412-tiny4412.dtb echo "make" make uImage LOADADDR=0x40007000 -j4 echo "make dtb" make dtbs echo "backup config" cp .config tiny4412_defconfig echo "copy uImage" cp arch/arm/boot/uImage ./ echo "copy dtb" cp arch/arm/boot/dts/exynos4412-tiny4412.dtb ./ echo "over"
编写脚本。执行,烧写
即可初步启动kernel
---------------------------------------------------------------------------------------------------------------------------------------------------------------
问题:启动后如果显示文件太多会出现
dma-pl330 12680000.pdma: Reset Channel-1 CS-20000f FTC-20000
[ 1573.447654] dma-pl330 12680000.pdma: Reset Channel-1 CS-20000f FTC-20000
参考:https://blog.csdn.net/sinat_20006769/article/details/79060779
说是DMA驱动的问题,按照介绍取消dma-pl330后,kernel无法启动
参考:https://blog.csdn.net/hyyoxhk/article/details/83305367
修改arch/arm/boot/dts/exynos4412-tiny4412.dts中,serial_0的dmas导致卡死,serial_2的dmas无效果
参考:https://blog.csdn.net/qq_25370227/article/details/84891632
是uboot中TrustZone造成,目前未尝试
--------------------------------------------------------------------------------------------------------------------------------------------------------------
整体参考:
https://www.cnblogs.com/pengdonglin137/p/5143516.html
https://blog.csdn.net/sinat_20006769/column/info/19139
标签:4.4,kernel,tiny4412,boot,exynos4412,linux,dts,arch,arm 来源: https://www.cnblogs.com/chu-yi/p/10496621.html