Linux 3.16 LTS Kernel for Odroid C2

Moderators: odroid, mdrjr

Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Fri Jan 26, 2018 7:46 am

Patchset and build scripts:
http://seafile.servator.de/sbc/odroid/build/

Ready to use linux image for Debian/Ubuntu:
http://seafile.servator.de/sbc/odroid/kernel/

Alternative xorg driver:
http://seafile.servator.de/sbc/odroid/fbturbo/

# info
As 3.14 does not get security patches anymore an 4.14 has a different driver architecture and needs a new uboot I decied to integrate the hardkernel drivers into kernel 3.16.
Why 3.16? It is close enough to 3.14 so the patches to be made are small and we can just copy the missing drivers into the kernel tree.
Th second reason 3.16 has longterm support by linux mainline (currently longer than 4.9) and Debian.
The prepare script downloads and unpacks the latest debian 3.16 kernel and fetches the latest hardkernel odroidc2-3.14.y from github.
In the next step c2 drivers (drivers/amlogic, drivers/gpu/arm, drivers/gpu/drm/mali, drivers/hardkernel and others) will be copied into the 3.16 kernel and patches applied.

The patchset is divided into the main and the optional part.
To enable the optional part just open prepare-linux.sh and change the line doOptional=false to doOptional=true

Contains refreshed patches of my earlier work (optional):
viewtopic.php?f=139&t=23361
viewtopic.php?f=139&t=23765

You can run the prepare script on any current Debian or Ubuntu with bash and use your own build environment, but the build scripts are made to work directly on Odroid C2.

# 1. prepare
Code: Select all
wget http://seafile.servator.de/sbc/odroid/build/linux-3.16-odroidc2-build.tar.gz
mkdir linux-c2
cd linux-c2

tar xzf ../linux-3.16-odroidc2-build.tar.gz

sudo ./build-deps.sh

./update-debian-linux.sh
bash -e prepare-linux.sh


# 2.1 build with debian scripts ...
Code: Select all
./build-debian-linux.sh

sudo ./install-debian-linux.sh


# 2.2 ...or build with mainline scripts
Code: Select all
./config-linux.sh

./build-linux.sh

sudo ./install-linux.sh



Test setup:
- Odroid C2
- Class 10 micro SD card
- LG FHD TV (HDMI) and HP 1600x1200 LCD (via passive DVI to HDMI adapter)
- Tested with 720p50, 1080p60, 1600x900, 1600x1200
- USB keyboard and mouse
- 2.5" USB HDD (only for kernel build)
- Network Port connected to gigabit switch
- Debian 9 XFCE
- Partitions
/dev/mmcblk0p1 /media/boot vfat
/dev/mmcblk0p2 / ext4

Test software:
- fbset
- glmark2-es2
- mpv
- xfce4-sensors-plugin
- freerdp and others in daily use
Last edited by scpcom on Sat Jan 27, 2018 7:23 am, edited 1 time in total.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Fri Jan 26, 2018 8:40 am

Great news!
We will try it and share our test results early next week.
3.16 seems to be maintained until April 2020. :o
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby moon.linux » Fri Jan 26, 2018 5:44 pm

@scpcom.
Excellent work dont but you.
their were some error in the script but I use to get over them.
Code: Select all
# bash -e scripts
moon.linux
 
Posts: 1059
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Sat Jan 27, 2018 7:11 am

Yes, sorry I forgot to say that the scripts are made to run under bash.
Any other shell may show errors because of some syntax that is bash specific.
I fixed also some lines so all scripts work with "bash -e" now.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Sun Jan 28, 2018 10:42 am

Kodi UI and video playback are working well. So all the basic GPU and VPU functionality looks fine.
Some official USB WiFi modules work too.
Very promising LTS Kernel. :D
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Mon Jan 29, 2018 4:17 am

Nice to hear, did not test Kodi myself yet.

Changes 20180128
- cleaned up linux-3.16.y-arm64_kernel.patch, added assignment of machine_name
- removed linux-3.16.y-of_fdt_initial_boot_params.patch
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Mon Jan 29, 2018 9:50 am

Nice update.
We will try to upload your kernel into GitHub for a debugging party with other forum members within a couple of weeks.

PS. I've moved this thread to Project sub-forum and made it "STICKY".
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Thu Feb 01, 2018 5:30 am

Changes 20180131
- moved kernel offset, size and flags below #endif (linux-3.16.y-arm64_kernel.patch)
- moved dtb append to optional (linux-3.16.y-arm64_boot_dtb_append.patch)
- added optional armv7 compat patch (linux-3.16.y-arm64_kernel_armv7_compat.patch)
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby stmicro » Thu Feb 01, 2018 10:45 am

@scpcom,
Great job! I like your development approach.
I hope we can run Ubuntu 18.04 with 3.16 LTS kernel in May. :mrgreen:
stmicro
 
Posts: 224
Joined: Tue Apr 28, 2015 4:23 pm
Location: shenzhen china
languages_spoken: english, chinese
ODROIDs: Many Odroids and Rpis.

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Sun Feb 04, 2018 9:56 am

Changes 20180203
- Removed mm/cma.c because it has some redundant/conflicting code with drivers/base/dma-contiguous.c
- Improved linux-3.16.y-dma-contiguous.patch and linux-3.16.y-of_reserved_mem.patch to make shared-dma-pool (cma) work
- Added serial drivers section to config-odroidc2 to fix "cannot create duplicate filename" in debian kernel
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby soulrebell » Wed Feb 07, 2018 6:14 am

Hi,
i want to update the kernel. I am using Debian Stretch image from meveric.
When i am using the script "build-deps.sh", i got the following message

./build-deps.sh: 51: ./build-deps.sh: Bad substitution

Any idea?
soulrebell
 
Posts: 13
Joined: Thu Oct 13, 2016 12:41 pm
languages_spoken: german

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby meveric » Wed Feb 07, 2018 7:10 am

try starting it with bash -x to see more debug messages to find out what could be the issue.
Also there are other tools to create kernels, for example make-kpkg or simply make bindeb-pkg should work as well.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8642
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Wed Feb 07, 2018 8:27 am

@soulrebell
if you get "Bad substitution" you need to run the scripts with bash. If real bash is missing, you need to install it:
Code: Select all
apt-get install bash

You can just run the script with:
Code: Select all
bash build-deps.sh

If you are not logged in as root you can run:
Code: Select all
sudo apt-get install bash
sudo bash build-deps.sh


@stmicro
The kernel works fine with current Alpha 2 of Xubuntu 18.04. Newer systemd needs syscall 279 (memfd_create) which is part of 3.16
You can also compile the kernel with gcc-7, just need this small patch:
linux-3.16.y-gcc-7_give_up_on_gcc_ilog2_constant_optimizations.patch
See https://patchwork.kernel.org/patch/9643505/

The show stopper on bionic is newer libc6, which causes crash in fb while initializing mali drm
- normal fbdev driver without mali works fine
- Keeping old zesty libc6 (and 43 other old depending on it), upgrading all possible packages works fine with fbturbo and mali, so newer xorg is not the problem
I will try to debug this
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Sat Feb 10, 2018 7:10 am

Update to side-topic: Xubuntu 18.04 works fully now. I needed to fix fbturbo (fbturbo-fix-depth.patch). You can download updated version on links above.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby moon.linux » Sat Feb 10, 2018 11:41 am

@scpcon Thanks you very much, I will check you changes at my end.
moon.linux
 
Posts: 1059
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby soulrebell » Tue Feb 13, 2018 4:39 am

Sorry for my late answer.
@scpcon: Your hint solve my problem, thank you.

But for the compiling of the kernel, i have consider the following things.

In build-deps.sh
apt-get update
and the install of the following packages.
bc
zip (required for the script build_debian_linux.sh)

In build-debian-linux.sh
Change line 115
from ./build-meta.sh
to bash build-meta.sh

In install-debian-linux.sh
considering
mkdir /media/boot

The kernel compiling successfully and the installing works without errors or warnings.
I wanted to use the kernel, because i have an usb dvb-c stick which is suported since kernel 3.16.
Unfortunately the odroid hang up, if i plug in the dvb-c stick and i have no access to the odroid anymore (i see only the red light, the blue light is out).
Therefore it is difficult for me to search for the failure.
If i unplug the dvb-c stick and reboot, the odroid runs without problems.
soulrebell
 
Posts: 13
Joined: Thu Oct 13, 2016 12:41 pm
languages_spoken: german

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Tue Feb 13, 2018 7:07 am

Thank you for feedback. I changed the scripts (will upload them next time I add other changes).
I had a similar problem in earlier development while plugging an Arduino board via USB to C2, I will debug this now.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby soulrebell » Wed Feb 14, 2018 4:53 am

Ok.
I would be glad, if I can support somehow.
I will have a look at your thread.
soulrebell
 
Posts: 13
Joined: Thu Oct 13, 2016 12:41 pm
languages_spoken: german

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Sun Feb 18, 2018 12:34 pm

Changes 20180218
- Added atomic pool (linux-3.16.y-arm64_mm_dma-mapping.patch)
- Added firmware

Freeze on some USB devices is fixed now, tested with Cinergy HTC USB XS DVB-C/T stick (em28xx).

PS: You may need to get extra firmware if your device does not work.
On Debian 9 first try:
Code: Select all
sudo apt-get install firmware-misc-nonfree

If this does not work look in dmesg which firmware is missing and get it from other source like OpenELEC:
Code: Select all
dmesg
sudo wget -N https://github.com/OpenELEC/dvb-firmware/blob/master/firmware/dvb-usb-terratec-htc-stick-drxk.fw?raw=true -O /lib/firmware/dvb-usb-terratec-htc-stick-drxk.fw
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby soulrebell » Mon Feb 19, 2018 4:47 am

You are my hero.
Thank you very much!!!
i have tried it in the past to get the stick to run.
After some tests i see no problems.
Thanks
soulrebell
 
Posts: 13
Joined: Thu Oct 13, 2016 12:41 pm
languages_spoken: german

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby Khem » Mon Feb 19, 2018 7:03 pm

can we create a branch (odroidc2-3.16.y) on github.com/hardkernel/linux so we all can collaborate ? I am interested inintegrating this with Yocto/OE
Khem
 
Posts: 19
Joined: Sun Feb 18, 2018 2:11 pm
Location: San Jose, CA, US
languages_spoken: english, hindi, german
ODROIDs: Odroid-C2

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Tue Feb 20, 2018 2:29 am

I can not add it to github.com/hardkernel/linux, but I think this is already planned:
odroid wrote:Mon Jan 29, 2018
We will try to upload your kernel into GitHub for a debugging party with other forum members within a couple of weeks.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Tue Feb 20, 2018 3:19 pm

We are still testing scpcom's Kernel 3.16.51.
Code: Select all
odroid@odroid64:~$ uname -a
Linux odroid64 3.16.0-6-c2 #1 SMP Ubuntu 3.16.51-3+deb9 (2018-01-08) aarch64 aarch64 aarch64 GNU/Linux


The "fbturbo" seems to be working well with OpenGL-ES2 applications on X11.

Kodi 17.4 worked well with 4K H.265 sample videos thanks to the well ported GPU and VPU drivers.
But after upgrading Kodi to 17.6, I could see only a black screen. :(
We need to find what's wrong.

The 3D GPU acceleration(for webgl) on Chromium browser also worked well after fixing some broken links.
viewtopic.php?f=141&t=29296&p=209237#p209196

The eMMC driver seems to be missing or broken. We will be working on it soon.

Any sysfs nodes for CPU freq control is not available yet. Or, I couldn't find it.

Once the basic features are implemented well, we will gather our resources to polish this Kernel to make a new Ubuntu 18.04 image a few months later.
In fact, we considered Kernel 4.15 and 4.16, but there is no proper VPU driver yet. So many people will not use new Ubuntu 18.04 image if there is no Kodi.
Therefore, we have to go with 3.16 in this year probably.

@scpcom,
Can you please put your Kernel 3.16 code into your Github repo until we officially support Kernel 3.16?
We will send you some updates via pull-request.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby kszaq » Tue Feb 20, 2018 4:52 pm

@scpcom Have you considered looking at 4.9 kernel? S905X and S912 are supported, adding S905 should not be that hard.

Here you can find the kernel with full git history: https://github.com/Owersun/linux-amlogic

It is extracted from the latest Amlogic buildroot. As far as I can tell it is missing headers and device trees for gxbb (S905).
kszaq
 
Posts: 18
Joined: Thu Jan 28, 2016 5:35 pm
languages_spoken: english
ODROIDs: C2

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Tue Feb 20, 2018 5:09 pm

There are two reasons why we have to avoid it.
OverSun tested the kernel 4.9 with S905X only, not S905.
So there is no way to predict how much resources and time to invest to make it work on C2.
Additionally, Kernel 4.9 life cycle is much shorter than Kernel 3.16.

Anyway, if anybody can make the Kernel 4.9 work with C2 Ubuntu and Kodi, we will be on the same boat definitely.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby OverSun » Tue Feb 20, 2018 6:53 pm

This would be _not_ an easy task at all.
AML Kernel 4.9 is heavily modified and contains a lot of parts that are specific for gxl boards without mentioning gxbb. So although things are pretty similar, making it run on S905 would be a lot of researching and porting things from gxl to gxbb even if this would be a copy-paste. Unfortunately it is not just a matter of .dts only. =( Even in the .dts for some reason a lot of names were changed by amlogic, for example from "compatible = <pinctrl, aml-gxl>" to "compatible = <pinctrl, gxl-aml>" with corresponding changes to code. So C2 .dtb wouldn't even fit without thorough review.
I'd gladly investigate possibility to run 4.9 on S905 and create a corresponding branch and stuff, if I wouldn't see how huge this job is needed to be... =(
Nevertheless I did make it running on S905X and it runs flawlessly, there are no issues that are needed to be "fixed" for a S905X board, everything works.
User avatar
OverSun
 
Posts: 1321
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby memeka » Tue Feb 20, 2018 7:20 pm

Isn’t it possible to copy the vpu drivers from 4.9 to mainline?
User avatar
memeka
 
Posts: 3889
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby OverSun » Tue Feb 20, 2018 7:38 pm

Seriously not sure about this. VPU drivers draw on a specific surface that lays under EGL video output and I'm not sure there is such a thing like this in mainline kernel. So it could be that these drivers has nothing to connect to.
But there are already works going on to rewrite aml codecs to v4l2.
User avatar
OverSun
 
Posts: 1321
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Wed Feb 21, 2018 2:15 am

odroid wrote:...
Kodi 17.4 worked well with 4K H.265 sample videos thanks to the well ported GPU and VPU drivers.
But after upgrading Kodi to 17.6, I could see only a black screen. :(
We need to find what's wrong.
....
The eMMC driver seems to be missing or broken. We will be working on it soon.

Any sysfs nodes for CPU freq control is not available yet. Or, I couldn't find it.

...
@scpcom,
Can you please put your Kernel 3.16 code into your Github repo until we officially support Kernel 3.16?
We will send you some updates via pull-request.


I have no 4K display or eMMC, so I can not help on this parts.

CPU freq control is available at /sys/devices/system/cpu/cpu?/cpufreq
Example:
Code: Select all
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
echo "1296000" | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq


I am not familiar with github, Last use was five or more years ago, I will see if I can remember how it works :-)

EDIT: Something about Linux 4.9:
I already did some short tests with the S905X kernel on C2 without success. The problem are not only the changes by amlogic itself. linux-amlogic is linux-mainline+linux-linaro+amlogic and all of them do massive changes each version which is hard to track. The amlogic changes look very small if you look at all the other changes that are done. Each kernel has game changes in very sensible parts (clock handling, cpu handling, memory handling, header/entry points for boot loader etc.). Even if you try a simple looking step like going two steps from 3.14 to 3.16 this is not easy. For example the next step from 3.16 to 3.18 even did not work for me currently.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Wed Feb 21, 2018 9:48 am

Ah.. I can find "cpufreq" today. I have no idea why it didn't exist yesterday. I was crazy perhaps. :)

BTW, I will send you a PM very soon to send you a couple of eMMC samples.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Sun Feb 25, 2018 1:14 pm

Changes 20180224
- Cleaned up linux-3.16.y-arm64_mm_dma-mapping.patch
- Fix bad page on reboot (linux-3.14.y-amlogic-gpu_arm_fix_bad_page_on_reboot.patch)
- Disabled linux-3.16.y-arm64_boot_dtb_append.patch and linux-3.14-c2-arm64_boot_dts_mesongxbb-no-armv8-timer.patch in patches-optional/series-odroidc2-optional
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Tue Feb 27, 2018 10:40 am

Changes 20180226
- Fixed eMMC driver (linux-3.16.y-mmc.patch, tested with Hardkernel 8GB and 32GB eMMC)
- Added touchscreen drivers (linux-3.16.y-input_touchscreen.patch, tested with ODROID VU7 Plus)
- Allow gcc-5 in build-deps.sh if gcc-6 is missing (for build under Ubuntu 16.04)

Second binary/deb package still building.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Tue Feb 27, 2018 10:44 am

Very impressive progress again! :o

I hope you can open a GitHub in March for better collaboration.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby moon.linux » Tue Feb 27, 2018 2:02 pm

@scpcom @odroid @oversun.

We should work with getting the base patches mergers on top of 3.16.y kernel, so I have being searching for github repository
which have 3.14.29 + amlogic series of patches, below is one.

https://github.com/LibreELEC/linux-amlogic/

So we need to cherry pick the amlogic patches and also pick up Hardkernel patches from odroid c2 repository.
As some patches related to ARM64 are critical for stability of the board which should not be missed
or merged properly.

If some regression is discovered then we will be able to pin-point the patch and feature.

After them we should consider github repository for testing.
moon.linux
 
Posts: 1059
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Tue Feb 27, 2018 3:52 pm

If anyone is interesting to look into the source tree of 3.16.51 with ODROID-C2 patches from scpcom, please visit here https://github.com/tobetter/linux/commi ... 2-v3.16.51. I just made the git repository based on the script of scpcom and haven't done a testing yet.

It would be good if scpcom can contribute further more on top of the branch, instead of extra patch files.
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby scpcom » Tue Feb 27, 2018 7:57 pm

@moon.linux
does the libreELEC repo contain any patches that are not already inside the hardkernel version?
Stability and security patches for ARM64 and common parts are already handled by debian patches.
I may not have full overview yet into amlogic 3.14.y kernel, but hardware critical parts for me are things like cpu, memory and thermal handling which is already ported to 3.16.

@tobetter
Thank you for creating the repository. This is the way I had planned for next days (adding the patches as separated commits etc.)
I will look at these later an will try to commit future changes there.
scpcom
 
Posts: 45
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Tue Feb 27, 2018 9:43 pm

scpcom wrote:@tobetter
Thank you for creating the repository. This is the way I had planned for next days (adding the patches as separated commits etc.)
I will look at these later an will try to commit future changes there.

Thanks, you really did good job. I am going to test the branch later after my work and am also considering to try to see how difficult to rebase the branch with new tag like 3.16.54.
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Mon Mar 05, 2018 3:29 am

I've rebased the branch with v3.16.55 and contains the patches from scpcom. The basic functionality is fine in my test and would need more testing. :)
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Mon Mar 05, 2018 9:52 am

@tobetther,
Great news about the successful rebasing!
Can you please share an instruction of native build? I really want to try it.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Tue Mar 06, 2018 11:58 am

@odroid, here is the instruction what I did to run Linux 3.16.y on Hardkernel's official image and Armbian's image. It would be good if you try and share your experience.

In order to check out the Linux kernel tree
Code: Select all
$ git clone https://github.com/tobetter/linux.git -b odroidc2-v3.16.y
$ make odroidc2_defconfig
$ make -j8


To run on Hardkernel's official Ubuntu image
Code: Select all
$ sudo cp arch/arm64/boot/dts/meson64_odroidc2.dtb /media/boot/
$ sudo cp arch/arm64/boot/Image /media/boot/


To run on Armbian Image
Code: Select all
$ sudo mkdir -p /boot/dtb-3.16.55-odroidc2
$ sudo cp arch/arm64/boot/Image /boot/vmlinuz-3.16.55-odroidc2
$ sudo cp arch/arm64/boot/dts/meson64_odroidc2.dtb /boot/dtb-3.16.55-odroidc2/
$ sudo rm /boot/Image /boot/dtb
$ sudo ln -s /boot/vmlinuz-3.16.55-odroidc2 /boot/zImage
$ sudo ln -s /boot/dtb-3.16.55-odroidc2 /boot/dtb
$ sudo make modules_install


After copying all files
Code: Select all
$ sync
$ reboot
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Tue Mar 06, 2018 2:24 pm

Thank you for the detail guide.
I've followed it on my C2 which runs our official Ubuntu 16.04 image.
Code: Select all
sudo apt install git
git clone --depth 1 https://github.com/tobetter/linux.git -b odroidc2-v3.16.y                                             
cd linux                                                                                                                   
make odroidc2_defconfig                                                                                                   
make -j5                                                                                                                   
sudo make modules_install                                                                                                 
sudo cp arch/arm64/boot/dts/meson64_odroidc2.dtb /media/boot/                                                             
sudo cp arch/arm64/boot/Image /media/boot/                                                                                 
sync                                                                                                                       
sudo reboot


The Kernel 3.16.55 booted beautifully. :D
Code: Select all
odroid@odroid64:~$ uname -a                                                                                                       
Linux odroid64 3.16.55 #1 SMP PREEMPT Tue Mar 6 00:10:58 EST 2018 aarch64 aarch64 aarch64 GNU/Linux

Basic Kodi VPU and Chromium GPU acceleration are workign fine.
So far so good!

I will try some 4K/UHD video samples on Kodi 17.6 and share the result tomorrow.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby meveric » Wed Mar 07, 2018 2:14 am

I've also build some Kernel/Header packages for 3.16.55+ which seem to work mostly fine.
I found that WiFi Module 5 is not supported.
I still have issue getting Kodi to work properly (only get black video window) but that's most likely not related to the Kernel itself.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8642
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Wed Mar 07, 2018 8:11 am

I've tested several H.265/264 4K/2K videos with Kodi 17.6 on Ubuntu. They worked well.
I also felt the USB driver seems to be more stable than Kernel 3.14 even though we need further tests.

@meveric,
Right. There is no RTL8812AU driver yet.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Wed Mar 07, 2018 8:32 am

@odroid and @maveric, Thank you for sharing the result...Let me find out the patches for Wifi #5 and patch to my branch.

Again, appreciate to @scpcom for great work to collect the changes.
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Wed Mar 07, 2018 8:42 am

Yes. @scpcom made an amazing job indeed.
I really want to meet him via our Magazine ODROIDian article if he doesn't mind.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby meveric » Wed Mar 07, 2018 8:50 am

odroid wrote:I've tested several H.265/264 4K/2K videos with Kodi 17.6 on Ubuntu. They worked well.
I also felt the USB driver seems to be more stable than Kernel 3.14 even though we need further tests.

I suspect Ubuntu 16.04 and Debian 9 work very differently in this field.
While Ubuntu 16.04. never had any issues with Kodi, ever since I tried Debian Stretch Kodi didn't work at all.
NONE of the versions available did work.
Not the one I build, not the one directly from Debian, not the one from Deb-Multimedia.
It was only thanks to the help of @ptitSeb we found a way to start Kodi under Debian Stretch.
A variable is not handled correctly 64 -> 32 conversion was missing. Apparently this is specific to the OS and might affect only certain versions namely Debian Stretch (and maybe Ubuntu 18.04 in the future).
My guess is that the graphic initialization was not the only 64 -> 32 bit variable mixup in the Kodi 17.6 code.
The Hardware decoder of Kodi is running fine but I still get a black video window, and it always claims "Pixel Format: Unknown".

But sorry that's very off topic.

I installed my rtl8812au-dkms package after which WiFi Module 5 was working perfectly fine :)
So Kernel and Headers are working as expected.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8642
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Wed Mar 07, 2018 9:19 am

@meveric,
I think there seems to be an Alpha blending issue on newer xorg or desktop compositors.
Once the Ubuntu 18.04 final beta is released in early April, we will try it.
I hope we can implement I2C, RTC, GPIO, UART, PPS, I2S(hifi-shield), SPDIF, 3.5" LCD, ADC, CEC, IR receiver and other essential drivers at that time frame.
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby tobetter » Wed Mar 07, 2018 9:28 am

@odroid, I supposed I have the one, but cannot find it. :cry: Anyway, I've found the patches and uploaded to my branch, have checked to build '8812au.ko'. Could you please test the branch?
tobetter
 
Posts: 2159
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby odroid » Wed Mar 07, 2018 9:57 am

@tobetter,
I've just run the following commands.
Code: Select all
cd linux
git pull
make odroidc2_defconfig
make -j5
sudo make modules_install
sudo cp arch/arm64/boot/dts/meson64_odroidc2.dtb /media/boot/
sudo cp arch/arm64/boot/Image /media/boot/
sync
sudo reboot


Now WiFi module 5 works well with 8812au driver.
I've test 5Ghz and 2.4Ghz both bands. :D
User avatar
odroid
Site Admin
 
Posts: 27744
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux 3.16 LTS Kernel for Odroid C2

Unread postby qpens8 » Fri Mar 09, 2018 5:49 am

Hi,
Is there any chance for a guide how to make that kernel working in Dietpi?
qpens8
 
Posts: 3
Joined: Fri Mar 09, 2018 5:36 am
languages_spoken: english
ODROIDs: Odroid C2

Next

Return to Projects

Who is online

Users browsing this forum: No registered users and 1 guest