移植kernel-3.10.79
Posted hulig7
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了移植kernel-3.10.79 相关的知识,希望对你有一定的参考价值。
u-boot 使用u-boot-2014.10
find * -name "*2410*_defconfig"
find * -name "*2440*_defconfig"
可以看到
arch/arm/configs/mini2440_defconfig
arch/arm/configs/s3c2410_defconfig
下载命令:
set serverip 192.168.1.104
kernel:
tftp 30000000 uImage
nand erase 0x000c0000 0x500000
nand write.jffs2 30000000 0xc0000 0x500000
set machid 16a
1 基本修改
1.1 GCC
export PATH=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/flinn/tools/4.4.3/bin
1.2 Makefile
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
或者
ARCH ?= arm CROSS_COMPILE ?= /home/flinn/tools/4.4.3/bin/arm-none-linux-gnueabi-
1.3 编译
make s3c2410_defconfig;make uImage // s3c2410_defconfig肯定比mini2440_defconfig更全面些
这里s3c2410_defconfig肯定有开发板的支持, 编译出来的uImage会很大。执行make menuconfig裁剪
1.4 烧录
Uncompressing Linux... done, booting the kernel. Error: unrecognized/unsupported machine ID (r1 = 0x000000c1). Available machine support: ID (hex) NAME 000007cf MINI2440 0000016a SMDK2440
1.5 设置u-boot参数machid
set machid 16a
boot后 乱码
set machid 7cf,正常
可知smdk2440时钟有问题
1.6 修改时钟
vim arch/arm/mach-s3c24xx/mach-smdk2440.c
smdk2440_map_io s3c24xx_init_clocks(16934400); //改成12000000
烧录启动:
0x000000000000-0x000000004000 : "Boot Agent" mtd: partition "Boot Agent" doesn‘t end on an erase block -- force read-only 0x000000000000-0x000000200000 : "S3C2410 flash partition 1"
1.7 修改分区
注意:最小单位128K,否则
mtd: partition "device_tree" doesn‘t end on an erase block -- force read-onl
vim arch/arm/mach-s3c24xx/common-smdk.c
static struct mtd_partition smdk_default_nand_part[] = { [0] = { .name = "bootloader", .size = SZ_512K, .offset = 0, }, [1] = { .name = "device_tree", .offset = MTDPART_OFS_APPEND, .size = SZ_128K, }, [2] = { .name = "params", .offset = MTDPART_OFS_APPEND, .size = SZ_128K, }, [3] = { .name = "kernel", .offset = MTDPART_OFS_APPEND, .size = 0x500000, // 5M }, [4] = { .name = "root", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, } };
新分区:
device nand0 <smdk2440-0>, # parts = 5 #: name size offset mask_flags 0: bootloader 0x00080000 0x00000000 0 1: device_tree 0x00020000 0x00080000 0 2: params 0x00020000 0x000a0000 0 3: kernel 0x00500000 0x000c0000 0 4: rootfs 0x0fa40000 0x005c0000 0
设置u-boot
#define CONFIG_BOOTCOMMAND "nand read.jffs2 0x30007FC0 kernel; nand read.jffs2 32000000 device_tree; bootm 0x30007FC0 - 0x32000000"
以上是关于移植kernel-3.10.79 的主要内容,如果未能解决你的问题,请参考以下文章