zoukankan      html  css  js  c++  java
  • am335x system upgrade uboot nand boot(三)

    在uboot 下初始化nand,一般需要做如下工作:

    第一: 配置默认从NAND boot

    Index: include/configs/am335x_evm.h
    ===================================================================
    --- include/configs/am335x_evm.h (revision 8)
    +++ include/configs/am335x_evm.h (revision 9)
    @@ -17,9 +17,11 @@
    #define __CONFIG_AM335X_EVM_H

    #include <configs/ti_am335x_common.h>
    -#define CONFIG_SD_BOOT
    +/*#define CONFIG_SD_BOOT*/
    +#define CONFIG_NAND_BOOT
    #define CONFIG_PHY_MICREL
    #define CONFIG_PHY_MICREL_KSZ8XXX


    #ifndef CONFIG_SPL_BUILD
    # define CONFIG_TIMESTAMP

    第二,nand 相应的引脚做初始化

    ===================================================================
    --- board/ti/am335x/mux.c (revision 8)
    +++ board/ti/am335x/mux.c (revision 9)
    @@ -422,4 +422,5 @@
    configure_module_pin_mux(gpio0_7_pin_mux);
    configure_module_pin_mux(rmii1_pin_mux);
    configure_module_pin_mux(mmc0_pin_mux_sk_evm);
    + configure_module_pin_mux(nand_pin_mux);
    }
    第三:指定uboot变量何存至uboot-env分区

    Index: Kconfig
    ===================================================================
    --- Kconfig (revision 13)
    +++ Kconfig (revision 14)
    @@ -22,7 +22,7 @@
    default ENV_IS_IN_SPI_FLASH if INTEL_QUARK
    default ENV_IS_IN_SPI_FLASH if INTEL_QUEENSBAY
    default ENV_IS_IN_FAT if ARCH_BCM283X
    - default ENV_IS_IN_FAT if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS
    + default ENV_IS_IN_NAND if TI_COMMON_CMD_OPTIONS
    default ENV_IS_NOWHERE
    help
    At present the environment can be stored in only one place. Use this

    第四:指nand env的大小

    Index: am335x_evm.h
    ===================================================================
    --- am335x_evm.h (revision 15)
    +++ am335x_evm.h (revision 16)
    @@ -301,6 +301,7 @@
    #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */
    #elif defined(CONFIG_ENV_IS_IN_NAND)
    #define CONFIG_ENV_OFFSET 0x001c0000
    +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
    /*#define CONFIG_ENV_OFFSET_REDUND 0x001e0000*/
    #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
    #endif

    第五: 需要修改默认的bootcmd从nand启动

    Index: am335x_evm_defconfig
    ===================================================================
    --- am335x_evm_defconfig (revision 15)
    +++ am335x_evm_defconfig (revision 16)
    @@ -6,7 +6,7 @@
    CONFIG_DISTRO_DEFAULTS=y
    CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
    CONFIG_SPL_LOAD_FIT=y
    -CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
    +CONFIG_BOOTCOMMAND="run nandboot"
    CONFIG_LOGLEVEL=3
    CONFIG_SYS_CONSOLE_INFO_QUIET=y
    CONFIG_VERSION_VARIABLE=y

    经过上述修改之后,便可以默认从NAND引导,uboot环境变量保存至uboot-env分区

    boot log:

    U-Boot SPL 2018.01-svn16 (Nov 22 2018 - 15:56:43)
    Trying to boot from NAND


    U-Boot 2018.01-svn16 (Nov 22 2018 - 15:56:43 +0800)

    CPU : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM: 256 MiB
    NAND: 256 MiB
    MMC: OMAP SD/MMC: 0
    Net: cpsw
    Hit any key to stop autoboot: 0

  • 相关阅读:
    [LeetCode]String主题系列{第5,6题}
    [LeetCode]Math主题系列{第7,9,13,273题}
    [LeetCode]LinkedList主题系列{第2题}
    [LeetCode]HashTable主题系列{第3,36,49,94,136,138,187,202,204,205,290,347,389,409,438,451,463,500,508,560,594,599题}
    由于博客园的道路越来越像CSDN了,已经不再是当年的博客园了,决定退出博客园,后续建立自己的博客站点。
    Revit二次开发——非模态窗口的事件处理
    Revit二开---Schemachema扩展数据
    Revit二开---ViewFamily视图类型枚举
    CAD二开---扩展数据XData
    CAD二开---框选文字批量对齐
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/10008648.html
Copyright © 2011-2022 走看看