Welcome! Log In Create A New Profile

Advanced

Debian on NSA320s - possible?

Posted by pengu 
Re: NSA320s - cannot connect two 3,5 '' HDDs
August 18, 2015 04:13PM
Here it is, cross your fingers ....

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2014.07-tld-4-test-5.nsa310s.mtd0.kwb (512 KB)
Re: NSA320s - cannot connect two 3,5 '' HDDs
August 18, 2015 04:27PM
U-Boot 2014.07-tld-4-test-5 (Aug 18 2015 - 14:06:26)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server
...

no changes ;-(
Re: NSA320s - cannot connect two 3,5 '' HDDs
August 18, 2015 05:39PM
OK. The tld-4-test-5 code change was incorrect. Hope this one is better :) but I am still assuming that GPIO 33 is the right one.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2014.07-tld-4-test-6.nsa310s.mtd0.kwb (512 KB)
Re: Debian on NSA320s - possible?
August 18, 2015 05:54PM
U-Boot 2014.07-tld-4-test-6 (Aug 18 2015 - 15:07:32)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

no luck and "33" can't be set --> device or resource busy
and why is there a "gpiochip32" directory when 32 is wrong?

now the thermal sensor seems to be broken



Edited 1 time(s). Last edit at 08/18/2015 05:56PM by pengu.
Re: Debian on NSA320s - possible?
August 18, 2015 06:02PM
@pengu,

> no luck and "33" can't be set --> device or
> resource busy
> and why is there a "gpiochip32" directory when 32
> is wrong?

It meant to be tested with "ide reset" only, as I mentioned before. What happen in Debian is a different phase. If you do ide reset in u-boot and it can't initialize the 2nd port then perhaps gpio 33 is the wrong one.

The gpiochip32 directory is the folder for the 2nd group of GPIOs, i.e. it does not mean gpio 32.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 18, 2015 06:21PM
bodhi Wrote:
-------------------------------------------------------
> @pengu,
>
> > no luck and "33" can't be set --> device or
> > resource busy
> > and why is there a "gpiochip32" directory when
> 32
> > is wrong?
>
> It meant to be tested with "ide reset" only, as I
> mentioned before.

ok .. done .. but no luck ..
the 2end port isn't initialized


U-Boot 2014.07-tld-4-test-6 (Aug 18 2015 - 15:07:32)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server
...
...

NSA3x0S> ide reset

Reset IDE: Bus 0: .....OK Bus 1: not available  <- same as before 
  Device 0: Model: WDC WD20EARS-00MVWB0 Firm: 51.0AB51 Ser#:  WD-WCAZA7371950
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
> The gpiochip32 directory is the folder for the 2nd
> group of GPIOs, i.e. it does not mean gpio 32.
Re: Debian on NSA320s - possible?
August 18, 2015 06:26PM
pengu,

I'm not done yet :) will see if the 7th time is the charm. Will upload shortly.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 18, 2015 06:39PM
Here is version 7! please test with "ide reset".

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2014.07-tld-4-test-7.nsa310s.mtd0.kwb (512 KB)
Re: Debian on NSA320s - possible?
August 18, 2015 06:55PM
U-Boot 2014.07-tld-4-test-7 (Aug 18 2015 - 16:29:52)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

same as before ;-(
Re: Debian on NSA320s - possible?
August 18, 2015 07:03PM
Let's revisit this tomorrow! I'll review the code again to see if there is any loose end.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 19, 2015 04:28PM
@pengu & other NSA320S users,

Searching the GPL u-boot source, I could not find a definitive proof that GPIO 33 is the HDD2 power signal. Let's try the GPIO poke approach to see if this GPIO 33 is really the one. We want to do this test as followed.

In serial console prompt, with two 3.5" HDDs installed. Or at least one 3.5" HDD installed in the 2nd bay.

Dump memory
md f1010140
Poke the 2nd bit at GPIO high register:
mw.l f1010140  0x02

And then
ide reset

WARNING: as usual, playing with GPIOs is not for the faint of heart :) please do this test at your own risk, and make sure you don't have anything important on these 2 HDDs!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 19, 2015 04:55PM
NSA3x0S> md f1010140
f1010140: 00000002 fffffff9 00000000 00000000    ................
f1010150: 00000009 00000009 00000000 00000000    ................
f1010160: 00000000 00000000 00000000 00000000    ................
f1010170: 00000000 00000000 00000000 00000000    ................
f1010180: 00000000 00000000 00000000 00000000    ................
f1010190: 00000000 00000000 00000000 00000000    ................
f10101a0: 00000000 00000000 00000000 00000000    ................
f10101b0: 00000000 00000000 00000000 00000000    ................
f10101c0: 00000000 00000000 00000000 00000000    ................
f10101d0: 00000000 00000000 00000000 00000000    ................
f10101e0: 00000000 00000000 00000000 00000000    ................
f10101f0: 00000000 00000000 00000000 00000000    ................
f1010200: 00000000 76543210 3210ba98 000100ff    .....2Tv...2....
f1010210: 00000000 00000000 00000000 00000000    ................
f1010220: 00000000 00000000 00000000 00000000    ................
f1010230: 00000000 00000000 00000000 00000000    ................
NSA3x0S>

mw.l f1010140  0x02

NSA3x0S> ide reset

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: WDC WD3200AAJS-22B4A0  Firm: 01.03A01 Ser#:  WD-WCAT13936821
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305244.3 MB = 298.0 GB (625140335 x 512)
NSA3x0S>

the second one is now a 250 GB Samsung HDD



Edited 3 time(s). Last edit at 08/19/2015 05:31PM by pengu.
Re: Debian on NSA320s - possible?
August 19, 2015 05:33PM
@pengu,

Do another after the poke.

mw.l f1010140  0x02
md f1010140

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 19, 2015 05:36PM
f1010140: 00000002 fffffff9 00000000 00000000    ................
f1010150: 00000009 00000009 00000000 00000000    ................
f1010160: 00000000 00000000 00000000 00000000    ................
f1010170: 00000000 00000000 00000000 00000000    ................
f1010180: 00000000 00000000 00000000 00000000    ................
f1010190: 00000000 00000000 00000000 00000000    ................
f10101a0: 00000000 00000000 00000000 00000000    ................
f10101b0: 00000000 00000000 00000000 00000000    ................
f10101c0: 00000000 00000000 00000000 00000000    ................
f10101d0: 00000000 00000000 00000000 00000000    ................
f10101e0: 00000000 00000000 00000000 00000000    ................
f10101f0: 00000000 00000000 00000000 00000000    ................
f1010200: 00000000 76543210 3210ba98 000100ff    .....2Tv...2....
f1010210: 00000000 00000000 00000000 00000000    ................
f1010220: 00000000 00000000 00000000 00000000    ................
f1010230: 00000000 00000000 00000000 00000000    ................

nothing changed ...
Re: Debian on NSA320s - possible?
August 19, 2015 06:52PM
pengu,

> nothing changed ...

Of course, I now saw that it was already set to 2 before the poke.

Was that true it is already
f1010140: 00000002 fffffff9 00000000 00000000    ................
when you interrupt serial countdown and dump memory?

i.e., before you did the poke with
mw.l f1010140  0x02

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 19, 2015 07:07PM
bodhi Wrote:
-------------------------------------------------------
> pengu,
>
> > nothing changed ...
>
> Of course, I now saw that it was already set to 2
> before the poke.
>
> Was that true it is already

before the poke it was already
>
> f1010140: 00000002 fffffff9 00000000 00000000   
> ................
>
> when you interrupt serial countdown and dump
> memory?
>
> i.e., before you did the poke with
>
> mw.l f1010140  0x02
> 
Re: NSA320s - cannot connect two 3,5 '' HDDs
August 19, 2015 08:43PM
That's a bummer! No wonder why it did not seem to be right GPIO. More searching to be done.

If you have the GPL source, pls do some browsing (trunk/sysapp/u-boot...). See if you can find anything related to: gpio 33, hdd power, sata power,... And also in trunk/linux...

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



Edited 1 time(s). Last edit at 08/19/2015 08:45PM by bodhi.
Re: Debian on NSA320s - possible?
August 20, 2015 02:09AM
@pengu,

In case I've missed anything or unaware of what's going on in stock u-boot regarding the 2nd HDD. You might want to flash stock u-boot back to mtd0 and try the poke.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 20, 2015 12:13PM
with stock U-Boot:

Marvell>> md f1010140
f1010140: 00000000 ffffffff 00000000 00000000    ................
f1010150: 00000009 00000009 00000000 00000000    ................
f1010160: 00000000 00000000 00000000 00000000    ................
f1010170: 00000000 00000000 00000000 00000000    ................
f1010180: 00000000 00000000 00000000 00000000    ................
f1010190: 00000000 00000000 00000000 00000000    ................
f10101a0: 00000000 00000000 00000000 00000000    ................
f10101b0: 00000000 00000000 00000000 00000000    ................
f10101c0: 00000000 00000000 00000000 00000000    ................
f10101d0: 00000000 00000000 00000000 00000000    ................
f10101e0: 00000000 00000000 00000000 00000000    ................
f10101f0: 00000000 00000000 00000000 00000000    ................
f1010200: 00000000 76543210 3210ba98 000100ff    .....2Tv...2....
f1010210: 00000000 00000000 00000000 00000000    ................
f1010220: 00000000 00000000 00000000 00000000    ................
f1010230: 00000000 00000000 00000000 00000000    ................
Marvell>>

Marvell>> mw.l f1010140  0x02
Marvell>>

Marvell>> md f1010140
f1010140: 00000002 ffffffff 00000000 00000000    ................
f1010150: 00000009 00000009 00000000 00000000    ................
f1010160: 00000000 00000000 00000000 00000000    ................
f1010170: 00000000 00000000 00000000 00000000    ................
f1010180: 00000000 00000000 00000000 00000000    ................
f1010190: 00000000 00000000 00000000 00000000    ................
f10101a0: 00000000 00000000 00000000 00000000    ................
f10101b0: 00000000 00000000 00000000 00000000    ................
f10101c0: 00000000 00000000 00000000 00000000    ................
f10101d0: 00000000 00000000 00000000 00000000    ................
f10101e0: 00000000 00000000 00000000 00000000    ................
f10101f0: 00000000 00000000 00000000 00000000    ................
f1010200: 00000000 76543210 3210ba98 000100ff    .....2Tv...2....
f1010210: 00000000 00000000 00000000 00000000    ................
f1010220: 00000000 00000000 00000000 00000000    ................
f1010230: 00000000 00000000 00000000 00000000    ................
Marvell>>


Marvell>> ide reset

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: SAMSUNG SP2504C                          Firm: VT100-41 Ser#: S09QJ1GL612451      
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

Marvell>>

as you can see, only one drive is recognzied
Re: Debian on NSA320s - possible?
August 20, 2015 03:38PM
pengu,

Thanks for testing!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
August 23, 2015 04:10PM
@pengu,

Let's try another few GPIOs. In the NSA320S stock u-boot serial console. Poke each GPIO in order (most likely to least): 34, 20, 10, 4.

Each poke should follow with a "ide reset" to see if the 2nd HDD is power up. Please check my cconversion for correctness in the shift left operations below :)

GPIO 34 (1 << 2) -- 1 left shift 2 bits is 0x04
md f1010140
mw.l f1010140  0x04
md f1010140

GPIO 20 (1 << 20)
md f1010100
mw.l f1010100  0x100000
md f1010100

GPIO 10 (1 << 10)
md f1010100
mw.l f1010100  0x400
md f1010100

GPIO 4 (1 << 4)
md f1010100
mw.l f1010100  0x10
md f1010100

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



Edited 3 time(s). Last edit at 08/24/2015 01:58AM by bodhi.
Re: Debian on NSA320s - possible?
August 24, 2015 01:42AM
done, nothing changed:

http://pastebin.com/htLjmNHE
Re: Debian on NSA320s - possible?
August 24, 2015 01:55AM
pengu Wrote:
-------------------------------------------------------
> done, nothing changed:
>
> http://pastebin.com/htLjmNHE

Thanks pengu!

I'm running out of free time to pursue this. If you could, pls continue with similar tests for the other GPIOs. There are 36 GPIOs that are usable (0 to 35). And I've determined those above were the most likely to work, based on my understanding of Kirkwood SoC GPIO implementation.

You could try to test the rest of the GPIOs (excluding the ones already defined in the NSA320S DTS).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
bastel
Re: Debian on NSA320s - possible?
August 25, 2015 03:19PM
I have it running with 2 HDDs. Only used the left slot so far, now put on in the right one, too. But: One is a seagate that comes up in two phases, the motor starts spinning once Linux is initializing the ide port.

What I noticed is that dd if=/dev/sdb of=/dev/null bs=64k gives like 100 MB/s but it needs 60% CPU. Why? Or is this normal?
bastel
Re: Debian on NSA320s - possible?
August 25, 2015 03:22PM
Ah sorry, did miss the s in NSA320s, I have a NSA320. Well the CPU issue still remains :)
Re: Debian on NSA320s - possible?
September 20, 2015 01:49PM
because of a second WD Red I can put two Toshiba 2,5 '' HDDs in this box.
But I noticed that the power off issue still remains.
I'm trying now the newest kernel + NSA320s dtb .. let's see...

Edit

same as before :-(
[ 1316.847951] ------------[ cut here ]------------
[ 1316.852563] WARNING: CPU: 0 PID: 3764 at drivers/power/reset/gpio-poweroff.c:45 SyS_reboot+0x14c/0x1f8()
[ 1316.861997] Modules linked in: ipv6 adt7475 hwmon_vid evdev marvell_cesa des_generic orion_wdt mv_cesa gpio_keys uio_pdrv_genirq uio sg sd_mod uas usb_storage sata_mv libata fix
ed scsi_mod
[ 1316.878860] CPU: 0 PID: 3764 Comm: halt Not tainted 4.2.0-kirkwood-tld-1 #1
[ 1316.885784] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[ 1316.892052] [<c0015ebc>] (unwind_backtrace) from [<c0012324>] (show_stack+0x10/0x14)
[ 1316.899772] [<c0012324>] (show_stack) from [<c001f074>] (warn_slowpath_common+0x88/0xb0)
[ 1316.907837] [<c001f074>] (warn_slowpath_common) from [<c001f12c>] (warn_slowpath_null+0x18/0x20)
[ 1316.916587] [<c001f12c>] (warn_slowpath_null) from [<c003a404>] (SyS_reboot+0x14c/0x1f8)
[ 1316.924648] [<c003a404>] (SyS_reboot) from [<c000ee80>] (ret_fast_syscall+0x0/0x38)
[ 1316.932269] ---[ end trace 4ede80a0a9e67a41 ]---
[ 1348.013632] usb 1-1-port1: cannot reset (err = -110)
[ 1349.013609] usb 1-1-port1: cannot reset (err = -110)
[ 1350.013662] usb 1-1-port1: cannot reset (err = -110)
[ 1351.013594] usb 1-1-port1: cannot reset (err = -110)
[ 1352.013621] usb 1-1-port1: cannot reset (err = -110)
[ 1352.018566] usb 1-1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1353.023582] usb 1-1-port1: cannot disable (err = -110)
[ 1354.023635] usb 1-1-port1: cannot reset (err = -110)
[ 1355.023586] usb 1-1-port1: cannot reset (err = -110)
[ 1356.023599] usb 1-1-port1: cannot reset (err = -110)
[ 1357.023558] usb 1-1-port1: cannot reset (err = -110)
[ 1358.023615] usb 1-1-port1: cannot reset (err = -110)
[ 1358.028559] usb 1-1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1359.033550] usb 1-1-port1: cannot disable (err = -110)
[ 1360.033576] usb 1-1-port1: cannot reset (err = -110)
[ 1361.033536] usb 1-1-port1: cannot reset (err = -110)
[ 1362.033588] usb 1-1-port1: cannot reset (err = -110)
[ 1363.033525] usb 1-1-port1: cannot reset (err = -110)
[ 1364.033552] usb 1-1-port1: cannot reset (err = -110)
[ 1364.038500] usb 1-1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1365.043511] usb 1-1-port1: cannot disable (err = -110)
...

NSA310s dtb ... same result


and another strange thing :-(

[ 4758.932721] ------------[ cut here ]------------
[ 4758.937356] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:303 dev_watchdog+0x200/0x28c()
[ 4758.945757] NETDEV WATCHDOG: eth0 (mv643xx_eth_port): transmit queue 0 timed out
[ 4758.953117] Modules linked in: ipv6 adt7475 hwmon_vid raid0 md_mod evdev marvell_cesa des_generic mv_cesa orion_wdt uio_pdrv_genirq uio gpio_keys sg sd_mod uas usb_storage sata_mv libata fixed scsi_mod
[ 4758.971146] CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-kirkwood-tld-1 #1
[ 4758.978070] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[ 4758.984338] [<c0015ebc>] (unwind_backtrace) from [<c0012324>] (show_stack+0x10/0x14)
[ 4758.992058] [<c0012324>] (show_stack) from [<c001f074>] (warn_slowpath_common+0x88/0xb0)
[ 4759.000122] [<c001f074>] (warn_slowpath_common) from [<c001f0c8>] (warn_slowpath_fmt+0x2c/0x3c)
[ 4759.008788] [<c001f0c8>] (warn_slowpath_fmt) from [<c0507cec>] (dev_watchdog+0x200/0x28c)
[ 4759.016939] [<c0507cec>] (dev_watchdog) from [<c006584c>] (call_timer_fn+0x8c/0x1a4)
[ 4759.024660] [<c006584c>] (call_timer_fn) from [<c0065edc>] (run_timer_softirq+0x270/0x30c)
[ 4759.032895] [<c0065edc>] (run_timer_softirq) from [<c00222a0>] (__do_softirq+0x134/0x2f8)
[ 4759.041040] [<c00222a0>] (__do_softirq) from [<c00226cc>] (irq_exit+0x84/0xec)
[ 4759.048245] [<c00226cc>] (irq_exit) from [<c0057d2c>] (__handle_domain_irq+0x98/0xcc)
[ 4759.056049] [<c0057d2c>] (__handle_domain_irq) from [<c000944c>] (orion_handle_irq+0x70/0x88)
[ 4759.064542] [<c000944c>] (orion_handle_irq) from [<c0012e40>] (__irq_svc+0x40/0x6c)
[ 4759.072176] Exception stack(0xc0823f30 to 0xc0823f78)
[ 4759.077210] 3f20:                                     0426d542 00000454 0a812795 60000013
[ 4759.085352] 3f40: c0893e38 00000000 0a812795 00000454 065a5253 00000454 00000000 c08a3f38
[ 4759.093498] 3f60: 00000003 c0823f78 c04aeb04 c04aeb60 20000013 ffffffff
[ 4759.100093] [<c0012e40>] (__irq_svc) from [<c04aeb60>] (cpuidle_enter_state+0x22c/0x33c)
[ 4759.108163] [<c04aeb60>] (cpuidle_enter_state) from [<c0046b74>] (cpu_startup_entry+0x258/0x300)
[ 4759.116923] [<c0046b74>] (cpu_startup_entry) from [<c07dbc20>] (start_kernel+0x358/0x3cc)
[ 4759.125063] ---[ end trace 9dd16ffcafc32938 ]---
[ 4759.129668] mv643xx_eth_port mv643xx_eth_port.0 eth0: tx timeout
[ 4759.135743] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[ 4759.155420] mv643xx_eth: Set the PHY back to auto-negotiation mode
[ 4761.601582] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled



Edited 3 time(s). Last edit at 09/20/2015 03:42PM by pengu.
Re: Debian on NSA320s - possible?
September 20, 2015 03:34PM
@pengu,

It does not seem to be the same problem with the 2nd HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
September 20, 2015 04:13PM
shure .. the two 2,5'' HDDs were up fine.
The transmit timeout problem seens to occour while copying small files
Re: Debian on NSA320s - possible?
September 20, 2015 04:44PM
pengu,

Does your NSA310S behave the same way? Try taking the rootfs that is on NSA310S and run the NSA320S with it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on NSA320s - possible?
September 21, 2015 03:10AM
I'll check this ..
following situation now:
file transfer seems to hang sometimes but resumes after a while.
In bad situations, the modification fixing the dhcp issue seems to help

[Mo Sep 21 08:41:18 2015] mv643xx_eth_port mv643xx_eth_port.0 eth0: tx timeout
[Mo Sep 21 08:41:18 2015] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[Mo Sep 21 08:41:18 2015] mv643xx_eth: Set the PHY back to auto-negotiation mode
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: