Welcome! Log In Create A New Profile

Advanced

2023.04 U-Boot Kirkwood - Synology DS411j

Posted by bodhi 
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 10, 2023 03:30PM
dmb4312,

Sorry I did not tell you how. The higher GPIOS are on the 2nd bank.

So when you do
md.l 0xF1010140 1
The result is
0000baa3

Now to set GPIO 34 and 35, you need to use the 2nd bank address, and count backward right to left: bit 32, 33, 34, 35.

0 0 0 0 b a a        3
                     0011 (current value)
                     Set it to 1111 (bit 32, 33, 34, 35)


So
mw.l 0xF1010140 0x0000baaf

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 10, 2023 04:52PM
Bodhi,
so the sata didn't react now either.
DS411J> mw.l 0xF1010140 0x00000aaf
DS411J> sata init                 
DS411J> sata info                 
DS411J> dm tree                   
 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 root          0  [ + ]   root_driver           root_driver
 simple_bus    0  [   ]   simple_bus            |-- mbus@f1000000
 simple_bus    1  [ + ]   simple_bus            `-- ocp@f1000000
 serial        0  [ + ]   ns16550_serial            |-- serial@12000
 serial        1  [   ]   ns16550_serial            |-- serial@12100
 timer         0  [ + ]   orion_timer               |-- timer@20300
 usb           0  [   ]   ehci_mvebu                |-- ehci@50000
 ethernet      0  [ + ]   mvgbe                     |-- ethernet-controller@72000
 ahci          0  [   ]   sata_mv_ahci              `-- sata@80000
 blk           0  [   ]   sata_mv_blk                   |-- sata@80000.blk
 blk           1  [   ]   sata_mv_blk                   |-- sata@80000.blk
 blk           2  [   ]   sata_mv_blk                   |-- sata@80000.blk
 blk           3  [   ]   sata_mv_blk                   `-- sata@80000.blk
DS411J>


but the leds are controlled with bits: 36-43, specifically:

hdd1: 37
0x0000b02f
hdd2: 39
0x0000b08f
hdd3: 41
0x0000b20f
hdd4: 43
0x0000b80f

Will not be able to test much in couple of days.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 10, 2023 04:59PM
dmb4312,

> so the sata didn't react now either.
>
> Will not be able to test much in couple of days.

OK let's take a breather, and I'll upload a new DTB tomorrow or after.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 11, 2023 08:37PM
I've uploaded the Oct 11 version in the first post. Update in this version: Fan and RTC.

Copy the new DTB to your rootfs.

kwboot with this new u-boot. And boot straigth into Debian. Observe the kernel boot log to see if there is any change in RTC and Fan.

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



Edited 3 time(s). Last edit at 10/12/2023 12:44AM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 13, 2023 03:58PM
bodhi Wrote:
-------------------------------------------------------
> I've uploaded the Oct 11 version in the first
> post. Update in this version: Fan and RTC.
>
> Copy the new DTB to your rootfs.
>
> kwboot with this new u-boot. And boot straigth
> into Debian. Observe the kernel boot log to see if
> there is any change in RTC and Fan.


Hi Bodhi,

booted with new uboot and dtb, I think you fixed the RTC and the fan:

[   12.503678][  T162] rtc-rs5c372 0-0032: rs5c372a found, am/pm
[   12.555438][  T162] rtc-rs5c372 0-0032: registered as rtc0
[   12.595439][  T162] rtc-rs5c372 0-0032: setting system clock to 2023-10-14T02:14:42 UTC (1697249682)

the fan is now initialized:
Waiting for /dev to be fully populated...[   27.914197][  T368] gpio-fan gpio-fan-150-15: GPIO fan initialized

edit: attached bootlog



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

> booted with new uboot and dtb, I think you fixed
> the RTC and the fan:
>
>
> [   12.503678][  T162] rtc-rs5c372 0-0032:
> rs5c372a found, am/pm
> [   12.555438][  T162] rtc-rs5c372 0-0032:
> registered as rtc0
> [   12.595439][  T162] rtc-rs5c372 0-0032: setting
> system clock to 2023-10-14T02:14:42 UTC
> (1697249682)
>
>
> the fan is now initialized:
>
> Waiting for /dev to be fully populated...[  
> 27.914197][  T368] gpio-fan gpio-fan-150-15: GPIO
> fan initialized
>
>

Cool!

RTC is working so you can remove the fake hwclock package. Let it run with RTC only to see if time is always correct. if it is not correct after a long shutdown, then the RTC battery is gone.

So fan alarm GPIO 18 is wrong for this box, and has caused a conflict before. I've removed it in this version, but eventually that's something to looked at later (a minor issue that we can ignore for now or completely).

Now you can control the fan manually using the GPIO sys class. Example:

https://forum.doozan.com/read.php?2,12096,35663#msg-35663

However, note the boot log

Not starting fancontrol; run pwmconfig first. ... (warning).

Try fancontrol to see if it works. This SoC 6281 does not have kirkwood-thermal, therefore to activate higher fan speed when CPU or HDD temperature rising, we must use fancontrol, or use some cron script.

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



Edited 1 time(s). Last edit at 10/13/2023 04:38PM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 14, 2023 09:04AM
bodhi Wrote:
-------------------------------------------------------
> dmb4312,
>
> > booted with new uboot and dtb, I think you
> fixed
> > the RTC and the fan:
> >
> >
> > [   12.503678][  T162] rtc-rs5c372 0-0032:
> > rs5c372a found, am/pm
> > [   12.555438][  T162] rtc-rs5c372 0-0032:
> > registered as rtc0
> > [   12.595439][  T162] rtc-rs5c372 0-0032:
> setting
> > system clock to 2023-10-14T02:14:42 UTC
> > (1697249682)
> >
> >
> > the fan is now initialized:
> >
> > Waiting for /dev to be fully populated...[  
> > 27.914197][  T368] gpio-fan gpio-fan-150-15:
> GPIO
> > fan initialized
> >
> >
>
> Cool!
>
> RTC is working so you can remove the fake hwclock
> package. Let it run with RTC only to see if time
> is always correct. if it is not correct after a
> long shutdown, then the RTC battery is gone.
>
> So fan alarm GPIO 18 is wrong for this box, and
> has caused a conflict before. I've removed it in
> this version, but eventually that's something to
> looked at later (a minor issue that we can ignore
> for now or completely).
>
> Now you can control the fan manually using the
> GPIO sys class. Example:
>
> https://forum.doozan.com/read.php?2,12096,35663#msg-35663
>
> However, note the boot log
>
>
> Not starting fancontrol; run pwmconfig first. ...
> (warning).
>
>
> Try fancontrol to see if it works. This SoC 6281
> does not have kirkwood-thermal, therefore to
> activate higher fan speed when CPU or HDD
> temperature rising, we must use fancontrol, or use
> some cron script.

the clock is alive just wrong.

not sure about the fanncontrol though:

root@debian:~# fancontrol
Loading configuration from /etc/fancontrol ...
Error: Can't read configuration file

root@debian:~# pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0 is gpio_fan

Found the following PWM controls:
   hwmon0/pwm1           current value: 255

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon0/fan1_input     current speed: 4200 RPM

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon0/pwm1 ...
  hwmon0/fan1_input ... speed was 4200 now 0
    It appears that fan hwmon0/fan1_input
    is controlled by pwm hwmon0/pwm1
Would you like to generate a detailed correlation (y)? 
    PWM 255 FAN 4200
    PWM 240 FAN 4200
    PWM 225 FAN 4200
    PWM 210 FAN 3800
    PWM 195 FAN 3800
    PWM 180 FAN 3700
    PWM 165 FAN 3700
    PWM 150 FAN 3700
    PWM 135 FAN 3300
    PWM 120 FAN 3300
    PWM 105 FAN 3000
    PWM 90 FAN 3000
    PWM 75 FAN 3000
    PWM 60 FAN 2500
    PWM 45 FAN 2500
    PWM 30 FAN 2200
    PWM 28 FAN 2200
    PWM 26 FAN 2200
    PWM 24 FAN 2200
    PWM 22 FAN 2200
    PWM 20 FAN 2200
    PWM 18 FAN 2200
    PWM 16 FAN 2200
    PWM 14 FAN 2200
    PWM 12 FAN 2200
    PWM 10 FAN 2200
    PWM 8 FAN 2200
    PWM 6 FAN 2200
    PWM 4 FAN 2200
    PWM 2 FAN 2200
    PWM 0 FAN 0
    Fan Stopped at PWM = 0


Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)? 
/usr/sbin/pwmconfig: There are no temperature-capable sensor modules installed

when the pwmconfig is ran the fan stays on 100% speed
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 14, 2023 02:29PM
> the clock is alive just wrong.

It will be set by NTP eventually sometime after the system has booted, or you can manually set it with the date command.

> not sure about the fanncontrol though:

> /usr/sbin/pwmconfig: There are no
> temperature-capable sensor modules installed

It's been a while so I forgot. This box does not have sensor, that will not work. In that case, usually the fan is controlled with cron job, and the temperature could be read from the i2c.

Try verifying the GPIOs control with explicit command as this example.

So

/bin/echo 15 > /sys/class/gpio/export
/bin/echo "out" > /sys/class/gpio/gpio15/direction
/bin/echo 1 > /sys/class/gpio/gpio15/value

See if the fan speed change at all, and also try GPIO 17, too.

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

I've uploaded the Oct 14 u-boot version in the first post.

With this Oct 14 version DTB name change, you'll need to edit the uEnv.txt to add

devices=usb
ethaddr=ba:e8:e7:09:2b:f4
dtb_file=kirkwood-ds411jv10.dtb

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



Edited 2 time(s). Last edit at 10/14/2023 06:02PM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 14, 2023 06:06PM
Please test SATA GPIO 29, 30, and 31 like you did before.

dm tree
# poke GPIO
sata init                 
sata info                 
dm tree

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 15, 2023 03:10AM
bodhi Wrote:
-------------------------------------------------------
> dmb4312,
>
> I've uploaded the Oct 14 u-boot version in the
> first post.
>
> With this Oct 14 version DTB name change, you'll
> need to edit the uEnv.txt to add
>
>
> devices=usb
> ethaddr=ba:e8:e7:09:2b:f4
> dtb_file=kirkwood-ds411jv10.dtb
>

Hi bodhi,

sata test didn't return anything new.
when booting the kernel, it halts after loading kernel.
check the attached bootlog, looks like it can't find the dtb
loading DTB kirkwood-ds411jv10.dtb ...
Failed to load 'kirkwood-ds411jv10.dtb'

the file is there:
have I forgotten something?
~$ ls -la /media/dmb/rootfs/boot/dts/kirkwood-ds411jv10.dtb
-rw-r--r-- 1 root root 21424 okt.  15 09:26 /media/dmb/rootfs/boot/dts/kirkwood-ds411jv10.dtb
~$ 
~$ md5sum /media/dmb/rootfs/boot/dts/kirkwood-ds411jv10.dtb
9ccdc7d610aed7933618791af31b308c  /media/dmb/rootfs/boot/dts/kirkwood-ds411jv10.dtb
~$ cat /media/dmb/rootfs/boot/uEnv.txt
devices=usb
ethaddr=ba:e8:e7:09:2b:f4
dtb_file=kirkwood-ds411jv10.dtb
Attachments:
open | download - 14-oct.bodhi.uboot-1.txt (13.7 KB)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 15, 2023 01:41PM
Hi dmb4312,

> sata test didn't return anything new.

The output of dm tree is interresting. It showed some block devices were detected. And some were removed in the 2nd test, which is a good sign.

- Does each of these disks have a single partition, or any of these has more than 1 partition?
- Do you have a 2.5" HDD you can use for testing? for sanity, in case u-boot does not recognize these Samsung SSDs.

> when booting the kernel, it halts after loading
> kernel.

My bad! that should be:

cat /media/dmb/rootfs/boot/uEnv.txt
devices=usb
ethaddr=ba:e8:e7:09:2b:f4
dtb_file=/boot/dts/kirkwood-ds411jv10.dtb

======

BTW, even though currently u-boot cannot load kernel files from SATA, you can run the box with SATA rootfs: booting with kernel files on USB, but the entire rootfs for the system is on one of these SATA partitions. Basically, the USB can be used for booting only, and the system is on SATA. The setup is quite simple to do.

If you like to keep the rootfs on USB it is OK too. Does not hurt.

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



Edited 2 time(s). Last edit at 10/15/2023 06:38PM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 15, 2023 09:45PM
bodhi Wrote:
-------------------------------------------------------
> BTW, even though currently u-boot cannot load
> kernel files from SATA, you can run the box with
> SATA rootfs: booting with kernel files on USB, but
> the entire rootfs for the system is on one of
> these SATA partitions. Basically, the USB can be
> used for booting only, and the system is on SATA.
> The setup is quite simple to do.

I vaguely remember seeing this but can’t find it now - could you point this out, please? Or maybe I just need better keywords than I’m coming up with….
Thanks bodhi!
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 16, 2023 01:38PM
dhargens,

> > BTW, even though currently u-boot cannot load
> > kernel files from SATA, you can run the box
> with
> > SATA rootfs: booting with kernel files on USB,
> but
> > the entire rootfs for the system is on one of
> > these SATA partitions. Basically, the USB can
> be
> > used for booting only, and the system is on
> SATA.
> > The setup is quite simple to do.
>
> I vaguely remember seeing this but can’t find it
> now - could you point this out, please? Or maybe I
> just need better keywords than I’m coming up
> with….
> Thanks bodhi!

I've helped some users with this but forgot to add to the Wiki. If I can't find those posts, I will write a short how-to for this topic.

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

Here is the instruction for [How-To] boot with Kirkwood kernel files on USB and rootfs on HDD/SSD.

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

Please post related questions in that thread.

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



Edited 3 time(s). Last edit at 10/17/2023 10:30PM by bodhi.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 01:11PM
bodhi Wrote:
-------------------------------------------------------
> Hi dmb4312,
>
> > sata test didn't return anything new.
>
> The output of dm tree is interresting. It showed
> some block devices were detected. And some were
> removed in the 2nd test, which is a good sign.
>
> - Does each of these disks have a single
> partition, or any of these has more than 1
> partition?
> - Do you have a 2.5" HDD you can use for testing?
> for sanity, in case u-boot does not recognize
> these Samsung SSDs.
>
> > when booting the kernel, it halts after loading
> > kernel.
>
> My bad! that should be:
>
> cat /media/dmb/rootfs/boot/uEnv.txt
>
> devices=usb
> ethaddr=ba:e8:e7:09:2b:f4
> dtb_file=/boot/dts/kirkwood-ds411jv10.dtb
>

The box booted fine now, thanks.

I tried to exchange the drive to a HDD with same result; I guess it would've given motor start sound but nothing happens when poking 29-31 and 33-35.
fyi the box boots with all HDD leds on in uboot which go off when the debian is booted.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 01:13PM
bodhi Wrote:
-------------------------------------------------------
> > the clock is alive just wrong.
>
> It will be set by NTP eventually sometime after
> the system has booted, or you can manually set it
> with the date command.
>
> > not sure about the fanncontrol though:
>
> > /usr/sbin/pwmconfig: There are no
> > temperature-capable sensor modules installed
>
> It's been a while so I forgot. This box does not
> have sensor, that will not work. In that case,
> usually the fan is controlled with cron
> job, and the temperature could be read from the
> i2c.
>
> Try verifying the GPIOs control with explicit
> command as
> this
> example
.
>
> So
>
>
> /bin/echo 15 > /sys/class/gpio/export
> /bin/echo "out" >
> /sys/class/gpio/gpio15/direction
> /bin/echo 1 > /sys/class/gpio/gpio15/value
>
>
> See if the fan speed change at all, and also try
> GPIO 17, too.

Bodhi,
this fails with resource busy message:

root@debian:~# /bin/echo 15 > /sys/class/gpio/export
/bin/echo: write error: Device or resource busy

root@debian:~# ls -la /sys/class/gpio/export
--w------- 1 root root 4096 Oct 18 11:03 /sys/class/gpio/export

root@debian:~# ls -la /sys/class/gpio
total 0
drwxr-xr-x  2 root root    0 Oct 18 11:03 .
drwxr-xr-x 49 root root    0 Oct 18 11:02 ..
--w-------  1 root root 4096 Oct 18 11:03 export
lrwxrwxrwx  1 root root    0 Oct 18 11:04 gpiochip0 -> ../../devices/platform/ocp@f1000000/f1010100.gpio/gpio/gpiochip0
lrwxrwxrwx  1 root root    0 Oct 18 11:04 gpiochip32 -> ../../devices/platform/ocp@f1000000/f1010140.gpio/gpio/gpiochip32
--w-------  1 root root 4096 Oct 18 11:04 unexport

root@debian:~# /bin/echo 17 > /sys/class/gpio/export
/bin/echo: write error: Device or resource busy
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 01:28PM
dmb4312,

> I tried to exchange the drive to a HDD with same
> result; I guess it would've given motor start
> sound but nothing happens when poking 29-31 and
> 33-35.

OK. I think we'll have to test the HDD the harder way. Meaning I need to rebuild u-boot with these guessed GPIO built in, and hope one of them will work: 29, 30, 31, and perhaps 33 (GPIO 35 is not the correct one for poking).

> fyi the box boots with all HDD leds on in uboot
> which go off when the debian is booted.

You can test the LEDs in Debian to see which ones behave as expected.

For example, to turn HDD1 Green LED on/off:
echo default-on > /sys/class/leds/synology:green:hdd1/trigger
echo none > /sys/class/leds/synology:green:hdd1/trigger

And set/clear each of these LEDs (they are currently defined in the DTSI and enabled in the DTS).

gpio-leds-hdd-36 {
		status = "disabled";
		compatible = "gpio-leds";
		pinctrl-0 = <&pmx_hddled_36 &pmx_hddled_37 &pmx_hddled_38
			     &pmx_hddled_39 &pmx_hddled_40 &pmx_hddled_41
			     &pmx_hddled_42 &pmx_hddled_43 &pmx_hddled_44
			     &pmx_hddled_45>;
		pinctrl-names = "default";

		hdd1-green {
			label = "synology:green:hdd1";
			gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
		};

		hdd1-amber {
			label = "synology:amber:hdd1";
			gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
		};

		hdd2-green {
			label = "synology:green:hdd2";
			gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
		};

		hdd2-amber {
			label = "synology:amber:hdd2";
			gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
		};

		hdd3-green {
			label = "synology:green:hdd3";
			gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
		};

		hdd3-amber {
			label = "synology:amber:hdd3";
			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
		};

		hdd4-green {
			label = "synology:green:hdd4";
			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
		};

		hdd4-amber {
			label = "synology:amber:hdd4";
			gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
		};

		hdd5-green {
			label = "synology:green:hdd5";
			gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
		};

		hdd5-amber {
			label = "synology:amber:hdd5";
			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
		};
	};

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

Try again as shown in my post above just now.

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

this works but amber and green should be switched around.

amber gives green led and visa-versa as of now. for HDD1 to 4 that is.
tried on hdd5, this does not do anything.



Edited 3 time(s). Last edit at 10/18/2023 02:23PM by dmb4312.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 02:34PM
Im just doing this testing for the sake of testing, this does not bother me at all
I just notice things and report here for you/community being able to track the progress.

If at any time you need to stop testing and do something else please let me know.
when I find time I'm more than happy to help

if there are particular thing you want me to check or test please specify

As of now I see 2 "issues"

1. sata in uboot

2. leds are not in sync:
besides the "hdd"-leds:
only power led is lit, it is constantly blinking/chirping blue(cyan?) about twice per second
neither "status" nor "lan" is on



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

> amber gives green led and visa-versa as of now. for HDD1 to 4 that is.
> tried on hdd5, this does not do anything.

That's exactly what we need to see how the 4 LED behaves, meaning we can correct that in the DTS. And have some hints when I read the GPL source.

Yes, we don't have the 5th HDD so it is normal.

> 2. leds are not in sync:
> besides the "hdd"-leds:
> only power led is lit, it is constantly
> blinking/chirping blue(cyan?) about twice per
> second

> neither "status" nor "lan" is on

That's good to know. I'll take a look. That Power LED blinking chirping is likely to be GPIO 12, which was set when u-boot starts. You can also use the echo method to set the triger to turn it off, too.

These issues are easy to fix permanently in the DTS.


> Im just doing this testing for the sake of
> testing, this does not bother me at all
> I just notice things and report here for
> you/community being able to track the progress.
>
> If at any time you need to stop testing and do
> something else please let me know.
> when I find time I'm more than happy to help

OK. I think it's time to enjoy your box new life :)

I will update u-boot or DTB from time to time to do u-boot SATA and LEDs testing. But less frequent than we've been doing.

=======

Please do this to get the current state of the LEDs and post here.

ls -1 /sys/class/leds/*/trigger | xargs tail -n +1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 03:59PM
Bodhi,
here you go:
root@debian:~# ls -1 /sys/class/leds/*/trigger | xargs tail -n +1
==> /sys/class/leds/synology:alarm/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:amber:hdd1/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:amber:hdd2/trigger <==
none usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 [default-on] panic

==> /sys/class/leds/synology:amber:hdd3/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:amber:hdd4/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:amber:hdd5/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:green:hdd1/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:green:hdd2/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:green:hdd3/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:green:hdd4/trigger <==
[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic

==> /sys/class/leds/synology:green:hdd5/trigger <==
none usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:08:link f1072004.mdio-bus-mii:08:1Gbps f1072004.mdio-bus-mii:08:100Mbps f1072004.mdio-bus-mii:08:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 [default-on] panic


I've also posted test of fan and gpio echo command some posts obove.
thanks.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 04:03PM
just noticed that shutdown command produced the sata errors when halting the box.
as we talked about earlier I now used the shutdown and not init command to bring box to the halt.
not sure if this is intended or some kind of error in context with sata problems in uboot.

root@debian:~# shutdown -h now

INIT: Sending proUsing makefile-style concurrent boot in runlevel 0.
Stopping hotplug events dispatcher: systemd-udevd.
Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Stopping busybox' klogd implementation: klogd1124 (klogd)
Stopped klogd (pid 1124).
.
Stopping busybox' syslogd implementation: syslogd1081 (syslogd)
.
Saving random seed...done.
Stopping NFS kernel daemon: mountd nfsd.
Unexporting directories for NFS kernel daemon....
Asking all remaining processes to terminate...done.
All processes ended within 1 seconds...done.
Stopping RPC port mapper daemon: rpcbind.
Stopping NFS common utilities: idmapd statd.
Saving the system clock to /dev/rtc0.
Hardware Clock updated to Wed Oct 18 14:00:37 PDT 2023.
Deconfiguring network interfaces...Removed stale PID file
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/ba:e8:e7:09:2b:f4
Sending on   LPF/eth0/ba:e8:e7:09:2b:f4
Sending on   Socket/fallback
DHCPRELEASE of 192.168.2.12 on eth0 to 192.168.2.1 port 67
done.
Will now unmount temporary filesystems:umount: /tmp unmounted
.
Will now deactivate swap:.
[10781.905187][ T1473] EXT4-fs (sdb1): re-mounted c54a00b9-fd98-4935-a1ae-5fea6a8a1992 ro. Quota mode: none.
Mounting root filesystem read-only...done.
Will now halt.
logger: 
socket /dev/log
: Connection refused
[10782.044656][ T1479] sd 3:0:0:0: [sde] Synchronizing SCSI cache
[[10782.159985][ T1479] ata4: Unable to stop eDMA


[10848.436154][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10849.536149][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10850.636146][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10851.736141][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10852.836138][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10853.936132][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10855.036187][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10856.136125][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10857.236125][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10858.336116][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10859.436115][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10860.536120][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10861.636118][   T56] ata4: failed to resume link (SControl FFFFFFFF)
[10862.736101][   T56] ata4: failed to resume link (SControl FFFFFFFF)

I have not truncated the output, it hangs couple of minutes and then spits out the endless "failed to resume link" message
the disks are still spinning

here is another shutdown with init command which, this time shuts down perfectly:
root@debian:~# init 0
INIT: Sending processUsing makefile-style concurrent boot in runlevel 0.
Stopping hotplug events dispatcher: systemd-udevd.
Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Stopping busybox' klogd implementation: klogd1122 (klogd)
Stopped klogd (pid 1122).
.
Stopping busybox' syslogd implementation: syslogd1082 (syslogd)
.
Saving random seed...done.
Stopping NFS kernel daemon: mountd nfsd.
Unexporting directories for NFS kernel daemon....
Asking all remaining processes to terminate...done.
All processes ended within 1 seconds...done.
Stopping RPC port mapper daemon: rpcbind.
Stopping NFS common utilities: idmapd statd.
Saving the system clock to /dev/rtc0.
Hardware Clock updated to Wed Oct 18 14:31:30 PDT 2023.
Deconfiguring network interfaces...Removed stale PID file
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/ba:e8:e7:09:2b:f4
Sending on   LPF/eth0/ba:e8:e7:09:2b:f4
Sending on   Socket/fallback
DHCPRELEASE of 192.168.2.12 on eth0 to 192.168.2.1 port 67
done.
Will now unmount temporary filesystems:umount: /tmp unmounted
.
Will now deactivate swap:.
[  720.235082][ T1430] EXT4-fs (sdb1): re-mounted c54a00b9-fd98-4935-a1ae-5fea6a8a1992 ro. Quota mode: none.
Mounting root filesystem read-only...done.
Will now halt.
logger: 
socket /dev/log
: Connection refused
[  720.374657][ T1436] sd 3:0:0:0: [sde] Synchronizing SCSI cache
[  720.380785][ T1436] sd 3:0:0:0: [sde] Stopping disk
[  721.433728][ T1436] sd 2:0:0:0: [sdd] Synchronizing SCSI cache
[  721.439802][ T1436] sd 2:0:0:0: [sdd] Stopping disk
[  722.553725][ T1436] sd 1:0:0:0: [sdc] Synchronizing SCSI cache
[  722.561891][ T1436] sd 1:0:0:0: [sdc] Stopping disk
[  722.569199][ T1436] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  722.603711][ T1436] sd 0:0:0:0: [sda] Stopping disk
[  722.634311][ T1436] reboot: System halted

so we can observe that it sometime does and sometime does not shuts down correctly regardless of command used.



Edited 3 time(s). Last edit at 10/18/2023 04:34PM by dmb4312.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 04:23PM
That's good to know. I'll take a look. That Power LED blinking chirping is likely to be GPIO 12, which was set when u-boot starts. You can also use the echo method to set the triger to turn it off, too.

if you mean like this:
root@debian:~# /bin/echo 12 > /sys/class/gpio/export
root@debian:~# /bin/echo "out" > /sys/class/gpio/gpio12/direction
root@debian:~# /bin/echo 1 > /sys/class/gpio/gpio12/value
root@debian:~# /bin/echo 0 > /sys/class/gpio/gpio12/value
root@debian:~# /bin/echo 0 > /sys/class/gpio/gpio12/value

then it did nothing when tested now.



Edited 1 time(s). Last edit at 10/18/2023 04:23PM by dmb4312.
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 04:33PM
Quote

I've also posted test of fan and gpio echo command some posts obove.

Yes, I saw the GPIO busy error.

Quote

root@debian:~# /bin/echo 17 > /sys/class/gpio/export
/bin/echo: write error: Device or resource busy

This error indicates that the GPIO is currently assigned to a resource using DTS. If it were undefined, then we can export/set/clear. Likewise with the LEDs GPIOs above. When a GPIO is defined, we must use the sysclass to trigger or to set a value.

Find the fan in /sys/class

find  /sys/class -name '*fan*'
And then there are files in gpio-fan that contain the min speed, max speed, and "input". And then you can echo the index value (not the speed) in the speed map to the "input" file. So echo 0 will stop the fan, echo 4 to set it to 3000 RPM, and so on.

gpio-fan,speed-map = <    0 0
                                       2200 1
                                       2500 2
                                       3000 4
                                       3300 3
                                       3700 5
                                       3800 6
                                       4200 7 >;

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

if you mean like this:
root@debian:~# /bin/echo 12 > /sys/class/gpio/export
root@debian:~# /bin/echo "out" > /sys/class/gpio/gpio12/direction
root@debian:~# /bin/echo 1 > /sys/class/gpio/gpio12/value
root@debian:~# /bin/echo 0 > /sys/class/gpio/gpio12/value
root@debian:~# /bin/echo 0 > /sys/class/gpio/gpio12/value

No, we need to find it in /sys/class. See my post immediately above.

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

so we can observe that it sometime does and sometime does not shuts down correctly regardless of command used.

Add that to the TODO list. I need to look at the Poweroff. This board probably has a different Poweroff mechanism, like a few Synology boards that I came across), not a standard one.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 18, 2023 10:54PM
> Add that to the TODO list. I need to look at the
> Poweroff. This board probably has a different
> Poweroff mechanism, like a few Synology boards
> that I came across), not a standard one.

OK. This poweroff driver needs to be configured in kernel, so will be in the next kernel release 6.5.7 (soon).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2023.04 U-Boot Kirkwood - Synology DS411j
October 19, 2023 01:22PM
> No, we need to find it in /sys/class. See my post
> immediately above.

>find /sys/class -name '*fan*'

Bodhi,
this is what I get:
root@debian:~# find  /sys/class -name '*fan*'
/sys/class/devlink/platform:f1010000.pin-controller--platform:gpio-fan-150-15
/sys/class/devlink/platform:f1010100.gpio--platform:gpio-fan-150-15

root@debian:~# ls -la /sys/class/devlink/platform:f1010000.pin-controller--platform:gpio-fan-150-15
lrwxrwxrwx 1 root root 0 Oct 19 10:41 /sys/class/devlink/platform:f1010000.pin-controller--platform:gpio-fan-150-15 -> ../../devices/virtual/devlink/platform:f1010000.pin-controller--platform:gpio-fan-150-15
root@debian:~# 
root@debian:~# ls -la /sys/class/devlink/platform:f1010100.gpio--platform:gpio-fan-150-15
lrwxrwxrwx 1 root root 0 Oct 19 10:44 /sys/class/devlink/platform:f1010100.gpio--platform:gpio-fan-150-15 -> ../../devices/virtual/devlink/platform:f1010100.gpio--platform:gpio-fan-150-15


root@debian:~# ls -la /sys/devices/virtual/devlink/platform:f1010000.pin-controller--platform:gpio-fan-150-15/
total 0
drwxr-xr-x  2 root root    0 Oct 19 10:41 .
drwxr-xr-x 17 root root    0 Oct 19 10:41 ..
-r--r--r--  1 root root 4096 Oct 19 10:52 auto_remove_on
lrwxrwxrwx  1 root root    0 Oct 19 10:52 consumer -> ../../../platform/gpio-fan-150-15
-r--r--r--  1 root root 4096 Oct 19 10:52 runtime_pm
-r--r--r--  1 root root 4096 Oct 19 10:52 status
lrwxrwxrwx  1 root root    0 Oct 19 10:52 subsystem -> ../../../../class/devlink
lrwxrwxrwx  1 root root    0 Oct 19 10:52 supplier -> ../../../platform/ocp@f1000000/f1010000.pin-controller
-r--r--r--  1 root root 4096 Oct 19 10:52 sync_state_only
-rw-r--r--  1 root root 4096 Oct 19 10:52 uevent
root@debian:~# ls -la /sys/devices/virtual/devlink/platform:f1010100.gpio--platform:gpio-fan-150-15/
total 0
drwxr-xr-x  2 root root    0 Oct 19 10:47 .
drwxr-xr-x 17 root root    0 Oct 19 10:41 ..
-r--r--r--  1 root root 4096 Oct 19 10:53 auto_remove_on
lrwxrwxrwx  1 root root    0 Oct 19 10:53 consumer -> ../../../platform/gpio-fan-150-15
-r--r--r--  1 root root 4096 Oct 19 10:53 runtime_pm
-r--r--r--  1 root root 4096 Oct 19 10:53 status
lrwxrwxrwx  1 root root    0 Oct 19 10:53 subsystem -> ../../../../class/devlink
lrwxrwxrwx  1 root root    0 Oct 19 10:53 supplier -> ../../../platform/ocp@f1000000/f1010100.gpio
-r--r--r--  1 root root 4096 Oct 19 10:53 sync_state_only
-rw-r--r--  1 root root 4096 Oct 19 10:53 uevent


root@debian:~# ls -ls /sys/firmware/devicetree/base/gpio-          
gpio-fan-100-15-18/   gpio-fan-100-15-35-3/ gpio-fan-150-15/      gpio-fan-150-32-35/   gpio-leds-hdd-20/     gpio-leds-hdd-21-2/   gpio-leds-hdd-38/     
gpio-fan-100-15-35-1/ gpio-fan-100-32-35/   gpio-fan-150-15-18/   gpio-leds-alarm-12/   gpio-leds-hdd-21-1/   gpio-leds-hdd-36/


root@debian:~# ls -ls /sys/firmware/devicetree/base/gpio-fan-150-15
total 0
0 drwxr-xr-x  2 root root  0 Oct 19 10:58 .
0 drwxr-xr-x 27 root root  0 Oct 19 10:58 ..
0 -r--r--r--  1 root root  9 Oct 19 10:59 compatible
0 -r--r--r--  1 root root 64 Oct 19 10:59 gpio-fan,speed-map
0 -r--r--r--  1 root root 36 Oct 19 10:59 gpios
0 -r--r--r--  1 root root 16 Oct 19 10:59 name
0 -r--r--r--  1 root root 12 Oct 19 10:59 pinctrl-0
0 -r--r--r--  1 root root  8 Oct 19 10:59 pinctrl-names
0 -r--r--r--  1 root root  5 Oct 19 10:59 status


not sure whre the "input" file should reside.



Edited 1 time(s). Last edit at 10/19/2023 01:27PM by dmb4312.
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: