Welcome! Log In Create A New Profile

Advanced

2017.07-2023.04 U-Boot Kirkwood - GoFlexNet, GoFlexHome, PogoE02, Dockstar, iConnect, NetgearStora, PogoV4/Mobile, Sheevaplug, NSA325, NSA320, NSA310S, NSA320S, NSA310, HP T5325, Dreamplug

Posted by bodhi 
Hi Bodhi,

Thanks for the tutorial, I am planning to use ArchLinux official OS which can be found here: http://os.archlinuxarm.org/os/ArchLinuxARM-kirkwood-latest.tar.gz However, I'm not sure if this is FDT or non-FDT kernel?

so basically I'm stuck in your tutorial in Step 8, section F "Adjust the DTB name to boot with a rootfs that has FDT kernel" pls let me know what should I do? Shall I leave dtb_file empty in environment file?

Thanks.
Tushar,

Which box do you have?

This u-boot can run either FDT or non-FDT kernel. So it really does not matter. As long as you flash the default env image, then it will figure out the rootfs is FDT or not. However this only apply to Debian rootfs.

To figure out if this Arch rootfs is FDT or non FDT. Extract and prepare it first, and then look for the DTB folder. Assuming it is mounted as sdb1 on a Linux box. If the /boot/dtbs exists and contains the DTB files then it is FDT, otherwise it is not.
cd /media/sdb1
ls -l /boot/dtbs

However, to run Arch with my u-boot release, you need some adjustment.

Section B step f:

fw_setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'

need to change to
fw_setenv dtb_file '/boot/dtbs/kirkwood-dockstar.dtb'


And since Arch does not use initrd

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
need to change to
set_bootargs=setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts $custom_params

Post if you're not sure about the above.

And also, very important to set up netconsole if you don't have serial console connected.

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

Thanks for replying. I'm setting up the Pogoplug (Series 4). The system currently running on official Archlinux.

[root@alarm /]# uname -a
Linux alarm 4.4.10-1-ARCH #1 PREEMPT Fri Apr 22 23:34:48 MDT 2016 armv5tel GNU/Linux


I downloaded and extracted "ArchLinuxARM-kirkwood-latest.tar.gz" in /dev/sda1, After installation I checked for 'dtb' or 'dtbs' but no result returned.

[root@alarm /]# find / -name "dtb"
[root@alarm /]# find / -name "dtbs"

/boot directory looks like below:

[root@alarm /]# ls -l /boot/
total 7092
-rw-r--r-- 1 root root 2683848 May  1 19:47 initramfs-linux.img
-rw-r--r-- 1 root root 4555112 Apr 23 05:37 uImage

The box is intend to use for NAS/SAMBA and I successfully configured it on Archlinux. The reason I want to flash your u-boot because Archlinux's official u-boot sometimes can't identify correct USB drive/rootfs if multiple USB drives connected to the pogoplug. I believe your u-boot release solves this problem by labeling rootfs?

I have three questions now,

1. Now that it appears there's no DTB files present in my Archbox, what should I do with Section-B, Setp-F ?

2. Is there any directive in official Archlinux u-boot install script ( http://os.archlinuxarm.org/os/ppv4/ppv4-install.sh ) could be modified so I can prioritize to always look for rootfs in /dev/sda1 without changing official u-boot?

3. Silly question but what OS is better in terms of performance when it comes to running linux on ARM? shall I change to Debian?

Regards,

Tushar
Also here's the MTD output on Archlinux, I'm not sure why there's mtd5 with "spi0.0" showing there.

[root@alarm boot]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00300000 00020000 "uImage"
mtd2: 00300000 00020000 "uImage2"
mtd3: 00800000 00020000 "failsafe"
mtd4: 07000000 00020000 "root"
mtd5: 00010000 00008000 "spi0.0"
Well, I'm sorry but I believe you already answered my first question above, which was written in your tutorial-

Quote
In the special case when you are booting with a non-FDT kernel, or if you have appended the DTB to uImage. Remove the DTB file env. If not sure please post question before continuing.

fw_setenv dtb_file
Tushar Wrote:
-------------------------------------------------------
> Hi Bodhi,
>
> Thanks for replying. I'm setting up the Pogoplug
> (Series 4). The system currently running on
> official Archlinux.
>
>
> [root@alarm /]# uname -a
> Linux alarm 4.4.10-1-ARCH #1 PREEMPT Fri Apr 22
> 23:34:48 MDT 2016 armv5tel GNU/Linux
>
>
>
> I downloaded and extracted
> "ArchLinuxARM-kirkwood-latest.tar.gz" in
> /dev/sda1, After installation I checked for 'dtb'
> or 'dtbs' but no result returned.
>
>
> [root@alarm /]# find / -name "dtb"
> [root@alarm /]# find / -name "dtbs"
>
>
> /boot directory looks like below:
>
>
> [root@alarm /]# ls -l /boot/
> total 7092
> -rw-r--r-- 1 root root 2683848 May  1 19:47
> initramfs-linux.img
> -rw-r--r-- 1 root root 4555112 Apr 23 05:37
> uImage
>
>
> The box is intend to use for NAS/SAMBA and I
> successfully configured it on Archlinux. The
> reason I want to flash your u-boot because
> Archlinux's official u-boot sometimes can't
> identify correct USB drive/rootfs if multiple USB
> drives connected to the pogoplug. I believe your
> u-boot release solves this problem by labeling
> rootfs?
>

Yes.

> I have three questions now,
>
> 1. Now that it appears there's no DTB files
> present in my Archbox, what should I do with
> Section-B, Setp-F ?
>

You already figured out this step.

> 2. Is there any directive in official Archlinux
> u-boot install script (
> http://os.archlinuxarm.org/os/ppv4/ppv4-install.sh
> ) could be modified so I can prioritize to always
> look for rootfs in /dev/sda1 without changing
> official u-boot?

There is a way, but not as robust as rootfs label.

>
> 3. Silly question but what OS is better in terms
> of performance when it comes to running linux on
> ARM? shall I change to Debian?
>

They are the same. Whichever you are more comfortable with is fine.


> Regards,
>
> Tushar

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

After reading a few more topics on this site, I decided to switch to Debian because some people reported issue with booting the box when multiple USB drives are connected. So I wonder once the default U-boot installed, can I simply extract latest Kirkwood kernel 4.6 and rootfs (FDT) to primary USB drive and reboot the system to a up & running system?

I have read this topic: http://forum.doozan.com/read.php?2,12096 but the installation procedure seems to be talking about upgrade procedure from already running Debian system.

Currently I'm on stock pogoplug v4 OS and would like to flash default U-boot and also install latest Debian (Linux Kernel 4.6 Kirkwood -FDT), - is this possible?

Where can get the instructions?

Thanks.
Tushar Wrote:
-------------------------------------------------------
> Hi Bodhi,
>
> After reading a few more topics on this site, I
> decided to switch to Debian because some people
> reported issue with booting the box when multiple
> USB drives are connected. So I wonder once the
> default U-boot installed, can I simply extract
> latest Kirkwood kernel 4.6 and rootfs (FDT) to
> primary USB drive and reboot the system to a up &
> running system?

Yes, the latest u-boot will boot the latest 4.4 rootfs. And then you can install kernel 4.6.

> I have read this topic:
> http://forum.doozan.com/read.php?2,12096 but the
> installation procedure seems to be talking about
> upgrade procedure from already running Debian
> system.
>

No, the installation procedure are for both kernel or rootfs.

Quote

Latest kernel: linux-4.6.0-kirkwood-tld-1-bodhi.tar.bz2 (20 May 2016)
Latest rootfs: Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (20 Feb 2016)

So just create 4.4. rootfs using Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 . That will get you boot Debian. After that, upgrade to kernel 4.6 using linux-4.6.0-kirkwood-tld-1-bodhi.tar.bz2.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
I've released HP Thin Client T5325 u-boot-2015.10-tld-2. Please see 1st post for installation instruction.

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

I have already taken backup of my stock pogoplug (v4) MTD partitions,

dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00300000 00020000 "uImage"
mtd2: 00300000 00020000 "uImage2"
mtd3: 00800000 00020000 "failsafe"
mtd4: 07000000 00020000 "root"
mtd5: 00010000 00008000 "spi0.0"

Once your default u-boot is installed, is this possible to revert back to stock u-boot using serial cable? just curious to know.

Thanks.
Tushar Wrote:
-------------------------------------------------------
> Bodhi,
>
> I have already taken backup of my stock pogoplug
> (v4) MTD partitions,
>
>
> dev:    size   erasesize  name
> mtd0: 00200000 00020000 "u-boot"
> mtd1: 00300000 00020000 "uImage"
> mtd2: 00300000 00020000 "uImage2"
> mtd3: 00800000 00020000 "failsafe"
> mtd4: 07000000 00020000 "root"
> mtd5: 00010000 00008000 "spi0.0"
>
>
> Once your default u-boot is installed, is this
> possible to revert back to stock u-boot using
> serial cable? just curious to know.
>
> Thanks.

Yes, you can revert to stock uboot by restoring mtd0. And it's easier doing it in Linux shell, similar to when you install new u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Having a problem loading the latest u-boot to a Pogoplug E02. I managed to boot to the latest Debian rootfs (upgraded to Debian 8.5) on a USB flash drive. Expected the proper binaries to already be installed. fw_printenv and fw_setenv are available, but the crucial flash_erase is not available. So I unpacked linux-tools-installation-bodhi.tar.gz to a temp directory and the tried executing flash_erase with the following results:

root@debian:~/tools# ./flash_erase /dev/mtd0 0 4
flash_erase: error!: /dev/mtd0
error 13 (Permission denied)
root@debian:~/tools#

What do I do now? Is this a result of the crappy OpenWrt u-boot I'm trying to replace?
rayknight,

> What do I do now? Is this a result of the crappy
> OpenWrt u-boot I'm trying to replace?

raynight,

Whenever you see this error, it means the mtd0 was not RW. If you boot with OpenWrt u-boot, that's what it did to tell the kernel that mtd0 is RO. This can be fixed in the mtdparts env. So let's check the Pogo E02 envs.

fw_printenv | grep -i dtb
fw_printenv bootcmd
fw_printenv mtdparts
Does it the DTB comes with my Debian rootfs?
ls -l /boot/dts/*e02*
Verify which system is booting
uname -a

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



Edited 3 time(s). Last edit at 06/07/2016 11:26PM by bodhi.
I've split the last posts into its own thread:
http://forum.doozan.com/read.php?3,28443

Also this one:
http://forum.doozan.com/read.php?3,28541

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



Edited 2 time(s). Last edit at 06/14/2016 12:06AM by bodhi.
Last post moved to its own thread: http://forum.doozan.com/read.php?3,28599,28599#msg-28599

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



Edited 1 time(s). Last edit at 06/16/2016 03:17PM by bodhi.
I've released 2016.05-tld-1 U-Boot images. Please see 1st post for download link.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
I should have mentioned this new feature (described in the first post):

Quote

- The default envs were modified slightly to make it more robust. If you are upgrading u-boot, there is no need to reflash, but worth taking a look at the envs text file to see the differences.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
I've moved the last post to Rescue System subforum

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

I picked up my ignored pogo-e02 and I'm in the process of updating uboot/debian.

After updating uBoot (uboot.2016.05-tld-1.pogo_e02.bodhi), the pogo-e02 did not show on the network, I created the following /boot/uEnv.txt and the pogo-e02 is online again:

devices='usb mmc ide'
bootcmd='run bootcmd_uenv; run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; reset'
bootcmd_uenv='run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi'
uenv_import='echo importing envs ...; env import -t 0x810000'
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='echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /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'
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;'
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='172.16.1.247'
serverip='172.16.1.39'
devices=mmc usb ide
disks=0 1 2 3 4 5 6 7
arcNumber=3542
machid=0xdd6

Since uEnv.txt seems to have me saved, I decided to perform step B in the instructions:
I reflashed the uboot environment (uboot.2016.05-tld-1.environment.bodhi) by following these steps:

root# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erasing 128 Kibyte @ c0000 -- 100 % complete

root# 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

root# /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Writing data to block 6 at offset 0xc0000

root# fw_printenv
<<< output complete environment >>>

root# fw_setenv mtdparts 'orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)'
root# fw_printenv |grep etha
ethact=egiga0
ethaddr=52:3b:20:9c:11:51

root# fw_setenv ethaddr '00:25:31:02:ED:38'
Can't overwrite "ethaddr"

How do I solve the error at the last step?

Thank you very much for your time!
Wilbert
wilbert-vb,

> ethaddr=52:3b:20:9c:11:51

Dont worry about this. The above ethaddr is a auto-generated local MAC addr. So it will work. After booting into Debian gain, you can set it to the correct value.

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

i have the following situation. i am on a nsa325 plattform. i tryed to dump the mtd0

tools/nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
then i checked for bad blocks
dmesg | grep -i 'bad'
[    1.694843] Scanning device for bad blocks
[    1.704174] Bad eraseblock 100 at 0x000000c80000
[    1.713970] Bad eraseblock 200 at 0x000001900000
and erased the flash
 tools/flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete
and got the following error at writing the new blocks
tools/nandwrite /dev/mtd0 uboot.2016.05-tld-1.nsa320.mtd0.kwb
uboot.2016.05-tld-1.nsa320.mtd0.kwb: No such file or directory
nandwrite: error!: Data was only partially written due to error
           error 9 (Bad file descriptor)

what's wrong? how to proceed ? please help .... i have to keep the system on ?!
now finally got

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

sorry ... writing paths correctly is too difficult, isn't it ?!
> sorry ... writing paths correctly is too
> difficult, isn't it ?!

:)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Last posts moved to its own topic.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Stock Zyxel NSA310s here.

Current /proc/mtd:
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 00080000 00020000 "key_store"
mtd3: 00080000 00020000 "info"
mtd4: 00a00000 00020000 "etc"
mtd5: 00a00000 00020000 "kernel_1"
mtd6: 02fc0000 00020000 "rootfs1"
mtd7: 00a00000 00020000 "kernel_2"
mtd8: 02fc0000 00020000 "rootfs2"

Current /etc/fw_envconfig:
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
# NAND example
/dev/mtd1               0x0000          0x20000         0x20000                 4

Do I understand correctly that the new uboot will read it's envs from a different address and is this why I need to flash default u-boot envs image?
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors 
/dev/mtd0 0xc0000 0x20000 0x20000

Thank you very much,
Wilbert
Wilbert

> Do I understand correctly that the new uboot will read it's envs from a different address and is this why I need to flash default u-boot envs image?

Yes, correct.

> /dev/mtd0 0xc0000 0x20000 0x20000

All Kirkwood u-boot images that I built has this addr for envs location.

Note: except the HP T5325, which uses SPI flash. So even though the addr is the same, the T5325 is flashed differently.

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



Edited 2 time(s). Last edit at 07/19/2016 01:18PM by bodhi.
I just ran into another Kirkwood device that uses SPI flash instead of NAND. The GlobalScale DreamPlug has u-boot on 2MB SPI NOR and then boots linux from an internal microSD card. I believe that the D-Link DIR-665 is also using SPI NOR, but has 16MB of flash.

Ray
rayknight Wrote:
-------------------------------------------------------
> I just ran into another Kirkwood device that uses
> SPI flash instead of NAND. The GlobalScale
> DreamPlug has u-boot on 2MB SPI NOR and then boots
> linux from an internal microSD card. I believe
> that the D-Link DIR-665 is also using SPI NOR, but
> has 16MB of flash.
>
> Ray

Thanks for the info Ray.

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

I'm using a pogoplug v4. Now, I want to setup my system with only one external USB HDD where I like to keep rootfs on first partition while 2nd partition should hold my (NAS/SAMBA) files. What should I do? any suggestion?

Thanks.
Tushar Wrote:
-------------------------------------------------------
> Hi Bodhi,
>
> I'm using a pogoplug v4. Now, I want to setup my
> system with only one external USB HDD where I like
> to keep rootfs on first partition while 2nd
> partition should hold my (NAS/SAMBA) files. What
> should I do? any suggestion?
>
> Thanks.

Please post this question in its own Debian topic, I will answer there. And tell me which u-boot and kerrnel you are running. And are you running on USB,... Details like that.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Sorry, you can't reply to this topic. It has been closed.