Welcome! Log In Create A New Profile

Advanced

/boot/uEnv.txt ignored

Posted by balanga 
Re: /boot/uEnv.txt ignored
March 28, 2019 07:15PM
I'll post it again if you like, but do you want me to include the section after Starting kernel ... ?
Re: /boot/uEnv.txt ignored
March 28, 2019 08:29PM
balanga,

Thanks but no needed! I can see where it possibly went wrong now.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: /boot/uEnv.txt ignored
March 29, 2019 02:35AM
Looks like there are a couple reasons.

1. There was some changes in U-Boot hush parser between 2016.05 and 2017.07 u-boot, that I have been unaware of.
2. There is a bug in 2017.07 u-boot regarding "ide" command.

Number 1 is easy, I can fix the envs to get it work the way the u-boot 2017.07 expected. I should fix this problem regardless, since the envs were not coded defensively enough.

For number 2, I am a a little bit uncertain, I have to do some tests to see what is the best approach to work around this.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/29/2019 02:42AM by bodhi.
Re: /boot/uEnv.txt ignored
March 30, 2019 01:18AM
balanga,

The uEnv.xt on the HDD /boot folder should have this content:

bootfile=ubldr
kernel_addr_r=0x01000000
loadaddr=0x02000000
bootcmd_bsd=ext2load ide 0:1 ${loadaddr} ${bootfile} && bootelf ${loadaddr}

Power up, interrupt serial console and execute:

setenv uenv_init_devices 'echo Initializing 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'
setenv uenv_read 'echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi'
setenv uenv_load 'run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;'
setenv uenv_read_disk

and then

boot

After verifying that it is working as intended, login to Debian and set them permanently:

fw_setenv uenv_init_devices 'echo Initializing 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'
fw_setenv uenv_read 'echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi'
fw_setenv uenv_load 'run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;'
fw_setenv uenv_read_disk

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: /boot/uEnv.txt ignored
March 30, 2019 02:27AM
bodhi,

That works fine.

Thanks for your efforts.

I'll just include a log in case anyone needs to refer to the process:-

Script started on Sat Mar 30 07:21:22 2019
Command: cu -l /dev/cuaU0 -s 115200
Connected


U-Boot 2017.05-tld-2 (Jul 26 2017 - 02:37:42 -0700)
Seagate GoFlex Home

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  3  0 
GoFlexHome> printenv
api_address=7b12860
arcNumber=3338
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run bootcmd_bsd; run set_bootargs; run bootcmd_exec; run bootcmd_openwrt
bootcmd_exec=if run load_uimage; then; 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; fi
bootcmd_openwrt=run set_bootargs_openwrt; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=3
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1
dtb_file=/boot/dts/kirkwood-goflexhome.dtb
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
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)
partition=nand0,0
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
set_bootargs_openwrt=setenv bootargs console=ttyS0,115200 $mtdparts
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=echo Initializing 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 $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15

Environment size: 3134/131068 bytes
GoFlexHome> reset
resetting ...


U-Boot 2017.05-tld-2 (Jul 26 2017 - 02:37:42 -0700)
Seagate GoFlex Home

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  3  2  1  0 
Initializing devices...
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: WDC WD3200AAJS-00L7A0  Firm: 01.03E01 Ser#:  WD-WMAV2HZ97868
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
Loading envs from usb 0...
** Bad device usb 0 **
Loading envs from usb 1...
** Bad device usb 1 **
Loading envs from ide 0...
136 bytes read in 28 ms (3.9 KiB/s)
... envs loaded
importing envs ...
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: WDC WD3200AAJS-00L7A0  Firm: 01.03E01 Ser#:  WD-WMAV2HZ97868
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
device ide 0:1
1 bytes read in 20 ms (0 Bytes/s)
Found bootable drive on ide 0
295973 bytes read in 153 ms (1.8 MiB/s)
CACHE: Misaligned operation at range [01000098, 01030c04]
CACHE: Misaligned operation at range [01030c04, 01031707]
CACHE: Misaligned operation at range [01031708, 010330f0]
CACHE: Misaligned operation at range [010330f0, 0103558b]
CACHE: Misaligned operation at range [01035590, 01036c98]
CACHE: Misaligned operation at range [01036c98, 01036cf4]
CACHE: Misaligned operation at range [01036cf4, 01036d5c]
CACHE: Misaligned operation at range [01036d5c, 01036e30]
CACHE: Misaligned operation at range [01036e30, 01036e3c]
## Starting application at 0x01000098 ...
Consoles: U-Boot console  


Compatible U-Boot API signature found @0x7b12860





FreeBSD/arm U-Boot loader, Revision 1.2


(Thu Nov 30 14:06:37 GMT 2017 root@Test)





DRAM: 128MB


Number of U-Boot devices: 1


U-Boot env: loaderdev not set, will probe all devices.


Found U-Boot device: net


Booting from net0:


|/-


\|/-\|/-\can't load 'kernel'





Type '?' for a list of commands, 'help' for more detailed help.


loader> ~
[EOT]

Command exit status: 0
Script done on Sat Mar 30 07:22:01 2019

Now back to getting the FreeBSD build sorted out :)...
Re: /boot/uEnv.txt ignored
March 30, 2019 02:50AM
Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: /boot/uEnv.txt ignored
May 23, 2019 04:18AM
bodhi,


Just looking through some old logs....

balanga Wrote:
-------------------------------------------------------
>
> Script started on Sat Mar 30 07:21:22 2019
> Command: cu -l /dev/cuaU0 -s 115200
> Connected
> 
> Hit any key to stop autoboot:  3  2  1  0
> 
> Initializing devices...
> starting USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 1 USB Device(s)
> found
>        scanning usb for storage devices... 0
> Storage Device(s) found
> 
> Reset IDE: Bus 0: OK Bus 1: not available  
>   Device 0: Model: WDC WD3200AAJS-00L7A0  Firm:
> 01.03E01 Ser#:  WD-WMAV2HZ97868
>             Type: Hard Disk
>             Supports 48-bit addressing
>             Capacity: 305245.3 MB = 298.0 GB
> (625142448 x 512)
> Loading envs from usb 0...
> ** Bad device usb 0 **
> Loading envs from usb 1...
> ** Bad device usb 1 **
> Loading envs from ide 0...
> 136 bytes read in 28 ms (3.9 KiB/s)
> ... envs loaded
> importing envs ...
> running scan_disk ...
> Scan device usb
> device usb 0:1
> ** Bad device usb 0 **
> device usb 1:1
> ** Bad device usb 1 **
> Scan device ide
> 
> Reset IDE: Bus 0: OK Bus 1: not available  
>   Device 0: Model: WDC WD3200AAJS-00L7A0  Firm:
> 01.03E01 Ser#:  WD-WMAV2HZ97868
>             Type: Hard Disk
>             Supports 48-bit addressing
>             Capacity: 305245.3 MB = 298.0 GB
> (625142448 x 512)
> device ide 0:1
> 1 bytes read in 20 ms (0 Bytes/s)
> Found bootable drive on ide 0
> 295973 bytes read in 153 ms (1.8 MiB/s)
> CACHE: Misaligned operation at range [01000098,
> 01030c04]
> CACHE: Misaligned operation at range [01030c04,
> 01031707]
> CACHE: Misaligned operation at range [01031708,
> 010330f0]
> CACHE: Misaligned operation at range [010330f0,
> 0103558b]
> CACHE: Misaligned operation at range [01035590,
> 01036c98]
> CACHE: Misaligned operation at range [01036c98,
> 01036cf4]
> CACHE: Misaligned operation at range [01036cf4,
> 01036d5c]
> CACHE: Misaligned operation at range [01036d5c,
> 01036e30]
> CACHE: Misaligned operation at range [01036e30,
> 01036e3c]
> ## Starting application at 0x01000098 ...
> Consoles: U-Boot console  
> Script done on Sat Mar 30 07:22:01 2019
>

Just wondered why Reset IDE is performed twice... also why do I get CACHE: Misaligned operation at range?

If I want to set my boot priority to IDE, USB, MMC do I need to change uenv_init_devices?
Re: /boot/uEnv.txt ignored
May 23, 2019 04:58AM
balanga,


> >
> > Script started on Sat Mar 30 07:21:22 2019
> > Command: cu -l /dev/cuaU0 -s 115200
> > Connected
> > 
> > Hit any key to stop autoboot:  3  2  1 
> 0
> > 
> > Initializing devices...
> > starting USB...
> > USB0:   USB EHCI 1.00
> > scanning bus 0 for devices... 1 USB Device(s)
> > found
> >        scanning usb for storage devices... 0
> > Storage Device(s) found
> > 
> > Reset IDE: Bus 0: OK Bus 1: not available  
> >   Device 0: Model: WDC WD3200AAJS-00L7A0  Firm:
> > 01.03E01 Ser#:  WD-WMAV2HZ97868
> >             Type: Hard Disk
> >             Supports 48-bit addressing
> >             Capacity: 305245.3 MB = 298.0 GB
> > (625142448 x 512)
> > Loading envs from usb 0...
> > ** Bad device usb 0 **
> > Loading envs from usb 1...
> > ** Bad device usb 1 **
> > Loading envs from ide 0...
> > 136 bytes read in 28 ms (3.9 KiB/s)
> > ... envs loaded
> > importing envs ...
> > running scan_disk ...
> > Scan device usb
> > device usb 0:1
> > ** Bad device usb 0 **
> > device usb 1:1
> > ** Bad device usb 1 **
> > Scan device ide
> > 
> > Reset IDE: Bus 0: OK Bus 1: not available  
> >   Device 0: Model: WDC WD3200AAJS-00L7A0  Firm:
> > 01.03E01 Ser#:  WD-WMAV2HZ97868
> >             Type: Hard Disk
> >             Supports 48-bit addressing
> >             Capacity: 305245.3 MB = 298.0 GB
> > (625142448 x 512)
> > device ide 0:1
> > 1 bytes read in 20 ms (0 Bytes/s)
> > Found bootable drive on ide 0
> > 295973 bytes read in 153 ms (1.8 MiB/s)
> > CACHE: Misaligned operation at range [01000098,
> > 01030c04]
> > CACHE: Misaligned operation at range [01030c04,
> > 01031707]
> > CACHE: Misaligned operation at range [01031708,
> > 010330f0]
> > CACHE: Misaligned operation at range [010330f0,
> > 0103558b]
> > CACHE: Misaligned operation at range [01035590,
> > 01036c98]
> > CACHE: Misaligned operation at range [01036c98,
> > 01036cf4]
> > CACHE: Misaligned operation at range [01036cf4,
> > 01036d5c]
> > CACHE: Misaligned operation at range [01036d5c,
> > 01036e30]
> > CACHE: Misaligned operation at range [01036e30,
> > 01036e3c]
> > ## Starting application at 0x01000098 ...
> > Consoles: U-Boot console  
> > Script done on Sat Mar 30 07:22:01 2019
> >
>
> Just wondered why Reset IDE is performed twice...
> also why do I get CACHE: Misaligned operation at
> range?

It does not hurt to do it twice, providing there is a long enough time period between the 2. But only once is necessary.

In this case, the scandisk does it the 1st time, the bootcmd_uenv does it again.

This was intentional, since users could choose to remove the bootcmd_uenv to make it boot faster, if uEnv.txt is not needed.


>
> If I want to set my boot priority to IDE, USB, MMC
> do I need to change uenv_init_devices?

All you need is to set the devices env, don't need to change other envs.
setenv devices 'ide usb mmc'

-bodhi
===========================
Forum Wiki
bodhi's corner
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: