微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > Linux s3c6410 移植

Linux s3c6410 移植

时间:11-23 来源:互联网 点击:

内核清除:make mrproper(会清除配置好的.config文件和所有.o文件,如果干净的内核没有必要执行)
内核配置:make menuconfig (可以依据一个相近的配置cp arch/arm/configs/s3c6400_defconfig ./.config)
内核编译:make
添加DM9000网卡驱动
1)arch/arm/mach-s3c6410/mach-smdk6410.c

#include
……

#define S3C64XX_PA_DM9000 (0x1800030)
#define S3C64XX_VA_DM9000 S3C_ADDR_CPU(0x01000000)
#define S3C64XX_SZ_DM9000 SZ_1M

static struct resource smdk6410_dm9000_resources[] = {
[0] = {
.start = S3C64XX_PA_DM9000,
.end = S3C64XX_PA_DM9000 + 3,
.flags = IORESOURCE_MEM
},
[1] = {
.start = S3C64XX_PA_DM9000 + 4,
.end = S3C64XX_PA_DM9000 + 255,
.flags = IORESOURCE_MEM
},
[2] = {
.start = IRQ_EINT(7),
.end = IRQ_EINT(7),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
},
};

static struct dm9000_plat_data smdk6410_dm9000_pdata = {
.flags = DM9000_PLATF_16BITONLY
};

struct platform_device smdk6410_dm9000 = {
.name = "dm9000",
.id = -1,
.num_resources = ARRAY_SIZE(smdk6410_dm9000_resources),
.resource = smdk6410_dm9000_resources,
.dev = {
.platform_data = &smdk6410_dm9000_pdata,
}
};

……

static struct map_desc smdk6410_iodesc[] = {
{
.virtual = (unsigned long)S3C64XX_VA_DM9000,
.pfn = __phys_to_pfn(S3C64XX_PA_DM9000),
.length = S3C64XX_SZ_DM9000,
.type = MT_DEVICE,
},
};

static struct platform_device *smdk6410_devices[] __initdata = {
#ifdef CONFIG_SMDK6410_SD_CH0
&s3c_device_hsmmc0,
#endif
#ifdef CONFIG_SMDK6410_SD_CH1
&s3c_device_hsmmc1,
#endif
&s3c_device_i2c0,
&s3c_device_i2c1,
&s3c_device_fb,
&s3c_device_usb,
&s3c_device_usb_hsotg,
&smdk6410_lcd_powerdev,

&smdk6410_dm9000,
};
NFS rootfs相关配置
1、devices support 中打开DM9000支持
2、打开filsystem 中nfs的相关支持
--- Network File Systems
│ │ <*> NFS client support
│ │ [*] NFS client support for NFS version 3
│ │ [ ] NFS client support for the NFSv3 ACL protocol extension
│ │ [*] NFS client support for NFS version 4 (EXPERIMENTAL)
│ │ [ ] NFS client support for NFSv4.1 (DEVELOPER ONLY)
│ │ [*] Root file system on NFS

备注:Linux启动参数(uboot bootargs传递过来的)
"console=ttySAC0,115200 root=/dev/nfs rw nfsroot=172.20.118.103:/work/workspace/s3c6410/rootfs ip=172.20.118.193:172.20.118.103:172.20.118.254:255.255.255.0:hoxm:eth0:none"
停在Starting kernel问题解决
常见原因:
1)地址错误
2)Boot参数设置错误
3)串口fifo设置不必配(本次移植就是因为这个原因)
archarmmach-s3c6400includemachuncompress.h 中添加uart fifo配置

static void arch_detect_cpu(void)
{

fifo_mask = S3C_UFSTAT_TXMASK;
fifo_max = 63 < S3C_UFSTAT_TXSHIFT;
}

根文件系统建立
Download busybox

#make menuconfig
#make
#make install
busybox make,如果出现找不到crypt m库的错误提示Trying libraries: crypt m Library crypt is needed, cant exclude it (yet) Library m is needed, cant exclude it (yet) Final link with: crypt m,可以不必理会,直接make install

编译bash
export CC=arm-sunplus-linux-gnueabi-gcc
./configure --host=arm-sunplus-linux-gnueabi --enable-static-link --without-bash-malloc
make
make之后源码包顶层目录下生成bash,不用make install,直接copy到busybox的/bin目录

最简单的默认使用sh的根文件系统制作:
busybox生成: /bin /sbin /usr/bin /usr/sbin
mk空目录:mkdir dev etc home lib mnt opt proc sys tmp var
busybox /examples copy /etc下inittab,fstab,rc等相关脚本覆盖到/etc中

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top