• 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);

  • 相关阅读:
    ckfinder+ckeditor配置经验
    人人商城模块研究
    微擎小程序支付功能+退款功能
    php服务器网络请求
    linux对workerman的扩展和配置
    linux安装php_screw加密php代码
    webForm渲染视图的基本方法
    sql注入和暴库
    数据库设计命名规范
    枚举、结构体、联合体的简单应用程序-C语言
  • 原文地址:https://www.cnblogs.com/embedded-linux/p/5943699.html
Copyright © 2020-2023  润新知