Jump to content
  • 0

Odroid C2 general


TonyMac32
 Share

Question

This week we discontinued the default 3.x kernel for the Odroid C2, and are working on the 4.18/4.19 kernels.

 

A few odds and ends have come up, the biggest one appears to be the gpio-hog in the C2 device tree somehow not working, causing the USB hub on the board to never be powered on. 

root@odroidc2:/sys/class/gpio# cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 378-496, parent: platform/c8834000.periphs:pinctrl@4b0, periphs-banks:
 gpio-392 (                    |mdio-reset          ) out hi
 gpio-407 (                    |reset               ) out hi
 gpio-422 (                    |cd                  ) in  lo
 gpio-465 (                    |TFLASH_VDD          ) out hi

gpiochip0: GPIOs 497-511, parent: platform/c8100000.bus:pinctrl@14, aobus-banks:
 gpio-500 (                    |TF_IO               ) out lo
 gpio-501 (                    |usb-hub-reset       ) out hi
 gpio-502 (                    |USB_OTG_PWR         ) out hi
 gpio-510 (                    |c2:blue:alive       ) out lo

The hog claims it is there, but I get no power to the port.

 

 

The other is the HDMI output becoming extremely fussy about the sort of monitor it's been given.

[update]

 

On the NanoPi K2 I actually get a crash on boot with my HDMI --> DVI adapter monitor.  With both monitors, if plugged in after boot, desktop displays (on C2 only the pure HDMI monitor will display at all), but a fault occurs:

Spoiler

 


[  312.393869] WARNING: CPU: 3 PID: 2809 at drivers/gpu/drm/meson/meson_crtc.c:150 meson_crtc_atomic_begin+0x64/0x70 [meson_drm]
[  312.393880] Modules linked in: fuse brcmfmac brcmutil lz4hc cfg80211 lz4hc_compress snd_soc_hdmi_codec rc_cec rfkill snd_soc_simple_card dw_hdmi_cec dw_hdmi_i2s_audio snd_soc_simple_card_utils meson_vdec snd_soc_core snd_pcm_dmaengine videobuf2_dma_contig snd_pcm meson_dw_hdmi videobuf2_memops snd_timer v4l2_mem2mem dw_hdmi snd meson_drm cec videobuf2_v4l2 drm_kms_helper soundcore videobuf2_common drm videodev meson_rng rng_core media drm_panel_orientation_quirks meson_ir rc_core meson_gxbb_wdt pwm_meson scpi_hwmon zram zsmalloc ip_tables x_tables realtek
[  312.394080] CPU: 3 PID: 2809 Comm: Xorg Tainted: G        W         4.19.1-meson64 #2
[  312.394086] Hardware name: friendlyarm,nanopi-k2 (DT)
[  312.394095] pstate: 40000005 (nZcv daif -PAN -UAO)
[  312.394117] pc : meson_crtc_atomic_begin+0x64/0x70 [meson_drm]
[  312.394138] lr : meson_crtc_atomic_begin+0x20/0x70 [meson_drm]
[  312.394144] sp : ffff00000dbb3a00
[  312.394149] x29: ffff00000dbb3a00 x28: 0000000000000000
[  312.394162] x27: ffff80007085e600 x26: ffff80005ce4be00
[  312.394176] x25: ffff8000707cb078 x24: ffff80005ccc5900
[  312.394189] x23: 0000000000000038 x22: 0000000000000000
[  312.394201] x21: 0000000000000000 x20: 0000000000000001
[  312.394214] x19: ffff8000707cb018 x18: 0000000000000000
[  312.394227] x17: 0000000000000000 x16: 0000000000000000
[  312.394239] x15: 0000000000000000 x14: 0000046500000441
[  312.394252] x13: 0000043c00000465 x12: 0000043800000438
[  312.394264] x11: 0000000000000898 x10: 00000804000007d8
[  312.394277] x9 : ffff000008e69888 x8 : ffff000000bea000
[  312.394290] x7 : 0000000000000000 x6 : ffff800070f2d168
[  312.394302] x5 : 0000000000000000 x4 : 0000000000000001
[  312.394315] x3 : 0000000000000000 x2 : 0000000000000000
[  312.394327] x1 : ffff800066ae8000 x0 : 00000000ffffffea
[  312.394340] Call trace:
[  312.394362]  meson_crtc_atomic_begin+0x64/0x70 [meson_drm]
[  312.394461]  drm_atomic_helper_commit_planes+0x70/0x208 [drm_kms_helper]
[  312.394543]  drm_atomic_helper_commit_tail+0x30/0x78 [drm_kms_helper]
[  312.394628]  commit_tail+0x74/0x78 [drm_kms_helper]
[  312.394712]  drm_atomic_helper_commit+0xe8/0x168 [drm_kms_helper]
[  312.394919]  drm_atomic_commit+0x48/0x58 [drm]
[  312.395001]  drm_atomic_helper_set_config+0x84/0xc0 [drm_kms_helper]
[  312.395174]  drm_mode_setcrtc+0x140/0x600 [drm]
[  312.395344]  drm_ioctl_kernel+0x88/0x100 [drm]
[  312.395511]  drm_ioctl+0x1ac/0x3e0 [drm]
[  312.395527]  do_vfs_ioctl+0xb8/0x8e0
[  312.395536]  ksys_ioctl+0x80/0xb8
[  312.395546]  __arm64_sys_ioctl+0x1c/0x28
[  312.395559]  el0_svc_common+0x60/0xe8
[  312.395569]  el0_svc_handler+0x24/0x80
[  312.395578]  el0_svc+0x8/0xc
[  312.395584] ---[ end trace 6dcc4ef2fc3d8888 ]---
[  312.395999] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/drm_vblank.c:1026 drm_vblank_put+0xa0/0xb8 [drm]
[  312.396019] Modules linked in: fuse brcmfmac brcmutil lz4hc cfg80211 lz4hc_compress snd_soc_hdmi_codec rc_cec rfkill snd_soc_simple_card dw_hdmi_cec dw_hdmi_i2s_audio snd_soc_simple_card_utils meson_vdec snd_soc_core snd_pcm_dmaengine videobuf2_dma_contig snd_pcm meson_dw_hdmi videobuf2_memops snd_timer v4l2_mem2mem dw_hdmi snd meson_drm cec videobuf2_v4l2 drm_kms_helper soundcore videobuf2_common drm videodev meson_rng rng_core media drm_panel_orientation_quirks meson_ir rc_core meson_gxbb_wdt pwm_meson scpi_hwmon zram zsmalloc ip_tables x_tables realtek
[  312.396395] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W         4.19.1-meson64 #2
[  312.396400] Hardware name: friendlyarm,nanopi-k2 (DT)
[  312.396410] pstate: 20000085 (nzCv daIf -PAN -UAO)
[  312.396589] pc : drm_vblank_put+0xa0/0xb8 [drm]
[  312.396762] lr : drm_crtc_vblank_put+0x18/0x20 [drm]
[  312.396768] sp : ffff000008003de0
[  312.396773] x29: ffff000008003de0 x28: 0000000000000001
[  312.396787] x27: ffff000008ceee28 x26: ffff000008ef0c8a
[  312.396817] x25: ffff80007134c000 x24: ffff000008e69000
[  312.396871] x23: 0000000000000020 x22: 0000000000000080
[  312.396897] x21: ffff8000707cb018 x20: ffff000008e69000
[  312.396910] x19: ffff800070f2c218 x18: 0000000000000000
[  312.396922] x17: 0000000000000000 x16: 0000000000000000
[  312.396935] x15: 000000000000684c x14: 0000000000006878
[  312.396947] x13: 0000000000006874 x12: 0000000000006870
[  312.396960] x11: 000000000000686c x10: 0000000000006840
[  312.396972] x9 : 0000000000007498 x8 : 0000000040000000
[  312.396984] x7 : 0000000000210d00 x6 : ffff000008e69888
[  312.396997] x5 : ffff000000ba5a5c x4 : 0000000000000001
[  312.397030] x3 : 0000000000000170 x2 : 0000000000000000
[  312.397074] x1 : ffff800070f2d000 x0 : ffff800070a51800
[  312.397087] Call trace:
[  312.397265]  drm_vblank_put+0xa0/0xb8 [drm]
[  312.397456]  drm_crtc_vblank_put+0x18/0x20 [drm]
[  312.397494]  meson_crtc_irq+0x7c/0x608 [meson_drm]
[  312.397514]  meson_irq+0x20/0x30 [meson_drm]
[  312.397533]  __handle_irq_event_percpu+0x74/0x188
[  312.397559]  handle_irq_event_percpu+0x34/0x88
[  312.397574]  handle_irq_event+0x48/0x78
[  312.397587]  handle_fasteoi_irq+0xa8/0x180
[  312.397597]  generic_handle_irq+0x24/0x38
[  312.397607]  __handle_domain_irq+0x5c/0xb0
[  312.397616]  gic_handle_irq+0x58/0xa8
[  312.397640]  el1_irq+0xb0/0x128
[  312.397665]  arch_cpu_idle+0x10/0x18
[  312.397678]  do_idle+0x1d4/0x298
[  312.397686]  cpu_startup_entry+0x24/0x28
[  312.397699]  rest_init+0xcc/0xd8
[  312.397712]  start_kernel+0x3d4/0x400
[  312.397718] ---[ end trace 6dcc4ef2fc3d8889 ]---

FYI @Neil Armstrong

Link to comment
Share on other sites

Recommended Posts

When discussing a problem make sure to provide full logs!

  • 0
how do I enable CEC?
There are usually three things you must check:
- CEC pins enabled in the device tree
- CEC enabled in kernel config
- libcec supporting the CEC driver's API


Right now I am working on CEC for Rockchip boards. Any finding you do regarding C2, please share here, or make a PR to contribute to the project.

Enviado desde mi moto g(6) plus mediante Tapatalk

Link to comment
Share on other sites

  • 0

Hello. Currently I'm working on the I2S support and the micro USB for the current mainline kernel.

 

I have the C2 connected to my monitor via HDMI. Using the current Focal Desktop image with 5.9.14 kernel the sound output is working only when the Desktop is enabled. speaker-test works as normal user

But when I disable the desktop, sound stops working.

I guess the X-server configures something in ALSA, pulseaudio or enables somthing in the HDMI interface. What is strange since the graphics output still works...

 

Do you have an hint for me where to look?

Link to comment
Share on other sites

  • 0

Anyone was able to patch the kernel and DT to go beyond 1.54 GHz on the C2?

Armbian is great, but it is frustrating to not be able to run at 1.75 GHz like I used to do with HK 3.16 kernel several years ago...

And to be clear, it was not cosmetic, as at 1,75 GHz, some CPU intensive tasks were not maxing the CPU load at 100% when at 1.54 it did.

 

I am completely lost with this kernel patching process, so I can’t do it by myself.

Would be great to have a optional kernel for those who want to use OC with C2.

Link to comment
Share on other sites

  • 0
Am 1.1.2021 um 10:07 schrieb marcel-kanter:

Currently I'm working on the I2S support

 

I2S support with mainline kernel images would be great indeed. I can imagine it needs to be enabled and an I2S audio device created via device tree overlay first, like in case of NanoPi H3 SBCs (and the I2S NanoHat PCM5102A):

  

Link to comment
Share on other sites

  • 0

Is there any chance to get access to the gpios on the pin header again?

 

In /sys/class/gpio only two "banks" are listed "gpiochip378" and "gpiochip497". From searching around the net, I think that gpiochip378 is for configuring HDMI and gpiochip497 only has 15 entries. I'd also expected to find the gpios in "gpiochip0" as on other platforms.

 

Was this just an oversight in the device tree, when moving to a newer kernel or is it left out on purpose?

 

P.S.: for me it's not required to access the gpios via /sys/class/gpio, any method to write to pin 40 (aka RasPi gpio21) would work for me.

Link to comment
Share on other sites

  • 0
On 2/8/2022 at 12:54 PM, SvOlli said:

Is there any chance to get access to the gpios on the pin header again?

 

In /sys/class/gpio only two "banks" are listed "gpiochip378" and "gpiochip497". From searching around the net, I think that gpiochip378 is for configuring HDMI and gpiochip497 only has 15 entries. I'd also expected to find the gpios in "gpiochip0" as on other platforms.

 

Was this just an oversight in the device tree, when moving to a newer kernel or is it left out on purpose?

 

P.S.: for me it's not required to access the gpios via /sys/class/gpio, any method to write to pin 40 (aka RasPi gpio21) would work for me.

 

https://github.com/torvalds/linux/blob/09688c0166e76ce2fb85e86b9d99be8b0084cdf9/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts#L294

 

all the GPIO on the headers should be there.

Link to comment
Share on other sites

  • 0
5 hours ago, TonyMac32 said:

all the GPIO on the headers should be there.

Thanks for pointing me out in the right direction. They are there, if you know where to look:

root@odroid-c2:~# grep -e J2 -e ^gpio /sys/kernel/debug/gpio 
gpiochip1: GPIOs 378-496, parent: platform/c8834000.bus:pinctrl@4b0, periphs-banks:
 gpio-456 (J2 Header Pin35     )
 gpio-460 (J2 Header Pin36     )
 gpio-461 (J2 Header Pin31     )
 gpio-466 (J2 Header Pin32     )
 gpio-467 (J2 Header Pin26     )
 gpio-470 (J2 Header Pin29     )
 gpio-471 (J2 Header Pin24     )
 gpio-472 (J2 Header Pin23     )
 gpio-473 (J2 Header Pin22     )
 gpio-474 (J2 Header Pin21     )
 gpio-475 (J2 Header Pin18     )
 gpio-476 (J2 Header Pin33     )
 gpio-477 (J2 Header Pin19     )
 gpio-478 (J2 Header Pin16     )
 gpio-479 (J2 Header Pin15     )
 gpio-480 (J2 Header Pin12     )
 gpio-481 (J2 Header Pin13     )
 gpio-482 (J2 Header Pin8      )
 gpio-483 (J2 Header Pin10     )
 gpio-489 (J2 Header Pin11     )
 gpio-491 (J2 Header Pin7      )
gpiochip0: GPIOs 497-511, parent: platform/c8100000.bus:pinctrl@14, aobus-banks:

Notice that the mapping is not 1:1 to a Raspberry Pi. The pin 40, that I wanted to use, for example is  an ADC input only. Maybe I can change the circuit to use pin 7 instead.

Link to comment
Share on other sites

  • 0
13 hours ago, SvOlli said:

Notice that the mapping is not 1:1 to a Raspberry Pi. The pin 40, that I wanted to use, for example is  an ADC input only. Maybe I can change the circuit to use pin 7 instead.

Right.  The C2 doesn't put as much effort into the Pi header compatibility as a lot of other boards.  I haven't used one for GPIO partly for that reason. 

 

I need to add some of my other boards to this but:

 

https://docs.google.com/spreadsheets/d/1dJq7MM1_zA5HtXywDMZ9HMKyPaNgGmkxnuz3wYuk4s8/edit?usp=sharing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...