Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

Unread postby emk2203 » Tue Jun 05, 2018 1:08 pm

@scpcom: Does USB work now with your kernel?
User avatar
emk2203
 
Posts: 31
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Sat Jun 09, 2018 2:08 am

Update 20180602
- Kernel 4.17.0
- Removed linux-4.17.y-amlogic-drm-0016-[wip]_calculate_display_params.patch
- Removed linux-4.17.y-amlogic-drm-1000-wip_calculate_display_params-fix.patch
- Removed linux-4.17.y-amlogic-drm-1001-drm-mode-32000khz-vu7plus.patch
- Added linux-4.17-amlogic-dmt-extended-0001-make_dmt_timings_parameter_generic_and_add_more_frequencies.patch (by baylibre)
- Added linux-4.17-amlogic-dmt-extended-1001-fix-32000khz.patch
- Added linux-4.17-amlogic-dmt-extended-1002-custom-mode.patch
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.47-20180602-c2-arm64.zip
linux-4.17-odroidc2-build.tar.gz linux-image-4.17.0-20180602-c2-arm64.zip

The baylibre patch has a pll_base_freq of 2560000 for pixel clock 32000khz, I raised it to 5120000 again, otherwise my C2 with VU7+ freezes.

With the new patches drm-meson can handle now any custom resolution between 640x480 and 1920x1200 (+ predefined higher resolutions).
It will first do lookup in the predefined tables for standard resolutions, if nothing matches all required parameters will be calculated (timing parameters, pixel clock, pll base freq., m and frac).
The required combinations of od1, od2, od3, vid_pll_div and vclk_div are currently taken from the list of predefined params.

@emk2203
My USB devices (mouse, keyboard, VU7+ Touch, portable HDD and Cinergy HTC USB XS DVB-C/T stick) work without any problems (DVB-C/T stick works only on OTG port).
scpcom
 
Posts: 50
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Wed Jun 13, 2018 2:00 am

Update 20180610
- Kernel 4.17.1
- Added linux-4.17-amlogic-dmt-extended-1003-calculate-clock-dividers.patch
- Added linux-4.17-le-amlogic-gx-0027-arm64-dts-meson-activate_hdmi_audio_hdmi_enabled_boards.patch
- Added linux-4.14.y-le-amlogic-gx-1002-dts-meson-gxbb-rename_audio_card.patch
- Added linux-4.17.y-amlogic-clk-1001-clk-meson-fix_broken_audio.patch
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.49-20180610-c2-arm64.zip
linux-4.17-odroidc2-build.tar.gz linux-image-4.17.1-20180610-c2-arm64.zip

Th video clock dividers are calculated too now, independent from lookup tables.

I found that audio was not working in kernel 4.17.
This was caused by the "migrate the audio divider clock to clk_regmap" patch:
88a4e1283681e0f07048b2bd867cc81fbbae57cc

If you look at 4.14:
clk-audio-divider.c#L71
and 4.17:
clk-audio-divider.c#L54
you will see that a "+1" is missing in 4.17 code.
The result is a wrong value returned by clk_get_rate which causes an error here:
i2s-dai.c#L148
i2s-dai.c#L231
scpcom
 
Posts: 50
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Wed Jun 13, 2018 2:29 am

@scpcom If you find some bug and you solve this please send a patch upstream to fix the issue.
moon.linux
 
Posts: 1110
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby miskol » Thu Jun 14, 2018 5:10 am

here you can find nice set of patch-es for 4.17 from Neil Armstrong
https://github.com/superna9999/meta-mes ... son64-4.17
miskol
 
Posts: 129
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Thu Jun 14, 2018 10:09 am

@miskol
Thank you. I already use many patches from Neil Armstrong, but I did not know this patch set.
Good to know that he already had a patch for the audio divider.
scpcom
 
Posts: 50
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby mcloaked » Fri Jun 15, 2018 4:43 am

Way back in this thread around Jan 06 this year, I exchanged requests and ideas about getting the rtc working in the mainline kernel running archlinux arm on the odroid-c2 but at that time there were problems with the eMMC timing so I reverted to installing the non-mainline kernel in a clean install. Today with much more development in the kernel supporting the odroid-c2 I updated to kernel 4.17.1-1-ARCH and this seems stable. However the original problems with being unable to get the rtc working remain. The recipe for dtc changes given by campbell in January still don't work for me with the current mainline kernel in archlinuxarm, and although the rtc is not essential, since I use systemd-timesyncd to update the system clock very quickly after boot, it would be nice to know if there is a way to get the rtc working.

Code: Select all
# hwclock -r --verbose
hwclock from util-linux 2.32
System Time: 1529005387.845705
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.


The i2c shows there is a slot at 51

Code: Select all
# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


The i2c_dev and rtc_pcf8563 modules can be loaded with modprobe - but I still can't get hwclock -r to work. This seems close but I must be missing something critical.

Is the aml_i2c module crucial to using the rtc?

Code: Select all
# modprobe aml_i2c
modprobe: FATAL: Module aml_i2c not found in directory /lib/modules/4.17.1-1-ARCH


If anyone has been trying to do this and had some success I would appreciate knowing what method worked.

Thanks.
mcloaked
 
Posts: 9
Joined: Wed Jun 08, 2016 11:57 pm
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby emk2203 » Sat Jun 16, 2018 5:53 pm

scpcom wrote:Update 20180602
- Kernel 4.17.0

@emk2203
My USB devices (mouse, keyboard, VU7+ Touch, portable HDD and Cinergy HTC USB XS DVB-C/T stick) work without any problems (DVB-C/T stick works only on OTG port).


@scpcom: I tried the kernel 4.17.1 on a system with Odroid kernel and Ubuntu 18.04, but with a failure. System doesn't boot, no heartbeat LED. What would be the best way to debug it? The install was done per your instructions, everything went through with some symlinks to libmali refusing to install ("file exists"), I did these by hand. Everything else looked fine. I used the libmali .pkg for stretch, since the old Ubuntu one didn't meet dependencies.
User avatar
emk2203
 
Posts: 31
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Tue Jun 19, 2018 10:49 am

Update 20180617
- Kernel 4.17.2
- Reduced 4.17 patchset
- Synchronized 4.14 patchset with 4.17
- install-mali-driver.sh: Removed symlinking libwayland-egl.so.1.0.0 with libMali.so
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.50-20180617-c2-arm64.zip
linux-4.17-odroidc2-build.tar.gz linux-image-4.17.2-20180617-c2-arm64.zip
libsdl2-c2.zip libsdl2-2.0.8-c2-bionic-arm64.zip

Additional to the kernels I built libsdl2 2.0.8 for Ubuntu 18.04 LTS (same works on Debian 9 too). Nothing special, just disabled Open GL,Open GLES will be used. Works with both libMali versions on 3.1x and 4.1x kernels.

@emk2203
Did you try to ping C2? As I wrote here you may have black screen/no signal on first boot. But if you reboot again it will show up on screen.
If you can not ping C2 something may did go wrong with new boot loader. Did you run sd_fusing.sh? Did you check fstab and boot.cmd for correct boot partition?

For debugging you can use netconsole by adding the parameters to "bootargs" in boot.cmd.
Example:
Code: Select all
netconsole=@192.168.1.234/,@192.168.1.123/

192.168.1.234 = IP of C2
192.168.1.123 = IP of PC you use for debugging

After editing boot.cmd by hand, you need to run the following on C2:
Code: Select all
sudo mkimage -C none -A arm -T script -d /media/boot/boot.cmd /media/boot/boot.scr && sudo sync


On your PC you can run the following command, before starting C2:
Code: Select all
nc -u -l -p 6666

PS: I am running and developing C2 on Xubuntu 18.04 LTS now for about 2 weeks and since sdl2 is working too now, I do not need to switch back to Debian 9 (only for testing some time).
scpcom
 
Posts: 50
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby memeka » Fri Jul 13, 2018 7:25 am

User avatar
memeka
 
Posts: 3964
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Odroid C2 mainline kernel support

Unread postby KARL23 » Thu Jul 19, 2018 7:50 pm

@mcloaked
basicly to get rtc via i2c working, you need to have i2c enabled in uboot, and then: either have the kernelmodules aml-i2c i2c-dev and for the rtc-chip compiled into the kernel or you need to put them into the initramfs.

These modules are need before the normal fs is mounted. See my attached dmesg log:

Code: Select all
[    1.902552] c11084c0.serial: ttyAML1 at MMIO 0xc11084c0 (irq = 10, base_baud = 1500000) is a meson_uart
[    1.902820] c1108700.serial: ttyAML3 at MMIO 0xc1108700 (irq = 13, base_baud = 1500000) is a meson_uart
[    1.903071] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 16, base_baud = 1500000) is a meson_uart
[    2.682125] console [ttyAML0] enabled
[    2.686113] msm_serial: driver initialized
[    2.691008] libphy: Fixed MDIO Bus: probed
[    2.694106] mousedev: PS/2 mouse device common for all mice
[    2.699706] i2c /dev entries driver
[    2.705042] rtc-ds1307 1-0068: registered as rtc0
[    2.708341] ledtrig-cpu: registered to indicate activity on CPUs
[    2.713534] meson-sm: secure-monitor enabled
[    2.717703] EFI Variables Facility v0.08 2004-May-17
[    2.722588] efivars: get_next_variable: status=8000000000000007
[    2.728470] hidraw: raw HID events driver (C) Jiri Kosina
[    2.735123] registered taskstats version 1
[    2.737842] Loading compiled-in X.509 certificates
[    2.742655] zswap: loaded using pool lzo/zbud
[    2.759183] Key type big_key registered
[    2.764899] Key type encrypted registered
[    2.764938] AppArmor: AppArmor sha1 policy hashing enabled
[    2.776108] rtc-ds1307 1-0068: setting system clock to 2018-07-18 20:59:24 UTC (1531947564)

KARL23
 
Posts: 12
Joined: Sun Jun 26, 2016 10:59 pm
languages_spoken: english
ODROIDs: c1, c2,xu4

Re: Odroid C2 mainline kernel support

Unread postby gkkpch » Sat Jul 21, 2018 7:39 am

From the amlogic/ baylibre mailing list I see things are moving forward with amlogic sound/soc in 4.18/ 4.19
Does anyone have more precise planning info on i2s support in 4.19 (or perhaps 4.20) for Odroid C2?
User avatar
gkkpch
 
Posts: 250
Joined: Mon Feb 25, 2013 11:47 pm
Location: Switzerland
languages_spoken: english, dutch, german
ODROIDs: Odroid-C1+, Odroid-C1+ HiFi shield, Odroid-C1, Odroid-X2

Previous

Return to General Chat

Who is online

Users browsing this forum: No registered users and 3 guests