zoukankan      html  css  js  c++  java
  • uboot移植之环境变量在NandFlash

    一、概述

      u-boot环境变量可以设置在Norflash上,也可以在NandFlash上。

      倘若环境变量在NorFlash上,再假设S3C2440从NorFlash启动,是能正确从NorFlash上读取环境变量。但是,倘若从NandFlash启动,由于Bank0被挂载成S3C2440的stepstone,就不能从NorFlash上读取环境变量。

      倘若环境变量在NandFlash上,无论S3C2440以什么方式启动,由于NandFlash的逻辑空间与S3C2440的逻辑空间独立,NandFlash都能够正常使用,当然也能够从NandFlash上读取环境变量。

    二、参数收集

    1、NandFlash

    芯片:K9F2G08U0B

    擦除单位:块

    块大小:128KB

    2、环境变量存储区设置

      可以看到,分区0是uboot代码区,分配了256KB,分区1是环境变量区,分配了NandFlash的一个Block,128KB。

    三、移植

      修改TQ2440.h,添加如下内容。

    /*-----------------------------------------------------------------------
     *environment configuration
     */
     
    //#define    CFG_ENV_IS_IN_FLASH    1
    //#define CFG_ENV_SIZE        0x20000     /* Total Size of Environment Sector */
    
    #define CFG_ENV_IS_IN_NAND        1
    #define CFG_ENV_ADDR        (CFG_FLASH_BASE + 0x40000) /* addr of environment at 256K */
    #define CFG_ENV_OFFSET            0x40000 /* Environment offset */
    #define CFG_ENV_SIZE            0x20000    /* Environment Size 128K */
    
    #define CFG_MONITOR_BASE    CFG_ENV_ADDR
  • 相关阅读:
    如何参与linux 内核开发
    绘制dot 图
    GITHUB 提交错误 Error: Permission denied (publickey) 解决
    atomic_read
    linux 获取cpu 个数
    【转】 管理CPU 亲和性
    【转】 申请对齐某种结构体大小的buffer
    WePY框架开发的小程序中使用 echarts折线图
    vue + css3 实现主题色切换
    vue 中 const { x } = this 的用法
  • 原文地址:https://www.cnblogs.com/amanlikethis/p/3637738.html
Copyright © 2011-2022 走看看