修改时钟
linux-4.9.84\arch\arm\mach-s3c24xx\mach-smdk2440.c
// s3c2440_init_clocks(16934400);
s3c2440_init_clocks(12000000);
?拷贝配置
linux-4.9.84$ cp arch/arm/configs/s3c2410_defconfig ./
linux-4.9.84$ cp s3c2410_defconfig .config
修改机械码
linux-4.9.84\arch\arm\tools\mach-types
smdk2410 ARCH_SMDK2410 SMDK2410 193
smdk2440 ARCH_SMDK2440 SMDK2440 168
设置网卡参数,
linux-4.9.84\arch\arm\mach-s3c24xx\mach-smdk2440.c
#include <linux/dm9000.h>
#if 1
// new add
static struct resource s3c_dm9k_resource[] = {
[0] = {
.start = S3C2410_CS4,
.end = S3C2410_CS4 + 3,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S3C2410_CS4 + 4,
.end = S3C2410_CS4 + 4 + 3,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT7,
.end = IRQ_EINT7,
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
}
};
static struct dm9000_plat_data s3c_dm9k_platdata = {
.flags = DM9000_PLATF_16BITONLY,
};
struct platform_device s3c_device_dm9000 = {
.name = "dm9000",
.id = 0,
.num_resources = ARRAY_SIZE(s3c_dm9k_resource),
.resource = s3c_dm9k_resource,
.dev = {
.platform_data = &s3c_dm9k_platdata,
}
};
#endif
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_ohci,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c0,
&s3c_device_iis,
&s3c_device_dm9000,
};
?下载 yaffs2
ym@ym:~/work/tq2440/lesson02$ git clone git://www.aleph1.co.uk/yaffs2
ym@ym:~/work/tq2440/lesson02$ cd yaffs2/
ym@ym:~/work/tq2440/lesson02/yaffs2$ ./patch-ker.sh c m ../linux-4.9.84
Updating ../linux-4.9.84/fs/Kconfig
Updating ../linux-4.9.84/fs/Makefile
make menuconfig
Device Drivers --->
Input device support --->
[*] Touchscreens --->
<*> Samsung S3C2410/generic touchscreen input driver # 开启触摸屏支持
[*] Watchdog Timer Support --->
< > S3C2410 Watchdog # 关闭看门狗,要不然系统会一直重启
Graphics support --->
[*] Bootup logo --->
[*] Standard 16-color Linux logo # 选中该项,取消其他项
<*> Memory Technology Device (MTD) support --->
< > FTL (Flash Translation Layer) support # 取消选中,要不然会出现警告:ftl_cs: FTL header not found
< > NFTL (NAND Flash Translation Layer) support # 取消选中,要不然会出现警告:ftl_cs:
< > INFTL (Inverse NAND Flash Translation Layer) support # 取消选中,要不然会出现警告:ftl_cs:
<*> NAND Device Support --->
<*> NAND Flash support for Samsung S3C SoCs
[*] Samsung S3C NAND Hardware ECC # 开启NAND的硬件ECC校验
File systems --->
[*] Miscellaneous filesystems --->
<*> yaffs2 file system support # 开启yaffs2文件系统支持
?make uImage
?安装 sudo apt-get install u-boot-tools
使用gcc4.3.3 和 busybox1.6编译出来的根文件系统可以在ubuntu 上nfs挂载,但是在window 挂载无法工作。
使用gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf 和 busybox1.33.1编译出来的根文件系统无法工作
?明天来开uboot 和kernel debug? 定位问题
|