Forcing kernel loading form eMMC

Discussion about U-Boot and the kernel.

Forcing kernel loading form eMMC

Postby hergass » Tue May 17, 2016 4:20 am

On a BeagleBone Black Rev.c I am trying to get the ArchLinux running off the eMMC as well as from the SD card. The intention is that by pressing the Boot Select button (S2), the system will boot from the SD card otherwise should use the default eMMC.

The problem is that when the SD card is plugged in the u-boot will always use it as the primary boot device, and load the kernel and the filesystem from the SD card. If the SD card is not in, the OS is loaded from the eMMC correctly.

How can I force the u-boot to load from the eMMC, even when the SD is present.
I tried to modify the default u-boot environment variables using the uEnv.tet file, but it seems like the zImage kernel is not using the arguments passed.

uBoot:
$this->bbcode_second_pass_code('', '
U-Boot SPL 2014.07 (Aug 10 2014 - 19:47:18)
reading u-boot.img
reading u-boot.img


U-Boot 2014.07 (Aug 10 2014 - 19:47:18) Arch Linux ARM

I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
U-Boot#
U-Boot# env print
arch=arm
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=00C0
boot_fdt=try
bootcmd=gpio set 53; i2c mw 0x24 1 0x3e; run findmmc; run findfdt; run mmcboot;gpio clear 56; gpio clear 55; gpio clear 54; setenv mmcdev 1; setenv bootpart 1:2; if test $mmc0 = 1; then setenv mmcroot /dev/mmcblk1p2; fi; run mmcboot;
bootcount=1
bootdelay=1
bootdir=/boot
bootenv=uEnv.txt
bootfile=zImage
bootm_size=0x10000000
bootpart=0:2
console=ttyO0,115200n8
cpu=armv7
dfu_alt_info_emmc=rawemmc mmc 0 3751936
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 0x100 0x100;u-boot.img.raw mmc 0x300 0x400;spl-os-args.raw mmc 0x80 0x80;spl-os-image.raw mmc 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
eth1addr=6c:ec:eb:90:c8:ee
ethact=cpsw
ethaddr=6c:ec:eb:90:c8:ec
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtdir=/boot/dtbs
fdtfile=undefined
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; setenv fdtbase am335x-bone; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
findmmc=if test $board_name = A335BNLT; then setenv mmc1 1;mmc dev 0;if mmc rescan; then setenv mmc0 1;else setenv mmc0 0;fi;fi;
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}
loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} ${mmcrootextra}
mmcboot=mmc dev ${mmcdev}; if mmc rescan; then gpio set 54;echo SD/MMC found on device ${mmcdev};if run loadbootenv; then gpio set 55;echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $cape; then if test -e mmc ${bootpart} ${fdtdir}/$fdtbase-$cape.dtb; then setenv fdtfile $fdtbase-$cape.dtb; fi; echo using: $fdtfile...; fi; echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then gpio set 56; echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then if run loadfdt; then run mmcargs;if run loadramdisk; then bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};else bootz ${loadaddr} - ${fdtaddr};fi;else echo Kernel found, but no device tree found;fi;fi;echo No kernel found;fi;
mmcdev=0
mmcroot=/dev/mmcblk0p2
mmcrootextra=rw fixrtc rootwait
mtdids=nand0=omap2-nand.0
mtdparts=mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1792k(u-boot),128k(u-boot-spl-os),128k(u-boot-env),5m(kernel),-(rootfs)
nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} u-boot-spl-os; nand read ${loadaddr} kernel; bootz ${loadaddr} - ${fdtaddr}
nandroot=ubi0:rootfs rw ubi.mtd=7,2048
nandrootfstype=ubifs rootwait=1
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
nfsopts=nolock
partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
ramdisk_addr_r=0x88080000
ramroot=/dev/ram0 rw
ramrootfstype=ext2
rdaddr=0x88080000
rdfile=initramfs-linux.img
rootpath=/export/rootfs
soc=am33xx
spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
spibusno=0
spiimgsize=0x362000
spiroot=/dev/mtdblock4 rw
spirootfstype=jffs2
spisrcaddr=0xe0000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
usbnet_devaddr=6c:ec:eb:90:c8:ee
vendor=ti
ver=U-Boot 2014.07 (Aug 10 2014 - 19:47:18) Arch Linux ARM

Environment size: 4943/131068 bytes
')

zImage loading:
$this->bbcode_second_pass_code('', '
U-Boot# boot
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
25 bytes read in 4 ms (5.9 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
3366400 bytes read in 208 ms (15.4 MiB/s)
26098 bytes read in 22 ms (1.1 MiB/s)
** File not found /boot/initramfs-linux.img **
Kernel image @ 0x82000000 [ 0x000000 - 0x335e00 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff6000, end 8ffff5f1 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.187851] omap2_mbox_probe: platform not supported
[ 0.361886] tps65217-bl tps65217-bl: no platform data provided
[ 0.426869] bone-capemgr bone_capemgr.9: slot #0: No cape found
[ 0.463977] bone-capemgr bone_capemgr.9: slot #1: No cape found
[ 0.501084] bone-capemgr bone_capemgr.9: slot #2: No cape found
[ 0.538194] bone-capemgr bone_capemgr.9: slot #3: No cape found
[ 0.553510] bone-capemgr bone_capemgr.9: slot #6: BB-BONELT-HDMIN conflict P8.45 (#5:BB-BONELT-HDMI)
[ 0.563179] bone-capemgr bone_capemgr.9: slot #6: Failed verification
[ 0.569957] bone-capemgr bone_capemgr.9: loader: failed to load slot-6 BB-BONELT-HDMIN:00A0 (prio 2)
[ 0.588065] omap_hsmmc mmc.5: of_parse_phandle_with_args of 'reset' failed
[ 0.649839] pinctrl-single 44e10800.pinmux: pin 44e10854 already requested by 44e10800.pinmux; cannot claim for gpio-leds.8
[ 0.661576] pinctrl-single 44e10800.pinmux: pin-21 (gpio-leds.8) status -22
[ 0.668894] pinctrl-single 44e10800.pinmux: could not request pin 21 on device pinctrl-single
[ 0.874006] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 0.883630] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities

Welcome to Arch Linux ARM!

Expecting device dev-mmcblk0p4.device...
')
hergass
 
Posts: 1
Joined: Tue May 17, 2016 3:00 am

Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 8 guests