Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34251
  • 博文数量: 20
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 135
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-16 21:01
文章分类
文章存档

2011年(1)

2009年(19)

我的朋友
最近访客

分类: LINUX

2009-09-30 21:40:07

总结:总共修改了四个文件:
修改:根目录下Makefile.
修改:arch/arm/mach-s3c2440/Makefile
修改:arch/arm/mach-s3c2440/Kconfig
增加:arch/arm/mach-s3c2440/mini2440.c
有需要的可以在下面回邮箱地址,我把修改后文件发给大家。
一、下载代码
二、解压到工作目录
三、修改Makefile
kwrite Makefile
搜索:crosscompile
找到: export KBUILD_BUILDHOST := $(SUBARCH)
ARCH                ?= $(SUBARCH)
CROSS_COMPILE        ?=
复制代码改为: export KBUILD_BUILDHOST := $(SUBARCH)
ARCH                ?= arm
CROSS_COMPILE        ?= arm-linux-
复制代码保存。
四、打开arch/arm/mach-s3c2440/
找到mach-smdk2440.c,复制一份,重命名为:mach-mini2440.c
找到: static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {
        [0] = {
                .hwport             = 0,
                .flags             = 0,
                .ucon             = 0x3c5,
                .ulcon             = 0x03,
                .ufcon             = 0x51,
        },
        [1] = {
                .hwport             = 1,
                .flags             = 0,
                .ucon             = 0x3c5,
                .ulcon             = 0x03,
                .ufcon             = 0x51,
        },
        /* IR port */
        [2] = {
                .hwport             = 2,
                .flags             = 0,
                .ucon             = 0x3c5,
                .ulcon             = 0x43,
                .ufcon             = 0x51,
        }
};
 
/* LCD driver info */
 
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
 
        .lcdcon5        = S3C2410_LCDCON5_FRM565 |
                          S3C2410_LCDCON5_INVVLINE |
                          S3C2410_LCDCON5_INVVFRAME |
                          S3C2410_LCDCON5_PWREN |
                          S3C2410_LCDCON5_HWSWP,
 
        .type                = S3C2410_LCDCON1_TFT,
 
        .width                = 240,
        .height                = 320,
 
        .pixclock        = 166667, /* HCLK 60 MHz, divisor 10 */
        .xres                = 240,
        .yres                = 320,
        .bpp                = 16,
        .left_margin        = 20,
        .right_margin        = 8,
        .hsync_len        = 4,
        .upper_margin        = 8,
        .lower_margin        = 7,
        .vsync_len        = 4,
};
 
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
        .displays        = &smdk2440_lcd_cfg,
        .num_displays        = 1,
        .default_display = 0,
 
#if 0
        /* currently setup by downloader */
        .gpccon                = 0xaa940659,
        .gpccon_mask        = 0xffffffff,
        .gpcup                = 0x0000ffff,
        .gpcup_mask        = 0xffffffff,
        .gpdcon                = 0xaa84aaa0,
        .gpdcon_mask        = 0xffffffff,
        .gpdup                = 0x0000faff,
        .gpdup_mask        = 0xffffffff,
#endif
 
        .lpcsel                = ((0xCE6) & ~7) | 1<<4,
};
复制代码改为: static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
 
        #if 0
        .lcdcon5        = S3C2410_LCDCON5_FRM565 |
                          S3C2410_LCDCON5_INVVLINE |
                          S3C2410_LCDCON5_INVVFRAME |
                          S3C2410_LCDCON5_PWREN |
                          S3C2410_LCDCON5_HWSWP,
        #endif
 
        .lcdcon5=(S3C2410_LCDCON5_FRM565 | S3C2410_LCDCON5_HWSWP),
        .type                = S3C2410_LCDCON1_TFT,
 
        .width                = 800,
        .height                = 480,
 
        .pixclock        = 40000, /* HCLK 60 MHz, divisor 10 */
        .xres                = 800,
        .yres                = 480,
        .bpp                = 16,
        .left_margin        = 41,
        .right_margin        = 68,
        .hsync_len        = 32,
        .upper_margin        = 26,
        .lower_margin        = 6,
        .vsync_len        = 2,
};
 
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
        .displays        = &smdk2440_lcd_cfg,
        .num_displays        = 1,
        .default_display = 0,
 
        .gpccon =       0xaa955699,
        .gpccon_mask =  0xffc003cc,
        .gpcup =        0x0000ffff,
        .gpcup_mask =   0xffffffff,
 
        .gpdcon =       0xaa95aaa1,
        .gpdcon_mask =  0xffc0fff0,
        .gpdup =        0x0000faff,
        .gpdup_mask =   0xffffffff,
 
 
        .lpcsel                = 0xf82,
 
#if 0
        /* currently setup by downloader */
        .gpccon                = 0xaa940659,
        .gpccon_mask        = 0xffffffff,
        .gpcup                = 0x0000ffff,
        .gpcup_mask        = 0xffffffff,
        .gpdcon                = 0xaa84aaa0,
        .gpdcon_mask        = 0xffffffff,
        .gpdup                = 0x0000faff,
        .gpdup_mask        = 0xffffffff,
 
 
        .lpcsel                = ((0xCE6) & ~7) | 1<<4,
#endif
};
复制代码以支持7寸屏的正确显示,如果有用3.5寸屏的,请回复,我发相应代码。
将所有smdk2440改成mini2440.
搜索MACHINE_START在结果处改为:
MACHINE_START(MINI2440, "MINI2440")
修改时钟频率:
找到: static void __init mini2440_map_io(void)
{
        s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc));
        s3c24xx_init_clocks(12000000);
        s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
}
复制代码这段中原来的部分不是12000000,即不是12MHz,改过来。
在/arch/arm/plat-x3c24xx/common-smdk.c中,
修改nand 分区为:
[0]={
    .name = "bootloader",
    .offset = 0x00000000,
    .size = 0x00030000,
    },
    [1]={
    .name = "kernel",
    .offset = 0x00050000,
    .size = 0x00200000,
    },
    [2]={
    .name = "root",
    .offset = 0x00250000,
    .size = 0x03dac000,
    }
收藏 分享 评分 
  管理 回复 引用 编辑 订阅 道具 TOP
 
 
发短消息
加为好友
yellowater 当前离线
UID188 帖子149 精华0 积分152 威望0 份 奉献0 份 付出0 份 所取0 份 热心152 份 阅读权限100 在线时间20 小时 注册时间2009-7-1 最后登录2009-9-29  
指导员
 

--------------------------------------------------------------------------------
IP   编辑此人   禁止此人
 2#
 yellowater发表于 4 天前 21:24 | 只看该作者 本帖最后由 yellowater 于 2009-9-26 22:02 编辑
修改mini2440_map_io为:(其实就加了一句话)static void __init mini2440_map_io(void)
{
        s3c_device_nand.dev.platform_data = &mini2440_nand_info;
        s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc));
        s3c24xx_init_clocks(12000000);
        s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
}
复制代码增加头文件:
#include
#include
#include
#include
#include
我是加在了:
#include
后面。
背光驱动:static void __init smdk2440_machine_init(void)
{
        s3c24xx_fb_set_platdata(&smdk2440_fb_info);
        s3c_i2c0_set_platdata(NULL);
 
        platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
        smdk_machine_init();
}
复制代码改成:static void __init smdk2440_machine_init(void)
{
        s3c24xx_fb_set_platdata(&smdk2440_fb_info);
        s3c_i2c0_set_platdata(NULL);
        s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP);
        s3c2410_gpio_setpin(S3C2410_GPG4, 1);
        platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
        smdk_machine_init();
}
复制代码
 
本文来自: USR组织官方网站() 详细出处参考:
在上面所一直在修改的文件所在文件夹下的Makefile最后加一句:
obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
同文件夹下的Kconfig文件中,在:
endmenu 前加上:
config MACH_MINI2440
        bool "MINI2440 development board"
        select CPU_S3C2440
        help
          Say Y here if you are using the MINI2440 development board
回到代码根目录:
make s3c2410_defconfig
make menuconfig
System Type->S3C2440 Machines->只选种mini2440 developing board
Boot Options->Default kernel command string 填为:
noinitrd root=/dev/mtdblock2 boot=/linuxrc console=ttySAC0
make zImage
不过忘记了一点,没配置linux logo.
make menuconfig
Device Drivers->Graphics Support->Boot up logo.选 上就行了。
make zImage,有 原来的 文件,现在编译很快。
本文来自: USR组织官方网站() 详细出处参考:
 
嗯,这个只是第一个,其它部分移植,请见在下所辖论坛:
阅读(1279) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~