Welcome! Log In Create A New Profile

Advanced

Pogo E02 u-boot envs for LEDE

Posted by joerg_999 
Pogo E02 u-boot envs for LEDE
December 22, 2017 07:13AM
need help to figure out the right boot-envs and order:

Whats my problem:
i ve put LEDE on my Pogo-e02 changed the envs based on bodhis uboot.2016.05-tld-1.environment
like this:
# envs PogoE02 @debian (checked with uboot.2016.05-tld-1.environment):

fw_setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
fw_setenv set_bootargs_lede 'setenv bootargs console=ttyS0,115200 $mtdparts'
fw_setenv bootcmd_lede 'run set_bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede'
and everthing seems to be fine, boot LEDE from nand / boot debian from stick ....
with one exception:
if i am on LEDE i cant do a reboot (soft reboot) - cold reboot unplug - plug again works perfect.
i think it is a conflict between the different set_bootargs....
it is not that big problem, but i would like to learn and do it in the correct way

any suggestions from the experts?

the fully output of fw_printenv:
fw_printenv
arcNumber=3542
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede
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_lede=run set_bootargs_lede; 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=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
ethact=egiga0
ethaddr=00:25:31:04:96:8B
if_netconsole=ping $serverip
init_ide=ide reset
init_mmc=mmc rescan
init_usb=usb start
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
machid=dd6
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)
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
scan_ide=ide reset
scan_mmc=mmc rescan
scan_usb=usb start
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
set_bootargs_lede=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=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_loaded=0
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
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
usb_ready_retry=15



Edited 3 time(s). Last edit at 12/22/2017 12:45PM by bodhi.
Re: Pogo E02 u-boot envs for LEDE
December 22, 2017 12:51PM
Quote

if i am on LEDE i cant do a reboot (soft reboot) - cold reboot unplug - plug again works perfect.

What you do get when you do a reboot from LEDE? please post the entire serial console log for this case.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogo E02 u-boot envs for LEDE
December 22, 2017 02:18PM
Hello Bodhi , here is the log:
[   99.274476] reboot: Restarting system


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide
Unknown command 'ide' - try 'help'
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc
Unknown command 'mmc' - try 'help'
device mmc 0:1
** Bad device mmc 0 **
device mmc 1:1
** Bad device mmc 1 **
device mmc 2:1
** Bad device mmc 2 **
device mmc 3:1
** Bad device mmc 3 **
loading uImage ...
** Bad device usb 0 **
loading uInitrd ...
** Bad device usb 0 **
loading DTB /boot/dts/kirkwood-pogo_e02.dtb ...
** Bad device usb 0 **
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM LEDE Linux-4.4.92
   Created:      2017-10-17  17:46:20 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1810174 Bytes = 1.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
Using machid 0xdd6 from environment

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.92 (buildbot@builds-02.infra.lede-project.org) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3103-1b51a49) ) #0 Tue Oct 17 17:46:20 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: Cloud Engines Pogoplug E02
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 254500K/262144K available (4082K kernel code, 142K rwdata, 652K rodata, 176K init, 201K bss, 7644K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04a7db4   (4736 kB)
[    0.000000]       .init : 0xc04a8000 - 0xc04d4000   ( 176 kB)
[    0.000000]       .data : 0xc04d4000 - 0xc04f7bc8   ( 143 kB)
[    0.000000]        .bss : 0xc04f7bc8 - 0xc052a27c   ( 202 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000009] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000085] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[    0.090090] pid_max: default: 32768 minimum: 301
[    0.090206] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090224] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090749] CPU: Testing write buffer coherency: ok
[    0.091091] Setting up static identity map for 0x81e0 - 0x821c
[    0.091338] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.096004] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.096032] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.096116] pinctrl core: initialized pinctrl subsystem
[    0.097193] NET: Registered protocol family 16
[    0.097588] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.098311] cpuidle: using governor ladder
[    0.098662] Feroceon L2: Enabling L2
[    0.098707] Feroceon L2: Cache support initialised.
[    0.098980] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.116554] SCSI subsystem initialized
[    0.117279] usbcore: registered new interface driver usbfs
[    0.117355] usbcore: registered new interface driver hub
[    0.117423] usbcore: registered new device driver usb
[    0.118251] clocksource: Switched to clocksource orion_clocksource
[    0.119133] NET: Registered protocol family 2
[    0.119731] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.119766] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.119796] TCP: Hash tables configured (established 2048 bind 2048)
[    0.119853] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.119875] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.120022] NET: Registered protocol family 1
[    0.121855] Crashlog allocated RAM at address 0x3f00000
[    0.135827] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.135842] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.138536] io scheduler noop registered
[    0.138551] io scheduler deadline registered (default)
[    0.139751] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.140314] irq: Cannot allocate irq_descs @ IRQ32, assuming pre-allocated
[    0.140670] irq: Cannot allocate irq_descs @ IRQ64, assuming pre-allocated
[    0.172008] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.174985] console [ttyS0] disabled
[    0.175058] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 12500000) is a 16550A
[    0.626599] console [ttyS0] enabled
[    0.631795] nand: Could not find valid ONFI parameter page; aborting
[    0.638229] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    0.644642] nand: Hynix NAND 128MiB 3,3V 8-bit
[    0.649119] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.656733] Scanning device for bad blocks
[    0.769162] 2 cmdlinepart partitions found on MTD device orion_nand
[    0.775455] Creating 2 MTD partitions on "orion_nand":
[    0.780637] 0x000000000000-0x000000100000 : "u-boot"
[    0.787319] 0x000000100000-0x000008000000 : "ubi"
[    0.793935] libphy: orion_mdio_bus: probed
[    0.798862] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.806979] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:25:31:04:96:8b
[    0.815791] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.822358] ehci-pci: EHCI PCI platform driver
[    0.826886] ehci-platform: EHCI generic platform driver
[    0.832281] ehci-orion: EHCI orion driver
[    0.836464] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.842019] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    0.849850] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    0.868269] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    0.875004] hub 1-0:1.0: USB hub found
[    0.878983] hub 1-0:1.0: 1 port detected
[    0.883365] usbcore: registered new interface driver usb-storage
[    1.198265] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.350399] hub 1-1:1.0: USB hub found
[    1.354493] hub 1-1:1.0: 4 ports detected
[    1.898261] rtc-mv f1010300.rtc: internal RTC not ticking
[    1.903783] i2c /dev entries driver
[    1.908000] orion_wdt: Initial timeout 21 sec
[    1.915749] marvell-cesa f1030000.crypto: CESA device successfully registered
[    1.923981] NET: Registered protocol family 10
[    1.929995] NET: Registered protocol family 17
[    1.934510] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.947201] 8021q: 802.1Q VLAN Support v1.8
[    1.953561] UBI: auto-attach mtd1
[    1.956727] ubi0: attaching mtd1
[    2.188474] ubi0: scanning is finished
[    2.203998] ubi0: attached mtd1 (name "ubi", size 127 MiB)
[    2.209545] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    2.216452] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    2.223191] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    2.230016] ubi0: good PEBs: 1016, bad PEBs: 0, corrupted PEBs: 0
[    2.236134] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[    2.243404] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 692591403
[    2.252498] ubi0: available PEBs: 0, total reserved PEBs: 1016, PEBs reserved for bad PEB handling: 20
[    2.262222] ubi0: background thread "ubi_bgt0d" started, PID 888
[    2.268960] block ubiblock0_1: created from ubi0:1(rootfs)
[    2.274468] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    2.281664] hctosys: unable to open rtc device (rtc0)
[    2.288241] Waiting 10 sec before mounting root device...
[   12.298810] VFS: Cannot open root device "LABEL=rootfs" or unknown-block(0,0): error -6
[   12.306852] Please append a correct "root=" boot option; here are the available partitions:
[   12.315277] 1f00            1024 mtdblock0  (driver?)
[   12.320382] 1f01          130048 mtdblock1  (driver?)
[   12.325464] fe00            1638 ubiblock0_1  (driver?)
[   12.330739] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   12.339672] Rebooting in 1 seconds..


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  0
PogoE02> <INTERRUPT>
PogoE02>

Re: Pogo E02 u-boot envs for LEDE
December 22, 2017 10:38PM
Yes. Your u-boot envs need some further setup. Let me write a new env to do that shortly.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogo E02 u-boot envs for LEDE
December 23, 2017 04:03AM
Boot into Debian and

fw_setenv 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'

Reboot. Interrupt serial console and remove the USB stick. And then let it boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogo E02 u-boot envs for LEDE
December 23, 2017 05:38AM
thanks for the quick reply, i will test and report as soon as possible.

best regards and marry christmas
-joerg_999
Re: Pogo E02 u-boot envs for LEDE
December 23, 2017 12:43PM
bodhi, that worked, your new bootcmd_exec did it.
- could maybe implemented fix in the next uenvs...
- thank you very much again.
joerg_999



Edited 1 time(s). Last edit at 12/23/2017 02:21PM by joerg_999.
Re: Pogo E02 u-boot envs for LEDE
December 23, 2017 09:57PM
joerg_999 Wrote:
-------------------------------------------------------
> bodhi, that worked, your new bootcmd_exec did it.
> - could maybe implemented fix in the next
> uenvs...
> - thank you very much again.
> joerg_999

Cool!

Yes, that will be in the next released default envs image.

-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: