@bodhi Lol I even did a page refresh before I posted and nothing, we must have hit post message within seconds of each other. I will set up the test disk and report back soonby richjn - Debian
@bodhi Shiraz all round I reckon :) Let me know if there's anything else you want to try / test as my next task will be to put this box back into production, which will take a few days. After that I will be converting my other rs816 over to native Debian, this box has 4 x 8TB drives so I will be need to play around with options to boot on raid with gpt. Whilst I'm doing that Iby richjn - Debian
@bodhi For users to use this method to bring raid up on big gpt disks we do need to put uInitrd in there as well. No we have uImage working do you want to try ? Only thing I will be unable to test is whether it will then boot raid but it works at all in should do raid as well in theory.by richjn - Debian
@bodhi WIN :) Just remember on this box you do need scsi init first Marvell>> <INTERRUPT> Marvell>> scsi init AHCI init for unit0 Target spinup took 0 ms. SATA link 1 timeout. SATA link 0 timeout. SATA link 1 timeout. SATA link 2 timeout. SATA link 3 timeout. AHCI 0001.0000 32 slots 4 ports 6 Gbps 0xf impl SATA mode flags: 64bit ncq led only pmp fbss pio sby richjn - Debian
@bodhi Just as an aside, when using dd M is equivalent to MiB From man dd N and BYTES may be followed by the following multiplicative suffixes: c=1, w=2, b=512, kB=1000, K=1024, MB=1000*1000, M=1024*1024, xM=M, GB=1000*1000*1000, G=1024*1024*1024, and so on for T, P, E, Z, Y. Binary prefixes can be used, too: KiB=K, MiB=M, and so on.by richjn - Debian
@bodhi mboot sure seems picky!! No joy on this one but success must just around the corner Boot Marvell>> <INTERRUPT> Marvell>> scsi init AHCI init for unit0 Target spinup took 0 ms. SATA link 1 timeout. SATA link 0 timeout. SATA link 1 timeout. SATA link 2 timeout. SATA link 3 timeout. AHCI 0001.0000 32 slots 4 ports 6 Gbps 0xf impl SATA mode flags: 64biby richjn - Debian
@bodhi & @jdwl101 Decided to press on I have some other stuff I need to complete but it can wait a bit longer. I think we might be getting close :) I left the DTB bit in for this run was going to leave it out on the next run but good news is whatever else we have changed today plus the 0X2F00 size increase and imi now passes :) Marvell>> <INTERRUPT> Marvell>>by richjn - Debian
@bodhi & jdwl101 Several things have changed today but if you recall I had already tried imi on zImage AND uImage with 0x2F00 and it made no difference. I will nonetheless redo the test because we have swapped a few things since then. I'm away for 30 mins will try on my return.by richjn - Debian
@bodhi Debian Create uImage and copy it (truncated output sorry) root@debian:~# cd /boot 00008000 -n Linux-5.1.2-rj -d vmlinuz-5.1.2-rj uImage-C none -a 0x00008000 -e 0x0 Image Name: Linux-5.1.2-rj Created: Wed May 22 12:15:51 2019 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4841504 Bytes = 4728.03 KiB = 4.62 MiB Load Address: 00008000 Entry Point: 00008by richjn - Debian
@bodhi I had always thought bs=*M was the same as bs=*MiB, my bad Debian clear away previous images and rewrite zImage root@debian:~# dd if=/dev/zero of=/dev/sda bs=1M seek=10 count=60 60+0 records in 60+0 records out 62914560 bytes (63 MB, 60 MiB) copied, 0.139173 s, 452 MB/s root@debian:~# cd /boot root@debian:/boot# dd if=zImage of=/dev/sda bs=1MiB seek=10 4+1 records in 4+1by richjn - Debian
@bodhi Store zImage & uInitrd root@debian:~# cd /boot root@debian:/boot# ls -lh zImage -rwxr-xr-x 1 root root 4.7M May 19 14:08 zImage root@debian:/boot# ls -lh uInitrd -rw-r--r-- 1 root root 9.5M May 19 14:32 uInitrd root@debian:/boot# dd if=zImage of=/dev/sda bs=1M seek=10 4+1 records in 4+1 records out 4841504 bytes (4.8 MB, 4.6 MiB) copied, 0.1255 s, 38.6 MB/s root@debian:/by richjn - Debian
@bodhi Realized I was defining the memory address twice, one in the scsi read arguments and then again in the $load arguments. Trying again and now its just hung at SCSI read: device 0 block # 20480, count 33554432 ... EDIT The above whilst trying to load zImageby richjn - Debian
@bodhi Based on the 'Usage' of scsi command output it doesn't like the way I'm presenting the commands although the commands themselves work fine from MARVEL>> Failure on zImage magic but I don't think it even loaded it Marvell>> scsi init AHCI init for unit0 Target spinup took 0 ms. SATA link 1 timeout. SATA link 0 timeout. SATA link 1 timeout.by richjn - Debian
@bodhi QuoteNote: the imi command only works with uInitrd or uImage. My second run was against uImage which returned "unknown image format" which is why I asked if it needed to be built in the build directory. You have already said it doesn't which makes me question if the address I am trying to read is wrong ? If the adress is incorrect for imi to recognize it then it probablyby richjn - Debian
@bodhi I will use the SPI images as you suggest but to make sure I understand you correctly you mean the ones ending *.kwb ? I was going to pull the DTB from tftp to keep my life simpler for now, remember I have no idea how to work out the scsi read addresses. Whilst I dd the images can you cast an eye over the env's I was going to pass. scsi init setenv ipaddr 192.168.1.250 seteby richjn - Debian
@bodhi & @jdwl101 Raw sector HDD load A little bit closer; I'm not sure if true but I read you can just cat the DTB into uInitrd so to simplify things I am trying it out. From Debian root@debian:~# cat armada-385-synology-rs816-v12.dtb >> uInitrd root@debian:~# dd if=zImage of=/dev/sda bs=1M seek=10 4+1 records in 4+1 records out 4841504 bytes (4.8 MB, 4.6 MiB) copby richjn - Debian
@bodhi Quoteso saveenv is never used until... like right now :) Already had :) QuoteLet's take a breather (a glass of shiraz would be appropriate :) and worry about the HDD loading tomorrow! You've got my vote, tomorrow it is.by richjn - Debian
@bodhi Just wanted to say a big Thank You for all the effort you have put into this and for producing a great SPI flash guide, I know for myself its one thing being able to do something and quite another to write a guide under which your average users isn't going to fall down a hole. To do this "blind" without the hardware in front of you makes the achievement all the more noteworby richjn - Debian
@bodhi Just a small point for the how to. At various stages of the process there is an assumption that a good set of environments are set, for example the last set of commands assumes the bootargs line is saved. Maybe simplest solution is get users to saveenv before they start any of the how to steps which would prevent a situation where up to that point they (like I used to) enter the setenvby richjn - Debian
@bodhi Looking good! BootROM - 1.73 Booting from SPI flash General initialization - Version: 1.0.0 AVS selection from EFUSE disabled (Skip reading EFUSE values) Detected Device ID 6820 High speed PHY - Version: 2.0 Init Synology board board SerDes lanes topology details: | Lane # | Speed| Type | ------------------------------| | 0 | 0 | SGMII0 | |by richjn - Debian
@bodhi We are both typing too quickly :) Yes caught mtdpartsby richjn - Debian
@bodhi Separate post for small amendments (three apostrophe's) to your env and to check they were typos and not as you intended ? Changes in red setenv boot_config_spi 'setenv image_addr_spi 0x0F0000; setenv image_size_spi 0x006f0000; setenv dtb_addr_spi 0x0E0000; setenv dtb_size_spi 0x010000; sf probe 0 50000000' setenv load_image_spi 'echo loading zImage from flash .by richjn - Debian
@bodhi In case you missed my second edit I hadn't closed the console so I was able to copy the output to my post. UPDATE: bodhi: Saw that :)by richjn - Debian
@bodhi Flash complete fw_printenv root@debian:~# fw_printenv CASset=max MALLOC_len=5 MPmode=SMP ata_hdd_detect=syno_hdd_detect=39,39,39,39 ata_hdd_enable=syno_hdd_enable=37,37,37,37 autoload=no baudrate=115200 boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr bootargs= bootargs_dflt=$console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootby richjn - Debian
@bodhi Unneeded post just to say it is flashing now but looks like it will take a while 50% erase at the momentby richjn - Debian
@bodhi I think no harm done but want to check if you agree next step Just a small amendment to you how to is to instruct users to install mtd-tools When I tested kwboot I rebooted and rebooted again when it failed to carry out part 111 I should have applied the env again but didn't think to. setenv mtdparts 'mtdparts=spi0.0:896k(u-boot),64k(dtb),7104k(kernel),-(env)'by richjn - Debian
@bodhi Error as below $ ./kwboot -t -B 115200 /dev/ttyUSB0 -b rs816.stock.uboot.kwb -p Sending boot message. Please reboot the target...- Sending boot image... BootROM - 1.73 (Boot) Booting from SPI flash General initialization - Version: 1.0.0 AVS selection from EFUSE disabled (Skip reading EFUSE values) Detected Device ID 6820 High speed PHY - Version: 2.0 Init Synologyby richjn - Debian
@bodhi root@debian:~# ls -lh rs816* -rw-r--r-- 1 root root 64K May 21 15:34 rs816.dtb.mtd1.kwb -rw-r--r-- 1 root root 896K May 21 15:31 rs816.stock.uboot.kwb -rw-r--r-- 1 root root 7.0M May 21 15:35 rs816.zImage.mtd2.kwb Can we proceed without kwboot or is it required for the flash ? If it is required I will have to hunt around for a working version. My OS is a personal fork of Arcby richjn - Debian
@bodhi boot U-Boot 2013.01-g74a026b-dirty (Dec 30 2015 - 14:40:58) Marvell version: 2015_T1.0p16 Board: SYNO-RS816 SoC: MV88F6820 Rev A0 running 2 CPUs CPU: ARM Cortex A9 MPCore (Rev 1) LE CPU 0 CPU @ 1866 L2 @ 933 TClock @ 200 DDR3 @ 933 DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled DRAM:by richjn - Debian
@bodhi I'm happy to continue and accept the risk of non recovery / bricking ?by richjn - Debian