打印

BeagleBone U-Boot编译及添加Ext4支持

[复制链接]
701|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
qaz098xsw|  楼主 | 2017-9-30 11:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
BeagleBone U-Boot编译及添加Ext4支持

按照sitara-linuxsdk-sdg-05.04.01.00.pdf AMSDK u-boot User's Guide 编译MLO u-boot.img,启动时出现如下错误:
  • Uncompressing Linux... done, booting the kernel.
  • [    0.068275] _omap_mux_get_by_name: Could not find signal uart1_cts.uart1_cts
  • [    0.068294] omap_hwmod_mux_init: Could not allocate device mux entry
  • [    0.068448] _omap_mux_get_by_name: Could not find signal uart2_cts.uart2_cts
  • [    0.068466] omap_hwmod_mux_init: Could not allocate device mux entry
  • [    0.068623] _omap_mux_get_by_name: Could not find signal uart3_cts_rctx.uart3_cts_rctx
  • [    0.068642] omap_hwmod_mux_init: Could not allocate device mux entry
  • [    0.106262] cpuidle-am33xx cpuidle-am33xx.0: failed to register driver
  • [    0.261045] _omap_mux_get_by_name: Could not find signal leds-gpio
  • [    0.651859] omap2_set_init_voltage: unable to get clk dpll1_ck
  • [    0.658045] omap2_set_init_voltage: unable to set vdd_mpu_iva
  • [    0.664063] omap2_set_init_voltage: unable to get clk l3_ick
  • [    0.670000] omap2_set_init_voltage: unable to set vdd_core
  • <b><font color="#ff0000">[    0.897931] EXT3-fs (mmcblk0p2): error: couldn't mount because of unsupported optional features (40)
  • [    0.907766] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)</font></b>

复制代码
很明显,SD卡的mmcblk0p2这个分区是EXT4文件系统,而u-boot中并未支出EXT4,所以需要修改相关文件:
u-boot源码下的include/configs/am335x_evm.h
  • /* HSMMC support */
  • #ifdef CONFIG_MMC
  • #define CONFIG_GENERIC_MMC
  • #define CONFIG_OMAP_HSMMC
  • #define CONFIG_CMD_MMC
  • #define CONFIG_DOS_PARTITION
  • #define CONFIG_CMD_FAT
  • #define CONFIG_CMD_EXT2
  • <b><font color="#ff0000">#define CONFIG_CMD_EXT4/*2013-12-12*/</font></b>

复制代码
添加#define CONFIG_CMD_EXT4
  • #define CONFIG_EXTRA_ENV_SETTINGS \
  •         "bootfile=uImage\0" \
  •         "loadaddr=0x82000000\0" \
  •         "kloadaddr=0x80007fc0\0" \
  •         "script_addr=0x81900000\0" \
  •         "console=ttyO0,115200n8\0" \
  •         "mmc_dev=0\0" \
  •         "mmc_root=/dev/mmcblk0p2 rw\0" \
  •         "nand_root=ubi0:rootfs rw ubi.mtd=7,2048\0" \
  •         "spi_root=/dev/mtdblock4 rw\0" \
  •         "nor_root=/dev/mtdblock3 rw\0" \
  • <b><font color="#ff0000">        "mmc_root_fs_type=ext4 rootwait\0" \</font></b>
  •         "nand_root_fs_type=ubifs rootwait=1\0" \
  •         "spi_root_fs_type=jffs2\0" \
  •         "nor_root_fs_type=jffs2\0" \
  •         "nand_src_addr=0x280000\0" \
  •         "spi_src_addr=0x62000\0" \
  •         "nor_src_addr=0x08080000\0" \
  •         "nand_img_siz=0x500000\0" \
  •         "spi_img_siz=0x380000\0" \
  •         "nor_img_siz=0x280000\0" \
  •         "spi_bus_no=0\0" \
  •         "rootpath=/export/rootfs\0" \
  •         "nfsopts=nolock\0" \
  •         "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
  •                         "::off\0" \
  •         "ip_method=none\0" \
  •         "bootenv=uEnv.txt\0" \
  •         "loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}\0" \
  •         "importbootenv=echo Importing environment from mmc ...; " \
  •                 "env import -t $loadaddr $filesize\0" \
  •         "mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}\0" \
  •         "optargs=\0" \
  •         "bootargs_defaults=setenv bootargs " \
  •                 "console=${console} " \
  •                 "${optargs}\0" \
  •         "mmc_args=run bootargs_defaults;" \
  •                 "setenv bootargs ${bootargs} " \
  •                 "root=${mmc_root} " \
  •                 "rootfstype=${mmc_root_fs_type} ip=${ip_method}\0" \
  •         "nand_args=run bootargs_defaults;" \
  •                 "setenv bootargs ${bootargs} " \
  •                 "root=${nand_root} noinitrd " \
  •                 "rootfstype=${nand_root_fs_type} ip=${ip_method}\0" \
  •         "spi_args=run bootargs_defaults;" \
  •                 "setenv bootargs ${bootargs} " \
  •                 "root=${spi_root} " \
  •                 "rootfstype=${spi_root_fs_type} ip=${ip_method}\0" \
  •         "nor_args=run bootargs_defaults;" \
  •                 "setenv bootargs ${bootargs} " \
  •                 "root={nor_root} " \
  •                 "rootfstype=${nor_root_fs_type} ip=${ip_method}\0" \
  •         "net_args=run bootargs_defaults;" \
  •                 "setenv bootargs ${bootargs} " \
  •                 "root=/dev/nfs " \
  •                 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
  •                 "ip=dhcp\0" \
  •         "mmc_boot=run mmc_args; " \
  •                 "run mmc_load_uimage; " \
  •                 "bootm ${kloadaddr}\0" \
  •         "nand_boot=echo Booting from nand ...; " \
  •                 "run nand_args; " \
  •                 "nandecc hw 2; " \
  •                 "nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; " \
  •                 "bootm ${kloadaddr}\0" \
  •         "spi_boot=echo Booting from spi ...; " \
  •                 "run spi_args; " \
  •                 "sf probe ${spi_bus_no}:0; " \
  •                 "sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; " \
  •                 "bootm ${kloadaddr}\0" \
  •         "nor_boot=echo Booting from NOR ...; " \
  •                 "run nor_args; " \
  •                 "cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; " \
  •                 "bootm ${kloadaddr}\0" \
  •         "net_boot=echo Booting from network ...; " \
  •                 "setenv autoload no; " \
  •                 "dhcp; " \
  •                 "tftp ${kloadaddr} ${bootfile}; " \
  •                 "run net_args; " \
  •                 "bootm ${kloadaddr}\0" \

复制代码
"mmc_root_fs_type=ext3 rootwait\0" \  改为"mmc_root_fs_type=ext4 rootwait\0" \
大功告成!成功启动。






相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

632

主题

842

帖子

3

粉丝