Welcome! Log In Create A New Profile

Advanced

Linux Kernel 5.13.6 Kirkwood package and Debian rootfs

Posted by bodhi 
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 09, 2015 08:57AM
bodhi Wrote:
-------------------------------------------------------

>
> It could work if the Debian kernel was compiled in
> a similar way Arch Linux was (everything is
> compiled into kernel, no module needed).
>

Can you point me toward Archlinux installation guide?
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 09, 2015 05:22PM
tanya Wrote:
-------------------------------------------------------
> Dear bodhi,
>
> I just installed your 4.2 kernel, but the wifi
> card still does not appear. Can you suggest
> something to try?
>
> tanya

I forgot which card you have.???

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 09, 2015 11:40PM
archat68,

> Can you point me toward Archlinux installation
> guide?

Why? is your Debian rootfs working as you expected it to work?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 09, 2015 11:47PM
tanya,

If the Intel Pro NextGen is the one you're looking for, then check your modules see if it is running

lsmod | grep -i iwlwifi

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 02:30AM
Hello,

Which dtb/dts is the best for 310S 3.18.5 kernel (compiled by my self with your 3.18.5 patch) at the moment with stock u-boot?
I tried from 3.18.5, 4.1.0, 4.2.0 for 310S, 320S and encountered a problem with ethernet (not from u-boot - I don't need it).
After some reboots, coldboots nas can't get access to network. There is also problem with power button (not working).
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 02:51AM
bodhi Wrote:
-------------------------------------------------------
> archat68,
>
> > Can you point me toward Archlinux installation
> > guide?
>
> Why? is your Debian rootfs working as you expected
> it to work?


I installed the Debian rootfs as described by you. After install I plugged the USB stick to the USB slot next to the LAN port. Now the dockstar always boots to rescue.
fw_printenv
ethact=egiga0
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_device=0:1
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:10:75:1A:94:B9
rescue_installed=1
arcNumber=2097
bootdelay=10
usb_init=
usb_rootfstype=ext3
usb_scan_1=usb=0:1 dev=sda1
usb_root=rootfs=/dev/sda1

Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 02:52AM
jaru Wrote:
-------------------------------------------------------
> Hello,
>
> Which dtb/dts is the best for 310S 3.18.5 kernel
> (compiled by my self with your 3.18.5 patch) at
> the moment with stock u-boot?
> I tried from 3.18.5, 4.1.0, 4.2.0 for 310S, 320S
> and encountered a problem with ethernet (not from
> u-boot - I don't need it).
> After some reboots, coldboots nas can't get access
> to network. There is also problem with power
> button (not working).

The 3.18.5 patch does not have ethernet PHY problem patch file.

It's best to use the latest released kernel for NSA310S, and the kirkwood-nsa310s.dtb. The ethernet link problem has been fixed in the latest kernel. To verify, you should install the latest kernel release and see if it works consistently and go from there.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 03:13AM
archat68,

Typo here:

> usb_root=rootfs=/dev/sda1

should be

usb_root=/dev/sda1

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 03:24AM
bodhi Wrote:
-------------------------------------------------------
> archat68,
>
> Typo here:
>
>
> > usb_root=rootfs=/dev/sda1
>
>
> should be
>
>
> usb_root=/dev/sda1
>
is the command fw_setenv usb_root=/dev/sda1?
Got it fw_setenv usb_root '/dev/sda1'



Edited 1 time(s). Last edit at 09/10/2015 03:36AM by archat68.
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 03:39AM
archat68,

fw_setenv usb_root '/dev/sda1'

It is good practice to always wrap the entire value string in single quotes (in the above command, there is no need to do that). But it is required when there is special character in the stringg. For example, spaces in usb_scan_list:

fw_setenv usb_scan_list '1 2 3 4'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 04:02AM
Thanks!!
I booted through the USB stick with 3.16 rootfs. I have provided a SWAP in USB stick (400MB) with unallocated space of 400MB .
I shall do a apt-get update followed by upgrade.

i) Next to upgrade to latest kernel what shall I do?

ii) What I want to do is to boot through the USB stick with the HDD attached to the dockstar. I do not want to make any change in the filesystem of the HDD now and want to use as storage directory so that in case of any trouble I can use my HDD and boot into earlier version. Is it possible since both the disks have rootfs installed and are bootable?

I already have a SWAP in HDD. Can I use that when booting from USB?

iii) Also can I resize the partition of the HDD - install the 3.16 rootfs in a new partion and keep other partition intact and boot with it?



Edited 2 time(s). Last edit at 09/10/2015 04:07AM by archat68.
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 10, 2015 12:31PM
archat68 Wrote:
-------------------------------------------------------
> Thanks!!
> I booted through the USB stick with 3.16 rootfs. I
> have provided a SWAP in USB stick (400MB) with
> unallocated space of 400MB .
> I shall do a apt-get update followed by upgrade.
>
> i) Next to upgrade to latest kernel what shall I
> do?

First post of this thread, the instruction is in section Updated 30 June 2015. Same instruction applies to all newer kernel releases.

>
> ii) What I want to do is to boot through the USB
> stick with the HDD attached to the dockstar. I do
> not want to make any change in the filesystem of
> the HDD now and want to use as storage directory
> so that in case of any trouble I can use my HDD
> and boot into earlier version. Is it possible
> since both the disks have rootfs installed and are
> bootable?
>
> I already have a SWAP in HDD. Can I use that when
> booting from USB?
>
> iii) Also can I resize the partition of the HDD -
> install the 3.16 rootfs in a new partion and keep
> other partition intact and boot with it?

You can do all this. See this thread: http://forum.doozan.com/read.php?3,19093

And post questions if you're not sure about something.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 11, 2015 12:39AM
Thanks it's seems to be ok. I think last problem concerns not working power button, I can't do shutdown by pressing him.
I know it's a trifle, but is there any solution?
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 11, 2015 01:24AM
jaru Wrote:
-------------------------------------------------------
> Thanks it's seems to be ok. I think last problem
> concerns not working power button, I can't do
> shutdown by pressing him.
> I know it's a trifle, but is there any solution?

The Power button needs to be set up, since the kernel is Kirkwood-wide so does not have such specific box set up. Besides, this really belongs in rootfs, not kernel. The kernel only provides the buttons capability as GPIO button.

See DavideDg writeup for Esekeyd. It is a little bit cryptic, since Davide posted what his setup looks like, there is no instruction. If you have problem setting it up, I'll post mine with more comments.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 11, 2015 02:36AM
It was clear for me. Thanks a lot, now It works :)
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 11, 2015 03:37AM
jaru Wrote:
-------------------------------------------------------
> It was clear for me. Thanks a lot, now It works :)

Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 11, 2015 12:29PM
@all,

Please make separate topic when you have booting problem.

I've split the booting questions into a different topic.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 15, 2015 06:56AM
Dear bodh,

The card is "Intel® Centrino® Advanced-N + WiMAX 6250".
The "lsmod | grep -i iwlwifi" command output is empty.

The lsmod command output is the following :
# lsmod
Module                  Size  Used by
cfg80211              396985  0 
rfkill                 15823  1 cfg80211
evdev                   9408  0 
marvell_cesa           24785  0 
des_generic            16866  1 marvell_cesa
mv_cesa                11324  0 
orion_wdt               6105  0 
lm63                   10715  0 
uio_pdrv_genirq         2946  0 
uio                     7174  1 uio_pdrv_genirq
gpio_keys               7609  0 
fuse                   75892  3 
ipv6                  312359  32 
autofs4                28801  2 
sg                     21297  0 
sd_mod                 28586  2 
uas                    12100  0 
usb_storage            42754  2 uas
scsi_mod              173509  4 sg,uas,usb_storage,sd_mod
#

What do you suggest?
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 15, 2015 12:06PM
tanya Wrote:
-------------------------------------------------------
> Dear bodh,
>
> The card is "Intel® Centrino® Advanced-N + WiMAX
> 6250".
> The "lsmod | grep -i iwlwifi" command output is
> empty.
>
> The lsmod command output is the following :
>
> # lsmod
> Module                  Size  Used by
> cfg80211              396985  0 
> rfkill                 15823  1 cfg80211
> evdev                   9408  0 
> marvell_cesa           24785  0 
> des_generic            16866  1 marvell_cesa
> mv_cesa                11324  0 
> orion_wdt               6105  0 
> lm63                   10715  0 
> uio_pdrv_genirq         2946  0 
> uio                     7174  1 uio_pdrv_genirq
> gpio_keys               7609  0 
> fuse                   75892  3 
> ipv6                  312359  32 
> autofs4                28801  2 
> sg                     21297  0 
> sd_mod                 28586  2 
> uas                    12100  0 
> usb_storage            42754  2 uas
> scsi_mod              173509  4
> sg,uas,usb_storage,sd_mod
> #
>
>
> What do you suggest?

After booted into Debian:
modprobe iwlwifi

And look at your dmesg to see if the that network is up.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 16, 2015 03:27AM
Dear bodhi,

It seems to me that the network is still down. I made it without attaching LAN. The output is from serial:
Debian GNU/Linux 8 ZoliConnect ttyS0

ZoliConnect login: zoli
Password:
Last login: Wed Sep 16 09:53:22 CEST 2015 on ttyS0
Linux ZoliConnect 4.2.0-kirkwood-tld-1 #1 PREEMPT Mon Aug 31 23:12:00 PDT 2015 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
zoli@ZoliConnect:~$ su
Password:
root@ZoliConnect:/home/zoli# lsmod | grep -i iwlwifi
root@ZoliConnect:/home/zoli# modprobe iwlwifi
[  186.295898] Intel(R) Wireless WiFi driver for Linux
[  186.300866] Copyright(c) 2003- 2015 Intel Corporation
root@ZoliConnect:/home/zoli# lsmod | grep -i iwlwifi
iwlwifi                85784  0
cfg80211              396985  1 iwlwifi
root@ZoliConnect:/home/zoli# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:d0:b8:0c:d3:cd
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:87

eth0:avahi Link encap:Ethernet  HWaddr 00:d0:b8:0c:d3:cd
          inet addr:169.254.10.178  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:87

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3808 (3.7 KiB)  TX bytes:3808 (3.7 KiB)

root@ZoliConnect:/home/zoli#
DMESG contains only the 2 lines printed at modprobe command above.
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 16, 2015 03:36AM
tanya Wrote:
-------------------------------------------------------
> Dear bodhi,
>
> It seems to me that the network is still down. I
> made it without attaching LAN. The output is from
> serial:
>
> Debian GNU/Linux 8 ZoliConnect ttyS0
> 
> ZoliConnect login: zoli
> Password:
> Last login: Wed Sep 16 09:53:22 CEST 2015 on
> ttyS0
> Linux ZoliConnect 4.2.0-kirkwood-tld-1 #1 PREEMPT
> Mon Aug 31 23:12:00 PDT 2015 armv5tel
> 
> The programs included with the Debian GNU/Linux
> system are free software;
> the exact distribution terms for each program are
> described in the
> individual files in /usr/share/doc/*/copyright.
> 
> Debian GNU/Linux comes with ABSOLUTELY NO
> WARRANTY, to the extent
> permitted by applicable law.
> zoli@ZoliConnect:~$ su
> Password:
> root@ZoliConnect:/home/zoli# lsmod | grep -i
> iwlwifi
> root@ZoliConnect:/home/zoli# modprobe iwlwifi
> [  186.295898] Intel(R) Wireless WiFi driver for
> Linux
> [  186.300866] Copyright(c) 2003- 2015 Intel
> Corporation
> root@ZoliConnect:/home/zoli# lsmod | grep -i
> iwlwifi
> iwlwifi                85784  0
> cfg80211              396985  1 iwlwifi
> root@ZoliConnect:/home/zoli# ifconfig
> eth0      Link encap:Ethernet  HWaddr
> 00:d0:b8:0c:d3:cd
>           UP BROADCAST MULTICAST  MTU:1500 
> Metric:1
>           RX packets:0 errors:0 dropped:0
> overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0
> overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>           Interrupt:87
> 
> eth0:avahi Link encap:Ethernet  HWaddr
> 00:d0:b8:0c:d3:cd
>           inet addr:169.254.10.178 
> Bcast:169.254.255.255  Mask:255.255.0.0
>           UP BROADCAST MULTICAST  MTU:1500 
> Metric:1
>           Interrupt:87
> 
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536 
> Metric:1
>           RX packets:40 errors:0 dropped:0
> overruns:0 frame:0
>           TX packets:40 errors:0 dropped:0
> overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:3808 (3.7 KiB)  TX bytes:3808
> (3.7 KiB)
> 
> root@ZoliConnect:/home/zoli#
> 
>
> DMESG contains only the 2 lines printed at
> modprobe command above.

Check it to see wlan0 is active (bring it up is a separate command)
ifconfig -a


And do you have it set up to bring the wifi network up?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 16, 2015 04:58AM
Dear bodhi,

The network does not appear:
root@ZoliConnect:/home/zoli# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:d0:b8:0c:d3:cd
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:87

eth0:avahi Link encap:Ethernet  HWaddr 00:d0:b8:0c:d3:cd
          inet addr:169.254.10.178  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:87

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3808 (3.7 KiB)  TX bytes:3808 (3.7 KiB)

root@ZoliConnect:/home/zoli#

How should I set up to bring it up??
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 16, 2015 06:57AM
tanya Wrote:
> How should I set up to bring it up??

Isn't this a bit off-topic ?
Anyway - try a little primer: https://wiki.debian.org/WiFi/HowToUse#Command_Line ( be sure not to install the GUI packages ofc).

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
Re: Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs
September 16, 2015 11:59AM
@tanya,

You probably need to install firmware-iwlwifi package. And davidedg is right! please start a separate Debian topic for this wifi card problem. The module is included in the kernel, so there might be some more set up is needed.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 12:00PM
Hello bodhi. First of all thank you very very much for this great work.

My NSA320 now runs your Deb8 image with 4.2.0-kirkwood-tld-1, booted with DTB from a USB drive.
Uboot is u-boot-2014.07-tld-4

I have a small(ish) issue, counts more towards comfort then a real issue, but it would be great if it can be fixed.
The kernel throws alot of bad eraseblock errors at boot, as you can see from the dmesg excerpt bellow.
In Debian, when issuing any nand/uboot related command I also get badblock messages and it fails. My main problem is that I have to reboot in uboot and break boot to edit the env. Also flashing new uboot is a bit more cumbersome.

In uboot, however, I can read, dump, erase, write the nand no problems. No badblocks appear when working on the nand via uboot.

Any advice would be really appreciated. Many thanks.

See bellow the dmesg errors attached, fw_* error and my uboot env (which is broken in 2 parts, one on nand and one loaded at boot from USB flash):

root@fs:~# fw_printenv
Too few good blocks within range

uboot env:
preboot=setenv stderr serial; setenv stdin serial; setenv stdout serial; setenv baudrate 115200; setenv console ttyS0,115200; setenv bootdelay 10

baudrate=115200
console=ttyS0,115200
stderr=serial
stdin=serial
stdout=serial

ethact=egiga0
ethaddr=28:28:5d:16:09:ee

bootdelay=10

led_error=orange blinking
led_exit=green off
led_init=green blinking

mtdids=nand0=orion_nand
mtdparts=mtdparts=nand_mtd:0x100000(uboot),0x80000(stock_uboot_env)
partition=nand0,2

bootcmd=run bootcmd_uenv; run bootcmd_usb; usb stop; run bootcmd_sata; reset
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot

uenv_import=echo importing envs ...; env import -t 0x810000
uenv_load=usb start; setenv uenv_loaded 0; for devtype in usb; do for disknum in 0; do run uenv_read_disk; done; done
uenv_read_disk=if $devtype part $disknum; then run uenv_read; fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv/uEnv.txt; then setenv uenv_loaded 1; fi


extra uEnv script:
root@fs:~# cat /boot/uEnv/uEnv.txt
arcNumber=3956
machid=118f
mainlineLinux=yes

led_error=orange blinking
led_exit=orange on
led_init=green blinking

mtdparts=mtdparts=nand_mtd:0x100000(uboot),0x80000(stock_uboot_env)
partition=nand0,2

device=0:1
rootdelay=10
rootfstype=ext4

usb_root=/dev/sdc1
usb_init=usb start
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
usb_boot=mw 0x800000 0 1; run usb_load_dtb; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
usb_load_dtb=ext4load usb $device 0x1c00000 /boot/dts/kirkwood-nsa320.dtb
usb_load_uimage=ext4load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext4load usb $device 0x1100000 /boot/uInitrd

sata_root=/dev/sda1
sata_init=ide reset
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts $init
sata_boot=mw 0x800000 0 1; run sata_load_dtb; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_load_dtb=ext4load usb $device 0x1c00000 /boot/dts/kirkwood-nsa320.dtb
sata_load_uimage=ext4load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext4load ide $device 0x1100000 /boot/uInitrd
Attachments:
open | download - dmesg_err.txt (53.5 KB)
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 02:40PM
vcheche,

> I have a small(ish) issue, counts more towards
> comfort then a real issue, but it would be great
> if it can be fixed.
> The kernel throws alot of bad eraseblock errors at
> boot, as you can see from the dmesg excerpt
> bellow.
> In Debian, when issuing any nand/uboot related
> command I also get badblock messages and it fails.
> My main problem is that I have to reboot in uboot
> and break boot to edit the env. Also flashing new
> uboot is a bit more cumbersome.

This is an easy problem to fix (we've solved it long ago in general for Kirkwood boxes). But I am wondering why nobody has reported this before on the NSA320? could be a different NAND chip is used in your NS320??

Let me take a look and upload a newer DTB for you to try.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 02:49PM
thank you for your reply.
I replaced the factory nand some time ago as it was reporting a bad block at very low offset (in the uboot area), so I swapped it out for an identical chip and recovered the box with kwboot.

Can't say if the factory nand would report the same errors as the replacement, as I never had anything but stock fw on it. Also, reswapping them is not such an easy job, the pin pitch is quite fine.

I believe I did not have this issue on the non-FDT kernels. But I'm not sure. Maybe I'll give it a try now if I find a free USB drive.
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 03:00PM
> I believe I did not have this issue on the non-FDT
> kernels. But I'm not sure. Maybe I'll give it a
> try now if I find a free USB drive.

Ah! this is what I think to be the cause. I'm pretty sure that I had a correct NAND chip delay in kerne 3.16.x. So the fix is most likely that the device tree needs to conform to the old setting.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 03:26PM
vcheche,

Please try this DTB.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - kirkwood-nsa320.dtb (13.4 KB)
Re: Linux Kernel 4.2 Kirkwood (FDT) and 3.16 Kirkwood (non-FDT) package and rootfs
September 20, 2015 04:02PM
Bad block errors are gone and I can now read and write to the uboot env from Linux.
I will also try an uboot flash with nandwrite, but I think it will work just fine.

Thank you very much,
Val.
Sorry, you can't reply to this topic. It has been closed.