本移植主要参考友善之臂移植手册完成,做个笔记以备不时之需
Linux-2.6.32 在Mini2440上的移植(二)
使用环境:fedora9
交叉编译工具链:arm-linux-gcc-4.4.3
内核源码来源:
内核存放目录:/opt/mymini2440/linux-2.6.32
说明:红色部分为代码修改部分
(1)在151行附近作如下修改(152-200为添加代码)
-
149 .lpcsel = ((0xCE6) & ~7) | 1<<4,
-
150 };
-
151
-
152 static struct mtd_partition mini2440_default_nand_part[] = {
-
153 [0] = {
-
154 .name = "boot",
-
155 .size = 0x00040000,
-
156 .offset = 0,
-
157 },
-
158 [1] = {
-
159 .name = "param",
-
160 .offset = 0x00040000,
-
161 .size = 0x00020000,
-
162 },
-
163 [2] = {
-
164 .name = "Kernel",
-
165 .offset = 0x00060000,
-
166 .size = 0x00500000,
-
167 },
-
168 [3] = {
-
169 .name = "root",
-
170 .offset = 0x00560000,
-
171 .size = 1024 * 1024 * 1024, //
-
172 },
-
173 [4] = {
-
174 .name = "nand",
-
175 .offset = 0x00000000,
-
176 .size = 1024 * 1024 * 1024, //
-
177 }
-
178 };
-
179
-
180 static struct s3c2410_nand_set mini2440_nand_sets[] = {
-
181 [0] = {
-
182 .name = "NAND",
-
183 .nr_chips = 1,
-
184 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
-
185 .partitions = mini2440_default_nand_part,
-
186 },
-
187 };
-
188
-
189 /* choose a set of timings which should suit most 512Mbit
-
190 * * chips and beyond.
-
191 * */
-
192
-
193 static struct s3c2410_platform_nand mini2440_nand_info = {
-
194 .tacls = 20,
-
195 .twrph0 = 60,
-
196 .twrph1 = 20,
-
197 .nr_sets = ARRAY_SIZE(mini2440_nand_sets),
-
198 .sets = mini2440_nand_sets,
-
199 .ignore_unset_ecc = 1,
-
200 };
-
还需要把nand flash 设备注册到系统中208行附近
-
202 static struct platform_device *mini2440_devices[] __initdata = {
-
203 &s3c_device_usb,
-
204 &s3c_device_lcd,
-
205 &s3c_device_wdt,
-
206 &s3c_device_i2c0,
-
207 &s3c_device_iis,
-
208 &s3c_device_nand,
-
209 };
在50行附近加入头文件
-
48 #include <plat/common-smdk.h>
-
49
-
50 #include<linux/mtd/mtd.h>
-
51 #include <linux/mtd/nand.h>
-
52 #include <linux/mtd/nand_ecc.h>
-
53 #include <linux/mtd/partitions.h>
-
54 #include <plat/nand.h>
-
55
-
56 static struct map_desc mini2440_iodesc[] __initdata = {
在228行添加如下代码,用于显示分区信息
-
224 static void __init mini2440_machine_init(void)
-
225 {
-
226 s3c24xx_fb_set_platdata(&mini2440_fb_info);
-
227 s3c_i2c0_set_platdata(NULL);
-
228 s3c_device_nand.dev.platform_data =&mini2440_nand_info;
-
229 platform_add_devices(mini2440_devices, ARRAY_SIZE(mini2440_devices));
-
230 //smdk_machine_init();
-
231 }
nand分区表修改完毕,接下来移植yaffs2!
阅读(1757) | 评论(0) | 转发(1) |