Welcome! Log In Create A New Profile

Advanced

Debian Installation on Thecus N2350 (Marvell Armada 385)

Posted by lordzahl 
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 14, 2018 11:31PM
Hi bodhi,

Thanks for clarifying that.

So i use the debian definition
mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr)


which leads:

$ cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 20000000 00020000 "ubifs"
mtd1: 00400000 00001000 "uboot"
mtd2: 00010000 00001000 "uboot_env"
mtd3: 00010000 00001000 "uboot_scr"

First i was confused, because the erase size is different then in your post, but in you last post your debian result shows the same. So i will continue now.
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 12:01AM
Hi,

Here we go:

$ sudo nanddump --noecc --omitoob -f thecus_n2350.mtd0 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x20000000...

$ sudo dd if=/dev/mtd1 of=thecus_n2350.mtd1 bs=4096k conv=sync
1+0 records in
1+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 7.02599 s, 597 kB/s

$ sudo dd if=/dev/mtd2 of=thecus_n2350.mtd2 bs=3072k conv=sync
0+1 records in
1+0 records out
3145728 bytes (3.1 MB, 3.0 MiB) copied, 0.135414 s, 23.2 MB/s

$ sudo flashcp -v u-boot-a38x-2015T1_p18_Thecus-tld-2-spi.bin  /dev/mtd1
Erasing blocks: 235/235 (100%)
Writing data: 937k/937k (100%)
Verifying data: 937k/937k (100%)

$ sudo ./thecus-n2350-boot-script-tld-3.sh 
boot_config=setenv devices "usb ide"; setenv bootdev usb; setenv device 0:1; setenv disks "0 1 2 3 4 5 6 7";
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if ext2load $dev $disknum:1 $load_image_addr /boot/zImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
kernel_config=setenv load_dtb_addr 0x1000000; setenv load_initrd_addr 0x3000000; setenv load_image_addr 0x02000000; setenv dtb_file /boot/dts/armada-385-thecus-n2350.dtb
load_image=echo loading zImage ...; ext2load $bootdev $device $load_image_addr /boot/zImage
load_dtb=echo loading DTB $dtb_file ...; ext2load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; ext2load $bootdev $device $load_initrd_addr /boot/uInitrd
set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial"
set_bootargs_stock=setenv bootargs "root=/dev/ram0 rw max_loop=210 console=ttyS0,115200 init=sbin/init rootdelay=3 ubi.mtd=0 mtdparts=armada-nand:-(ubifs);spi_flash:0x00400000(uboot),0x00010000@0x00100000(uboot_env)"
bootcmd_exec=echo Booting from $bootdev $device …; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; if run load_image; then; if run load_initrd; then if run load_dtb; then bootz $load_image_addr $load_initrd_addr $load_dtb_addr; else bootz $load_image_addr $load_initrd_addr; fi; else if run load_dtb; then bootz $load_image_addr - $load_dtb_addr; else bootz $load_image_addr; fi; fi; fi
bootcmd_custom=run boot_config; run kernel_config; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd=echo Booting Debian ...; run bootcmd_custom; echo Booting stock ...; run set_bootargs_stock; usb reset; if fatload usb 0:1 0x2000000 rescue_fw/rescue_fw.img;then imi 0x2000000;source 0x2000000; fi; ubi part ubifs;ubifsmount boot;ubifsload 0x2000000 boot/bzImage;ubifsload 0x3000000 boot/ramdisk;bootm 0x2000000 0x3000000

After that i rebooted and the system booted using my rescue_fw method. I have no serial connected at the moment. I can do that this evening and will try to remove the rescue_fw partition from my disk and use your boot method.
Thanks!
Manuel
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 12:01AM
Manuel,

> First i was confused, because the erase size is
> different then in your post, but in you last post
> your debian result shows the same. So i will
> continue now.

I see. It does make sense why you asked. There is a 4K sector capability and 64K capability for SPI flash. The latest Linux driver is 4K-sector capable. We care only about the mtd size in that it must be as stated to be flashed correctly.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 12:04AM
> After that i rebooted and the system booted using
> my rescue_fw method. I have no serial connected at
> the moment. I can do that this evening and will
> try to remove the rescue_fw partition from my disk
> and use your boot method.
> Thanks!
> Manuel

Cool! it did boot is that we care about. We can refine the envs, as we go.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 01:59PM
Hi bodhi,

I removed the rescue_fw partition from my disk, so the system/debian image is the first partition on it, and it booted without problems using your envs/custom uboot.
Great! :)
Cheers,
Manuel
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 05:45PM
lordzahl Wrote:
-------------------------------------------------------
> Hi bodhi,
>
> I removed the rescue_fw partition from my disk, so
> the system/debian image is the first partition on
> it, and it booted without problems using your
> envs/custom uboot.
> Great! :)
> Cheers,
> Manuel

Awesome!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 09:03PM
Manuel,

UART booting is quite reliable now that I've figured out the quirk of this box during UART handshake.

When you run the script to download the image, if it seems to take too long (ie. the script reports that it got something, but then go on to wait for the next handshake opportunity, and again,...), just control-C, recall the command and execute it again. It will catch the NAK from the Thecus box right away. There is no need to wait a long time for it to occur!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 15, 2018 11:46PM
Hi,

Yeah, good that you write that down here. I think i did it already like this, but i never reported it.
Sometimes one misses little stuff, which might be very important to others.
Cheers, Manuel
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 16, 2018 05:44AM
Manuel,

Right! Without being able to run UART booting consistently, I would not want to develop new uboot for this and other Armada boxes.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 25, 2018 02:46AM
Manuel,

When you booted up the Thecus the first time, stock OS set the IP address to the default 192.168.1.100. That would be a problem for people with router 192.168.0.1.

Did Thecus provide a way to set it to 192.168.0.x subnet? I means some automatic way for normal users with Wifi (other than connecting an ethernet cable to your PC so you can run admin setup).

I usually go straight to serial consle to hack a box, so I have not looked into this.

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



Edited 1 time(s). Last edit at 05/25/2018 02:47AM by bodhi.
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 25, 2018 03:09AM
Hi bodhi,

I am not quite sure. The setup process is a little bit weird. For the initial configuration the box can not be reached through the browser at that ip. One has to use their mobile phone app or desktop (windows) program to setup the router. I think that it is not communicating at that point over tcp but maybe over udp. But i am not familiar with these basic levels of networking.
I can only say for sure, that at the initial state the router can e.g. not be pinged and only reached by thecus' apps.
Cheers, Manuel
Re: Debian Installation on Thecus N2350 (Marvell Armada 385)
May 25, 2018 04:24PM
Hi Manuel,

> For the initial configuration the box
> can not be reached through the browser at that ip.
> One has to use their mobile phone app or desktop
> (windows) program to setup the router.

Thanks! I can see this is necessary because stock OS does not use DHCP to get an address. What a crazy way to setup a NAS, unless they want to make sure the Thecus installation app will phone home when people set up the box :)

-bodhi
===========================
Forum Wiki
bodhi's corner
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: