Welcome! Log In Create A New Profile

Advanced

variable for booting from sdcard on pogoplug mobile/v4

Posted by november17 
variable for booting from sdcard on pogoplug mobile/v4
December 06, 2016 09:42PM
I was having trouble getting one of my plugs to boot from the mmc card - just getting an error. after carefully reviewing the env.config I noticed that the bootcmd_mmc variable is missing in the file, so it just overpasses it with an error.


I have the bootcmd variable set as follows;
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run net_bootcmd; run bootcmd_pogo; reset

so...bootcmd_mmc= ?

The only example I could find here in the forums was here http://forum.doozan.com/read.php?2,28798,28798#msg-28798

mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then boo tm 0x800000 0x1100000; else bootm 0x800000; fi 
mmc_init=mmc rescan 
mmc_load_uimage=ext2load mmc $device 0x800000 /boot/uImage 
mmc_load_uinitrd=ext2load mmc $device 0x1100000 /boot/uInitrd 
mmc_root=/dev/mmcblk0p1

If my sdcard has debian installed on ext3 and it is labelled rootfs and is device 1 , would the above code I copied be=

mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi 
mmc_init=mmc rescan 
mmc_load_uimage=ext3load mmc $device 0x800000 /boot/uImage 
mmc_load_uinitrd=ext3load mmc $device 0x1100000 /boot/uInitrd 
mmc_root=/dev/rootfs

I know I can always trial and error it but I'm trying to understand (and finally starting to get it a little) exactly how the script/code itself within the env.config file works as well.

Thanks!

Quote

"When I was a little boy, I used to pray every night for a new bicycle. Then I realised, the Lord, in his wisdom, doesn't work that way. So I just stole one and asked Him to forgive me." - Emo Phillips

GitHub Profile



Edited 3 time(s). Last edit at 12/06/2016 09:46PM by november17.
Re: variable for booting from sdcard on pogoplug mobile/v4
December 07, 2016 12:10AM
november17,

> I know I can always trial and error it but I'm
> trying to understand (and finally starting to get
> it a little) exactly how the script/code itself
> within the env.config file works as well.
>

I think you mispoke the file name env.config (there is no file like that).

Usually if you see something missing like that, it is because you did not flash the default envs image that comes with the u-boot image. Or the u-boot version that you've flashed needs further set up.

For example, If you have flashed both the u-boot uboot.2016.05-tld-1.pogo_v4.mtd0.kwb and the envs image uboot.2016.05-tld-1.environment.img, then your u-boot envs look like this

Quote
Content of uboot.2016.05-tld-1.environment

arcNumber=2097
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
machid=0x831
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15


And the file that specifies where in NAND the envs are stored:

Quote
/etc/fw_env.config

# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

This fw_env.config is used by the kernel MTD driver to determine where to read/write the u-boot envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: variable for booting from sdcard on pogoplug mobile/v4
December 07, 2016 12:14AM
And this is incorrect:
mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi 
mmc_init=mmc rescan 
mmc_load_uimage=ext3load mmc $device 0x800000 /boot/uImage 
mmc_load_uinitrd=ext3load mmc $device 0x1100000 /boot/uInitrd 
mmc_root=/dev/rootfs

In order to change these correctly (if you decide not to flash the default u-boot envs image), please post your current envs listing in u-boot console.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/07/2016 12:15AM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: