分享

全志A20单独烧录内核

 dwlinux_gs 2014-09-23

     全志A20平板,摸索了一下fastboot,但是烧录失败,提示找不到分区。于是就想到用TF卡烧录boot.img,因为只修改了内核,不想打包全部烧录一遍。

     启动到uboot命令行,输入mmcinfo初始化mmc,不过提示:No MMC avaliable什么的,查找uboot源代码,发现,

u-boot/arch/arm/lib/board.c里面,

    if(!storage_type){
        puts("NAND:  ");
        nand_init();        /* go init the NAND */
    }
    else{
        puts("MMC:   ");
        mmc_initialize(bd);
    }

     红色代码地方表明,uboot命令行只支持NAND或者MMC中的一种,这没有道理啊。于是去掉else,无论什么情况下都初始化MMC。也就是修改为:

    if(!storage_type){
        puts("NAND:  ");
        nand_init();        /* go init the NAND */
    }
    //else{//modified by Antony, for the perpose of enable MMC in uboot
        puts("MMC:   ");
        mmc_initialize(bd);
   // }


还有个地方需要修改的:include/configs/sun7i.h,以下三处红色的地方。

/* mmc config */
#define CONFIG_MMC
#define CONFIG_GENERIC_MMC
#define CONFIG_CMD_MMC
#define CONFIG_MMC_SUNXI
#define CONFIG_MMC_SUNXI_SLOT        0        /* which mmc slot to use, could be 0,1,2,3 */
#define CONFIG_MMC_SUNXI_USE_DMA
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV        0/* first detected MMC controller */
#define CONFIG_STORAGE_EMMC
#define CONFIG_FASTBOOT_MMC_NO        0
#define CONFIG_MMC_LOGICAL_OFFSET   (20 * 1024 * 1024/512)

启动系统,可以顺利识别MMC了。

执行命令:

mmcinfo

fatload mmc 2:1 82000000 boot.img

nand erase.part boot

nand write 82000000 3000000 1000000

重新启动发现内核确实更新了。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多