Welcome! Log In Create A New Profile

Advanced

Debian on Synology RS816 (Armada 385)

Posted by zifxify 
Re: Debian on Synology RS816 (Armada 385)
January 24, 2022 08:26PM
rreignier Wrote:
-------------------------------------------------------
> Hi bodhi
>
> It took me a while but I have finally finished
> reading this whole thread.
>
> From what I have read, I did not see anyone
> booting with a kernel image stored on USB. It was
> only from tftp (as I did already), from flash
> (which failed from me) or from raw HDD sectors
> (did not try yet).
>
> Do you remember another thread in which it was
> done?

Can't recall anybody done this.

Ok so connect serial console and plug in Ext3 formatted USB. And

usb reset

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 12:28PM
Hi bodhi

Quote
bodhi
Ok so connect serial console and plug in Ext3
formatted USB. And

usb reset

usb reset:
Marvell>> usb reet
USB is stopped. Please issue 'usb start' first.

So usb start:
Marvell>> usb start
(Re)start USB...
USB:   Active port:     1
Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found

Nice!

Then ext2ls:
Marvell>> ext2ls usb 0:1
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<DIR>       4096 etc
<DIR>       4096 mnt
<DIR>       4096 sbin
<DIR>       4096 root
<DIR>       4096 dev
<DIR>       4096 usr
<DIR>       4096 srv
<DIR>       4096 boot
<DIR>       4096 media
<DIR>       4096 proc
<DIR>       4096 var
<DIR>       4096 run
<DIR>       4096 bin
<DIR>       4096 opt
<DIR>       4096 tmp
<DIR>       4096 lib
<DIR>       4096 home
<DIR>       4096 sys
      1073741824 swapfile1
<DIR>       4096 @tmp
<DIR>       4096 @eaDir

Great!

No I have to check how to boot from here.
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 01:41PM
Actually, only one of the two USB ports works in uboot.
The USB stick is only detected on the port the closer to the Ethernet socket.

By slightly modifying the tftp boot variables, I have managed to boot from the USB drive.

setenv ipaddr 192.168.1.19
setenv serverip 192.168.1.42
setenv load_initrd_addr 0x3000000
setenv load_image_addr 0x02000000
setenv usb_setup 'usb start'
setenv load_image 'echo loading uImage from usb ...; ext2load usb 0:1 $load_image_addr boot/uImage'
setenv load_initrd 'echo loading uInitrd from usb ...; ext2load usb 0:1 $load_initrd_addr boot/uInitrd'
setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
setenv bootcmd_exec 'echo Booting Debian . . .; run usb_setup;  run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; bootm $load_image_addr $load_initrd_addr'
setenv bootcmd 'run bootcmd_exec; run bootspi'
boot

Note that the bootspi is not working because not present in this version of uboot.

Is it safe to just do a saveenv now or do I have to make some changes before?
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 03:15PM
After some time, I have the following kernel error in the console:

[ 1573.614898][    C0] irq 51: nobody cared (try booting with the "irqpoll" option)
[ 1573.622370][    C0] CPU: 0 PID: 5066 Comm: localedef Not tainted 5.15.5-mvebu-tld-1 #1.0
[ 1573.630513][    C0] Hardware name: Marvell Armada 370/XP (Device Tree)
[ 1573.637084][    C0] [<c01157a8>] (unwind_backtrace) from [<c01103fc>] (show_stack+0x10/0x14)
[ 1573.645598][    C0] [<c01103fc>] (show_stack) from [<c0aaa574>] (dump_stack_lvl+0x40/0x4c)
[ 1573.653929][    C0] [<c0aaa574>] (dump_stack_lvl) from [<c0184dec>] (__report_bad_irq+0x28/0xc0)
[ 1573.662782][    C0] [<c0184dec>] (__report_bad_irq) from [<c01851e8>] (note_interrupt+0x1b8/0x260)
[ 1573.671800][    C0] [<c01851e8>] (note_interrupt) from [<c0181da4>] (handle_irq_event_percpu+0x4c/0x70)
[ 1573.681256][    C0] [<c0181da4>] (handle_irq_event_percpu) from [<c0181e00>] (handle_irq_event+0x38/0x5c)
[ 1573.690884][    C0] [<c0181e00>] (handle_irq_event) from [<c0186810>] (handle_edge_irq+0xdc/0xfc)
[ 1573.699815][    C0] [<c0186810>] (handle_edge_irq) from [<c0180e7c>] (handle_irq_desc+0x24/0x34)
[ 1573.708656][    C0] [<c0180e7c>] (handle_irq_desc) from [<c05faa44>] (mvebu_gpio_irq_handler+0x164/0x178)
[ 1573.718288][    C0] [<c05faa44>] (mvebu_gpio_irq_handler) from [<c0180e7c>] (handle_irq_desc+0x24/0x34)
[ 1573.727740][    C0] [<c0180e7c>] (handle_irq_desc) from [<c0181568>] (handle_domain_irq+0x3c/0x54)
[ 1573.736757][    C0] [<c0181568>] (handle_domain_irq) from [<c05e5bd8>] (armada_370_xp_handle_irq+0x48/0xd0)
[ 1573.746561][    C0] [<c05e5bd8>] (armada_370_xp_handle_irq) from [<c01015d0>] (__irq_usr+0x50/0x80)
[ 1573.755664][    C0] Exception stack(0xc419dfb0 to 0xc419dff8)
[ 1573.761447][    C0] dfa0:                                     00000000 02e9d9c0 0261cfdc 0261cfd8
[ 1573.770369][    C0] dfc0: 008809e8 02e9d958 00000004 bea3c8a8 0261d06c 018a7488 02e9d9c0 0261d028
[ 1573.779290][    C0] dfe0: 0261cfd8 bea3c858 004e906b b6ead2d4 200e0030 ffffffff
[ 1573.786638][    C0] handlers:
[ 1573.789622][    C0] [<568635c5>] fan_alarm_irq_handler
[ 1573.794809][    C0] Disabling IRQ #51

Do you know if this is an issue?
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 04:40PM
> Actually, only one of the two USB ports works in
> uboot.
> The USB stick is only detected in the port the
> closer to the Ethernet socket.

That's very good to know and noted loudly in the installation instruction!

I think it best that you go through the Steps in the USB installation instruction:

https://forum.doozan.com/read.php?2,76314,91094#msg-91094

You might find something we did not before. And we can improve the instruction.

The IRQ problem above seems to be specific to the fan alarm so it does not hurt anything. However, I think I should look at the DTS again to see if we need to add or remove something.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 04:59PM
Quote
boudhi
I think it best that you go through the Steps in the USB installation instruction:

https://forum.doozan.com/read.php?2,76314,91094#msg-91094

Theses instructions only use USB for rootfs and flash kernel to flash, isn't it?

Now that I can boot directly from USB, even the kernel, I think I only have to change the uboot env, right?
Re: Debian on Synology RS816 (Armada 385)
January 25, 2022 05:29PM
rreignier,

> Theses instructions only use USB for rootfs and
> flash kernel to flash, isn't it?
>
> Now that I can boot directly from USB, even the
> kernel, I think I only have to change the uboot
> env, right?

Yes. If you can go through similar steps. Then we have a new instruction to boot directly from USB :)

So could you copy the Steps and revise them with what you just did (in a new post here in this thread)? Of course, it's your instruction so please write your own explanation if you'd like in each step. It's basically the outline that should be similar.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
January 27, 2022 09:04AM
Ok, I see.

I have installed openmediavault on the NAS and let it run for almost two days, no issue detected, Ethernet and the two sata ports are working.

Only the two disk leds are declared in the DTS so the STATUS, LAN and POWER leds are missing but they may be accessible from the external microcontroller and trigger by the serial port. I did not try yet and did not tried other GPIO.

But I have noticed that if I reboot the system, interrupt u-boot and paste the "setenv" commands, it does not work, I have:

Marvell>> setenv serverip 192.168.1.42
Unknown command 'setenv' - try 'help'

If I enter the commands manually, it seems to work but I cannot find them all with "printenv".

Have you already this strange behavior on reboot? Maybe once I will save the env, the issue won't be there anymore.

For now, I have to pull the power cord to reboot the box.
Re: Debian on Synology RS816 (Armada 385)
January 27, 2022 04:15PM
rreignier,

> Have you already this strange behavior on reboot?
> Maybe once I will save the env, the issue won't be
> there anymore.

I don't have this box. So all tests were done by users on this thread.

Yes. Once you save envs then you will know that the box can boot automatically without manual interruption. But please do read again the Installation Instruction steps to see if the issue you are seeing was discussed.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
February 17, 2022 05:29PM
Hi,

I was able to activate both sata in u-boot fo Synology DS218j using

mw.l f1018100 000ff000;

scsi init -- found both HDDs.

But after booting in Linux I could not find sdb.
Re: Debian on Synology RS816 (Armada 385)
June 13, 2022 09:51PM
I'm revisiting this topic and don't recall we have the serial pinouts post for RS816, DS116, or DS118. If you own one of these boxes, please post the serial pinouts.

Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
June 15, 2022 11:29PM
See Recovering a Failed Synology Diskstation with a Serial Console for details regarding pin out for most Marvell based Synology NAS.

Ray
Re: Debian on Synology RS816 (Armada 385)
June 16, 2022 04:23PM
> See
> Recovering
> a Failed Synology Diskstation with a Serial
> Console
for details regarding pin out for
> most Marvell based Synology NAS.

Thanks, I found that too. But that was DS212+, i.e. not one of these 3 boxes. So the questions to users in this thread is "do they all have same pinouts like below?"

1 3.3V
2 GND
4 TX
6 RX

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
June 19, 2022 01:33AM
I used this pinout successfully with these boxes in the past: DS214 (trying to unbrick now), DS413J, DS413 and DS118. I would bet that if you see a connector with 6 pins that it will be the serial port and that is uses this layout.

I do use only 2, 4 and 6. A common plug that is used for connecting servos in RC model flight fits perfectly.

Jan
Re: Debian on Synology RS816 (Armada 385)
June 19, 2022 03:59AM
Thanks Jan! that's answered my question.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
June 24, 2022 06:16PM
Hi Jan,

> I do use only 2, 4 and 6. A common plug that is
> used for connecting servos in RC model flight fits
> perfectly.
>

On your boxes, is this orientation of the pins correct? pin 1 is marked with a triangle

Quote

2 3 4
1 6 5

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
June 24, 2022 07:16PM
Or this?

https://www.netbsd.org/ports/sandpoint/instSynology.html

2 4 6
1 3 5

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Synology RS816 (Armada 385)
June 24, 2022 07:35PM
I've just watched Richard Bignell's video in the 414 unbricking tutorial.

https://forum.doozan.com/read.php?3,100059

Quote

Linux from Raspberry Pi: https://youtu.be/2WtcMX_d6Vk

Looks like:

2 4 6
1 3 5

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/24/2022 07:36PM by bodhi.
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: