POGO E02 - Help needed to flash uboot December 25, 2022 08:22PM |
Registered: 1 year ago Posts: 16 |
If you agree, type 'ok' and press ENTER to continue: ok # checking for /usr/sbin/nandwrite... # Installing /usr/sbin/nandwrite... Connecting to download.doozan.com (45.77.104.33:80) wget: not an http or ftp url: https://download.doozan.com/uboot/nandwrite.md5 Connecting to download.doozan.com (45.77.104.33:80) wget: not an http or ftp url: https://download.doozan.com/uboot/nandwrite.md5 ## Could not install /usr/sbin/nandwrite from http://download.doozan.com/uboot/nandwrite, exiting.
Re: POGO E02 - Help needed to flash uboot December 25, 2022 08:38PM |
Registered: 1 year ago Posts: 16 |
-bash-3.2# cat /proc/mtd dev: size erasesize name mtd0: 00100000 00020000 "u-boot" mtd1: 00400000 00020000 "uImage" mtd2: 02000000 00020000 "root" mtd3: 05b00000 00020000 "data" -bash-3.2# cat /proc/cpuinfo Processor : ARM926EJ-S rev 1 (v5l) BogoMIPS : 1192.75 Features : swp half thumb fastmult edsp CPU implementer : 0x56 CPU architecture: 5TE CPU variant : 0x2 CPU part : 0x131 CPU revision : 1 Cache type : write-back Cache clean : cp15 c7 ops Cache lockdown : format C Cache format : Harvard I size : 16384 I assoc : 4 I line length : 32 I sets : 128 D size : 16384 D assoc : 4 D line length : 32 D sets : 128 Hardware : Feroceon-KW Revision : 0000 Serial : 0000000000000000 -bash-3.2# printenv TERM=xterm SHELL=/bin/bash SSH_TTY=/dev/pts/0 USER=root PATH=/usr/bin:/bin PWD=/tmp SHLVL=1 HOME=/root LOGNAME=root SSH_CONNECTION=xxx.xx.xx.xx xxxx xxx.xx.xx.yy _=/bin/printenv OLDPWD=/bin -bash-3.2# free total used free shared buffers Mem: 256008 23892 232116 0 0 Swap: 0 0 0 Total: 256008 23892 232116 -bash-3.2# df -h Filesystem Size Used Available Use% Mounted on /dev/mtdblock2 32.0M 15.8M 16.2M 49% / none 125.0M 1.8M 123.2M 1% /tmp
Re: POGO E02 - Help needed to flash uboot December 25, 2022 08:42PM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
I went thrugh instructions for 2017 version of uboot install. Couldn't make much progress as my system seem to fail at commands like "flash_erase" as those are not found on my system. System does have "nandwrite". I was curious if I should just do a "nandwrite" using kwb file and then copy the environment from the following as I can't execute most of the commands mentioned in the following thread
Quote
A. Flashing Instruction:
Installation is the same for each u-Boot image, the instruction below is written to include all boxes. So choose the platform name that you are installing for, and copy/paste the appropriate commands.
If you are running kernel that do not provide mtd-utils and uboot-tools (fw_setenv, fw_printenv, flash_erase, nandwrite), you can download the NAND and U-Boot tools binaries here in this thread.
Re: POGO E02 - Help needed to flash uboot December 25, 2022 10:34PM |
Registered: 1 year ago Posts: 16 |
./fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200 -bash-3.2# ./fw_printenv ethaddr Warning: Bad CRC, using default environment ## Error: "ethaddr" not defined
Re: POGO E02 - Help needed to flash uboot December 25, 2022 11:55PM |
Registered: 1 year ago Posts: 16 |
[ 1.050000] Scanning device for bad blocks [ 1.050000] Bad eraseblock 3 at 0x00060000 [ 1.090000] Bad eraseblock 654 at 0x051c0000
Re: POGO E02 - Help needed to flash uboot December 26, 2022 12:55AM |
Admin Registered: 13 years ago Posts: 18,852 |
> [ 1.050000] Scanning device for bad blocks > [ 1.050000] Bad eraseblock 3 at 0x00060000 > [ 1.090000] Bad eraseblock 654 at 0x051c0000 >>
Re: POGO E02 - Help needed to flash uboot December 26, 2022 03:29AM |
Registered: 1 year ago Posts: 16 |
-bash-3.2# ./flash_erase /dev/mtd0 0 5 Erasing 128 Kibyte @ 40000 -- 40 % complete flash_erase: Skipping bad block at 0 0060000 Erasing 128 Kibyte @ 80000 -- 100 % complete -bash-3.2# ls /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb -bash-3.2# ls -l /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb -rw-r--r-- 1 root root 524288 Jan 1 00:21 /tmp/pogo/uboot.2017.07- tld-1.pogo_e02.mtd0.kwb </mtd0 /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb Writing data to block 0 at offset 0x0 Writing data to block 1 at offset 0x20000 Writing data to block 2 at offset 0x40000 Writing data to block 3 at offset 0x60000 Bad block at 60000, 1 block(s) from 60000 will be skipped Writing data to block 4 at offset 0x80000 -bash-3.2# cd /tmp -bash-3.2# ./pogo/tools/nanddump -nof /tmp/uBoot1.dump -l 0x60000 /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00000000 and ending at 0x00060000... <ddump -nof /tmp/uBoot2.dump -l 0x20000 -s 0x80000 /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00080000 and ending at 0x000a0000... -bash-3.2# cat uBoot1.dump uBoot2.dump > uBoot.dump -bash-3.2# ls hbplug.log resolv.conf uBoot1.dump var pogo uBoot.dump uBoot2.dump -bash-3.2# ls -l -rw-r--r-- 1 root root 430 Jan 1 00:12 hbplug.log drwxr-xr-x 3 root root 220 Jan 1 00:21 pogo -rw-r--r-- 1 root root 29 Jan 1 00:00 resolv.conf -rw-r--r-- 1 root root 540672 Jan 1 00:35 uBoot.dump -rw-r--r-- 1 root root 405504 Jan 1 00:34 uBoot1.dump -rw-r--r-- 1 root root 135168 Jan 1 00:35 uBoot2.dump drwxr-xr-x 2 root root 60 Jan 1 00:00 var -bash-3.2# diff -s /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb uBoot.dump Binary files /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb and uBoot.dump diff er
Re: POGO E02 - Help needed to flash uboot December 26, 2022 11:18AM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 26, 2022 03:33PM |
Admin Registered: 13 years ago Posts: 18,852 |
-bash-3.2# ./flash_erase /dev/mtd0 0 5 Erasing 128 Kibyte @ 40000 -- 40 % complete flash_erase: Skipping bad block at 0 0060000 Erasing 128 Kibyte @ 80000 -- 100 % complete
-bash-3.2# ls -l /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb -rw-r--r-- 1 root root 524288 Jan 1 00:21 /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb
</mtd0 /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb Writing data to block 0 at offset 0x0 Writing data to block 1 at offset 0x20000 Writing data to block 2 at offset 0x40000 Writing data to block 3 at offset 0x60000 Bad block at 60000, 1 block(s) from 60000 will be skipped Writing data to block 4 at offset 0x80000
-bash-3.2# ./pogo/tools/nanddump -nof /tmp/uBoot1.dump -l 0x60000 /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00000000 and ending at 0x00060000...
<ddump -nof /tmp/uBoot2.dump -l 0x20000 -s 0x80000 /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00080000 and ending at 0x000a0000...
-rw-r--r-- 1 root root 540672 Jan 1 00:35 uBoot.dump
-bash-3.2# diff -s /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb uBoot.dump Binary files /tmp/pogo/uboot.2017.07-tld-1.pogo_e02.mtd0.kwb and uBoot.dump diff er
./pogo/tools/nanddump --helpAnd then adjust the -nof to specify that you want to "obmit OOB" and no ECC. See this in the u-boot installation instruction:
Quote
3. Be sure to save your current uBoot image in mtd0, or have a backup image saved somewhere as precaution. And save your current u-boot envs with fw_printenv, or just copy/paste the listing into a text file. Note the nanddump command below allows future restoration to the same box you're backing up, and also can be used to restore a differrent box's mtd0 if needed.
Dumping NAND mtd0:
nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
Quote
Should I go ahead and apply the environment variables now and proceed with the rest of the flashing?
Quote
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) from 60000 will be skipped
Writing data to block 4 at offset 0x80000
Re: POGO E02 - Help needed to flash uboot December 26, 2022 04:17PM |
Registered: 1 year ago Posts: 16 |
-bash-3.2# ./pogo/tools/nanddump --noecc --omitoob -l 0x60000 -f /tmp/uBoot1.dump /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00000000 and ending at 0x00060000... -bash-3.2# ./pogo/tools/nanddump --noecc --omitoob -l 0x20000 -s 0x80000 -f /tmp/uBoot2.dump /dev/mtd0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00080000 and ending at 0x000a0000... -bash-3.2# cat uBoot1.dump uBoot2.dump > uBoot.dump -bash-3.2# diff -s uboot.2017.07-tld-1.pogo_e02.mtd0.kwb uBoot.dump Files uboot.2017.07-tld-1.pogo_e02.mtd0.kwb and uBoot.dump are identical
arcNumber=3542 ethaddr=xx:xx:xx:xx:xx:xx 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_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 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; machid=dd6 preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi preboot=run preboot_nc ipaddr=xxx.xxx.xx.xx serverip=xxx.xxx.xx.yy dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
Then for all boxes, restore these 2 envs using the saved envs text in step c (replace xxx with the real saved values fw_setenv mtdparts 'xxxxxxxxx' fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
-bash-3.2# ./pogo/tools/fw_printenv|grep -i 'mtdparts' mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
Re: POGO E02 - Help needed to flash uboot December 26, 2022 04:38PM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
> -bash-3.2# diff -s
> uboot.2017.07-tld-1.pogo_e02.mtd0.kwb uBoot.dump
> Files uboot.2017.07-tld-1.pogo_e02.mtd0.kwb and
> uBoot.dump are identical
> arcNumber=3542 > ethaddr=xx:xx:xx:xx:xx:xx > 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_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 > 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; > machid=dd6 > preboot_nc=setenv nc_ready 0; for pingstat in 1 2 > 3 4 5; do; sleep 1; if run if_netconsole; then > setenv nc_ready 1; fi; done; if test $nc_ready -eq > 1; then run start_netconsole; fi > preboot=run preboot_nc > ipaddr=xxx.xxx.xx.xx > serverip=xxx.xxx.xx.yy > dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
> -bash-3.2# ./pogo/tools/fw_printenv|grep -i > 'mtdparts' > mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) > set_bootargs=setenv bootargs console=ttyS0,115200 > root=LABEL=rootfs rootdelay=10 $mtdparts > $custom_params >>
Re: POGO E02 - Help needed to flash uboot December 26, 2022 08:05PM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 26, 2022 08:32PM |
Registered: 1 year ago Posts: 16 |
Initializing devices... starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 3 USB Device(s) found scanning usb for storage devices... Use USB retry period from the environment: 15 second(s) 1 Storage Device(s) found Unknown command 'ide' - try 'help' Unknown command 'mmc' - try 'help' Loading envs from usb 0... ** File not found /boot/uEnv.txt ** Loading envs from usb 1... ** Bad device usb 1 ** Loading envs from usb 2... ** Bad device usb 2 ** Loading envs from usb 3... ** Bad device usb 3 ** Loading envs from ide 0... ** Bad device ide 0 ** Loading envs from ide 1... ** Bad device ide 1 ** Loading envs from ide 2... ** Bad device ide 2 ** Loading envs from ide 3... ** Bad device ide 3 ** Loading envs from mmc 0... ** Bad device mmc 0 ** Loading envs from mmc 1... ** Bad device mmc 1 ** Loading envs from mmc 2... ** Bad device mmc 2 ** Loading envs from mmc 3... ** Bad device mmc 3 ** running scan_disk ... Scan device usb device usb 0:1 1 bytes read in 722 ms (0 Bytes/s) Found bootable drive on usb 0 loading uImage ... 5435888 bytes read in 1381 ms (3.8 MiB/s) loading uInitrd ... 9671091 bytes read in 1617 ms (5.7 MiB/s) loading DTB /boot/dts/kirkwood-pogo_e02.dtb ... 10114 bytes read in 3752 ms (2 KiB/s) ## Booting kernel from Legacy Image at 00800000 ... Image Name: Linux-5.13.6-kirkwood-tld-1 Created: 2021-09-24 0:22:58 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 5435824 Bytes = 5.2 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 01100000 ... Image Name: initramfs-5.13.6-kirkwood-tld-1 Created: 2021-09-24 1:06:32 UTC Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 9671027 Bytes = 9.2 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 01c00000 Booting using the fdt blob at 0x1c00000 Starting kernel ...
Re: POGO E02 - Help needed to flash uboot December 26, 2022 08:58PM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
10. Set up netconsole. It's important to set up neconsole if you don't already have serial console connected. If you have serial console, don't set up netconsole at this moment, because it will interfere with serial console.
bootSwitch back to serial console terminal and wait, eventually you will see boot log progress.
fw_printenvSee the u-boot envs listing, if it looks normal, remove netconsole
fw_setenv prebootNow when you reboot, everything will appear on serial console.
Re: POGO E02 - Help needed to flash uboot December 26, 2022 09:59PM |
Registered: 1 year ago Posts: 16 |
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi preboot=run preboot_nc ipaddr=xxx.xx.xx.xx serverip=xxx.xx.xx.yy
Re: POGO E02 - Help needed to flash uboot December 26, 2022 10:09PM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
Starting kernel ...
ping debian.local
Re: POGO E02 - Help needed to flash uboot December 26, 2022 10:58PM |
Registered: 1 year ago Posts: 16 |
~# nc -l -u -p 6666 & [3] 3025 [2] Killed nc -l -u -p 6666 ~# U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700) Pogo E02 gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28 Hit any key to stop autoboot: 0 Initializing devices... starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 3 USB Device(s) found scanning usb for storage devices... Use USB retry period from the environment: 15 second(s)
I am curious - should I rebuild rootfs and then incorporate the above steps to get better visibility? Or is this only possible after the boot is successful to the new debian OS on pogo?Quote
Now after you can log in, see this post for further netconsole setup so that you can see more boot log.
https://forum.doozan.com/read.php?2,9522
Re: POGO E02 - Help needed to flash uboot December 27, 2022 01:12AM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
I am curious - should I rebuild rootfs and then incorporate the above steps to get better visibility? Or is this only possible after the boot is successful to the new debian OS on pogo?
Re: POGO E02 - Help needed to flash uboot December 27, 2022 09:46AM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 27, 2022 03:12PM |
Admin Registered: 13 years ago Posts: 18,852 |
nc.traditional -lup 6666 192.168.0.x 6666(The latest Debian nc is different from one we are used to use for years. So I installed nc.traditional to get it back).
Re: POGO E02 - Help needed to flash uboot December 27, 2022 03:56PM |
Admin Registered: 13 years ago Posts: 18,852 |
Re: POGO E02 - Help needed to flash uboot December 27, 2022 05:31PM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 27, 2022 05:56PM |
Admin Registered: 13 years ago Posts: 18,852 |
Re: POGO E02 - Help needed to flash uboot December 28, 2022 09:25AM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 28, 2022 03:06PM |
Admin Registered: 13 years ago Posts: 18,852 |
Re: POGO E02 - Help needed to flash uboot December 29, 2022 10:05AM |
Registered: 1 year ago Posts: 16 |
Re: POGO E02 - Help needed to flash uboot December 29, 2022 03:24PM |
Admin Registered: 13 years ago Posts: 18,852 |
Quote
Also, if I need to switch the rootfs to another usb stick, what is the process? Is it just a matter of running a "dd" command to copy the rootfs to the new device? Do I need to copy everything including label and UUID, so that I can switch to the new flash drive seamlessly?
Quote
How to clone a rootfs from one Kirkwood box to another: Step 1 and Step 2
How to clone SATA rootfs to USB rootfs
How to clone USB rootfs to SATA rootfs
Re: POGO E02 - Help needed to flash uboot December 31, 2022 03:41PM |
Registered: 1 year ago Posts: 16 |
Quote
Use this opportunity to create a backup tarball and restore it to the new USB drive. And you need to be root (sudo won't work). And yes, the partition label needs to be rootfs so that it will be a drop-in replacement (nothing else needs to be done).
Re: POGO E02 - Help needed to flash uboot December 31, 2022 04:01PM |
Admin Registered: 13 years ago Posts: 18,852 |