教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 教学研究 >

FL2440开发板内核移植笔记(2)

来源:网络收集 时间:2026-01-24
导读: .dev = { .platform_data = s3c24xx_uda134x_data, } }; 将下面代码添加到平台中 static struct platform_device *smdk2440_devices[] __initdata = { s3c_device_usb, s3c_device_lcd, s3c_device_wdt, s3c_device

.dev = {

.platform_data = &s3c24xx_uda134x_data,

}

};

将下面代码添加到平台中

static struct platform_device *smdk2440_devices[] __initdata = {

&s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c0, &s3c_device_iis,

&s3c_device_rtc,

&s3c24xx_uda134x,//增加这里 这些都是内核启动的时候初始化的设备

};

配置内核

[root@WEB188 linux-2.6.33]# make menuconfig

Device Drivers --->

<*> Sound card support --->

<*> Advanced Linux Sound Architecture --->

<*> OSS Mixer API

<*> OSS PCM (digital audio) API [*] OSS PCM (digital audio) API - Include plugin system

[*] Support old ALSA API

[*] Verbose procfs contents [*] Verbose printk

[*] Generic sound devices --->

<*> ALSA for SoC audio support --->

<*> SoC Audio for the Samsung S3C24XX chips

<*> SoC I2S Audio support UDA134X wired to a S3C24XX 19、 移植DM9000驱动,修改 drivers/net/dm9000.c 文件

[root@WEB188 linux-2.6.33]# vi drivers/net/dm9000.c

#include <mach/regs-gpio.h>

#include <mach/irqs.h>

#include <mach/hardware.h>

在dm9000_probe 函数开始增加(注意是开始处,而不是函数上面):

unsigned char ne_def_eth_mac_addr[]={0x00,0x12,0x34,0x56,0x80,0x49};

static void *bwscon;

static void *gpfcon;

static void *extint0;

static void *intmsk;

#define BWSCON (0x48000000)

#define GPFCON (0x56000050)

#define EXTINT0 (0x56000088)

#define INTMSK (0x4A000008)

bwscon=ioremap_nocache(BWSCON,0x0000004);

gpfcon=ioremap_nocache(GPFCON,0x0000004);

extint0=ioremap_nocache(EXTINT0,0x0000004);

intmsk=ioremap_nocache(INTMSK,0x0000004);

writel(readl(bwscon)|0xc0000,bwscon);

writel( (readl(gpfcon) & ~(0x3 << 14)) | (0x2 << 14), gpfcon);

writel( readl(gpfcon) | (0x1 << 7), gpfcon); // Disable pull-up

writel( (readl(extint0) & ~(0xf << 28)) | (0x4 << 28), extint0); //rising edge writel( (readl(intmsk)) & ~0x80, intmsk);

在这个函数最后修改以下位置

if (!is_valid_ether_addr(ndev->dev_addr)) {

/* try reading from mac */

mac_src = "chip";

for (i = 0; i < 6; i++)

//ndev->dev_addr[i] = ior(db, i+DM9000_PAR);

ndev->dev_addr[i] = ne_def_eth_mac_addr[i];//修改这里 }

修改arch/arm/mach-s3c2440/mach-smdk2440.c,添加设备

static struct platform_device *smdk2440_devices[] __initdata = {

&s3c_device_usb,

&s3c_device_lcd,

&s3c_device_wdt, &s3c_device_i2c0,

&s3c_device_iis, &s3c_device_rtc, &s3c24xx_uda134x, &s3c_device_dm9000,//此处添加

};

修改文件arch/arm/plat-s3c24xx/devs.c

[root@WEB188 linux-2.6.33]# vi arch/arm/plat-s3c24xx/devs.c

添加头文件:

#include <linux/dm9000.h>

以及以下信息:

static struct resource s3c_dm9000_resource[] = {

[0] = {

.start = S3C24XX_PA_DM9000,

.end = S3C24XX_PA_DM9000+ 0x3,

.flags = IORESOURCE_MEM

},

[1]={

.start = S3C24XX_PA_DM9000 + 0x4, //CMD pin is A2

.end = S3C24XX_PA_DM9000 + 0x4 + 0x7c,

.flags = IORESOURCE_MEM

},

[2] = {

.start = IRQ_EINT7,

.end = IRQ_EINT7,

.flags = IORESOURCE_IRQ

}, };

static struct dm9000_plat_data s3c_device_dm9000_platdata = { .flags= DM9000_PLATF_16BITONLY,

};

struct platform_device s3c_device_dm9000 = {

.name= "dm9000",

.id= 0,

.num_resources= ARRAY_SIZE(s3c_dm9000_resource),

.resource= s3c_dm9000_resource,

.dev= {

.platform_data = &s3c_device_dm9000_platdata,

}

};

EXPORT_SYMBOL(s3c_device_dm9000);

修改arch/arm/plat-s3c/include/plat/devs.h 45行附近,添加

[root@WEB188 linux-2.6.33]# vi arch/arm/plat-s3c/include/plat/devs.h

extern struct platform_device s3c_device_dm9000;

修改arch/arm/mach-s3c2410/include/mach/map.h

[root@WEB188 linux-2.6.33]# vi arch/arm/mach-s3c2410/include/mach/map.h

新增

/* DM9000 */

#define S3C24XX_PA_DM9000 0x20000300

#define S3C24XX_VA_DM9000 0xE0000000

(如果无法发现网卡,请进行操作:)修改arch/arm/mach-s3c2410/mach-smdk2410.c在smdk2410_devices增加以下行

&s3c_device_dm9000,

另外在static struct map_desc smdk2410_iodesc[] __initdata增加以下内容 [0] = {

.virtual = (unsigned long)S3C24XX_VA_DM9000, .pfn = __phys_to_pfn(S3C24XX_PA_DM9000),

.length = SZ_1M,

.type = MT_DEVICE,

},

20、 移植LCD。打开文件arch/arm/mach-s3c2410/mach-smdk2410.c

[root@WEB188 linux-2.6.33]# vi arch/arm/mach-s3c2410/mach-smdk2410.c

在以下两个结构体中static struct s3c2410fb_display smdk2440_lcd_cfg[] __initdata,static struct s3c2410fb_mach_info smdk2440_fb_info __initdata,改成如下代码

static struct s3c2410fb_display smdk2440_lcd_cfg[] __initdata = {

{

/* Config for 320x240 LCD */

.lcdcon5 = S3C2410_LCDCON5_FRM565 |

S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_INVVFRAME | S3C2410_LCDCON5_PWREN | S3C2410_LCDCON5_HWSWP,

.type = S3C2410_LCDCON1_TFT, .width = 320,

.height = 240,

.pixclock = 270000,

.xres = 320,

.yres = 240,

.bpp = 16,

.left_margin = 8,

.right_margin = 5,

.hsync_len …… 此处隐藏:2555字,全部文档内容请下载后查看。喜欢就下载吧 ……

FL2440开发板内核移植笔记(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/49095.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)