Install Debian on Toshiba Canvio Home NAS

Firstly, thanks to everyone involved here. It is a great resource of info and files for these Marvell SoC devices.

I have a Kirkwood based “Toshiba Canvio Home NAS” that I want to update the stock Linux 2.6.31.8 kernel and found out that without a suitable DTS file it turned in to a much bigger project than I expected.

I tried a variety of DTS files from some similar Kirkwood devices but none of them were suitable. So I have created one now and sharing it here if anyone else can make use of it.

After updating to linux-4.11.3 the ethernet stopped working with 'Failed to bring up eth0.' I have made some changes to the DTS and it is fixed now, and it is still working ok in 4.4.0 too. The updated DTS, DTB and 4.11.3 boot log are attached.

A couple of notes:
The pinctrll warnings are less and CESA device is registered ok now, thanks for the fixes.

The SPI partitions set out in the DTS would not work in 4.4 but they get setup ok on 4.11. They could be defined in uboot and added as boot args in 4.4 which may be the preferred option anyhow?

Esekeyd would not pick up the restart button by default. I had to edit /etc/default/esekeyd to input event0 to get it to work.

DAEMON_OPTS="/etc/esekeyd.conf /dev/input/event0"

The NAS has RTC hardware but no battery so the system time would get messed up when the power was disconnected. I could not find an ready-made way to get around it so ended up using 'fake-hwclock' software which saves the time on shutdown and just edited it slightly so the startup script would update the real hwclock on boot so at least it will have a sane time. It is not connected to the Internet so tvheadend does the time syncing over the DVB-T network.

I will donate this thing to a family member and not sure how they will treat it so I have set it to do a file check on each boot with boot arg fsck.mode=force and edit /etc/default/rcS with FSCKFIX=yes. I would look into creating a readonly boot image for it if I had more time.

But otherwise it is working ok and quite a good little gadget now with TV tuner and 2Tb storage shared over the network.

The reset button is working as expected so the DTS settings should be ok.

I got caught out because I thought esekeyd listened on all input/events but it just would not respond to the button push. Once I told it specifically event0 with the DAEMON_OPTS= then it worked as expected. Learnkeys finds RESTART(press): and RESTART(release):

I understood that from what you said before. But I found it strange that esekeyd does not sense RESTART button where it should. This usually is related to the GPIO. You have the gpio_key and the button defined in the DTS. It looks fine to me.

So by this definition, esekeyd should have been triggered by the GPIO 21. And the RESTART button action should have executed some_script as esekeyd.conf specified. There should be no input event processing needed.

I made GPIO_ACTIVE_LOW because when initially testing the GPIO pin it was giving 0 in normal state and changed to 1 when pushed. With it set GPIO_ACTIVE_HIGH and the output was reversed with a normal state of 1.

I have done some tests and GPIO_ACTIVE_LOW is correct. With it set at HIGH learnkeys shows a RESTART press without even pushing the button. Then button push is shown as release... and then the release is shown as a push again.

One thing I noticed now though is that without specifying /dev/input/event0 it did show an error 'learnkeys: can`t open /dev/input/event65534'

And on boot with a clean install of 4.4 with only esekeyd installed shows:

The thing is the button press is working ok, I currently have it flashing the red LED a few times before it goes and does a reboot as expected. But I just don't know why esekeyd needed event0 specified. Only made a note of it because it took a while to get it going and it may help others?

I think it is more to do with esekeyd, but if you have any other ideas I am happy to test.

It will restart just fine fine with RESTART:/sbin/shutdown -r now.
The RESTART(press): and RESTART(release): were how the config was described when running 'learnkeys /etc/esekeyd.conf /dev/input/event0'.

I have been over the DTS again and made some subtle changes but it still has the esekeyd can`t open /dev/input/event65534 if /dev/input/event0 is not included. I was hopeful by adding #include <dt-bindings/input/input.h> but alas no difference. The slightly changed file is attached anyhow.

I don't know the relevance of event65534. I am beginning to wonder if it is related to the 'kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group' error these kirkwood-6192 have. I had a look online for the pogoplug v4 with esekeyd and the one I found actually had set the event0 added too in the config ! link.

> I don't know the relevance of event65534. I am beg
> inning to wonder if it is related to the 'kirkwood
> -pinctrl f1010000.pin-controller: unknown pinctrl
> group' error these kirkwood-6192 has

Now it might be a clue there. My Pogo V4 does not have these errors anymore.

>
> Do you know of any kirkwood-88f6702/6192 that are
> running esekeyd?

I do! I have 3 Pogo V4 (6192) running 24/7 with esekeyd working (same version that you have). And one NSA310S (6702) running esekeyd. That's why I thought something is not righ. The Pogo V4 has one button: EJECT. The NSA310S has 3 buttons (Power, Restart, Copy), all working with esekeyd.

Thanks for the details, no surprises there though. The Pogoplug v4 was one of the first DTS files I tried to boot this machine from because of the CPU and ram similarities, but it would kernel panic with the nand/spi differences. But it was one of the templates I used for starting the current canvio DTS.

Can you tell me how you got rid of the pntctrl messages in your 6702/6192? I had a look through the 4.11.3 patch but could not see any obvious changes in pinctrl-kirkwood.c or pinctrl-mvebu.c. Edit: I see there was a patch added to mainline about v4.5.

This Canvio still has 2 errors with 4.11.3 which is strange since it should be similar hardware with the same group of pins (36-49) not included across all of these models.

I have found the culprit! It is having a lone <KEY_RESTART> in the DTS. For some reason the restart key is treated differently and is not assigned the keyboard handler.

Esekeyd is looking at /proc/bus/input/devices for H: Handlers=kbd but it is not there with KEY_RESTART. I tried it with KEY_EJECTCD as with your Pogoplug and it worked as you expected.

The solution as this stage is to change KEY_RESTART with KEY_POWER in the DTS and it works ok.
'H: Handlers=kbd event0' and esekeyd is happy and it still has the same result with 'POWER:/sbin/shutdown -r now' instead in /etc/esekeyd.conf.

I expect KEY_RESTART would be ok to use if other regular key were also defined in the DTS so that the keyboard handler would then be assigned with /dev/input/event0
It seems the previous setup was working ok and the input was available with gpio-keys, just not as a keyboard :)

With esekeyd I think it is behaving as expected. Although the error 'can`t open /dev/input/event65534' when it cannot find any keyboard handler is quite cryptic and could be improved.

This machine has just the one button. It was initially probably a reset button for clearing passwords or maybe a factory restore so not actually a restart button anyhow. I suppose at the end of the day it doesn't really matter too much what Linux key code it is assigned to it, as long as it is configurable once the system has booted.

Robert, could you explain to an entire novice how to do the installation in a HDNB120XKEK1 Toshiba Canvio Home? I have one with firmware failure Toshiba dont provides a firmware fix method and I'm stuck with an expensive paperweight :)
I haven't even found how to open it if necessary. So, any information is welcome.

I'm not shure if so bricked, it starts the OS to an state where I can't use it (no ssh, no web login)

The story:

Power off (from the web control panel) for furniture change and the hell started.

When power on, access from my computers start to fail all the time. The problem, samba locking.tdb grows without control and breaks samba server. Ok, I have backup of my data, lets go with factory reset.

Ohh no!!!! After factory reset cant create any volume, I have 2 TB that can't use. You think I have enought bad ideas? Nop. Factory reset again and now cant log into de NAS from the web panel

In the web page shows:

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0, (factory reset #1)

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0, (factory reset #2)

If try to login... well, I can't.

Is posible to install without opening? I think I will need to extract the HDD and install your Debian image in. Then pray for start OK with a real OS, not a Toshiba toy :)

wzaldivar Wrote:
-------------------------------------------------------
> I'm not shure if so bricked, it starts the OS to a
> n state where I can't use it (no ssh, no web login
> )
>
> The story:
>
> Power off (from the web control panel) for furnitu
> re change and the hell started.
>
> When power on, access from my computers start to f
> ail all the time. The problem, samba locking.tdb g
> rows without control and breaks samba server. Ok,
> I have backup of my data, lets go with factory res
> et.
>
> Ohh no!!!! After factory reset cant create any vol
> ume, I have 2 TB that can't use. You think I have
> enought bad ideas? Nop. Factory reset again and no
> w cant log into de NAS from the web panel
>
> In the web page shows:
>
> Warning: Unknown: write failed: No space left on d
> evice (28) in Unknown on line 0, (factory reset #1
> )
>
> Warning: Unknown: Failed to write session data (fi
> les). Please verify that the current setting of se
> ssion.save_path is correct () in Unknown on line 0
> , (factory reset #2)
>
> If try to login... well, I can't.
>
> Is posible to install without opening?

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.