Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

Unread postby brad » Fri Oct 27, 2017 2:49 pm

campbell wrote:This is a specific bug that only currently occurs in 4.14-RC and has a fix that has just not made it into the Arch repo yet. If you upgrade to 4.13 (the latest actually released kernel) it's fine.


Looks like fixes will make it into 4.14...

http://lists.infradead.org/pipermail/li ... 04838.html

Interestingly Jerome has tested these fixes in hs400 mode at 220MB/s read which is very respectable. Im not sure of the make of the emmc.
brad
 
Posts: 605
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby daggs » Sun Nov 05, 2017 2:57 am

Greetings,

what is the support status of latest stable kernel? does one needs special patches to get the board to boot?
daggs
 
Posts: 196
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2

Re: Odroid C2 mainline kernel support

Unread postby asavah » Sun Nov 05, 2017 7:04 am

Few hours ago I've built the kernel straight from mainline master which already has the patches that were supposed to fix mmc merged ...
No luck, the board boots fine but with emmc in RO, CRC errors.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby rpcameron » Sun Nov 05, 2017 8:50 am

daggs wrote:Greetings,

what is the support status of latest stable kernel? does one needs special patches to get the board to boot?

I'm running mainline 4.13.11 on mainline u-boot 2017.09 without much issue off eMMC. I get occasional hangs, but otherwise everything's fine. (Well, except for the issue of USB devices only being recognized when they are inserted in pairs as previously acknowledged.)
rpcameron
 
Posts: 256
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby maxvirrozeito » Fri Nov 10, 2017 9:09 pm

I am looking for a bit of help running mainline u-boot with mainline Linux kernel. I am using an Odroid-C2 headless so from what I read, the current level of support in mainline Linux should be sufficient for me.

This thread has been helpful so far, I managed to run u-boot 2017.09 but I am struggling with the kernel (4.13.9).
boot.ini although present in the boot partition of the SD card does not seem to get called and instead u-boot tries to find an OS with TFTP.

If I interrupt the booting sequence, then I can enter a few commands
Code: Select all
setenv bootargs "console=tty0 boot=/dev/mmcblk0p1 root=/dev/mmcblk0p2 rootwait ro"
fatload mmc 0:1 0x1080000 uImage
fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb
bootm 0x1080000 - 0x1000000

Then the kernel hangs with 'Starting kernel...'
(The blue LED is flashing)

What should I look for to debug this problem? Thank you in advance for your help
maxvirrozeito
 
Posts: 4
Joined: Fri Nov 10, 2017 9:00 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: Odroid C2 mainline kernel support

Unread postby rpcameron » Fri Nov 10, 2017 11:05 pm

maxvirrozeito wrote:I am looking for a bit of help running mainline u-boot with mainline Linux kernel. I am using an Odroid-C2 headless so from what I read, the current level of support in mainline Linux should be sufficient for me.

This thread has been helpful so far, I managed to run u-boot 2017.09 but I am struggling with the kernel (4.13.9).
boot.ini although present in the boot partition of the SD card does not seem to get called and instead u-boot tries to find an OS with TFTP.

If I interrupt the booting sequence, then I can enter a few commands
Code: Select all
setenv bootargs "console=tty0 boot=/dev/mmcblk0p1 root=/dev/mmcblk0p2 rootwait ro"
fatload mmc 0:1 0x1080000 uImage
fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb
bootm 0x1080000 - 0x1000000

Then the kernel hangs with 'Starting kernel...'
(The blue LED is flashing)

What should I look for to debug this problem? Thank you in advance for your help

Mainline uboot does not use the boot.ini. It needs a compiled script, and the syntax is slightly different.
rpcameron
 
Posts: 256
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby maxvirrozeito » Fri Nov 10, 2017 11:25 pm

Ok. I actually compiled my boot.ini into boot.scr with the command:
Code: Select all
mkimage -C none -A arm -T script -d boot.ini boot.scr

and that boot.scr is now automatically picked up when u-boot runs.

I am still left with the problem that the kernel does not start properly or hangs.
My boot.ini is as follows. Is there something that looks wrong with the syntax?

Code: Select all
#------------------------------------------------------------------------------------------------------
#
# boot.ini identification
#
#------------------------------------------------------------------------------------------------------
ODROIDC2-UBOOT-CONFIG

#------------------------------------------------------------------------------------------------------
#
# Boot Specific Stuff
#
# Note: set root=root=/dev/mmcblk0p2 for mmc card boot
#------------------------------------------------------------------------------------------------------
setenv bootrootfs "root=UUID=2eb32696-27ff-4fc1-9201-e4b501bc3d17"

# Auto Detection of Monitor settings based on your Screen information
# See: http://odroid.com/dokuwiki/doku.php?id=en:c2_auto_detect_display
setenv display_autodetect "true"

# HDMI mode
setenv m "1080p60hz" # Progressive 60Hz

# HDMI BPP Mode
setenv m_bpp "32"

# Uncomment only a single Line! The line with setenv written.
# At least one mode must be selected.
# setenv vout "dvi"
# setenv vout "vga"

# HDMI HotPlug Detection control
# Allows you to force HDMI thinking that the cable is connected.
# true = HDMI will believe that cable is always connected
# false = will let board/monitor negotiate the connection status
setenv hpd "true"
# setenv hpd "false"

# Meson Timer
# 1 - Meson Timer
# 0 - Arch Timer
# Using meson_timer improves the video playback however it breaks KVM (virtualization).
# Using arch timer allows KVM/Virtualization to work however you'll experience poor video
setenv mesontimer "1"

# Server Mode (aka. No Graphics)
# Setting nographics to 1 will disable all video subsystem
# This mode is ideal of server type usage. (Saves ~300Mb of RAM)
setenv nographics "0"

# Monitor output
# Controls if HDMI PHY should output anything to the monitor
setenv monitor_onoff "false" # true or false

# UHS (Ultra High Speed) MicroSD mode enable/disable
setenv disableuhs "false"

# MicroSD Card Detection enable/disable
# Force the MMC controlled to believe that a card is connected.
setenv mmc_removable "true"

# USB Multi WebCam tweak
# Only enable this if you use it.
setenv usbmulticam "false"

# Disable/Enable ODROID-VU7 Touchscreen
setenv disable_vu7 "true"

#------------------------------------------------------------------------------------------------------
#
# Console Setup
#   setenv condev "console=ttyAML0,115200n8"                # on serial port
#   setenv condev "console=tty0"                            # on display (HDMI)
#   setenv condev "console=tty0 console=ttyAML0,115200n8"   # on both
#
#------------------------------------------------------------------------------------------------------
setenv console "console=tty0 console=ttyAML0,115200n8"

#------------------------------------------------------------------------------------------------------
#
# LibreELEC variables
#
# Setup the LibreELEC options
#   valid values are: textmode debugging progress nofsck nosplash noram overlay quiet ssh
#------------------------------------------------------------------------------------------------------
# setenv libreelec "quiet"

#------------------------------------------------------------------------------------------------------
#
# Odroid C2 specific
#
#------------------------------------------------------------------------------------------------------
setenv odroid   "no_console_suspend consoleblank=0 loglevel=8 debug ro rootwait"

# CPU Frequency / Cores control
###########################################
### WARNING!!! WARNING!!! WARNING!!!
# Before changing anything here please read the wiki entry:
# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq
#
# MAX CPU's
# setenv maxcpus "1"
# setenv maxcpus "2"
# setenv maxcpus "3"
setenv maxcpus "4"

# MAX Frequency
# setenv max_freq "2016"  # 2.016GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1920"  # 1.920GHz
# setenv max_freq "1896"  # 1.896GHz
# setenv max_freq "1752"  # 1.752GHz
# setenv max_freq "1680"  # 1.680GHz
# setenv max_freq "1656"  # 1.656GHz
setenv max_freq "1536"  # 1.536GHz

#------------------------------------------------------------------------------------------------------
#
# U-Boot bootcmd command
#
#------------------------------------------------------------------------------------------------------
setenv kernel  "fatload mmc 0:1 0x1080000 uImage"
setenv dtb     "fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb"
setenv bootseq "bootm 0x1080000 - 0x1000000"
setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"

#------------------------------------------------------------------------------------------------------
#
# Kernel boot
#
#------------------------------------------------------------------------------------------------------

# Populate the final bootcmd
setenv bootargs "${console} ${bootrootfs} ${odroid} ${libreelec}"

# Boot the board
run bootcmd

For the rootfs, I just extracted an Ubuntu 17.04 tar.gz image into the second partition of the SD card formatted as ext4.
maxvirrozeito
 
Posts: 4
Joined: Fri Nov 10, 2017 9:00 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: Odroid C2 mainline kernel support

Unread postby asavah » Sat Nov 11, 2017 5:22 am

What's the output you get?

What is the binutils version used to build your kernel?
For me building mainline kernel with 2.29.1 resulted in "Starting kernel ..." and silence (mainline-uboot too)
Building with binutils 2.28.1 results in kernel actually booting but EMMC is read-only with 4.14

My boot.txt (mostly stolen from ALARM)
Code: Select all
test -n "${distro_bootpart}" || setenv distro_bootpart 1
setenv bootargs "console=ttyAML0,115200n8 console=tty1 root=/dev/mmcblk0p2 ro rootwait earlycon"

if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} Image; then
  if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} meson-gxbb-odroidc2.dtb; then
      booti ${kernel_addr_r} - ${fdt_addr_r};
  fi;
fi


EDIT: PS: You seem to be using modified old LE boot.ini for HK uboot, most of that stuff is no longer valid with mainline.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby maxvirrozeito » Tue Nov 14, 2017 12:06 am

EDIT: PS: You seem to be using modified old LE boot.ini for HK uboot, most of that stuff is no longer valid with mainline.


This is true, it is probably a mix and match. I did not know what was still relevant for mainline u-boot so I left everything but it needs cleaning up. Is there any documentation that could help me determining what I can leave out safely instead of doing a lot of trial and error?

Regarding the mainline kernel, after rebuilding it, it now boots. I had some rootfs issues also. At least I have a prompt now but it is quite basic. It is a Ubuntu minimal image (17.10) but I cannot even get apt-get to update/install packages.

However, when I plug the SD card in a laptop and chroot to it, I can update everything I need. So it could be a rw issue.
maxvirrozeito
 
Posts: 4
Joined: Fri Nov 10, 2017 9:00 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Nov 14, 2017 2:53 am

I can confirm that after running pacman -Syu this morning, mainline kernel 4.14.0-1-ARCH is working fine, on an emmc, without the read-only-fs issue, and I get about 167 MB/s from "sudo dd if=/dev/mmcblk0 of=/dev/null bs=2048 status=progress" after one minute.
campbell
 
Posts: 200
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Nov 14, 2017 3:01 am

campbell wrote:I can confirm that after running pacman -Syu this morning, mainline kernel 4.14.0-1-ARCH is working fine, on an emmc, without the read-only-fs issue, and I get about 167 MB/s from "sudo dd if=/dev/mmcblk0 of=/dev/null bs=2048 status=progress" after one minute.

AND it seems to be just fine at recognising when a single USB device is plugged in!
campbell
 
Posts: 200
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby asavah » Tue Nov 14, 2017 9:17 am

campbell wrote:I can confirm that after running pacman -Syu this morning, mainline kernel 4.14.0-1-ARCH is working fine, on an emmc, without the read-only-fs issue, and I get about 167 MB/s from "sudo dd if=/dev/mmcblk0 of=/dev/null bs=2048 status=progress" after one minute.


Which emmc module you have?
Which uboot?

Mine is reported as
Code: Select all
[    1.172802] mmc0: new HS200 MMC card at address 0001
[    1.173196] mmcblk0: mmc0:0001 AGND3R 14.6 GiB


I get this error, haven't tried 4.14 release yet, the error is from rc
Code: Select all
[    1.795698] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Nov 14, 2017 1:12 pm

I'm using the mainline uboot and kernel in the Arch Linux repo. Scroll back a page or two in this thread to see the exact sequence for installing it.
Code: Select all
[    1.995677] mmc0: new HS200 MMC card at address 0001
[    1.996303] mmcblk0: mmc0:0001 SDW16G 14.7 GiB
Unfortunately I can't say for sure whether I had the read-only-filesystem issue with this same eMMC under 4.14-RC. I definitely did with one of the black ones (the ones for odroid C2 only). This is one of the red ones (the ones that work with either XU4 or C2). I'll try installing 4.14.0 on the black one later tonight or tomorrow if I get a chance.

[edit] Yes, the black one (which definitely didn't work under 4.14-RC) also works now:
Code: Select all
[    1.098771] mmc0: new HS200 MMC card at address 0001
[    1.099216] mmcblk0: mmc0:0001 8GND3R 7.28 GiB
campbell
 
Posts: 200
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby asavah » Tue Nov 14, 2017 9:35 pm

Thanks gotta rebuild all the stuff and try again later, fingers crossed.
My emmc is a black one.

> Scroll back a page or two in this thread to see the exact sequence for installing it.
Thanks, but I build all my stuff from source, I have build process figured out and scripted. :P
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby maxvirrozeito » Tue Nov 14, 2017 11:04 pm

With mainline u-boot (2017.09), mainline kernel (4.13.9) and Ubuntu minimal rootfs (17.10), I cannot connect over Ethernet.

The interface eth0 is missing altogether (only lo is present when invoking ifconfig). Has anyone faced this problem? If so, how could I resolve it?
I already tried to set something in /etc/network/interfaces but to no avail.
maxvirrozeito
 
Posts: 4
Joined: Fri Nov 10, 2017 9:00 pm
languages_spoken: english
ODROIDs: Odroid-C2

Re: Odroid C2 mainline kernel support

Unread postby asavah » Wed Nov 15, 2017 8:30 am

No luck, my emmc seems to refuse to work with 4.14 , emmc itself is ok, tested.
The system boots fine from sdcard.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby asavah » Wed Nov 15, 2017 10:58 am

Ok, this is getting better.
Finally figured it out. My emmc doesn't like 270 tx_phase, reverted it to 0 and voila - emmc runs fine.
I was able to add working hdmi (no audio yet) support by snatching a patchset from ML and and kernel patchwork.
Code: Select all
[    3.208902] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    3.214290] meson-drm d0100000.vpu: Failed to create debugfs directory
[    3.215483] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    3.224041] [drm] No driver support for vblank timestamp query.
[    3.228486] meson-drm d0100000.vpu: CVBS Output connector not available
[    3.266041] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    3.271414] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    3.272343] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops [meson_dw_hdmi])
[    3.566707] Console: switching to colour frame buffer device 240x67
[    3.612002] meson-drm d0100000.vpu: fb0:  frame buffer device
[    3.634643] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0


https://github.com/asavah/odroid-c2-mainline-patches
Patches are to be applied on top of vanilla linux-4.14.y tree.
Some patches are optional, see readme.
If your emmc works fine - don't apply odroidc2-tx-clock-0.patch
arm64-* patches are from armbian
I've only tested this with mainline uboot.

When prompted for MESON_GX_PM_DOMAINS and MESON_GX_SOCINFO say Y(es) , MESON_MX_SOCINFO is not needed for c2.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby teknoid » Thu Nov 16, 2017 8:12 am

Huge thanks go for the people from baylibre (https://github.com/baylibre) who are bringing meson support into mainline and all the kernel developers.
Huge "booooo" goes for hardkernel for not supporting their own hardware, and leaving odroid-c2 users with an outdated kernel plagued by hacks and affected by CVEs.


fulll ack!!!

I totally disappointed moved to nanopi.
User avatar
teknoid
 
Posts: 7
Joined: Sat May 27, 2017 3:02 am
languages_spoken: german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Thu Nov 16, 2017 11:47 am

@baylibre have contract with Amlogic to extend support to all Amlogic device.
moon.linux
 
Posts: 919
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby daggs » Fri Nov 17, 2017 9:48 pm

asavah wrote:Ok, this is getting better.
Finally figured it out. My emmc doesn't like 270 tx_phase, reverted it to 0 and voila - emmc runs fine.
I was able to add working hdmi (no audio yet) support by snatching a patchset from ML and and kernel patchwork.
Code: Select all
[    3.208902] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    3.214290] meson-drm d0100000.vpu: Failed to create debugfs directory
[    3.215483] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    3.224041] [drm] No driver support for vblank timestamp query.
[    3.228486] meson-drm d0100000.vpu: CVBS Output connector not available
[    3.266041] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    3.271414] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    3.272343] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops [meson_dw_hdmi])
[    3.566707] Console: switching to colour frame buffer device 240x67
[    3.612002] meson-drm d0100000.vpu: fb0:  frame buffer device
[    3.634643] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0


https://github.com/asavah/odroid-c2-mainline-patches
Patches are to be applied on top of vanilla linux-4.14.y tree.
Some patches are optional, see readme.
If your emmc works fine - don't apply odroidc2-tx-clock-0.patch
arm64-* patches are from armbian
I've only tested this with mainline uboot.

When prompted for MESON_GX_PM_DOMAINS and MESON_GX_SOCINFO say Y(es) , MESON_MX_SOCINFO is not needed for c2.

two questions:
  1. if MESON_MX_SOCINFO is not needed, why 0000-mx-socinfo.patch is needed?
  2. I see vpu patches, this means that the vpu is fully supported?
daggs
 
Posts: 196
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2

Re: Odroid C2 mainline kernel support

Unread postby asavah » Fri Nov 17, 2017 10:03 pm

1) The patch was needed because otherwise the following patches would not apply cleanly, and I'm too lazy to rebase.
2) It's only vpu power support, which seems to be needed to enable hdmi. HW video decoding is not supported.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby gkkpch » Sat Nov 18, 2017 2:49 am

I have watched this thread with interest, my intention is to switch to a mainline kernel for Volumio 2 as soon as i2s is supported properly.
From Neil Amstrong's video I understand it will take a good number of months before audio is supported.
Our focus is stereo output , no need for multichannel (as of yet) because most "audiophile" devices don't support anything else.
Does anyone have more accurate info on this subject?

-- Gé --
User avatar
gkkpch
 
Posts: 241
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

Re: Odroid C2 mainline kernel support

Unread postby asavah » Sat Nov 18, 2017 4:34 am

AFAIK it's work in progress. i2s patches haven't hit the ML yet.
https://github.com/BayLibre/libretech-l ... hdmi-audio (AFAIK this is for HDMI audio only, but I'm no expert)

>Does anyone have more accurate info on this subject?
Guess we'll have to wait until amlogic gx* socs get a proper kernel with full support of all the functionality they have, when will this happen? No idea.
But it least there is some nice movement.
asavah
 
Posts: 16
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby gkkpch » Sat Nov 18, 2017 5:17 am

oh, nice HDMI is getting there.
But while waiting for spdif and i2s we will stick to the 3.14 kernel before it makes sense to switch.
User avatar
gkkpch
 
Posts: 241
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 6 guests