HC4 reboot, WOL and RTCwake

Post Reply
theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

HC4 reboot, WOL and RTCwake

Post by theleks »

Hello,

I bought an odroid-hc4 several months ago. I plan to build up a headless tvheadend server to store movies on the sata devices of the hc4.
A main goal is to set the system to sleep as long as nobody is using it or no recording is running.

I found a lot of problems with suspend/resume, reboot and poweroff, regardless of whether I used hardkernel 4.19 kernel, different tobetter kernel versions or armbian distro.

For this reason, I started to build up my own odroid-hc4 kernel based on the current stable 5.15.y version.
The current status is as follows:
  • Eth irq problem fixed
  • Reboot works fine
  • Wake on lan support is working (poweroff)
  • RCT wake up support is working (poweroff)
  • Suspend/resume is still not working. Main problems are the missing suspend/resume support of meson-pci, ahci sata implementation and suspend/resume problems of other devices.
My branch is still under development. I will always rebase my ongoing changes onto the stable linux branch (currently 5.15.12)
You can find my odroid-hc4 kernel source branch at https://github.com/theleks/linux-odroid ... hc4_5.15.y

I look forward to your feedback and I hope this can help someone.

Best regards
theleks
These users thanked the author theleks for the post:
tomerr (Sat Jan 01, 2022 9:22 pm)

User avatar
tobetter
Posts: 8938
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 521 times
Been thanked: 1433 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tobetter »

Thanks, @theleks.

I went through your commits and good idea to use SCPI, I've considered to use it but no since I basically do not want to use it from 4.9. I have a patch that WOL works with HC4 + Petitboot but for some reason sometimes it does not work in low rate.

FYI, RTC wake up works with Petitboot, not tested with other OS.
viewtopic.php?f=203&t=42869

Anyway, I will look into your commits again.

Thank you.
These users thanked the author tobetter for the post:
tomerr (Mon Jan 24, 2022 5:24 pm)

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

that's incredible - did you actually get Wake on lan working after systemctl suspend?
can you share compiled packages of this kernel ?

User avatar
tobetter
Posts: 8938
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 521 times
Been thanked: 1433 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tobetter »

tomerr wrote:
Sat Jan 01, 2022 8:21 pm
that's incredible - did you actually get Wake on lan working after systemctl suspend?
can you share compiled packages of this kernel ?
No, systemctl suspend does not make wake up since PCIe has an issue as you observed.

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

tobetter wrote:
Sat Jan 01, 2022 8:27 pm
tomerr wrote:
Sat Jan 01, 2022 8:21 pm
that's incredible - did you actually get Wake on lan working after systemctl suspend?
can you share compiled packages of this kernel ?
No, systemctl suspend does not make wake up since PCIe has an issue as you observed.
ok, so how does WOL do work with this custom kernel? i mean, "real world experience" - i shutdown the HC4 (with shutdown command etc) and can turn it back on with WOL packet?

User avatar
tobetter
Posts: 8938
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 521 times
Been thanked: 1433 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tobetter »

tomerr wrote:
Sat Jan 01, 2022 8:45 pm
tobetter wrote:
Sat Jan 01, 2022 8:27 pm
tomerr wrote:
Sat Jan 01, 2022 8:21 pm
that's incredible - did you actually get Wake on lan working after systemctl suspend?
can you share compiled packages of this kernel ?
No, systemctl suspend does not make wake up since PCIe has an issue as you observed.
ok, so how does WOL do work with this custom kernel? i mean, "real world experience" - i shutdown the HC4 (with shutdown command etc) and can turn it back on with WOL packet?
No, currently WOL does not work with my kernel package yet.

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

tobetter wrote:
Sat Jan 01, 2022 9:17 pm
tomerr wrote:
Sat Jan 01, 2022 8:45 pm
tobetter wrote:
Sat Jan 01, 2022 8:27 pm
tomerr wrote:
Sat Jan 01, 2022 8:21 pm
that's incredible - did you actually get Wake on lan working after systemctl suspend?
can you share compiled packages of this kernel ?
No, systemctl suspend does not make wake up since PCIe has an issue as you observed.
ok, so how does WOL do work with this custom kernel? i mean, "real world experience" - i shutdown the HC4 (with shutdown command etc) and can turn it back on with WOL packet?
No, currently WOL does not work with my kernel package yet.
i was referring to @theleks custom kernel this post is originally about

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

Hello,

first of all I wish everyone a happy new year.

@tomerr yes with the kernel I refer to in my original post, it is possible to wake up using WOL (magic packet) and RTC.I use the command "poweroff" instead of "systemctl suspend".
Before shutdown you have to call "ethtool -s eth0 wol g". I used a systemd service to do the job automatically at system start.
To shutdown after a specified time of inactivity I use autosuspend.
With this setup I'm happy and it works for several weeks, in my setup.

I still working on a suspend/resume solution, but that seems difficult to me. Therefore I decide to publish a solution using "poweroff".

I look forward to feedback if it is also working for anyone else.

Best regards
theleks
These users thanked the author theleks for the post:
tomerr (Sun Jan 02, 2022 1:10 am)

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

theleks wrote:
Sat Jan 01, 2022 11:35 pm
Hello,

first of all I wish everyone a happy new year.

@tomerr yes with the kernel I refer to in my original post, it is possible to wake up using WOL (magic packet) and RTC.I use the command "poweroff" instead of "systemctl suspend".
Before shutdown you have to call "ethtool -s eth0 wol g". I used a systemd service to do the job automatically at system start.
To shutdown after a specified time of inactivity I use autosuspend.
With this setup I'm happy and it works for several weeks, in my setup.

I still working on a suspend/resume solution, but that seems difficult to me. Therefore I decide to publish a solution using "poweroff".

I look forward to feedback if it is also working for anyone else.

Best regards
theleks
i would love to test it. any chance you could upload compiled packages for your kernel? i never installed a custom kernel.
many thanks

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

tomerr wrote:
Sun Jan 02, 2022 1:14 am
i would love to test it. any chance you could upload compiled packages for your kernel? i never installed a custom kernel.
many thanks
Sorry, currently I can not upload compiled packages.
I will think about, how we can get you able to compile and install the kernel by your own.
Do you have a preferred distro to use?

Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

theleks wrote:
Sun Jan 02, 2022 1:30 am
tomerr wrote:
Sun Jan 02, 2022 1:14 am
i would love to test it. any chance you could upload compiled packages for your kernel? i never installed a custom kernel.
many thanks
Sorry, currently I can not upload compiled packages.
I will think about, how we can get you able to compile and install the kernel by your own.
Do you have a preferred distro to use?

Best regards
theleks
my laptop is running Fedora. already downloaded your git, not sure what are the next steps -
do i need to use
make menuconfig
to begin with?

thanks

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

Please fetch my branch again, I have added my current configuration.
Make sure you have installed the cross toolchain described in the hardkernel wiki: https://wiki.odroid.com/odroid-hc4/soft ... tab__basic
Follow the description how to build the kernel and use "make hc4_defconfig" instead of "make odroidg12_defconfig"
When the kernel has successfully compiled, you have to install the kernel and the modules. This can be a little be tricky and it depends on the disro you are using at your sd card.
I recommend to use a sd card with a fresh installed distro (like armbian https://redirect.armbian.com/region/EU/ ... Jammy_edge) for testing, do not use your production system :-)

Here is a short description to get the custom kernel run on an armbian image:

# Steps on cross compile host after setting up the correct toolchain

Code: Select all

cd linux_kernel_folder
make hc4_defconfig
make -j$(expr $(expr $(nproc) \* 6) \/ 5)
mkdir ../modules
sudo make modules_install ARCH=arm64 INSTALL_MOD_PATH=../modules
- the ohroid-hc4 must be up and running

Code: Select all

scp arch/arm64/boot/Image.gz root@<odroid_ip_address>:/boot/vmlinuz-5.15.4-meson64
scp arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dtb root@<odroid_ip_address>:/boot/dtb/amlogic
cd ../modules/lib/modules/
tar cf - * | ssh root@<odroid_ip_address> '(cd /lib/modules/; tar xf - )'
# Steps on odroid-hc4
- login as root
- add the following lines to /boot/boot.cmd, before the legacy or modern kernel is selected for booting

Code: Select all

setenv kernel_comp_addr_r "0x19000000"
setenv kernel_comp_size "0x04000000"
- extend the bootargs variable of the "modern kernel boot" section with gpio-keypad.gpiopower=481 to enable RTCwake
- run the following commands:

Code: Select all

mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
halt
- replug the power supply and start the system

# Test wol
- login as root

Code: Select all

ethtool -s eth0 wol g
poweroff
- use your preferred tool to wake up your odroid-hc4 via wol

# Test RTCwake (odroid-hc4 with optional oled display)
- login as root

Code: Select all

echo 0 | sudo tee /sys/class/rtc/rtc0/wakealarm
echo $(date '+%s' -d '+ 1 minutes') | sudo tee /sys/class/rtc/rtc0/wakealarm
poweroff
- wait for about 1 minute, the odroid-hc4 will start up

I hope this will help.

Best regards
theleks
Last edited by theleks on Sun Jan 09, 2022 9:03 am, edited 1 time in total.

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

thanks for all the instructions but i'm not going to use Armbian in the long run, on the HC4

hanguofu
Posts: 22
Joined: Fri Sep 28, 2018 2:35 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by hanguofu »

Thanks for sharing your packages :) Does this custom kernel on an armbian image caters to video play-back application too ?

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

tomerr wrote:
Mon Jan 03, 2022 6:02 am
thanks for all the instructions but i'm not going to use Armbian in the long run, on the HC4
Ok, this is only a sample how to integrate an own build kernel. Which distro would you prefer?

Best regards
theleks

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

hanguofu wrote:
Mon Jan 03, 2022 6:34 am
Thanks for sharing your packages :) Does this custom kernel on an armbian image caters to video play-back application too ?
The intend of this custom kernel is to demonstrate/test reboot, wol and RTCwake on the odroid-hc4. I'm not sure if video play-back applications are working.
I do not have applied as many patches as hardkernel, tobetter or ambian did.

Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

theleks wrote:
Mon Jan 03, 2022 11:04 am
tomerr wrote:
Mon Jan 03, 2022 6:02 am
thanks for all the instructions but i'm not going to use Armbian in the long run, on the HC4
Ok, this is only a sample how to integrate an own build kernel. Which distro would you prefer?

Best regards
theleks
the official Debian10 from netinstall (by tobetter) .
I also use petitboot + GRUB . as far as I understand, you need to remove petitboot to install Armbian, which would probably break my current configuration

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

@tomerr: Sorry for the late response, but I hope you get my custom kernel running.
If not I can provide a short description how to get my custom kernel the Debian 10 system running.
You need the same steps to compile the custom kernel, I provide in a former post.

# Debian 10 netinstall and petitboot
flash spiupdate_odroidhc4_20201222.img.xz to sd card

# Steps on odroid-hc4
- boot with this sd card to flash petitboot, if petitboot is not stored in the onboard spi flash
- install "Debian 10 (Buster) Netboot Installer" from Petitboot (dev.20201222) to sd card
- use software selections: "SSH server" and "standard system utilities" for a minimal system
- at the first boot with Debian 10, login as root
- add "RootPermitLogin yes" to /etc/ssh/sshd_config file
- install the network manager to get wol working correctly

Code: Select all

apt install network-manager
- remove eth0 entries from /etc/network/interfaces
- install ethtool to switch on wol of the eth0 interface

Code: Select all

apt install ethtool
- Change boot configuration

Code: Select all

cp /boot/boot.scr /boot/boot.cmd
- remove the first line of /boot/boot.cmd
- add setenv bootargs "${bootargs} gpio-keypad.gpiopower=481" after the "serial console" section to enable RTCwake
- run the following command to update the boot configuration

Code: Select all

mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
- reboot the hc4 system

# Steps on host
- copy the kernel and its modules

Code: Select all

scp arch/arm64/boot/Image.gz root@<odroid-ip-address>:/boot/vmlinuz-5.14.0-odroid-arm64
scp arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dtb root@<odroid-ip-address>:/boot/dtbs/5.14.0-odroid-arm64/amlogic/meson64_odroidhc4.dtb
cd ../modules/lib/modules/
tar cf - * | ssh root@<odroid-ip-address> '(cd /lib/modules/; tar xf - )'
- reboot the hc4 system

Now you can test WOL and RTCwake as described in a former post.

I hope this helps and I look forward for any feedback.

Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

thanks for all your details instructions. I created a new Debian 10 netinstall on a new SD and followed your steps after compiling the kernel (on WSL running Debian 11 as it's the fastest machine i have)
copied the compiled kernel and it booted ok -
uname -a shows
Linux hc4-tst 5.15.13-02262-g6288d3636c6b #1 SMP PREEMPT Sun Jan 9 21:18:29 IST 2022 aarch64 GNU/Linux
but, after running

Code: Select all

ethtool -s eth0 wol g
poweroff
i wasn't able to turn the HC4 back on with a WOL magic packet.
ethtool eth0 shows

Code: Select all

# 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: Symmetric Receive-only
        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: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: ug
        Wake-on: g
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes
any idea what could have gone wrong , as it isn't waking up?

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

Cool that you get the kernel compiled an running :-).
If you have poweroff your system, the green network led has to blink.
Is this not the case it seams that you did not use the network manager.
Could you please call:

Code: Select all

cat /run/network/ifstate
If you see eth0=eth0 as output, you have to remove the eth0 entries in /etc/network/interfaces
Please post the content of:

Code: Select all

cat /run/network/ifstate
and

Code: Select all

cat /etc/network/interfaces
Maybe you can post a dmesg log also.
Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

got it :) i missed the part about removing eth0 entries from /etc/network/interface
once i removed that line, WOL is working! amazing
but i have a new problem now, where i can't properly control anymore the PWM fan using hddfancontrol - it complains that
No such file or directory: '/sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1_enable'
though i can control the fan manually if i adjust
/sys/devices/platform/pwm-fan/hwmon/hwmon2/pwm1
also, there's no fan1_input file anymore under /sys/devices/platform/pwm-fan/hwmon/hwmon2 (it shows the fan speed)
which i guess has something to do with this issue . any idea?
These users thanked the author tomerr for the post:
theleks (Tue Jan 11, 2022 7:01 am)

User avatar
mad_ady
Posts: 10181
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 821 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by mad_ady »

Compare your original kernel config to the current one (/proc/config.gz) and see what options are missing.
These users thanked the author mad_ady for the post:
tomerr (Mon Jan 10, 2022 5:32 pm)

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

mad_ady wrote:
Mon Jan 10, 2022 3:36 pm
Compare your original kernel config to the current one (/proc/config.gz) and see what options are missing.
there are a lot of changes, these kind of caught my eye - left side original kernel, right custom
Screenshot from 2022-01-10 10-25-08.png
Screenshot from 2022-01-10 10-25-08.png (20.7 KiB) Viewed 353 times
could these not set options be the issue?

User avatar
mad_ady
Posts: 10181
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 821 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by mad_ady »

I don't think those are it...

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

tomerr wrote:
Mon Jan 10, 2022 2:39 pm
got it :) i missed the part about removing eth0 entries from /etc/network/interface
once i removed that line, WOL is working! amazing
That is great. Thanx a lot for testing.
also, there's no fan1_input file anymore under /sys/devices/platform/pwm-fan/hwmon/hwmon2 (it shows the fan speed)
I found the reason for that. I have updated my repository.

With hwmon and fancontrol, i'm not so familiar. I will take a look at, but my custom kernel is intend to fix the reboot, wol and RTCwake issues only.
I have to think about adding more stuff to this branch in general.

Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

theleks wrote:
Tue Jan 11, 2022 3:46 am
tomerr wrote:
Mon Jan 10, 2022 2:39 pm
got it :) i missed the part about removing eth0 entries from /etc/network/interface
once i removed that line, WOL is working! amazing
That is great. Thanx a lot for testing.
also, there's no fan1_input file anymore under /sys/devices/platform/pwm-fan/hwmon/hwmon2 (it shows the fan speed)
I found the reason for that. I have updated my repository.

With hwmon and fancontrol, i'm not so familiar. I will take a look at, but my custom kernel is intend to fix the reboot, wol and RTCwake issues only.
I have to think about adding more stuff to this branch in general.

Best regards
theleks
would you say your custom kernel is safe to install on my "production" HC4 NAS? I'm using Grub , so I don't mind replacing one kernel option with it,
but I'm not totally sure on what files i should replace.
Last edited by tomerr on Tue Jan 11, 2022 1:38 pm, edited 1 time in total.

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

Hello tomerr,

thanx a lot for your testing.

I think it is not recommended to replace the existing kernel with my custom kernel.
Instead you have to put the custom kernel, if it fits to your need, beside the other kernels and create the corresponding symbolic links.
I can't tell you how to do that in your system.

This thread should still be about the reboot, wol and RTCwake issues and I hope that my changes will
find their way into the kernel of tobetter or Armbian distro ;-).

Best regards
theleks

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

so i've recompiled the kernel with the recent changes, and copied the files to the test (netinstall) Debian 10 - for some reason it didn't boot (petitboot did show) .
at that point I used petitboot shell to revert to the kernel file backup i made - and it booted ok , also i could see the fanspeed . but hddfancontrol still wouldn't run -
PXL_20220111_143650808.jpg
PXL_20220111_143650808.jpg (383.38 KiB) Viewed 268 times
as it couldn't find pwm1_enable .
WOL worked well just like before, but i decided for now not to try to install the kernel in my production NAS. hopefully tobetter would be able to implement your changes in next kernel package update.

erifax
Posts: 6
Joined: Sun Jan 17, 2021 10:19 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 0
Been thanked: 0
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by erifax »

Hey theleks -- this looks great, thanks for doing the work! Are you planning to try to upstream this into the mainline kernel? For WoL in particular I could see other folks with this particular PHY being interested in having the WoL logic plumbed through the driver.

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

erifax wrote:
Thu Jan 13, 2022 7:41 pm
Hey theleks -- this looks great, thanks for doing the work! Are you planning to try to upstream this into the mainline kernel? For WoL in particular I could see other folks with this particular PHY being interested in having the WoL logic plumbed through the driver.
yes, getting the stuff into the mainline kernel is the long term goal. This will takes time, because I have ported code from the hardkernel 4.9 kernel. This must be reworked to fit better into the 5.x kernel.
My current branch is for testing and getting feedback if it is working not only for me :-)
Before getting this into the mainline kernel, maybe there is a way to get the part into the kernel of tobetter or arbmian. Then a lot of people can participate from this changes.

Best regards
theleks
These users thanked the author theleks for the post:
tomerr (Fri Jan 14, 2022 5:06 am)

theleks
Posts: 12
Joined: Tue Nov 09, 2021 8:25 am
languages_spoken: english
ODROIDs: Odroid HC4
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by theleks »

tomerr wrote:
Wed Jan 12, 2022 3:03 am
but hddfancontrol still wouldn't run - as it couldn't find pwm1_enable .
I have updated my branch and added support for 'pwm1_enable' of the pwm-fan.
Now hddfancontrol works, but you have to disable the kernel thermal control to get full user control.

Code: Select all

echo disabled > /sys/class/thermal/thermal_zone0/mode
Best regards
theleks
These users thanked the author theleks for the post:
odroid (Fri Jan 14, 2022 10:21 am)

chewitt
Posts: 158
Joined: Mon Aug 12, 2019 12:27 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 122 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by chewitt »

theleks wrote:
Fri Jan 14, 2022 2:11 am
getting the stuff into the mainline kernel is the long term goal. This will takes time, because I have ported code from the hardkernel 4.9 kernel. This must be reworked to fit better into the 5.x kernel. My current branch is for testing and getting feedback if it is working not only for me :-)
$0.02 on upstreaming. First, remove petitboot and install upstream u-boot to SPI. It has support for HC4 and with the latest stable kernel, no known reboot issues. This is the baseline the kernel maintainers will test anything you submit from so it's best to start using the same. Second, drop the odroid power-reset driver patches from the kernel. I've pointed these out to the maintainers in the past and they view them as incorrect and unnecesary so they will be refused and their presence risks modifying kernel behaviour. If you or @tobetter think there is a real need for those changes they should be submitted as RFC patches and discussed on the linux-amlogic mailing list. Third and final; the best way to get good feedback and guidance on your approach (particularly when porting drivers from the vendor kernel) is to submit an RFC series to relevant mailing lists. It's best to "fail early" than invest effort in a direction that ultimately won't be accepted, and the best people to guide you on what will be accepted are the maintainers, and the linux-amlogic reviewers and maintainers are a friendly bunch. If you need any general (non-code) coaching on the process of submitting things (the kernel has some patch etiquette and rules to follow) I'd be happy to help - feel free to PM.

NB: Martin Blumenstingl also has some realtek LED patches here https://github.com/xdarklight/linux/com ... 6-20220102
These users thanked the author chewitt for the post:
theleks (Mon Jan 17, 2022 3:36 pm)

User avatar
rooted
Posts: 9004
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 745 times
Been thanked: 422 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by rooted »

It's awesome to see you helping so much around here @chewitt, especially when it comes to trying to improve Odroid compatibility with more recent kernels.

I know you would like to see a switch to upstream Uboot and hopefully this won't fall on deaf ears, I'm not sure why it's not being used but I guess it's due to not working with petitboot. It's an awesome feature but it shouldn't hold back development as I'm sure a lot of people don't use it.

tomerr
Posts: 36
Joined: Thu Feb 11, 2021 11:06 pm
languages_spoken: english
ODROIDs: HC4
Has thanked: 13 times
Been thanked: 3 times
Contact:

Re: HC4 reboot, WOL and RTCwake

Post by tomerr »

tobetter wrote:
Fri Dec 31, 2021 9:48 am
Thanks, @theleks.

I went through your commits and good idea to use SCPI, I've considered to use it but no since I basically do not want to use it from 4.9. I have a patch that WOL works with HC4 + Petitboot but for some reason sometimes it does not work in low rate.

FYI, RTC wake up works with Petitboot, not tested with other OS.
viewtopic.php?f=203&t=42869

Anyway, I will look into your commits again.

Thank you.
Hi tobetter
any chance we'll see WOL support soon from Odroid official custom kernel you maintain ?
thanks

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest