zoukankan      html  css  js  c++  java
  • NorFlash linux分区分析

    一般情况下,与板卡相关的内容都在bsp中(即arch/arm/mach-xxx/board-xxx.c)中,但norflash的分区直接放在norflash驱动中。由于norflash应用基于mtd,所以驱动位于drivers/mtd/目录下,chips目录是norflash相关公用驱动,maps是不同板卡应用的的驱动,如at91sam9261.c。分区信息便在板卡norflash驱动文件中。

    #define WINDOW_ADDR 0x10000000      /* physical properties of flash */

    #define WINDOW_SIZE 0x800000

    #define BUSWIDTH    2

    #define MSG_PREFIX "SAM9261-NOR:"   /* prefix for our printk()'s */

    #define MTDID      "sam9261-nor"    /* for mtdparts= partitioning */

    static struct mtd_info *mymtd;

    struct map_info sam9261nor_map = {

        .name = "NOR flash on sam9261",

        .size = WINDOW_SIZE,

        .bankwidth = BUSWIDTH,

        .phys = WINDOW_ADDR,

    };

    #ifdef CONFIG_MTD_PARTITIONS

    /*

     * MTD partitioning stuff

     */

    static struct mtd_partition sam9261_partitions[] =

    {

    #if 1           /* New fs */

        {   /* rootfs 2M */

            .name = "rootfs",

            .size = MTDPART_SIZ_FULL,

            .offset = 0x380000,

        },

    #endif

    };

    驱动定义两个函数,用于加载卸载驱动:

    static int __init init_sam9261nor(void);

    static void __exit cleanup_sam9261nor(void);

    module_init(init_sam9261nor);

    module_exit(cleanup_sam9261nor);

  • 相关阅读:
    一些有意思的网站
    SQLLocalDB 11.0持续报错,这是泥马德什么问题啊!!!
    SystemErrorCodes
    事件查看器事件ID部分说明
    Application.AddMessageFilter(this);
    Provider:SSL提供程序,error:0
    SQL Server的“错误:9004”
    关于TortoiseSVN的一些知识
    progressBar走马灯设置
    2015广州强网杯(Misc)
  • 原文地址:https://www.cnblogs.com/embedded-linux/p/5943699.html
Copyright © 2011-2022 走看看