Odroid C2 mainline kernel support

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

Re: Odroid C2 mainline kernel support

Unread post by memeka » Tue Nov 27, 2018 8:13 am

@Eric, I would try DRM/KMS

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Wed Nov 28, 2018 2:32 pm

memeka,
I've built kmscube to get a handle on how it should be done. It doesn't run. It's looking for meson_dri.so which won't exist on a non-X system :-(
I've got these packages installed:
mesa 18.2.5-1
dkms-mali-utgard-meson r6p1-2
mali-utgard-meson-libgl-fb r6p1-1

In my kernel (amlogic-4.19.4) I've got enabled:
CONFIG_DRM
CONFIG_DRM_FBDEV_EMULATION

It feels like I'm missing something simple, like I've got the wrong options/packages.
Any ideas?

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Wed Nov 28, 2018 3:51 pm

erich wrote:memeka,
I've built kmscube to get a handle on how it should be done. It doesn't run. It's looking for meson_dri.so which won't exist on a non-X system :-(
I've got these packages installed:
mesa 18.2.5-1
dkms-mali-utgard-meson r6p1-2
mali-utgard-meson-libgl-fb r6p1-1

In my kernel (amlogic-4.19.4) I've got enabled:
CONFIG_DRM
CONFIG_DRM_FBDEV_EMULATION

It feels like I'm missing something simple, like I've got the wrong options/packages.
Any ideas?
Hi Eric,
Userspace mali requires the mainline mali kernel driver which can be found here and compiled against your kernel https://github.com/superna9999/meson_gx ... 1_meson_gx - I am not sure if the arch guys have an easier option for install as yet.

meson_dri.so is not required (and does not exist) so you can probably safely ignore that error. Do you know which libMali.so userspace drivers you have installed in arch? Following should show you if the libMali.so can use libdrm.so.....

$ readelf -d /usr/lib/aarch64-linux-gnu/libMali.so

I like your project and would like to see you succeed! I can try to get arch mali working in FB / drm mode on the weekend to see if there is anything odd in the setup.

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Wed Nov 28, 2018 4:06 pm

Brad,
Here's the output:

Code: Select all

$ readelf -d /usr/lib/mali/libMali.so

Dynamic section at offset 0x168f10 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000010 (SYMBOLIC)           0x0
 0x000000000000000c (INIT)               0x33490
 0x000000000000000d (FINI)               0x14a724
 0x0000000000000019 (INIT_ARRAY)         0x175078
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x175080
 0x000000000000001c (FINI_ARRAYSZ)       16 (bytes)
 0x0000000000000004 (HASH)               0x180
 0x0000000000000005 (STRTAB)             0x15958
 0x0000000000000006 (SYMTAB)             0x4e28
 0x000000000000000a (STRSZ)              76217 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x1796d0
 0x0000000000000002 (PLTRELSZ)           2424 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x32b18
 0x0000000000000007 (RELA)               0x299f8
 0x0000000000000008 (RELASZ)             37152 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x29958
 0x000000006fffffff (VERNEEDNUM)         5
 0x000000006ffffff0 (VERSYM)             0x28312
 0x000000006ffffff9 (RELACOUNT)          1542
 0x0000000000000000 (NULL)               0x0
Between posts I did add the Mali450 driver to the kernel build and tried it again with the same results:

Code: Select all

$ ./kmscube 
gbm: failed to open any driver (search paths /usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/meson_dri.so: cannot open shared object file: No such file or directory
failed to load driver: meson
failed to initialize
failed to initialize EGL
Is the source around for an amlogic libMali and gbm?

Thanks,
Eric

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Thu Nov 29, 2018 4:36 pm

I spent the evening trying to build Mesa 18.2.6, but it requires DRI for EGL/gbm even with X11 support turned off.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Thu Nov 29, 2018 5:28 pm

erich wrote: Between posts I did add the Mali450 driver to the kernel build and tried it again with the same results:

Code: Select all

$ ./kmscube 
gbm: failed to open any driver (search paths /usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/meson_dri.so: cannot open shared object file: No such file or directory
failed to load driver: meson
failed to initialize
failed to initialize EGL
Is the source around for an amlogic libMali and gbm?

Thanks,
Eric
Your userspace libMali.so is designed for original kernel so not really compatible. They only come as binaries, Amlogic do have a 4.9 version which supports DRM and arm released a version for hikey which works on C2

Amlogic version can be found buried in the buildroot - http://openlinux.amlogic.com:8000/downl ... ilesystem/
(Buildroot_Openlinux_Release_20180211_dl.tar.gz)

userspace driver for hikey board which works on C2 - https://developer.arm.com/products/soft ... user-space
(mali-450_r7p0-01rel0_linux_1arm64.tar.gz)

They are both releases of the shared libraries which include a file named libMali.so and some symlinks alias's back to it in a directory. There are some variants in the amlogic buildroot, eg wayland, X11 (and DRM) or framebuffer but I found the hikey version was the most compatible (with later kernels at least).

If the kernel module you tried loaded correctly then it should show up in modules

Code: Select all

$ lsmod | grep mali
mali                  245760  0
Last edited by brad on Thu Nov 29, 2018 8:24 pm, edited 1 time in total.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Thu Nov 29, 2018 8:23 pm

brad wrote: Amlogic version can be found buried in the buildroot - http://openlinux.amlogic.com:8000/downl ... Linux_BSP/
(buildroot_openlinux_kernel_4.9_wayland_20180316.tar.gz)
Ooops, sorry it should be this one http://openlinux.amlogic.com:8000/downl ... _dl.tar.gz

located here http://openlinux.amlogic.com:8000/downl ... ilesystem/

Ill edit my other post I would hate someone to have to download the first link for nothing its huge (been there done that :oops: )

vbd
Posts: 2
Joined: Thu Nov 29, 2018 8:58 pm
languages_spoken: english, french
ODROIDs: C2
Location: France
Contact:

Re: Odroid C2 mainline kernel support

Unread post by vbd » Fri Nov 30, 2018 2:18 am

Hi there,

For those of you building 4.x kernel for arch arm, would you mind sharing any special steps you might have done ? I run a little cluster of odroid c2 as a kubernetes / faas platform, I'm also hosting my own archlinux packages repository that gets populated by a build pipeline bound to my gitolite for continuous build delivery (might be "common" but I'm still proud) and I would like to add 4.x kernel to it so I can deploy it to my cluster's node with a bit more ease and automation.

I'll be home soon and try anyway but I thought: if asking would prevent me to run into some known issues, why not.

Thank you for the wonderful work you're all doing :).

edit: nevermind, I should have looked in the repositories for the mainline kernel and uboot before I wrote.
Last edited by vbd on Mon Dec 03, 2018 9:48 pm, edited 1 time in total.

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Sun Dec 02, 2018 5:19 am

@brad:
I built the kernel module, the insmod reports success.
I installed the mali-450_r7p0-01rel0_linux_1+arm64 userspace and now kmscube runs but is running software rendering.

Code: Select all

./kmscube
gbm: failed to open any driver (search paths /usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/meson_dri.so: cannot open shared object file: No such file or directory
failed to load driver: meson
Using display 0xaaaac282d170 with EGL version 1.4
===================================
EGL information:
  version: "1.4 (DRI2)"
  vendor: "Mesa Project"
  client extensions: <SNIP>
===================================
OpenGL ES 2.x information:
  version: "OpenGL ES 3.0 Mesa 18.2.5"
  shading language version: "OpenGL ES GLSL ES 3.00"
  vendor: "VMware, Inc."
  renderer: "llvmpipe (LLVM 7.0, 128 bits)"
Still says it needs dri.

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Sun Dec 02, 2018 8:52 am

@brad:
After starting over with the aarch64 defconfig and not paring down the kernel so much, IT WORKS!
I must have removed something essential that the kernelspace driver needed.

Thanks for all the help.
Eric

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Sun Dec 02, 2018 9:02 am

DOH! I spoke too soon. Textures don't work.
Something is still broken with gbm.

Code: Select all

./kmscube -M rgba
Using display 0x1 with EGL version 1.4
===================================
EGL information:
  version: "1.4 Linux-r7p0-01rel0"
  vendor: "ARM"
  client extensions: "EGL_EXT_client_extensions EGL_EXT_platform_base EGL_KHR_platform_gbm EGL_KHR_platform_wayland "
  display extensions: "EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_EXT_image_dma_buf_import EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_swap_buffers_with_damage EGL_EXT_swap_buffers_with_damage EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_KHR_partial_update EGL_KHR_create_context_no_error "
===================================
OpenGL ES 2.x information:
  version: "OpenGL ES 2.0"
  shading language version: "OpenGL ES GLSL ES 1.00"
  vendor: "ARM"
  renderer: "Mali-450 MP"
  extensions: "GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_vertex_half_float GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map GL_KHR_debug GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_mapbuffer GL_KHR_no_error"
===================================
./kmscube: symbol lookup error: ./kmscube: undefined symbol: gbm_bo_map

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Dec 03, 2018 6:40 pm

erich wrote:DOH! I spoke too soon. Textures don't work.
Something is still broken with gbm.

Code: Select all

./kmscube -M rgba
Using display 0x1 with EGL version 1.4
===================================
EGL information:
  version: "1.4 Linux-r7p0-01rel0"
  vendor: "ARM"
  client extensions: "EGL_EXT_client_extensions EGL_EXT_platform_base EGL_KHR_platform_gbm EGL_KHR_platform_wayland "
  display extensions: "EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_EXT_image_dma_buf_import EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_swap_buffers_with_damage EGL_EXT_swap_buffers_with_damage EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_KHR_partial_update EGL_KHR_create_context_no_error "
===================================
OpenGL ES 2.x information:
  version: "OpenGL ES 2.0"
  shading language version: "OpenGL ES GLSL ES 1.00"
  vendor: "ARM"
  renderer: "Mali-450 MP"
  extensions: "GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_vertex_half_float GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map GL_KHR_debug GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_mapbuffer GL_KHR_no_error"
===================================
./kmscube: symbol lookup error: ./kmscube: undefined symbol: gbm_bo_map
It looks like more missing extensions in the libMali.so. I found an openembedded patch for kmscube which appears to work around the issue https://patchwork.openembedded.org/patch/148777/

Also upstream patch - https://patchwork.freedesktop.org/patch/167043/

Which version of kmscube is archlinux running?

@memeka could another solution be comparability library also?

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

Re: Odroid C2 mainline kernel support

Unread post by memeka » Mon Dec 03, 2018 8:56 pm

I would try something else, like glmark2-es-drm.

erich
Posts: 8
Joined: Tue Nov 27, 2018 5:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by erich » Wed Dec 05, 2018 8:07 am

As a followup, the issue with the gbm_bo_map/gbm_bo_unmap is an older Mesa than the drivers were built with.
The good side is that it's not necessary for those functions to be present for GL to work properly, it's only an issue with the way kmscube was allocating textures.
In short, everything I need works fine. I've ported my app to KMS/DRM and it's working very well.

Thanks for your help everyone!

Eric

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

Re: Odroid C2 mainline kernel support

Unread post by memeka » Wed Dec 05, 2018 8:34 am

Great to hear.
I suspecting this to be the case :D

tonymac32
Posts: 5
Joined: Sun Dec 09, 2018 1:50 pm
languages_spoken: english
ODROIDs: XU4 (liquid-cooled)
XU4-Q
C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by tonymac32 » Sun Dec 09, 2018 1:55 pm

Hi guys,

I'm the individual working on the Armbian mainline support for Meson64, using primarily Neil's work. I've come across a snag on 4.19 where powering a board with nothing in the USB ports results in "dead ports". This looked a lot like the issue I saw with the Rockchip dwc2 hardware, however that fix did not rectify the issue with the Amlogic devices. Have any of you seen the same thing?

[EDIT] OK, I had applied the fix wrong, I stuck in the wrong routine (I'll blame lack of coffee, but...) I'm still getting strange behavior, it seems picky about what port and what device it likes to see as the first thing plugged in...

https://github.com/armbian/build/blob/m ... -fix.patch

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Sun Dec 09, 2018 5:41 pm

tonymac32 wrote:Hi guys,

I'm the individual working on the Armbian mainline support for Meson64, using primarily Neil's work. I've come across a snag on 4.19 where powering a board with nothing in the USB ports results in "dead ports". This looked a lot like the issue I saw with the Rockchip dwc2 hardware, however that fix did not rectify the issue with the Amlogic devices. Have any of you seen the same thing?

[EDIT] OK, I had applied the fix wrong, I stuck in the wrong routine (I'll blame lack of coffee, but...) I'm still getting strange behavior, it seems picky about what port and what device it likes to see as the first thing plugged in...

https://github.com/armbian/build/blob/m ... -fix.patch
Does a lsusb -v fix the problem? Believe their was some regression in 4.19 usb to be fixed in 4.20 and the workaround was the patch you listed above or a "lsusb -v".

tonymac32
Posts: 5
Joined: Sun Dec 09, 2018 1:50 pm
languages_spoken: english
ODROIDs: XU4 (liquid-cooled)
XU4-Q
C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by tonymac32 » Mon Dec 10, 2018 12:06 am

lsusb -v? I have no idea, I really want to hear how setting the "verbose" switch wakes up the driver, that has to be interesting.

The description I got from the Rockchip fix:

Code: Select all

From: Hal Emmerich <hal@halemmerich.com>
Date: Thu, 19 Jul 2018 21:48:08 -0500
Subject: [PATCH] usb: dwc2: disable power_down on rockchip devices

 The bug would let the usb controller enter partial power down,
 which was formally known as hibernate, upon boot if nothing was plugged
 in to the port. Partial power down couldn't be exited properly, so any
 usb devices plugged in after boot would not be usable.

 Before the name change, params.hibernation was false by default, so
 _dwc2_hcd_suspend() would skip entering hibernation. With the
 rename, _dwc2_hcd_suspend() was changed to use  params.power_down
 to decide whether or not to enter partial power down.

 Since params.power_down is non-zero by default, it needs to be set
 to 0 for rockchip devices to restore functionality.

 This bug was reported in the linux-usb thread:
 REGRESSION: usb: dwc2: USB device not seen after boot
I've apparently spent the last several months (and everyone else testing my images) powering up with USB plugged in.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Dec 10, 2018 5:38 am

tonymac32 wrote:lsusb -v? I have no idea, I really want to hear how setting the "verbose" switch wakes up the driver, that has to be interesting.
It was mentioned as a work around in #linux-amlogic channel and a fix would be coming 4.20 maybe? My understanding was that the dwc2 device is initialised ok but breaks when the controller is reset and put 4 port host only mode. lsusb- v integrates the controller and users were reporting it as a possible workaround. I never bothered as I always had a device plugged in on boot.

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Mon Dec 10, 2018 2:52 pm

tonymac32 wrote:I've come across a snag on 4.19 where powering a board with nothing in the USB ports results in "dead ports". This looked a lot like the issue I saw with the Rockchip dwc2 hardware, however that fix did not rectify the issue with the Amlogic devices. Have any of you seen the same thing?
This sounds an awful lot like what I've been observing since at least 4.18. Go back a couple pages in this thread (viewtopic.php?f=135&t=22717&start=850#p231545) and you'll see a detailed summary.

tonymac32
Posts: 5
Joined: Sun Dec 09, 2018 1:50 pm
languages_spoken: english
ODROIDs: XU4 (liquid-cooled)
XU4-Q
C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by tonymac32 » Mon Dec 10, 2018 3:27 pm

campbell wrote:This sounds an awful lot like what I've been observing since at least 4.18. Go back a couple pages in this thread (viewtopic.php?f=135&t=22717&start=850#p231545) and you'll see a detailed summary.
Right, it seems to have appeared in 4.17. I've been testing with stuff plugged in it would seem, not testing a cold boot with no peripherals.

https://patchwork.kernel.org/patch/10720173/

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Dec 10, 2018 3:46 pm

tonymac32 wrote:
campbell wrote:This sounds an awful lot like what I've been observing since at least 4.18. Go back a couple pages in this thread (viewtopic.php?f=135&t=22717&start=850#p231545) and you'll see a detailed summary.
Right, it seems to have appeared in 4.17. I've been testing with stuff plugged in it would seem, not testing a cold boot with no peripherals.

https://patchwork.kernel.org/patch/10720173/
It appears some fixes for dwc2 reset issues are in 4.20-rc, can anyone confirm the issue with 4.20 ?

4.20 dwc2 driver history (rockchip board is added to mainline also in 4.20)
https://git.kernel.org/pub/scm/linux/ke ... rep&q=dwc2

Thanks,
Brad

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Dec 10, 2018 5:30 pm

I asked developers and Neil mentioned the fix was pushed yesterday :)

I tested 4.20-rc6 with this patch successfully https://lore.kernel.org/linux-amlogic/2 ... l.com/T/#t

I now boot with no devices attached and they are detected when I plugin after boot (or disconnect / reconnect)

tonymac32
Posts: 5
Joined: Sun Dec 09, 2018 1:50 pm
languages_spoken: english
ODROIDs: XU4 (liquid-cooled)
XU4-Q
C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by tonymac32 » Tue Dec 11, 2018 9:12 am

brad wrote:I asked developers and Neil mentioned the fix was pushed yesterday :)

I tested 4.20-rc6 with this patch successfully https://lore.kernel.org/linux-amlogic/2 ... l.com/T/#t

I now boot with no devices attached and they are detected when I plugin after boot (or disconnect / reconnect)
Right, that's the patch I linked to above, I'll adjust mine in case DWC2_POWER_DOWN_PARAM_NONE is something other than "0". I had shown Neil the fix I used the morning of the 9th, so everyone must have been coming up on it together. ;)

4.19 is set to be the next "default" Armbian image, with 4.20 + being "next" and "dev" as they appear and mature. I'm still having some ugly HDMI problems, so 4.19 might still be a little while before it hits users... (currently available as a nightly download from dl.armbian.com if anyone wants to make tests)

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Tue Dec 11, 2018 12:17 pm

Patch will only work on 4.20-rc6 or greater as this is when dwc2 updates were pushed

tonymac32
Posts: 5
Joined: Sun Dec 09, 2018 1:50 pm
languages_spoken: english
ODROIDs: XU4 (liquid-cooled)
XU4-Q
C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by tonymac32 » Tue Dec 11, 2018 2:39 pm

brad wrote:Patch will only work on 4.20-rc6 or greater as this is when dwc2 updates were pushed
Mine works on 4.19, tested across all of my S905 devices, so no worries.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Tue Dec 11, 2018 3:04 pm

tonymac32 wrote: Mine works on 4.19, tested across all of my S905 devices, so no worries.
That's great, was thinking it would only work after 4.20 updates to dwc2 but 4.19 has what is needed

scpcom
Posts: 77
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english
Contact:

Re: Odroid C2 mainline kernel support

Unread post by scpcom » Fri Dec 14, 2018 7:54 am

Update 20181208
- Kernel 4.19.8
- Added support for UMP in compat mode (mali-r6p2-2001-ump_hybrid.patch)
- Added support for Mali r5p1 (mali-r6p2-2002-mali_hybrid_v800.patch)
linux-4.19-odroidc2-build.tar.gz linux-image-4.19.8-20181208-c2-arm64.zip

Mali UMP now also works in compatiblity mode (64 bit arm64 kernel, 32 bit armhf linux/userland).
Additionally you can use r5p1 libs found in Amlogic buildroot.

The mali driver now works with r5p1, r6p2 and r7p0 Amlogic and Hardkernel builds armhf/arm64.

fvolk
Posts: 219
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by fvolk » Fri Dec 14, 2018 7:53 pm

brad wrote: I now boot with no devices attached and they are detected when I plugin after boot (or disconnect / reconnect)
This is awesome! Finally! :-)

This was the missing piece to run a current kernel on a C2 in headless server mode, where one can attach/detach USB disks later as needed.

When will this land in a new server minimal install image - or is the only option "roll your own kernel" for now?

MrGlasspoole
Posts: 25
Joined: Sat Dec 31, 2016 6:04 pm
languages_spoken: english, german
Contact:

Re: Odroid C2 mainline kernel support

Unread post by MrGlasspoole » Mon Dec 17, 2018 4:04 am

Sorry, but what image do i need to implement that: http://seafile.servator.de/sbc/odroid/n ... nstall.txt
And does it work with lite versions (no desktop)?

Because normally i use DietPi or Armbian.

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Odroid C2 mainline kernel support

Unread post by outhudd9 » Mon Dec 17, 2018 8:48 pm

MrGlasspoole wrote:Sorry, but what image do i need to implement that: http://seafile.servator.de/sbc/odroid/n ... nstall.txt
I'm sure scpcom can answer better than I can, but I think everything in that text file should still exist and install OK. The image you need is included there in that text file.

But you can install linux-image-4.19.8-20181208-c2-arm64.zip instead of the 20181110 version in the text file to get the latest.

MrGlasspoole
Posts: 25
Joined: Sat Dec 31, 2016 6:04 pm
languages_spoken: english, german
Contact:

Re: Odroid C2 mainline kernel support

Unread post by MrGlasspoole » Tue Dec 18, 2018 7:41 am

I mean what image to start with before i follow the steps in the install.txt. The one i flash to the SD with Etcher...

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Odroid C2 mainline kernel support

Unread post by outhudd9 » Tue Dec 18, 2018 6:06 pm


brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Jan 07, 2019 10:18 am

4.20 was released a few weeks ago and still a few bugs for the Odroid C2 I experienced including:

- Ethernet performance very slow (fix was pushed for 4.21 and should be backported to stable shortly after, its a devicetree fix)
- USB devices not detected after boot (long running issue with fix pushed by developers to hopefully 4.21)

Also its 2019, Linus is back and we are due for a version change to 5.0 so 4.21 might not exist :)

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Mon Jan 07, 2019 11:49 am

brad wrote:
Mon Jan 07, 2019 10:18 am
its a devicetree fix
Do you know the specifics so we can apply this manually in the meantime?

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Jan 07, 2019 12:53 pm

And 4.21 has officially become 5.0 - https://www.kernel.org/

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Mon Jan 07, 2019 5:22 pm

campbell wrote:
Mon Jan 07, 2019 11:49 am
brad wrote:
Mon Jan 07, 2019 10:18 am
its a devicetree fix
Do you know the specifics so we can apply this manually in the meantime?
This is the patch used - https://patchwork.kernel.org/patch/10717921/

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Fri Jan 11, 2019 4:17 am

USB hotplug is still not working under Arch Linux as of 4.20.1-1-ARCH released this morning.

edit: Nor is it working with 5.0.0-rc1

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Sat Jan 12, 2019 7:39 am

campbell wrote:
Fri Jan 11, 2019 4:17 am
USB hotplug is still not working under Arch Linux as of 4.20.1-1-ARCH released this morning.

edit: Nor is it working with 5.0.0-rc1
I notice that the fix is applied to kernel v4.20.1 - https://git.kernel.org/pub/scm/linux/ke ... dd24d1f16f

And it looks to be part of 4.20.1-1-ARCH, this was the fix I tested working on my C2. Sorry to hear it is not working for you on arch. It has not been applied to v5.0-rc as yet.

I will recheck with 4.20.1 when I have a chance.

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Tue Jan 15, 2019 3:31 pm

brad wrote:
Sat Jan 12, 2019 7:39 am
campbell wrote:
Fri Jan 11, 2019 4:17 am
USB hotplug is still not working under Arch Linux as of 4.20.1-1-ARCH released this morning.

edit: Nor is it working with 5.0.0-rc1
I notice that the fix is applied to kernel v4.20.1 - https://git.kernel.org/pub/scm/linux/ke ... dd24d1f16f

And it looks to be part of 4.20.1-1-ARCH, this was the fix I tested working on my C2. Sorry to hear it is not working for you on arch. It has not been applied to v5.0-rc as yet.

I will recheck with 4.20.1 when I have a chance.
Under both 4.20.1 and 4.20.2 what I'm seeing is that if you boot the board with nothing plugged in, and then plug something in, it works the first time, but if you unplug it and plug it back again it doesn't come back up a second time. If you boot the board with something plugged in, and then unplug it and plug it back in, it doesn't come back.

Something else just occurred to me, have you removed the jumper next to the microUSB port? Can you check it with and without? My board is buttoned up inside an enclosure without the jumper on it, so I can't check easily. I believe new boards still come with the jumper attached (which is borderline unsafe if you power it via the barrel jack instead of microUSB and don't read the part of the website that says to remove it). If the patch in 4.20.1 only works with the jumper attached then that's a pretty serious problem.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Wed Jan 16, 2019 6:04 am

campbell wrote:
Tue Jan 15, 2019 3:31 pm

Under both 4.20.1 and 4.20.2 what I'm seeing is that if you boot the board with nothing plugged in, and then plug something in, it works the first time, but if you unplug it and plug it back again it doesn't come back up a second time. If you boot the board with something plugged in, and then unplug it and plug it back in, it doesn't come back.

Something else just occurred to me, have you removed the jumper next to the microUSB port? Can you check it with and without? My board is buttoned up inside an enclosure without the jumper on it, so I can't check easily. I believe new boards still come with the jumper attached (which is borderline unsafe if you power it via the barrel jack instead of microUSB and don't read the part of the website that says to remove it). If the patch in 4.20.1 only works with the jumper attached then that's a pretty serious problem.
I did some more tests and it appears to be device specific, ie I have a usb to micro adaptor that causes the entire hub to fail if hot plugged (its fine plugged in at boot). I have other devices that are ok, ie a wireless keyboard mouse & also a usb sound card.

My current odroid c2 is almost 3 years old and has jumper removed (I have triied usb powers with jumper attached also). I have broken the sd connector on it which is making it harder for me to test at the moment but I have a new one on order. Ill see if I can work what is different about the devices that fail and what might be the cause.

huantxo
Posts: 29
Joined: Thu Feb 22, 2018 1:09 am
languages_spoken: English, Spanish
ODROIDs: HC1, XU4, C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by huantxo » Thu Jan 17, 2019 12:47 am

Changing a little bit the subject, has anyone gotten to work the higher CPU frequencies (above 1.536 GHz) with the mainline kernel?

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Fri Jan 18, 2019 3:39 am

Latest power consumption numbers with 4.20.2 kernel just in case anyone is tracking this:

- Early 2016 Odroid C2 in cogent.design aluminium heatsink enclosure, 16 GB red eMMC
- Arch Linux with 4.20.2 kernel (430 mW less than 3.16.61-2-ARCH)
- Powering via barrel jack with OTG jumper removed (important, worth at least 1 W, and not under the heatsink, you can damage yourself or your gear)
- Ethernet limited to 100baseTX via ethtool
- Ondemand governor

Resulting core temperature reported in sysfs is 27-28 C, and idle power draw is 810 mW.

- Ethernet limited to 10baseT via ethtool (~30 mW)
- Reduce RAM clock to 408 MHz via script from Hardkernel (~100 mW)
- Disable USB in device tree (~40 mW)

The above additional changes drop the idle power consumption to 640 mW. The single greatest drop (other than improperly leaving the jumper attached) is due to substituting the mainline kernel for the 3.16.x kernel. You can drop it a small bit further by disabling cores but the costs outweigh the benefits.
Last edited by campbell on Sat Jan 19, 2019 1:01 am, edited 2 times in total.

User avatar
rooted
Posts: 6440
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: Odroid C2 mainline kernel support

Unread post by rooted » Fri Jan 18, 2019 11:19 am

How much is limiting to 100 vs 1000 megabit worth?

campbell
Posts: 381
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: N2, C2, C1+, XU4, XU3, Cloudshell, Smart Power
Contact:

Re: Odroid C2 mainline kernel support

Unread post by campbell » Fri Jan 18, 2019 2:29 pm

rooted wrote:
Fri Jan 18, 2019 11:19 am
How much is limiting to 100 vs 1000 megabit worth?
About 230 milliwatts.

Flole
Posts: 28
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by Flole » Wed Jan 23, 2019 7:07 am

Does anybody in here have a recent kernel with Netboot and DHCP Support?

@tobetter Are you planning on updating your launchpad builds? Those were always very helpful for me!

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Wed Jan 23, 2019 4:41 pm

campbell wrote:
Fri Jan 18, 2019 2:29 pm
rooted wrote:
Fri Jan 18, 2019 11:19 am
How much is limiting to 100 vs 1000 megabit worth?
About 230 milliwatts.
I have been playing with sdio port (on the 40pin header) with mainline kernel & sd card (success). I have a few cheap sdio boards on order to try out low power wifi on 40 pin which I I am optimistically hoping to work. If it does power consumption will be of interest. If I disable USB and Ethernet what type of savings in total would you expect on mainline @campbell? I would hopefully use sdio for wifi (who knows at this stage how much power it will consume if it works) and uart (or GPIO) for keyboard/mouse if I need it.

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Wed Jan 23, 2019 4:46 pm

Flole wrote:
Wed Jan 23, 2019 7:07 am
Does anybody in here have a recent kernel with Netboot and DHCP Support?
I am testing a somewhat recent copy at the moment (4.20-rc6) but I find with netboot/DHCP the ethernet lights are not valid (lights are set in uboot but netboot resets to default values which are not really compatible with C2). I will try a build with 5.something on the weekend and can post it then but I think the lights might still be an issue atm.

Flole
Posts: 28
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2
Contact:

Re: Odroid C2 mainline kernel support

Unread post by Flole » Wed Jan 23, 2019 10:30 pm

As long as it boots I am fine with it, the only thing that is really important is NFSROOT and DHCP for me, as long as that works . You mean the ethernet lights that show if it's a 1000/100 connection and if there is a connection at all? I'm totally fine with those not working, I never understood why those are there anyways (I mean on almost every device I could just look in the software, I don't need 2 LEDs consuming power) :D

brad
Posts: 819
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Odroid C2 mainline kernel support

Unread post by brad » Thu Jan 24, 2019 5:11 pm

campbell wrote:
Fri Jan 18, 2019 3:39 am
- Ethernet limited to 10baseT via ethtool (~30 mW)
Energy Efficient Ethernet (EEE) is no longer disabled in some newer kernels :) This might provide some additional benefits for power saving for Ethernet be it 10, 100 or 1000. I don't have easy tools to check :( https://git.kernel.org/pub/scm/linux/ke ... 3fa639d1c9

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 5 guests