uboot的生成

在Release_to_customer.sh中可以看到,当flash为nand时,在boot目录下执行了:

# make infinity2m_spinand_defconfig

Release_to_customer.sh中uboot的脚本内容如下:

# build uboot
cd ${RELEASEDIR}/boot
declare -x ARCH="arm"
declare -x CROSS_COMPILE="arm-linux-gnueabihf-"
if [ "${flashtype}" = "nor" ]; then
    make infinity2m_defconfig
else
    make infinity2m_spinand_defconfig
fi
#make clean
make -j16

if [ "${flashtype}" = "nor" ]; then
    if [ -d ../project/board/i2m/boot/nor/uboot ]; then
        cp u-boot.xz.img.bin ../project/board/i2m/boot/nor/uboot
    fi
else
    if [ -d ../project/board/i2m/boot/spinand/uboot ]; then
        cp u-boot_spinand.xz.img.bin ../project/board/i2m/boot/spinand/uboot/
    fi
fi

# vi boot/configs/infinity2m_spinand_defconfig

infinity2m_spinand_defconfig配置如下所示:

CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="infinity2m"
CONFIG_SYS_CONFIG_NAME="infinity2m"

CONFIG_SYS_SOC为infinity2m,因此对应的uboot配置文件名为:

# boot/include/configs/infinity2m.h

CONFIG_MS_SAVE_ENV_IN_NAND_FLASH=y
# CONFIG_MS_USB is not set
CONFIG_MS_EMAC=y
CONFIG_ETHERNET_ALBANY=y
# CONFIG_MS_AESDMA is not set
CONFIG_MS_SPINAND=y
CONFIG_IMAGE_POSTFIX="_spinand"

# vi boot/include/configs/infinity2m.h

infinity2m.h配置如下所示:

#ifdef CONFIG_MS_SPINAND
#if defined(CONFIG_MS_SAVE_ENV_IN_NAND_FLASH)
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET       CONFIG_MSTAR_ENV_NAND_OFFSET
#define CONFIG_MSTAR_ENV_NAND_OFFSET ms_nand_env_offset
/*#define CONFIG_MSTAR_ENV_NAND_OFFSET 0x440000*/
#define CONFIG_ENV_SIZE         0x00020000
#endif

#define CONFIG_CMD_SPINAND_CIS
#define CONFIG_CMD_UBI
/* #define CONFIG_CMD_UBIFS */
#define CONFIG_UBI_MWRITE
#define MTDIDS_DEFAULT            "nand0=nand0"    /* "nor0=physmap-flash.0,nand0=nand" */
/*    must be different from real partition to test NAND partition function */
#define MTDPARTS_DEFAULT        "mtdparts=nand0:0xC0000@0x140000(NPT),-(UBI)"
/*    #define MTDPARTS_DEFAULT    "mtdparts=nand0:0x60000@0x140000(IPL0),0x60000(IPL1),0x60000(IPL_CUST0),0x60000(IPL_CUST1),0xC0000(UBOOT0),0xC0000(UBOOT1),0x60000(ENV),0x340000(KERNEL),0x340000(RECOVERY),-(UBI)"*/
文档更新时间: 2021-04-26 17:55   作者:Aeeditor