Odroid C2 mainline kernel support

Post Reply
Flole
Posts: 34
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid C2 mainline kernel support

Post by Flole »

I finally wanted to try to upgrade my NFS-Based system's kernel again. Unfortunately it's still the same issue as before, even with the dts patched and a new dtb generated from that. Could you please share your meson-gxbb-odroidc2.dtb so I can rule out any mistake there? Also what kernel are you using?

moon.linux
Posts: 1200
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
ODROIDs: U3, XU3. XU4, C1+...
Has thanked: 0
Been thanked: 13 times
Contact:

Re: Odroid C2 mainline kernel support

Post by moon.linux »

If you are facing Ethernet issue not working out could you please try attach patches on C2/C4/N2.
ethreset.tar.gz
(1.27 KiB) Downloaded 48 times
On USB device we also need to some similar fix, I will try to find a solution to on that as well.

Edited:
Can you guys check the following changes to fix the USB reset issue.

Code: Select all

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 234490d3ee68..d9d2a1ffe1dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -19,6 +19,7 @@ usb0_phy: phy@c0000000 {
                        #phy-cells = <0>;
                        reg = <0x0 0xc0000000 0x0 0x20>;
                        resets = <&reset RESET_USB_OTG>;
+                       reset-names = "phy-reset";
                        clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB0>;
                        clock-names = "usb_general", "usb";
                        status = "disabled";
@@ -29,6 +30,7 @@ usb1_phy: phy@c0000020 {
                        #phy-cells = <0>;
                        reg = <0x0 0xc0000020 0x0 0x20>;
                        resets = <&reset RESET_USB_OTG>;
+                       reset-names = "phy-reset";
                        clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB1>;
                        clock-names = "usb_general", "usb";
                        status = "disabled";
@@ -43,6 +45,9 @@ usb0: usb@c9000000 {
                        phys = <&usb0_phy>;
                        phy-names = "usb2-phy";
                        dr_mode = "host";
+                       snps,reset-phy-on-wake;
+                       resets = <&reset RESET_USB_DDR_0>, <&reset RESET_USB_DDR_1>,
+                               <&reset RESET_USB_DDR_2>, <&reset RESET_USB_DDR_3>;
                        status = "disabled";
                };

@@ -55,6 +60,7 @@ usb1: usb@c9100000 {
                        phys = <&usb1_phy>;
                        phy-names = "usb2-phy";
                        dr_mode = "host";
+                       resets = <&reset RESET_USB_DDR_0>;
                        status = "disabled";
                };
        };

fvolk
Posts: 614
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 75 times
Contact:

Re: Odroid C2 mainline kernel support

Post by fvolk »

I run a diskless C2 cluster, with only one file, the Uboot script, on microSD first partition.
Uboot loads kernel Image+dtb via TFTP, no initramfs, rootfs mounted by kernel via NFS.

U-Boot 2020.04 (May 05 2020 - 22:32:05 +0200) odroid-c2
...that I self-compiled for why I cant remember.

Linux c2 5.7.10tb+ #2 Mon Jul 27 09:15:03 CEST 2020 aarch64 GNU/Linux
...a kernel built from tobetter's source tree (https://github.com/tobetter/linux/commits/odroid-5.7.y)

I have not retested USB for a while...

fvolk
Posts: 614
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 75 times
Contact:

Re: Odroid C2 mainline kernel support

Post by fvolk »

As an update, upgrading to tobetter's 5.10.2+ kernel, everything seems to work fine so far,
except plugging in USB devices after boot is still broken, even a simple keyboard is not working anymore :-/
These users thanked the author fvolk for the post:
odroid (Thu Dec 24, 2020 10:35 am)

fvolk
Posts: 614
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 75 times
Contact:

Re: Odroid C2 mainline kernel support

Post by fvolk »

Note that I tried only some headless server things, not Ubuntu desktop things, so I don't know about them.

campbell
Posts: 438
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: C4, N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Has thanked: 9 times
Been thanked: 10 times
Contact:

Re: Odroid C2 mainline kernel support

Post by campbell »

fvolk wrote:
Thu Dec 24, 2020 1:55 am
As an update, upgrading to tobetter's 5.10.2+ kernel, everything seems to work fine so far,
except plugging in USB devices after boot is still broken, even a simple keyboard is not working anymore :-/
Apologies if this has already been tried, but on the C4 you can comment out the gpio reset toggle in the usb section of the dts, and then exert manual control over that gpio in userspace to toggle the usb hub on and off. Might be worth a try on the C2 to see if you can bring up USB after boot that way.

fvolk
Posts: 614
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 75 times
Contact:

Re: Odroid C2 mainline kernel support

Post by fvolk »

In some previous release of upstream kernel it worked when I first plugged in a USB keyboard and then a USB harddisk.
Now even that workaround no longer seems to work... and I'm not very motivated to do something manually every time :-/

fvolk
Posts: 614
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 75 times
Contact:

Re: Odroid C2 mainline kernel support

Post by fvolk »

It seems the C2 USB not working issue in upstream is also discussed on the linux-meson mailing list recently, maybe there is also an interaction which requires a newer UBoot, and the developers have no C2 available to test themselves, see this thread: http://lists.infradead.org/pipermail/li ... 09254.html

campbell
Posts: 438
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: C4, N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Has thanked: 9 times
Been thanked: 10 times
Contact:

Re: Odroid C2 mainline kernel support

Post by campbell »

I haven't been tracking this thread for a couple years, but it's time to move on from Arch Linux, and I've still got a C2 that needs a mainline kernel to be useful. Is there a concise procedure for getting the mainline kernel into the official Ubuntu 20.04+ image in such a way that it will be kept up to date via apt from then on?

igorpec
Posts: 959
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 56 times
Been thanked: 135 times
Contact:

Re: Odroid C2 mainline kernel support

Post by igorpec »

campbell wrote:
Wed Mar 10, 2021 5:47 am
I haven't been tracking this thread for a couple years, but it's time to move on from Arch Linux, and I've still got a C2 that needs a mainline kernel to be useful. Is there a concise procedure for getting the mainline kernel into the official Ubuntu 20.04+ image in such a way that it will be kept up to date via apt from then on?
Armbian (Ubuntu / Debian) is on stable mainline based kernel for several years now. We record no major problems and our work is trusted by some critical projects as such https://forum.armbian.com/topic/14750-o ... r-part-ii/
ARMBIAN
Linux for ARM development boards
What is Armbian?

campbell
Posts: 438
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: C4, N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Has thanked: 9 times
Been thanked: 10 times
Contact:

Re: Odroid C2 mainline kernel support

Post by campbell »

igorpec wrote:
Fri Mar 12, 2021 10:16 pm
campbell wrote:
Wed Mar 10, 2021 5:47 am
I haven't been tracking this thread for a couple years, but it's time to move on from Arch Linux, and I've still got a C2 that needs a mainline kernel to be useful. Is there a concise procedure for getting the mainline kernel into the official Ubuntu 20.04+ image in such a way that it will be kept up to date via apt from then on?
Armbian (Ubuntu / Debian) is on stable mainline based kernel for several years now. We record no major problems and our work is trusted by some critical projects as such https://forum.armbian.com/topic/14750-o ... r-part-ii/
Unfortunately I need to be able to recompile the kernel on the board, with minor changes to the existing .config, and I understood this to be a nontrivial undertaking with Armbian (compared to Arch or the Hardkernel 3.16 sources) due to the special build environment that Armbian expects. If there is a procedure for this, then I am willing to give Armbian another shot.

But in this thread I'm just looking for whatever the up-to-date procedure is to switch to the mainline kernel and u-boot, starting from the Hardkernel Ubuntu image.

igorpec
Posts: 959
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 56 times
Been thanked: 135 times
Contact:

Re: Odroid C2 mainline kernel support

Post by igorpec »

campbell wrote:
Fri Mar 26, 2021 4:54 am
Unfortunately I need to be able to recompile the kernel on the board, with minor changes to the existing .config, and I understood this to be a nontrivial undertaking with Armbian
Compilation part is trivial:

armbian-config -> software -> get kernel source
cd /usr/src/linux-*
make menuconfig
make -j6

Just artefacts copy is your manual task ... automated packing and installation is planned, but no time for realisation so far.
ARMBIAN
Linux for ARM development boards
What is Armbian?

campbell
Posts: 438
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: C4, N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Has thanked: 9 times
Been thanked: 10 times
Contact:

Re: Odroid C2 mainline kernel support

Post by campbell »

igorpec wrote:
Fri Mar 26, 2021 6:02 am
Compilation part is trivial:

armbian-config -> software -> get kernel source
cd /usr/src/linux-*
make menuconfig
make -j6

Just artefacts copy is your manual task ... automated packing and installation is planned, but no time for realisation so far.
This seems to only gives the option to download kernel sources for several older 5.8 and 5.9 kernels, not the 5.10.21 kernel that the OS image comes with. Is there some other step I need to do first, to update armbian-config?

igorpec
Posts: 959
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 56 times
Been thanked: 135 times
Contact:

Re: Odroid C2 mainline kernel support

Post by igorpec »

campbell wrote:
Fri Mar 26, 2021 6:49 am
igorpec wrote:
Fri Mar 26, 2021 6:02 am
Compilation part is trivial:

armbian-config -> software -> get kernel source
cd /usr/src/linux-*
make menuconfig
make -j6

Just artefacts copy is your manual task ... automated packing and installation is planned, but no time for realisation so far.
This seems to only gives the option to download kernel sources for several older 5.8 and 5.9 kernels, not the 5.10.21 kernel that the OS image comes with. Is there some other step I need to do first, to update armbian-config?
This means it doesn't work as designed. Here is the file:
https://mirrors.dotsrc.org/armbian-apt/ ... t-meson64/

If you have a desire that this work better, you are welcome to join armbian-config refectoring initiative. We don't need this to work better. "You" do.
ARMBIAN
Linux for ARM development boards
What is Armbian?

campbell
Posts: 438
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: C4, N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Has thanked: 9 times
Been thanked: 10 times
Contact:

Re: Odroid C2 mainline kernel support

Post by campbell »

igorpec wrote:
Fri Mar 26, 2021 6:25 pm
campbell wrote:
Fri Mar 26, 2021 6:49 am
igorpec wrote:
Fri Mar 26, 2021 6:02 am
Compilation part is trivial:

armbian-config -> software -> get kernel source
cd /usr/src/linux-*
make menuconfig
make -j6

Just artefacts copy is your manual task ... automated packing and installation is planned, but no time for realisation so far.
This seems to only gives the option to download kernel sources for several older 5.8 and 5.9 kernels, not the 5.10.21 kernel that the OS image comes with. Is there some other step I need to do first, to update armbian-config?
This means it doesn't work as designed. Here is the file:
https://mirrors.dotsrc.org/armbian-apt/ ... t-meson64/

If you have a desire that this work better, you are welcome to join armbian-config refectoring initiative. We don't need this to work better. "You" do.
For anyone that comes looking for this, what I did that worked, starting from Armbian_21.02.3_Odroidc2_buster_current_5.10.21.img.xz, was:

Code: Select all

apt install linux-source-5.10.21-current-meson64
cd /usr/src
mkdir linux
cd linux
tar Jxf ../linux-source-5.10.21-meson64.tar.xz 
gunzip -c /proc/config.gz > .config
# edit .config as desired
make -j4
make modules_install
make install
make dtbs_install
# then I had to delete some -meson64 files and recreate some symlinks in /boot, this is probably avoidable by setting CONFIG_LOCALVERSION or some such

bolemo
Posts: 1
Joined: Sun Jun 06, 2021 10:55 pm
languages_spoken: english, french
ODROIDs: Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid C2 mainline kernel support

Post by bolemo »

Hello to all,

This might be a very dumb question, so my apology if it is the case.

When I had my C2, I used it at first with the Linux provided by Hard Kernel. I was able to overclock it to 1.75 MHz, and it made a difference compared to standard 1.54 MHz.

Then I needed to upgrade my system and switched to Armbian with 5.x kernels. All is great, except that overclocking is not possible anymore with the mainline kernel.
In the Armbian forums, they told me that I needed to patch the blob in the kernel and the “DT”. I don’t know how to do that.

Is there any current kernel compatible with Armbian that allows to overclock beyond 1.54 MHz like it used to be with HK 3.x kernels? Is there any explaination on how the kernel can be patched to reach that?

It is frustrating to have lost a feature when upgrading to a more modern kernel...

Thank you

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest