Welcome! Log In Create A New Profile

Advanced

2023.04 U-Boot Kirkwood - Synology DS411j

Posted by bodhi 
2023.04 U-Boot Kirkwood - Synology DS411j
September 19, 2023 12:31PM
This u-boot is ready to use. But do run kwboot to test it on your box before installation.

Known issues: SATA (in u-boot only)

A cleanup installation instruction will be posted here soon.

=================
Update 14 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
4649d67655529ece192461bbe7850735
sha256:
d2412d0fa745c8a7471fbd44825c2e6719698c75395ee4c22275edbf7238cd9b

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411jv10.dts
kirkwood-ds411jv10.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 11 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
1dbfc37410aa9a0c2506e3e6d9d6127f
sha256:
5fcf983910a9b73baaa6ea6ca25b70be5ed045a5788eacc0ef0b0ac6d9f294bf

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 09 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
80174e41e18f33d917503c8b70b19765
sha256:
09e8d02d724dd6079049445e61c7f05fb6fc912c1fe283fd506c0252d0c5205f

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.

=================
Update 05 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
7f6bb7d8ba7acd1e9d532af6066fc361
sha256:
9a29eadfe4ccba9146ec01098a7b6f1823a3645e611e933adb4679578f700996

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.

=================
Update 04 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
aae8a31b4380acbaf138fbd53ca38fba
sha256:
2702814c80c26b9b0973a3d003f3ec45d77660d28227828ae6e66f52c8f5b4d4

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 02 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
a05e9aba372697e53d00737ebf0d1dd4
sha256:
574820cee50ad9e334fed57d7f0fd8edc04fae551434c546f315b2bdf42d0799

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.

=================
Update 01 Oct 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
185bf6c61fcb679c853d02010d51c5bb
sha256:
46fbe3ada2acc764b5f2fe03bb8785b9c7635d89500e1ad69e857f307afb3937

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 30 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
ac26df3b14d3fa7bf98906e91b77792e
sha256:
ee80f899c4bb3c1d6b7e774da4dc918651cecd1b82b1f07a679dcc3d058e3876

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 28 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
1e2adf875bdcdb8ae43afd47d7d81929
sha256:
380da4f7003801207c7a16ac3da6d78696a1be162e4f4bce04434665763d525d

There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 26 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
53c2f137e946517b2f792c247b300122
sha256:
39f50601260539bc8add2efa896e3565c1f5d44d0b7084cecc466290e2219506
There are 5 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dts
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 24 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
08ffa63a5aa62609ea0c4520ec9196f6
sha256:
21a643be3765dcb3349c3fb806b818befed4440328a599daffb0ddb3e419dfcf
There are 4 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
kirkwood-ds411j.dtb
README.txt

As always, please verify the hash of your download.


=================
Update 23 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
e8091f9a18fb92949fa911ffd08a4392
sha256:
37ae17aecb947d30622d3cd2e851376787de46e1da78aebd27a54fd810dc4d73
There are 3 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
README.txt

As always, please verify the hash of your download.


=================
Update 22 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
6f49197c9a10f83ad10f30141ac8d4b6
sha256:
7464c6bc8245c85bbb1729485edbe283aa5f950242db1b82c4bbcea8299fa24c

There are 3 files in this tarball.
uboot.2023.04-tld-1.ds411j.kwb
uboot.2023.04-tld-1.ds411j.environment
README.txt

As always, please verify the hash of your download.

=================
Update 21 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5: 
991a1e339d773c2c2bb0c03fe21baf0b
sha256:
b4e4f66cbfd79e92a8fa47b6b1681125294b2abf9f7c2541c6412f47d9bf36a1

As always, please verify the hash of your download.

=================
Initial version 19 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5: 
8fdad1a0d77f6d63189bc5387ac998b1
sha256:
cc276e6d68fd629e8e4a8df727692c16504a926410758849996b77284238c4ef

As always, please verify the hash of your download.

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



Edited 20 time(s). Last edit at 10/14/2023 05:50PM by bodhi.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 19, 2023 04:35PM
Reserved.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 21, 2023 12:48PM
Bodhi,

initial uboot-load:
remote some unecessary procentage load line.
sudo kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2023.04-tld-1.ds411j.kwb -p

kwboot version 2022.01+dfsg-2ubuntu2.4
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...-
Waiting 2s and flushing tty
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (477120 bytes)...
  0 % [......................................................................]
 99 % [..................                                                    ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Sep 18 2023 - 20:47:35 -0700)
Synology DS411j

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
Core:  16 devices, 12 uclasses, devicetree: separate
Loading Environment from SPIFlash... jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet-controller@72000 (eth0) using random MAC address - 5a:94:08:9e:f1:40
eth0: ethernet-controller@72000
Warning: ethernet-controller@76000 (eth1) using random MAC address - 02:99:21:58:dc:f6
, eth1: ethernet-controller@76000
Hit any key to stop autoboot:  0 
DS411J>
DS411J only has one NIC

env:
DS411J> print
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootdelay=10
eth1addr=02:99:21:58:dc:f6
ethaddr=5a:94:08:9e:f1:40
fdtcontroladdr=7b6acf0
loadaddr=0x800000
mtdparts=mtdparts=spi0.0:4M(uboot)
ver=U-Boot 2023.04-tld-1 (Sep 18 2023 - 20:47:35 -0700)\
Synology DS411j

Environment size: 315/65532 bytes
DS411J>

kernel boot:

DS411J> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
DS411J> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
DS411J> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
DS411J> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
DS411J> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
DS411J> setenv bootcmd 'usb reset; run usb_bootcmd; usb stop; reset'
DS411J> setenv devices usb sata
DS411J> setenv dtb_file /boot/dts/kirkwood-ds411j.dtb
DS411J> boot
resetting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
5456860 bytes read in 1430 ms (3.6 MiB/s)
9671091 bytes read in 413 ms (22.3 MiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.13.6-kirkwood-tld-1
   Created:      2023-09-14  20:38:51 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5456796 Bytes = 5.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02100000 ...
   Image Name:   initramfs-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   1:06:32 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9671027 Bytes = 9.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
Working FDT set to 0


Starting kernel ...

   Loading Kernel Image
   Loading Ramdisk to 0722d000, end 07b66173 ... OK
FDT and ATAGS support not compiled in

resetting ...
it just hangs on resetting

fans are still same full speed both, no changes on boot of uboot/kernel.



Edited 3 time(s). Last edit at 09/21/2023 01:31PM by dmb4312.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 21, 2023 01:39PM
Ah OK. I'll upload a new version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 21, 2023 04:50PM
See the first post for 21 Sept version.

Quote

Update 21 Sept 2023

Download at Dropbox
uboot.2023.04-tld-1.ds411j.bodhi.tar
md5:
991a1e339d773c2c2bb0c03fe21baf0b
sha256:
b4e4f66cbfd79e92a8fa47b6b1681125294b2abf9f7c2541c6412f47d9bf36a1

The fan issue is not taken into consideration in this version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 21, 2023 11:15PM
boot:

kwboot version 2022.01+dfsg-2ubuntu2.4
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...-
Waiting 2s and flushing tty
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (479820 bytes)...
  0 % [......................................................................]
 98 % [.......................................                               ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Sep 21 2023 - 14:21:30 -0700)
Synology DS411j

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
Core:  16 devices, 12 uclasses, devicetree: separate
Loading Environment from SPIFlash... jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet-controller@72000 (eth0) using random MAC address - ba:e8:e7:09:2b:f4
eth0: ethernet-controller@72000
Warning: ethernet-controller@76000 (eth1) using random MAC address - 8e:4b:7d:eb:9b:9a
, eth1: ethernet-controller@76000
Hit any key to stop autoboot:  0 
DS411J>

variables:
DS411J> print
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=if run load_uimage; then; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else b
ootm $load_uimage_addr; fi; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb sata
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-ds411j.dtb
eth1addr=8e:4b:7d:eb:9b:9a
ethaddr=ba:e8:e7:09:2b:f4
fdtcontroladdr=7b69cd0
if_netconsole=ping $serverip
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x2c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
loadaddr=0x800000
mtdparts=mtdparts=spi0.0:4M(uboot)
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_sata "sata init";  setenv scan_mmc "mmc rescan"; 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 $s
can_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=echo Initializing devices...; setenv init_usb usb start;  setenv init_sata sata init;  setenv init_mmc mmc rescan; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15
ver=U-Boot 2023.04-tld-1 (Sep 21 2023 - 14:21:30 -0700)\
Synology DS411j

Environment size: 2725/65532 bytes

kernel:
se attached boot-log
Attachments:
open | download - 21-sep.bodhi.uboot.kernel.txt (28.6 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 12:15AM
dmb4312,

Fantastic! that was a very good test. We're getting quite close to make it a permanent u-boot. Looks like most everything is working.

Now the remaining issues are the SPI flash and gpio-fan.

=======

The current way you are booting is same as with stock u-boot. The DTB is not loaded separately, but it is embedded in the uImage.

DS411J> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
DS411J> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
DS411J> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
DS411J> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
DS411J> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
DS411J> setenv bootcmd 'usb reset; run usb_bootcmd; usb stop; reset'
DS411J> setenv devices usb sata
DS411J> setenv dtb_file /boot/dts/kirkwood-ds411j.dtb

With the new u-boot, the DTB should be loaded separately. And while we correct that, we'll make it so you will not need to enter anything in serial console.

I will make it a separate post tomorrow.

======

The SPI flash issue is that we don't know the make and model. It must be an old chip. The JEDEC bytes don't have anything in it. It is indicative of an old chip type that we need to know the exact make and model to code it in the u-boot and kernel DTS.

u-boot does not know which chip:
Loading Environment from SPIFlash... jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00
Stock kernel did not print out the info
[   45.050000] SPI Serial flash detected @ 0xf8000000, 4096KB (64sec x 64KB)

The new kernel detected the chip but did not print out make and model:
[   10.337020][    T1] spi-nor spi0.0: found m25p32, expected m25p80
[   10.343316][    T1] spi-nor spi0.0: m25p32 (4096 Kbytes)
[   10.348718][    T1] 6 fixed-partitions partitions found on MTD device spi0.0
The key thing here is m25p32, so I will revise the DTS for u-boot to see if it will be able initialize the chip correctly.

We cannot flash the new u-boot yet, because we need to initialize the SPI flash while u-boot is running.

If you can, open up the box and take a high-res pic of the board. The SPI chip usually has a marking that show the model name.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 01:00AM
Bodhi,

strange that it kernel sees one chip and expects another:
[   10.337020][    T1] spi-nor spi0.0: found m25p32, expected m25p80
[   10.343316][    T1] spi-nor spi0.0: m25p32 (4096 Kbytes)

this might be the m25p32
m25p32

and
m25p80


Im at work for at least 8 more hours, I will check the flash imprint and report back later.

I have access to the system though, let me know if there is anything that might be of interest from the debian.
thanks.



Edited 2 time(s). Last edit at 09/22/2023 01:15AM by dmb4312.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 01:09PM
Hi Bodhi,

please see attached photo:

it looks like its ST Microelectronics M25P32V6P SOP16 chip

I cant seems to find matching datasheet anywhere
I found this which is ST m25p32 datasheet.
I hope this can be useful

link to full image:
m25p32v6p



Edited 1 time(s). Last edit at 09/22/2023 01:10PM by dmb4312.
Attachments:
open | download - m25p32v6p.jpg (434.3 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 02:27PM
dmb4312,

Definitely! that confirmed the name of the flash.

I've uploaded a new version, see the 1st post.

You could try kwboot now. But I will post a few steps in a new post below, so you won't have to enter the envs each time.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 02:39PM
Now you have booted the box using kwboot with new u-boot.

With this new u-boot, the DTB file should be loaded separately. So the uImage must be the original, which does not have the DTB file embedded in it (if the DTB is loaded and also embedded, it will cause a conflict).

So do this correction:

Log into Debian and

cd /boot
cp -a uImage uImage.411j.with.dtb
cp -a uImage.orig uImage
sync

Start kwboot with the latest ds411j u-boot image on the other Linux box.

And then reboot this ds411j (or cold start). Let it boot automatically, it should load uImage, uInitrd, and DTB file and start Debian.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 04:22PM
Bodhi,

I seemed to had deleted the uImage.orig file while testing earlier.

So I extracted it from the
3414d7ad038b402836f232a575d3433f  Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2
and copied the uImage to the /boot/ of the USB previously having renamed dtb-containing uImage, all done logged in as root. so it should be fine now

root@debian:~# ls -la /boot
total 57696
drwxr-xr-x  3 root root    4096 Sep 22  2023 .
drwxr-xr-x 21 root root    4096 Sep 23  2021 ..
-rw-r--r--  1 root root 4403336 Jul 31  2021 System.map-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root  183927 Jul 31  2021 config-5.13.6-kirkwood-tld-1
drwxr-xr-x  2 root root    4096 Aug  1  2021 dts
-rw-r--r--  1 root root 9671027 Sep 23  2021 initrd.img-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root 7762080 Aug  1  2021 linux-headers-5.13.6-kirkwood-tld-1_1.0_armel.deb
-rw-r--r--  1 root root 5435888 Sep 22  2023 uImage
-rw-r--r--  1 root root 5456860 Sep 14  2023 uImage.ds411j.with.dtb
-rw-r--r--  1 root root 9671091 Sep 23  2021 uInitrd
-rwxr-xr-x  1 root root 5435824 Jul 31  2021 vmlinuz-5.13.6-kirkwood-tld-1
-rwxr-xr-x  1 root root 5435824 Aug  1  2021 zImage-5.13.6-kirkwood-tld-1
-rwxr-xr-x  1 root root 5456796 Sep 14  2023 zImage.fdt
root@debian:~# md5sum /boot/uImage
6ec6c40860fcf45d8fa6bbd31c09dc4e  /boot/uImage

used uboot:
91b20b9ea28ea8d90326542fbb8bbd3a  uboot.2023.04-tld-1.ds411j.kwb

it seems that there are some errors when booting now opposed to previous manual run
the system is responding and I can login both via console/ssh
the boot process is attached



Edited 1 time(s). Last edit at 09/22/2023 04:30PM by dmb4312.
Attachments:
open | download - 22-sep.bodhi.uboot.autoboot-1.txt (34.1 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 22, 2023 06:09PM
dmb4312,

Cool! that worked without any problem.

> it seems that there are some errors when booting
> now opposed to previous manual run

The errors you saw were not really errors. They were warnings only.

U-Boot 2023.04-tld-1 (Sep 22 2023 - 12:09:32 -0700)
Synology DS411j

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
Core:  15 devices, 11 uclasses, devicetree: separate
Loading Environment from SPIFlash... Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment
We know SPI flash is not there yet. But looks like the behavior is different from before. I need to take a closer look.

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet-controller@72000 (eth0) using random MAC address - ca:b9:b1:d5:54:d3
eth0: ethernet-controller@72000
Warning: ethernet-controller@76000 (eth1) using random MAC address - 86:26:d9:e3:fa:69
, eth1: ethernet-controller@76000
I need to take look why there are 2 Ethernet. But those random MAC addresses were expected (we don't have anything on flash yet). We'll make it better temporarily at the bottom of this post.

Hit any key to stop autoboot:  0 
Initializing devices...
starting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Loading envs from usb 0...
Failed to load '/boot/uEnv.txt'
That was OK. Only a warning.

Loading envs from usb 1...
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
Loading envs from usb 2...
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
Loading envs from usb 3...
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Loading envs from sata 0...
** Bad device specification sata 0 **
Couldn't find partition sata 0:1
Can't set block device
Loading envs from sata 1...
** Bad device specification sata 1 **
Couldn't find partition sata 1:1
Can't set block device
Loading envs from sata 2...
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
Loading envs from sata 3...
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
The above are warnings only. We could make the scan less noisy. Again, we'll fix this at the bottom of this post.

running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 11 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
5435888 bytes read in 277 ms (18.7 MiB/s)
loading uInitrd ...
9671091 bytes read in 413 ms (22.3 MiB/s)
loading DTB /boot/dts/kirkwood-ds411j.dtb ...
20972 bytes read in 25 ms (818.4 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   0:22:58 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5435824 Bytes = 5.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   1:06:32 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9671027 Bytes = 9.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02c00000
   Booting using the fdt blob at 0x2c00000
Working FDT set to 2c00000


Starting kernel ...
Nice!

[   10.546629][    T1] spi-nor spi0.0: found m25p32, expected m25p80
[   10.552904][    T1] spi-nor spi0.0: m25p32 (4096 Kbytes)
[   10.558303][    T1] 1 cmdlinepart partitions found on MTD device spi0.0
[   10.564973][    T1] Creating 1 MTD partitions on "spi0.0":
[   10.570496][    T1] 0x000000000000-0x000000400000 : "uboot"
SPI is working in the kernel, as before.

======================

Now let's make the boot more correct. We'll use the uEnv.txt file to adjust the envs on the fly. These envs are transient, so before we can write to flash, we'll keep using this file.

cd /boot
touch uEnv.txt

And then edit this uEnv.txt file to have the following 2 envs:
devices=usb
ethaddr=ba:e8:e7:09:2b:f4

And then
sync

Start kwboot, and then reboot the DS411j. Now it should be quieter during boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 23, 2023 02:26AM
Cool,

looks like uEnv.txt works

Loading envs from usb 0...
38 bytes read in 904 ms (0 Bytes/s)
... envs loaded
importing envs ...


see attached boot-log.
Attachments:
open | download - 22-sep.bodhi.uboot.autoboot-2.txt (33.3 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 23, 2023 01:43PM
I've uploaded the Sep 23 version in the 1st post.

Start kwboot, and then reboot the DS411j. Interrupt u-boot at count down and set the IP address to 192.168.2.14 (or whatever you want this box IP address to be). Assuming your router is 192.168.2.1.

setenv ipaddr 192.168.2.14
Ping the router
ping  192.168.2.1
and then
boot

Log into Debian through SSH, and then
ifconfig -a 
ethtool eth0

=============

If you lost the Ethernet using the new u-boot version. Then kwboot with the Sep 22 version. SSH in and do the same command
ifconfig -a 
ethtool eth0

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 23, 2023 04:09PM
Bodhi,

It lost the NIC with 23sep version.

here is the process:
sudo kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2023.04-tld-1.ds411j.kwb -p
kwboot version 2022.01+dfsg-2ubuntu2.4
Patching image boot signature to UART
Aligning image header to Xmodem block size
Sending boot message. Please reboot the target...-
Waiting 2s and flushing tty
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (479828 bytes)...
  0 % [......................................................................]
 98 % [.......................................                               ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Sep 23 2023 - 11:12:19 -0700)
Synology DS411j

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
Core:  13 devices, 11 uclasses, devicetree: separate
Loading Environment from SPIFlash... Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet-controller@76000 (eth0) using random MAC address - aa:1f:19:69:06:4a
eth0: ethernet-controller@76000
Hit any key to stop autoboot:  0 
DS411J> print
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=if run load_uimage; then; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb sata
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-ds411j.dtb
ethaddr=aa:1f:19:69:06:4a
fdtcontroladdr=7b69cd0
if_netconsole=ping $serverip
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x2c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
loadaddr=0x800000
mtdparts=mtdparts=spi0.0:4M(uboot)
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_sata "sata init";  setenv scan_mmc "mmc rescan"; 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 load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=echo Initializing devices...; setenv init_usb usb start;  setenv init_sata sata init;  setenv init_mmc mmc rescan; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15
ver=U-Boot 2023.04-tld-1 (Sep 23 2023 - 11:12:19 -0700)\
Synology DS411j

Environment size: 2698/65532 bytes
DS411J> setenv ipaddr 192.168.2.14  
DS411J> ping 192.168.2.1
Could not get PHY for ethernet-controller@76000: addr 9
phy_connect failed
ping failed; host 192.168.2.1 is not alive


here are the commands from system booted with 22sep version:
root@debian:~# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.14  netmask 255.255.255.224  broadcast 192.168.2.31
        inet6 fe80::b8e8:e7ff:fe09:2bf4  prefixlen 64  scopeid 0x20<link>
        ether ba:e8:e7:09:2b:f4  txqueuelen 1000  (Ethernet)
        RX packets 112  bytes 29302 (28.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 121  bytes 17530 (17.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 38  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 13  bytes 1766 (1.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 1766 (1.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@debian:~# ethtool eth0
Settings for eth0:
	Supported ports: [ TP	 MII ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full
	                                     100baseT/Half 100baseT/Full
	                                     1000baseT/Full
	Link partner advertised pause frame use: No
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Auto-negotiation: on
	master-slave cfg: preferred slave
	master-slave status: slave
	Port: Twisted Pair
	PHYAD: 8
	Transceiver: external
	MDI-X: Unknown
	Supports Wake-on: d
	Wake-on: d
	Link detected: yes

another thing I noticed is that something must be wrong with scsi/sata bus.
when i try to list the drives by fdisk -l it hangs, same does lshw.
all drives are connected and Im almost certain that I did also have all 4 connected previously and could scan/list drives without problems(I might be mistaken after so many attempts)
This is somethin that you have mentioned earlier.

when accessing SCSI/drives the console is spammed with errors, see the attached log.

################
I also attached autoboot for 23sep uboot version just for information.

Thanks
Attachments:
open | download - 22-sep-scannig-drives-console-output.txt (39.8 KB)
open | download - 23-sep.bodhi.uboot.autoboot-1.txt (34.3 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 23, 2023 05:11PM
dmb4312,

> It lost the NIC with 23sep version.

> DS411J> ping 192.168.2.1
> Could not get PHY for ethernet-controller@76000:
> addr 9
> phy_connect failed
> ping failed; host 192.168.2.1 is not alive

Cool! that told me exactly which ethernet should work. PHY 9 is not the one. The mainline Linux DTS is wrong. Will fix this.

> here are the commands from system booted with
> 22sep version:

> root@debian:~# ethtool eth0
> Settings for eth0:
> Supported ports: [ TP MII ]
> Supported link modes: 10baseT/Half
> 10baseT/Full
> 100baseT/Half
> 100baseT/Full
> 1000baseT/Full
> Supported pause frame use: Symmetric
> Receive-only
> Supports auto-negotiation: Yes
> Supported FEC modes: Not reported
> Advertised link modes: 10baseT/Half
> 10baseT/Full
> 100baseT/Half
> 100baseT/Full
> 1000baseT/Full
> Advertised pause frame use: No
> Advertised auto-negotiation: Yes
> Advertised FEC modes: Not reported
> Link partner advertised link modes: 10baseT/Half
> 10baseT/Full
>
> 100baseT/Half 100baseT/Full
>
> 1000baseT/Full
> Link partner advertised pause frame use: No
> Link partner advertised auto-negotiation: Yes
> Link partner advertised FEC modes: Not reported
> Speed: 1000Mb/s
> Duplex: Full
> Auto-negotiation: on
> master-slave cfg: preferred slave
> master-slave status: slave
> Port: Twisted Pair
> PHYAD: 8
> Transceiver: external
> MDI-X: Unknown
> Supports Wake-on: d
> Wake-on: d
> Link detected: yes
> [/code]

So you've confirmed that the PHY addr is 8 for this box.

> another thing I noticed is that something must be
> wrong with scsi/sata bus.
> when i try to list the drives by fdisk -l it
> hangs, same does lshw.

That fdisk and lshw commands might choke. I think it is probably related to Ethernet problem. For now avoid those, and use other higher level commands to list the disks.

lsblk
or
df -h

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 24, 2023 02:49AM
bodhi Wrote:
-------------------------------------------------------
> Cool! that told me exactly which ethernet should
> work. PHY 9 is not the one. The mainline Linux DTS
> is wrong. Will fix this.
> So you've confirmed that the PHY addr is 8 for
> this box.

Nice!

> That fdisk and lshw commands might choke. I think
> it is probably related to Ethernet problem. For
> now avoid those, and use other higher level
> commands to list the disks.

The time will tell I guess.
Thanks.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 24, 2023 01:57PM
I've uploaded the Sep 24 version in the 1st post.

The DTB file kirkwood-ds411j.dtb should be updated in your rootfs (rename the current DTB in /boot/dts to kirkwood-ds411j.dtb.orig, and copy the new DTB over).

Please do the same network test as described before for Sep 23 version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 25, 2023 01:26PM
Hi Bodhi,

did the test and the nic worked in uboot, not sure why it says Sep 23 2023 here, Im certain that I used correct kwb from Sep 24 uboot version.
508681b544cfbd1ea6a7e7007769d40f  uboot.2023.04-tld-1.ds411j.kwb


[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Sep 23 2023 - 15:48:15 -0700)
Synology DS411j

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
Core:  13 devices, 11 uclasses, devicetree: separate
Loading Environment from SPIFlash... Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet-controller@72000 (eth0) using random MAC address - aa:1f:19:69:06:4a
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0

DS411J> print
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
bootcmd_exec=if run load_uimage; then; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb sata
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-ds411j.dtb
ethaddr=aa:1f:19:69:06:4a
fdtcontroladdr=7b69cb0
if_netconsole=ping $serverip
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x2c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
loadaddr=0x800000
mtdparts=mtdparts=spi0.0:4M(uboot)
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_sata "sata init";  setenv scan_mmc "mmc rescan"; 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 load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=echo Initializing devices...; setenv init_usb usb start;  setenv init_sata sata init;  setenv init_mmc mmc rescan; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15
ver=U-Boot 2023.04-tld-1 (Sep 23 2023 - 15:48:15 -0700)\
Synology DS411j

Environment size: 2698/65532 bytes
DS411J> setenv ipaddr 192.168.2.14
DS411J> ping 192.168.2.1
ethernet-controller@72000 Waiting for PHY auto negotiation to complete........ done
Using ethernet-controller@72000 device
host 192.168.2.1 is alive
DS411J> version
U-Boot 2023.04-tld-1 (Sep 23 2023 - 15:48:15 -0700)
Synology DS411j

gcc (Debian 12.2.0-14) 12.2.0
GNU ld (GNU Binutils for Debian) 2.40
DS411J>
It does use a approx. 2 seconds when waiting for auto-neg to complete but I guess that is as intended.


I also rebooted and waited for it to auto-boot, it loops on disks upon kernel boot:
[  110.599791][   T98] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[  110.607610][   T98] ata3.00: failed command: READ DMA

please see the attached boot-process
Attachments:
open | download - 24-sep.bodhi.uboot-autoboot-1.txt (39.1 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 25, 2023 01:50PM
addition:
24-sep.bodhi.uboot-autoboot-2.txt shows another outcome, this is when I had activated an ip and pinged the gateway in uboot.
so not the same when just letting the box boot on it's own

Edit: I let it run and at the end the login prompt appeared:
see attached rest-boot-log

Edit2: Attached dmesg



Edited 3 time(s). Last edit at 09/25/2023 02:49PM by dmb4312.
Attachments:
open | download - 24-sep.bodhi.uboot-autoboot-2.txt (68.1 KB)
open | download - 24-sep.bodhi.uboot-autoboot-2-rest.txt (61.7 KB)
open | download - dmesg.txt (144.3 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 25, 2023 02:46PM
dmb4312,

Quote

not sure why it says Sep 23 2023 here, Im certain that I used correct kwb from Sep 24 uboot version.

Yes, I started the build on Sep 23, logged out to do real work and logged back in Sep 24 to create the tarball and upload it. So the u-boot banner shows the build date as Sep 23.

The reason I changed the Ethernet node in the DTS: there was a conflict between SATA and Ethernet.

23-sep.bodhi.uboot.autoboot-1.txt

[   10.642589][    T1] kirkwood-pinctrl f1010000.pin-controller: pin PIN20 already requested by f1080000.sata; cannot claim for f1076000.ethernet-controller
[   10.656551][    T1] kirkwood-pinctrl f1010000.pin-controller: pin-20 (f1076000.ethernet-controller) status -22
[   10.666665][    T1] kirkwood-pinctrl f1010000.pin-controller: could not request pin 20 (PIN20) from group mpp20  on device f1010000.pin-controller
[   10.679907][    T1] mv643xx_eth f1076000.ethernet-controller: Error applying setting, reverse things back
[   10.689574][    T1] mv643xx_eth: probe of f1076000.ethernet-controller failed with error -22

But it got worse :)

It seems we need to go back to the DTB on Sep 23 for the rootfs and work from there again.

=========

1. Please restore the DTB in the rootfs /boot/dts to the default like before. and kwboot with Sep 24 u-boot again. If Ethernet works, i.e you can SSH in, keep the serial boot log as the 1st run.

2. Ugrade the kernel to linux-6.4.11-kirkwood-tld-1. And make a 2nd run with the new DTB in the Sep 24 tarball. I compiled this DTB in 6.4.11 and did not think it is possible that something got out of sync (it is rarely occurs, but good to know if you can/not run this DTB with kernel 6.4.11).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 25, 2023 03:46PM
Bodhi,
1.
rolled back to original DTB and booted off with sep24 uboot, ethernet works fine as it seems, bootlog attached.

2.
when you say upgrade the kernel to 6.4.11, I assume you mean going through the update instructions in the link you posted.
I will have to do this another sitting as I unfortunately dont have time right now.

I will read and follow it and be back with the results some time tomorrow
Thanks
Attachments:
open | download - 24-sep.bodhi.uboot-autoboot3-orig-dtb.txt (34.1 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 25, 2023 05:35PM
dmb4312,

> 1.
> rolled back to original DTB and booted off with
> sep24 uboot, ethernet works fine as it seems,
> bootlog attached.

Cool!

>
> 2.
> when you say upgrade the kernel to 6.4.11, I
> assume you mean going through the update
> instructions in the link you posted.

Yes. And keep in mind that we are booting with new u-boot (i.e. uImage is original).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 26, 2023 03:28PM
Hi Again,
I found some time to go through the kernel-upgrade
followed everyting and choose 4a step

it booted to 6.4.11 and network seems to work, I got logged in over ssh.

dtb used:
root@debian:/boot/dts# md5sum kirkwood-ds411j.dtb
41690f9e69155b04939c46bd958cf47e  kirkwood-ds411j.dtb

please see the files attached
thanks.



Edited 1 time(s). Last edit at 09/26/2023 03:29PM by dmb4312.
Attachments:
open | download - upgrade-kernel-to-6.4.11-process.txt (7.6 KB)
open | download - 24-sep.bodhi.uboot-autoboot-3-new-dtb+6.4.11.txt (32.3 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 26, 2023 04:57PM
dmb4312,

> it booted to 6.4.11 and network seems to work, I
> got logged in over ssh.

Fantastic! we no longer see the conflict between SATA and Ethernet GPIOs.

======

Note that you did not extract the DTB tarball when you upgraded the kernel.
tar -xf  linux-dtb-6.4.11-kirkwood-tld-1.tar

So the DTB should be the Sep 24 uboot.2023.04-tld-1.ds411j.bodhi.tar version:
-rw-r--r-- 1 root root  21212 Sep 23 15:59 kirkwood-ds411j.dtb
Also the md5sum matches with what you've posted.

======

Ok so moving on to the SPI flash issue. We seem to have lost the SPI flash in this kernel DTS version. I'll upload another DTB for testing.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 26, 2023 07:11PM
I've uploaded the u-boot 26 Sept 2023 version in the 1st post.

See if the SPI flash behavior is better in u-boot and kernel (should be the same for everything else).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 27, 2023 01:40AM
bodhi
> Fantastic! we no longer see the conflict between
> SATA and Ethernet GPIOs.
Thats awesome.

> Note that you did not extract the DTB tarball when
> you upgraded the kernel.
>
> tar -xf  linux-dtb-6.4.11-kirkwood-tld-1.tar
>
>
> So the DTB should be the Sep 24
> uboot.2023.04-tld-1.ds411j.bodhi.tar version:
>
> -rw-r--r-- 1 root root  21212 Sep 23 15:59
> kirkwood-ds411j.dtb
>
> Also the md5sum matches with what you've posted.
Yes, that what I was trying to, to use your lastest dtb, was that not how you'd want it?

> ======
>
> Ok so moving on to the SPI flash issue. We seem to
> have lost the SPI flash in this kernel DTS
> version. I'll upload another DTB for testing.

I will test this in couple of days, not physically possible now.

Thanks
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 28, 2023 11:16AM
Hi Bodhi,

so I tested with new dtb you had attached with 26sep version by copying to /boot/dts
didn't do anything with dts file as Im unsure if and where it should be used.
booted using 26sep uboot version

looks like there is same warning regarding spi flash.

log attached



Edited 2 time(s). Last edit at 09/28/2023 11:18AM by dmb4312.
Attachments:
open | download - 26-sep.bodhi.uboot-autoboot-1-new-dtb.txt (33.1 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 28, 2023 01:11PM
dmb4312,

> so I tested with new dtb you had attached with
> 26sep version by copying to /boot/dts
> didn't do anything with dts file as Im unsure if
> and where it should be used.

I've included the DTS so we can see what I've changed on top of the mainline DTS. Just for information.

> booted using 26sep uboot version
>
> looks like there is same warning regarding spi
> flash.

OK. Fact that we lost the SPI flash in the kernel with this DTS version, and the u-boot error is about SPI chip select.

Suspiciously, stock u-boot does not use the envs in flash.
U-Boot 1.1.4 (Jul 14 2010 - 20:36:08) Marvell version: 3.4.4

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 0068B3B4

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 480Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM CAS Latency = 6 tRP = 6 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
[4096kB@f8000000] Flash:  4 MB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
Using default environment
So I think Synology had similar problem and could not solve it (or intentially ignored it) so they just configured the envs as internal only. The boot device strapping of this board might have been set to the wrong value.

I'll give it some more thought and come back with a new u-boot and DTS version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: