Welcome! Log In Create A New Profile

Advanced

2023.04 U-Boot Kirkwood - Synology DS411j

Posted by bodhi 
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j (and possibly 413j)
September 28, 2023 01:54PM
Thanks for the explanation.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 29, 2023 01:57PM
I've uploaded the 28 Sept 2023 u-boot version.

Please try again to see if SPI behavior is different.

Also, after logged in to Debian,

cat /etc/fw_env.config
cat /proc/mtd
mtdinfo -a

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 29, 2023 03:30PM
Bodhi,

looks like there is a change in behavior, check the bootlog.

here are the commands you've asked for
>cat /etc/fw_env.config
root@debian:~# cat /etc/fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
root@debian:~#
>cat /proc/mtd
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00010000 "uboot"
root@debian:~#
>mtdinfo -a
root@debian:~# mtdinfo -a
Count of MTD devices:           1
Present MTD devices:            mtd0
Sysfs interface supported:      yes

mtd0
Name:                           uboot
Type:                           nor
Eraseblock size:                65536 bytes, 64.0 KiB
Amount of eraseblocks:          64 (4194304 bytes, 4.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:0
Bad blocks are allowed:         false
Device is writable:             true

root@debian:~#

also found some info-commands which I ran:
root@debian:~# 
root@debian:~# ls -la /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
root@debian:~#
root@debian:~# realpath /sys/class/spi_master/spi0/device/driver
/sys/bus/platform/drivers/orion_spi
root@debian:~#
root@debian:~# cat /sys/bus/spi/devices/spi0.0/modalias
spi:m25p80
root@debian:~#
root@debian:~# xxd -ps /sys/bus/spi/devices/spi0.0/driver_override
0a

i guess we are post this already:
https://stackoverflow.com/questions/74135141/jedec-spi-nor-not-executing-in-linux-kernel


thanks
Attachments:
open | download - 28-sep.bodhi.uboot-autoboot-1-new-dtb.txt (40.9 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 29, 2023 04:04PM
dmb4312,

> i guess we are post this already:
> https://stackoverflow.com/questions/74135141/jedec-spi-nor-not-executing-in-linux-kernel

Yes. We know it is m25p32, not m25p80. The kernel handled it OK.

[    5.870794][    T1] spi-nor spi0.0: found m25p32, expected m25p80
[    5.877088][    T1] spi-nor spi0.0: m25p32 (4096 Kbytes)

Bad news is u-boot got worse in this version :) so we will need another update for u-boot.

=====

After that, we'll flash the new u-boot to SPI. Even though the envs cannot be accessed in u-boot yet, it would be OK for now. The BootROM will be able to load u-boot from the SPI flash and start it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 29, 2023 04:19PM
In the mean time, could you do this test.

kwboot with Sep 26 version (keep the rootfs as is, ie. Sep 28 DTB).

Interrupt u-boot countdown and,

setenv ipaddr 192.168.2.14  
ping 192.168.2.1
flinfo
sf probe 0
sf probe 1

And post the log here. You could boot all the way into Debian, but I'm only interested in seeing the u-boot log.

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



Edited 1 time(s). Last edit at 09/29/2023 04:35PM by bodhi.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 29, 2023 05:05PM
the "flinfo" command is missing:

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 (479812 bytes)...
  0 % [......................................................................]
[truncated]
 98 % [.......................................                               ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2023.04-tld-1 (Sep 26 2023 - 16:24:37 -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 - 6e:bc:70:96:b1:64
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0 
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> flinfo
Unknown command 'flinfo' - try 'help'
DS411J> sf probe 0
Invalid bus 0 (err=-19)
DS411J> sf probe 1
Invalid bus 0 (err=-19)
DS411J> 


Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 30, 2023 05:03PM
I've uploaded the 30 Sept 2023 u-boot version.

There is no change in the DTB for the kernel. Only u-boot image is new.

kwboot with this new u-boot. Interrupt the count down and,

printenv
flinfo
dm tree
and then
boot

Login to Debian,

mtdinfo -a
cat /proc/mtd

And post the serial console log here!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
September 30, 2023 05:59PM
Bodhi,
flinfo does not return anything,

please see attached log.
Attachments:
open | download - 30-sep.bodhi.uboot-1.txt (38.8 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 01, 2023 02:30PM
dmb4312,

I've uploaded the 01 Oct 2023 u-boot version in the 1st post.

There is no change in the DTB for the kernel. Only u-boot image is new.

kwboot with this new u-boot. Interrupt the count down and,

printenv
dm tree
and then
boot

Login to Debian,
mtdinfo -a
cat /proc/mtd

And post serial console log as usual.

======

This is hopefully the last version before we flash it to SPI. I will write a separate post for that.

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



Edited 1 time(s). Last edit at 10/01/2023 02:31PM by bodhi.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 01, 2023 03:01PM
bodhi,
here you go, log attached.
Attachments:
open | download - 01-oct.bodhi.uboot-1.txt (38.7 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 01, 2023 04:17PM
Flashing instruction

1. In Debian, verify the mtds definition as following

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00300000 00010000 "data"

2. Backup the current mtds

dd if=/dev/mtd0 of=mtd0.ds411j bs=512k conv=sync
dd if=/dev/mtd1 of=mtd1.ds411j bs=64k conv=sync
dd if=/dev/mtd2 of=mtd2.ds411j bs=3072k conv=sync

3. Flash the new u-boot

flashcp -v uboot.2023.04-tld-1.ds411j.kwb  /dev/mtd0
expected output
Erasing blocks: 8/8 (100%)
Writing data: 512k/512k (100%)
Verifying data: 512k/512k (100%)

4. Adjust the env location

echo "/dev/mtd1 0x00000 0x10000 0x10000" > /etc/fw_env.config

5. Run your serial consle server (picocom/minicom)

And then cross your finger, and reboot

sync
shutdown -r now

Please post the serial bootlog (if any :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 06:37AM
Hi bodhi,
followed the instructions but the verification of written mtd0 is failing.

>1. In Debian, verify the mtds definition as following

>cat /proc/mtd
>dev: size erasesize name
>mtd0: 00080000 00010000 "u-boot"
>mtd1: 00010000 00010000 "u-boot-env"
>mtd2: 00300000 00010000 "data"
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00300000 00010000 "data"


>2. Backup the current mtds

>dd if=/dev/mtd0 of=mtd0.ds411j bs=512k conv=sync
>dd if=/dev/mtd1 of=mtd1.ds411j bs=64k conv=sync
>dd if=/dev/mtd2 of=mtd2.ds411j bs=3072k conv=sync
root@debian:~# dd if=/dev/mtd0 of=mtd0.ds411j bs=512k conv=sync
1+0 records in
1+0 records out
524288 bytes (524 kB, 512 KiB) copied, 0.863565 s, 607 kB/s
root@debian:~# dd if=/dev/mtd1 of=mtd1.ds411j bs=64k conv=sync
1+0 records in
1+0 records out
65536 bytes (66 kB, 64 KiB) copied, 0.109435 s, 599 kB/s
root@debian:~# dd if=/dev/mtd2 of=mtd2.ds411j bs=3072k conv=sync
1+0 records in
1+0 records out
3145728 bytes (3.1 MB, 3.0 MiB) copied, 5.17675 s, 608 kB/s

root@debian:~# scp 192.168.2.18:/srv/tftp/uboot.2023.04-tld-1.ds411j.kwb . 
root@debian:~# md5sum uboot.2023.04-tld-1.ds411j.kwb 
77bffd254cb9c512b1fceca5c10be39b  uboot.2023.04-tld-1.ds411j.kwb


>3. Flash the new u-boot

>flashcp -v uboot.2023.04-tld-1.ds411j.kwb /dev/mtd0
>expected output
>Erasing blocks: 8/8 (100%)
>Writing data: 512k/512k (100%)
>Verifying data: 512k/512k (100%)

root@debian:~# flashcp -v uboot.2023.04-tld-1.ds411j.kwb  /dev/mtd0
Erasing blocks: 8/8 (100%)
Writing data: 512k/512k (100%)
Verifying data: 10k/512k (1%)File does not seem to match flash data. First mismatch at 0x00000000-0x00002800
root@debian:~# flashcp -v uboot.2023.04-tld-1.ds411j.kwb  /dev/mtd0
Erasing blocks: 8/8 (100%)
Writing data: 512k/512k (100%)
Verifying data: 10k/512k (1%)File does not seem to match flash data. First mismatch at 0x00000000-0x00002800
Might the flash be corrupted?
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 01:42PM
dmb4312,

Reboot without kwboot, does it still boot into stock u-boot? if it does, interrupt the countdown and

help
flinfo

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 02:13PM
bodhi Wrote:
-------------------------------------------------------
> dmb4312,
>
> Reboot without kwboot, does it still boot into
> stock u-boot? if it does, interrupt the countdown
> and
>
>
> help
> flinfo
>

yes, it does start with stock uboot:
OPTIONS: I18n                                                                
Port /dev/ttyUSB0, 21:11:37                                                  
                                                                             
Press CTRL-A Z for help on special keys                                      
                                                                             
�                                                                            
         __  __                      _ _                                     
        |  \/  | __ _ _ ____   _____| | |                                    
        | |\/| |/ _` | '__\ \ / / _ \ | |                                    
        | |  | | (_| | |   \ V /  __/ | |                                    
        |_|  |_|\__,_|_|    \_/ \___|_|_|                                    
 _   _     ____              _                                               
| | | |   | __ )  ___   ___ | |_                                             
| | | |___|  _ \ / _ \ / _ \| __|                                            
| |_| |___| |_) | (_) | (_) | |_                                             
 \___/    |____/ \___/ \___/ \__|  ** LOADER **                              
 ** MARVELL BOARD: Synology Disk Station LE                                  
                                                                             
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


CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PCI 0: PCI Express Root Complex Interface
PEX interface detected Link X1

Synology Model: DS411j
Fan Status: Not Good
Fan 1: Not Good

Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0 
Marvell>> 
Marvell>> 
Marvell>> help
?       - alias for 'help'
SatR - sample at reset sub-system, relevent for DB only
base    - print or set address offset
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bubt    - Burn an image on the Boot Flash.
cmp     - memory compare
cp      - memory copy
cpumap - Display CPU memory mapping settings.
crc32   - checksum calculation
echo    - echo args to console
erase   - erase FLASH memory
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
icrc32  - checksum calculation
iloop   - infinite loop on address range
imd     - i2c memory display
imm     - i2c memory modify (auto-incrementing)
imw     - memory write (fill)
inm     - memory modify (constant address)
iprobe  - probe to discover valid I2C chip addresses
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
resetenv        - Return all environment variable to default.
setenv  - set environment variables
sflash  - read, write or erase the external SPI Flash.
tftpboot- boot image via network using TFTP protocol
version - print monitor version
Marvell>> flinfo

Bank # 1: 
Flash Base Address  : 0xf8000000
Flash Model         : ST M25P32
Manufacturer ID     : 0x20
Device Id           : 0x2016
Sector Size         : 64K
Number of sectors   : 64
Page Size           : 256
Write Protection    : All

Marvell>> 

Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 03:03PM
dmb4312,

> yes, it does start with stock uboot:

Cool!

> Marvell>> flinfo
> 
> Bank # 1: 
> Flash Base Address  : 0xf8000000
> Flash Model         : ST M25P32
> Manufacturer ID     : 0x20
> Device Id           : 0x2016
> Sector Size         : 64K
> Number of sectors   : 64
> Page Size           : 256
> Write Protection    : All

Exactly what I want to see. Synology set the write-protect bit for the flash upon power up.

OK. I think we should take this opportunity to solve this problem automatically (not using a work around like I did for other boxes with SPI). I'll be back in a bout 30-60 minutes for Oct 2 version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 03:38PM
dmb4312,

Please kwboot with the Oct 2 version. And try flashing this u-boot image in Debian, as described in the above post.

https://forum.doozan.com/read.php?3,135762,135883#msg-135883

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 04:05PM
bodhi,
that didn't work very well, same error.
check the attached log.
Attachments:
open | download - 02-oct.bodhi.uboot-1.txt (35 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 04:53PM
dmb4312,

> that didn't work very well, same error.
> check the attached log.

Ah OK. What I changed was not even coming to play. It's the same problem recognizing the SPI flash. I'll need to look into the Synology GPL source for hint (untortunately this ds411j was not explicitly patched in there, so it'll take some time to figure out).

In the meantime, what we should do is using the workaround approach. Let me revise the flashing instruction sometime later today.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 02, 2023 10:15PM
A. Boot the box with stock u-boot using serial console and tftp as described in

https://forum.doozan.com/read.php?2,102054,105374#msg-105374

Reminder: the rootfs uImage must be the one with embedded DTB.

B. Repeat Step A, but this time and adjust the envs in section 2b

2.b Boot the box

Power up, interrupt u-boot count down, and then,

setenv ipaddr 192.168.0.100
setenv serverip 192.168.0.200
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial mtdparts=spi0.0:512K@0x0(u-boot),64K@0xC0000(u-boot-env),3M@0x100000(data)'
mw 0x800000 0 1
tftpboot 0x800000 uImage
tftpboot 0x2100000 uInitrd

and then

printenv
protect off all
bootm 0x800000 0x2100000


Log in to Debian, and flash new u-boot.


C. Flashing new u-boot

See instruction in previous post:

https://forum.doozan.com/read.php?3,135762,135883#msg-135883

If the flashing was successful, restore the uImage using /boot/uImage.orig in the rootfs, and then reboot.

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



Edited 2 time(s). Last edit at 10/02/2023 10:18PM by bodhi.
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 03, 2023 08:09AM
bodhi,

Success, or I think it is. :)

after flashing and reboot the console didn't output anything so I hard-booted it. console output again and the box autobooted with your uboot. (oct 2)

Im attaching log-files for reference


1. I see that the fans are going full-speed, so I had this single 150mm connected to have some airflow over the board without an airplane beside me.

2. If I would to do a fresh install of 6.4.11 (or a later kernel)
what would the procedure be?

backing up /boot/dts/kirkwood-ds411j.dtb file
backup up /boot/uEnv.txt
backup /etc/fw_env.config
and do the basic installation of 5.13.6
restore the files
upgrade to 6.4.11(not rewriting the dtb)
enjoy?



Edited 2 time(s). Last edit at 10/03/2023 08:13AM by dmb4312.
Attachments:
open | download - bodhi.uboot.2oct-autoboot-after.flash.1.txt (29.7 KB)
open | download - flashing-bodhi-uboot-6411-1.txt (47.2 KB)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 03, 2023 01:47PM
dmb4312,

Congrat :)

> Im attaching log-files for reference

The u-boot phase looks great! except for SPI envs, which we worked around using uEnv.txt. So it's fine for now.

Kernel looks good, except 2 minor issues. Now that your box is fully functional as we want, we'll can take time to solve those.

- Fan
- RTC

I think this ds411j must be a variation/update of the original one from way back. The DTS back then should have been tested by somebody before it's got to mainline Linux. But the mainline version does not work fully. So I'm not even sure if there is a RTC chip on this box. And the gpio fan is obviously the wrong one.

RTC is nice to have. You can take a close look at the board again to see if there is a chip marking "s35390a", or some similar name.

But you can also install fake-hwclock to make the clock sane enough for the NTP to work better after a reboot or cold start.


> 2. If I would to do a fresh install of 6.4.11 (or
> a later kernel)
> what would the procedure be?
>
> backing up /boot/dts/kirkwood-ds411j.dtb file
> backup up /boot/uEnv.txt
> backup /etc/fw_env.config
> and do the basic installation of 5.13.6
> restore the files
> upgrade to 6.4.11(not rewriting the dtb)
> enjoy?

Yes!

OTOH, fresh install is not needed. But nice to do that to tool proof the whole installation.

Now you can enjoy the fruit of your labor :)

======

I'd like you to do a test to verify if the SPI flash protection bit will survive a cold start.

- Shutdown the box. Remove the power source, wait a few minutes or hours to drain the charge.
- kwboot with the backup stock mtd0, power up, interrupt count down and check the flash info again.

flinfo

And then just reset to get back to boot the box as normal now (no need to pull the power cord).
reset

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 03, 2023 09:41PM
Fan issue - get some info from stock u-boot.

Please kwboot with the backup mtd0. Interrupt the count down.

Are the fans running? are they running at full speed?

And do

md.l 0xF1010000 8
md.l 0xF1010100 1
md.l 0xF1010140 1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 04, 2023 08:42AM
bodhi Wrote:
-------------------------------------------------------
> dmb4312,
>
> Congrat :)
>
> > Im attaching log-files for reference
>
> The u-boot phase looks great! except for SPI envs,
> which we worked around using uEnv.txt. So it's
> fine for now.
>
> Kernel looks good, except 2 minor issues. Now that
> your box is fully functional as we want, we'll can
> take time to solve those.
>
> - Fan
> - RTC
>
> I think this ds411j must be a variation/update of
> the original one from way back. The DTS back then
> should have been tested by somebody before it's
> got to mainline Linux. But the mainline version
> does not work fully. So I'm not even sure if there
> is a RTC chip on this box. And the gpio fan is
> obviously the wrong one.
>
> RTC is nice to have. You can take a close look at
> the board again to see if there is a chip marking
> "s35390a", or some similar name.
>
> But you can also install fake-hwclock to make the
> clock sane enough for the NTP to work better after
> a reboot or cold start.
Not that important but nice to have correct clock
I will try that, thanks.


>
>
> > 2. If I would to do a fresh install of 6.4.11
> (or
> > a later kernel)
> > what would the procedure be?
> >
> > backing up /boot/dts/kirkwood-ds411j.dtb file
> > backup up /boot/uEnv.txt
> > backup /etc/fw_env.config
> > and do the basic installation of 5.13.6
> > restore the files
> > upgrade to 6.4.11(not rewriting the dtb)
> > enjoy?
>
> Yes!
>
> OTOH, fresh install is not needed. But nice to do
> that to tool proof the whole installation.
Yepp, I was thinking if usb got corrupted.




> Now you can enjoy the fruit of your labor :)
That would be your labor I would say, I just did some testing.
Thanks for your great work!



> ======
>
> I'd like you to do a test to verify if the SPI
> flash protection bit will survive a cold start.
>
> - Shutdown the box. Remove the power source, wait
> a few minutes or hours to drain the charge.
> - kwboot with the backup stock mtd0, power up,
> interrupt count down and check the flash info
> again.
>
>
> flinfo
>
>
> And then just reset to get back to boot the box as
> normal now (no need to pull the power cord).
>
> reset
>

here you go the protection is still off.
Marvell>> flinfo

Bank # 1: 
Flash Base Address  : 0xf8000000
Flash Model         : ST M25P32
Manufacturer ID     : 0x20
Device Id           : 0x2016
Sector Size         : 64K
Number of sectors   : 64
Page Size           : 256
Write Protection    : Off

Marvell>> version

U-Boot 1.1.4 (Jul 14 2010 - 20:36:08) Marvell version: 3.4.4
Marvell>>
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 04, 2023 08:47AM
bodhi Wrote:
-------------------------------------------------------
> Fan issue - get some info from stock u-boot.
>
> Please kwboot with the backup mtd0. Interrupt the
> count down.
>
> Are the fans running? are they running at full
> speed?
>
> And do
>
>
> md.l 0xF1010000 8
> md.l 0xF1010100 1
> md.l 0xF1010140 1
>

The fans are running fine in stock uboot, not at full-speed.

output you requested
Marvell>> md.l 0xF1010000 8
f1010000: 01002222 03303311 33330000 33003333    ""...30...3333.3
f1010010: 00005533 00000000 00000000 00000000    3U..............
Marvell>> md.l 0xF1010100 1
f1010100: 00011000    ....
Marvell>> md.l 0xF1010140 1
f1010140: 0000baa3    ....

when switched to bodhi.uboot the fans are running at full speed:
same command here:

DS411J> md.l 0xF1010000 8
f1010000: 01111111 11113322 00001111 00100000  ...."3..........
f1010010: 00000000 00000000 00000000 00000000  ................
DS411J> md.l 0xF1010100 1
f1010100: 00000000                             ....
DS411J> md.l 0xF1010140 1
f1010140: 00000000                             ....
DS411J> 

Re: (WIP) 2023.04 U-Boot Kirkwood - Synology DS411j
October 04, 2023 12:40PM
> here you go the protection is still off.

> Marvell>> flinfo
>
> Bank # 1:
> Flash Base Address : 0xf8000000
> Flash Model : ST M25P32
> Manufacturer ID : 0x20
> Device Id : 0x2016
> Sector Size : 64K
> Number of sectors : 64
> Page Size : 256
> Write Protection : Off
>

Nice! So now we know the fresh installtion needs to do this once and it will stick.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 04, 2023 01:38PM
dmb4312,

> The fans are running fine in stock uboot, not at
> full-speed.
>
> output you requested
>
> Marvell>> md.l 0xF1010000 8
> f1010000: 01002222 03303311 33330000 33003333   
> ""...30...3333.3
> f1010010: 00005533 00000000 00000000 00000000   
> 3U..............
> Marvell>> md.l 0xF1010100 1
> f1010100: 00011000    ....
> Marvell>> md.l 0xF1010140 1
> f1010140: 0000baa3    ....
> 
>
>
> when switched to bodhi.uboot the fans are running
> at full speed:
> same command here:
>
> 
> DS411J> md.l 0xF1010000 8
> f1010000: 01111111 11113322 00001111 00100000 
> ...."3..........
> f1010010: 00000000 00000000 00000000 00000000 
> ................
> DS411J> md.l 0xF1010100 1
> f1010100: 00000000                            
> ....
> DS411J> md.l 0xF1010140 1
> f1010140: 00000000                            
> ....
> DS411J> 
> 
>

As you can see I did the minimum to get the new u-boot working enough to boot USB rootfs. But the u-boot GPIO settings got nothing in it. Some config is even wrong. If they are all correct, we should be able to boot with SATA rootfs ()and possibly solve the gpio-fan.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 04, 2023 04:18PM
dmb4312,

I've uploaded the Oct 04 version in the first post.

Please kwboot this version. Observe SPI flash and fan behavior. And boot all the way into Debian. Post the serial boot log.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 05, 2023 02:06AM
Hi,

the fans are running full-speed, no change., both in uboot and past.
just spin full speed at start with no behavior changes under boot.

DS411J> md.l 0xF1010000 8
f1010000: 01002222 03303311 00000000 00100000  ""...30.........
f1010010: 00000000 00000000 00000000 00000000  ................
DS411J> md.l 0xF1010100 1
f1010100: 00010000                             ....
DS411J> md.l 0xF1010140 1
f1010140: 00000000                             ....


see full boot-log attached
please dont mind the 4th drive and ethernet as these are disconnected at this time.



Edited 1 time(s). Last edit at 10/05/2023 02:08AM by dmb4312.
Attachments:
open | download - 04-oct.bodhi.uboot-1.txt (33.2 KB)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 05, 2023 02:36PM
dmb4312,

I see. I'm afraid the Fan settings in the DTS might be the wrong one (may be not GPIO 15,16,17).
UPDATE: no, the fan should be set to medium speed and GPIO 16 looks like the correct one.

But I'll build another version and see what'll happen.

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



Edited 1 time(s). Last edit at 10/05/2023 02:54PM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 05, 2023 03:15PM
dmb4312,

I've uploaded the Oct 05 version in the first post.

Please kwboot this version. Dump the GPIOs like you did with md.l command. They should be identical to stock u-boot.

Observe SPI flash and fan behavior. And boot all the way into Debian. Post the serial boot log.

-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: