S3C-2416 kernel (linux-2.6.35-rc3)编译过程
扫描二维码
随时随地手机看文章
一、编译错误更改
1.linux-2.6.35-rc3archarmmach-s3c2416kconfig中增加:
config MACH_SMDK2416
bool "SMDK2416"
select CPU_S3C2416
select S3C_DEV_FB
select S3C_DEV_NAND#add by ltls
select S3C_DEV_USB_HOST#add by ltls
select S3C_DEV_SMDK #add by ltls
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC1
help
Say Y here if you are using an SMDK2416
目的:linux-2.6.35-rc3archarmmach-s3c2416makefile文件:
obj-$(CONFIG_S3C_DEV_USB_HOST)+= dev-usb.o
等相应的宏打开
2. linux-2.6.35-rc3archarmplat-s3c24xxkconfig中增加:
config MACH_SMDK
bool
default y #add by ltls
help
Common machine code for SMDK2410 and SMDK2440
目的:开linux-2.6.35-rc3archarmplat-s3c24xxmakefile文件:CONFIG_MACH_SMDK宏打开
obj-$(CONFIG_MACH_SMDK)+= common-smdk.o
这个是使针对makefile文件红控制做相应的更改的:
二、kernel启动问题
1.内核机器码arch/arm/tools/mach-types文件中smdk2416为1685
Uboot中borad/Samsung/smdk2416/smdk2416.c中
gd->bd->bi_arch_number =MACH_TYPE;
uboot中也可以通过命令bdinfo查找arch_number = 0x00000695(1685)
这两个要一致
2.uImage的制作:
a.更改linux-2.6.35-rc3/下的makefile文件:
export KBUILD_BUILDHOST := $(SUBARCH)
#ARCH?= arm#delete by ltls
#CROSS_COMPILE?= arm-linux-#delete by ltls
ARCH= arm#add by ltls
CROSS_COMPILE=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-#add by ltls
b. #cp config_mini2440_a70.config
c. #make menuconfig进入界面
d.#make zImage
e.#cdarch/arm/boot
f. #mkimage –Aarm –O linux –T kerenel –C none –a 0x30008000 –e 30008000 –n linux-2.6.35 –d zImage uImage
注释:
mkimage命令在uboot生成的/tools下面有mkimage文件拷到bin文件下就ok;0x30008000这个很关键。
3.启动uImage出错,当地在为c0008000改为32000000则正常。
Eg:
Tftp0x32000000 uImage
Bootm 0x32000000
make menuconfig
Kernel hacking--->
[*]Kernel debugging
[*]Kernel low-level debugging functions
[*]Kernel low-level debuggingmessagesvia S3C UART
4.nfs启动dm9000驱动出错:
a.Looking up port of RPC 100003/2 on 192.168.1.90
------------[ cut here ]------------
WARNING: at net/sched/sch_generic.c:258 dev_watchdog+0x270/0x294()
NETDEV WATCHDOG: eth0 (dm9000): transmit queue 0 timed out
Modules linked in:
B. dm9000 Ethernet Driver, V1.31
dm9000 dm9000: eth2090025647: Invalid ethernet
MAC address. Please set using ifconfig
eth0: dm9000a at c480c300,c4810304 IRQ 48
MAC: 00:00:00:00:00:00 (chip)
解决:在dm9000.C文件
memcpy(ndev->dev_addr, "x08x90x90x90x90x90", 6);// add ltls for dm9000
if (!is_valid_ether_addr(ndev->dev_addr))
dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "
"set using ifconfign", ndev->name);
5.增加dm9000:
//---start---add by ltls for dm9000 ----------------------------
//---author:fj_ltls
//---date:2001.6.18
//------start--------------------------------------------
/* DM9000AEP 10/100 ethernet controller */
static structresourcesmdk2416_dm9k_resource [ ] = {
[0] = {
.start = MACH_smdk2416_DM9K_BASE,
.end= MACH_smdk2416_DM9K_BASE + 3,
.flags = IORESOURCE_MEM
},
[1] = {
.start = MACH_smdk2416_DM9K_BASE + 4,
.end= MACH_smdk2416_DM9K_BASE + 7,
.flags = IORESOURCE_MEM
},
[2] = {
.start = IRQ_EINT4,//ltlsPort :GPF4EINT4
.end= IRQ_EINT4,//ltls
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
}
};
/*
* The DM9000 has no eeprom, and it's MAC address is set by
* the bootloader before starting the kernel.
*/
static struct dm9000_plat_data smdk2416_dm9k_pdata = {
.flags= (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
};
static struct platform_device smdk2416_device_eth = {
.name= "dm9000",
.id= -1,
.num_resources= ARRAY_SIZE(smdk2416_dm9k_resource),
.resource= smdk2416_dm9k_resource,
.dev= {
.platform_data= &smdk2416_dm9k_pdata,
},
};
//---end---add by ltls for dm9000 --------------------------------------
6.增加nandmtdpart:
A.arch/arm/mach-2416/s3c2416.c文件中:
void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
s3c_device_nand.name = "s3c2416-nand";这个与下面面的要对应更改为“s3c2440-nand”
}
B.Driver/mtd/nand/s3c2410.c文件中:
static struct platform_device_id s3c24xx_driver_ids[] = {
{
.name= "s3c2410-nand",
.driver_data= TYPE_S3C2410,
}, {
.name= "s3c2440-nand",
.driver_data= TYPE_S3C2440,
}, {
.name= "s3c2412-nand",
.driver_data= TYPE_S3C2412,
}, {
.name= "s3c6400-nand",
.driver_data= TYPE_S3C2412, /* compatible with 2412 */
},
{ }
};
C.arch/arm/plat-s3c24xx/common-smdk.c文件中:nandflash的分区:
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name= "Boot Agent",
.size= SZ_16K,
.offset= 0,
},
[1] = {
.name= "S3C2410 flash partition 1",
.offset = 0,
.size= SZ_2M,
},
[2] = {