zoukankan      html  css  js  c++  java
  • (三)修改内核大小,适配目标板Nand flash分区配置

    一. 修改内核大小

    1. 在你的配置文件下uboot/include/config/xxx.h 里面有一个宏定义

    #define MTDPARTS_DEFAULT    "mtdparts=jz2440-0:256k(u-boot),"    
                            "128k(params),"        
                            "4m(kernel),"    
                            "-(rootfs)"        

        此处将kerner对应的字段修改后即可修改uboot为linux内核分配的空间, kernel内为flash分配的分区下面分析。

    二. 修改Nand Flash分区

    1. 修改arch/arm/mach-s3c24xx/common-smdk.c文件中如下内容

    static struct mtd_partition smdk_default_nand_part[] = {
        [0] = {
            .name    = "bootloader",
            .size    = SZ_256K,
            .offset    = 0,
        },
        [1] = {
            .name    = "params",
            .offset = MTDPART_OFS_APPEND,
            .size    = SZ_128K,
        },
        [2] = {
            .name    = "kernel",
            .offset = MTDPART_OFS_APPEND,
            .size    = SZ_4M,
        },
        [3] = {
            .name    = "rootfs",
            .offset = MTDPART_OFS_APPEND,
            .size    = MTDPART_SIZ_FULL,
    
        }
    };

        arm/mach-s3c24xx/mach-mini2440.c中配套修改

    static struct mtd_partition mini2440_default_nand_part[] __initdata = {
        [0] = {
            .name    = "bootloader",
            .size    = SZ_256K,
            .offset    = 0,
        },
        [1] = {
            .name    = "params",
            .offset = MTDPART_OFS_APPEND,
            .size    = SZ_128K,
        },
        [2] = {
            .name    = "kernel",
            .offset = MTDPART_OFS_APPEND,
            .size    = SZ_4M,
        },
        [3] = {
            .name    = "rootfs",
            .offset = MTDPART_OFS_APPEND,
            .size    = MTDPART_SIZ_FULL,
    
        }
    };

    2. 修改系统晶振时钟

        在文件arch/arm/mach-s3c24xx/mach-smdk2440.c中将时钟改位12M

    static void __init smdk2410_init_time(void)
    {
        s3c2410_init_clocks(12000000);
        samsung_timer_init();
    }

    3. 修改完成后执行make uImage LOADADDR=0x30108000 -j8进行编译

  • 相关阅读:
    go语言入门(3)运算符及流程控制
    go语言入门(2)数据类型
    go语言入门(1)
    ubuntu上软件下载慢,github下载慢
    密码基础知识(2)以RSA为例说明加密、解密、签名、验签
    让你减少焦虑的一首英文小诗
    使用脚本启动fabric时出错
    Hyperledger Fabric(5)ChainCode的编写步骤
    Hyperledger Fabric(4)链码ChainCode
    设计题专题总结
  • 原文地址:https://www.cnblogs.com/edver/p/10642045.html
Copyright © 2011-2022 走看看