Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Tue Mar 13, 2018 10:59 pm

Hi All,

If you want to use mainline kernel your probably need to install ArchLinux
works good on sdcard, we need to wait for eMMC support to land into Linux tree.

Installation on sdcard and eMMC.
Code: Select all
https://archlinuxarm.org/platforms/armv8/amlogic/odroid-c2


After fist boot up you can change to mainline using
Code: Select all
pacman -R uboot-odroid-c2
pacman -S uboot-odroid-c2-mainline linux-aarch64
reboot


it's hasel free upgrade latest stable kernel. Basic feature will work good on ArchLinux
we need to wait for 4.17 to look into usb support to work correctly.
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby jit-010101 » Tue Mar 13, 2018 11:19 pm

moon.linux wrote:Hi All,

If you want to use mainline kernel your probably need to install ArchLinux

...

it's hasel free upgrade latest stable kernel. Basic feature will work good on ArchLinux
we need to wait for 4.17 to look into usb support to work correctly.


Then I'd rather try to compile it myself ;) ...

ArchLinux distribution upgrade used to break things way to often regarding my experiences, much unlike Debian (even in testing) and I hate pacman with a passion (personal preference).

When I look at the Matrix it says S905 (=Odroid C2) should already have eMMC (minus the patch from 4.17) and basic USB support, or am I reading something wrong?

Are USB Wifi dongles working with 4.16 or is there a need for USB-Host e.g. ?
jit-010101
 
Posts: 18
Joined: Tue Mar 13, 2018 9:40 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby asavah » Sun Mar 18, 2018 11:44 am

For those building mainline kernel + u-boot:

u-boot v2018.03 is broken on odroid-c2, hangs while accessing mmc (both emmc or sdcard),
the following patch is needed https://github.com/xypron/u-boot-odroid ... lock.patch
mailing list thread https://lists.denx.de/pipermail/u-boot/ ... 18535.html

With the patch above the board boots fine with u-boot v2018.03 + kernel 4.16-rc5 atleast on sdcard, haven't tried emmc.
asavah
 
Posts: 18
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu Mar 22, 2018 6:06 am

tobetter wrote:I've spent few day to run 200Mhz on 3.14 kernel as well since it has little bit more code tune emmc bus. Unfortunately, no luck. FYI, maintainers are already merge the patch to set the clock to 100MHz.
https://patchwork.kernel.org/patch/10254653/

Maybe it would help to change the driver to accept the configuration from kernel command line or device tree itself if such configuration can improve the performance. My small doubt is that the configuration can be permanant to a board.

Just FYI, a couple weeks and 4.16 release candidates later, this change to 100 MHz doesn't appear to have taken effect in the Arch linux-aarch64-rc package yet.

[edit] Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?
campbell
 
Posts: 301
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 emk2203 » Tue Mar 27, 2018 6:08 am

brad wrote:I should build another precompiled kernel for C2, essentially the 4.13.0-rc4 version had non default settings enabled as below. Is there anything else that would be useful?..

- network PHY and ethernet drivers built in
- NFS root
- IP auto-configuration with DHCP (allow very early network and DHCP client in kernel to mount NFS root)
- Some extra USB device drivers enabled (audio, serial, wifi, bluetooth, hid, media, etc)
- GPIO interface exported to /sys/

Which version would be most suitable 4.14, 4.15 or 4.16-rc? 4.14 is Long term release but later should have HDMI enabled as standard.

I guess I can provide 2 dtb's as well, one default and one with emmc speed limited to 100MHz for compatibility. Also a quick guide on how it was all built and prepared for install to the C2.

If there is an interest I can probably provide a 4.14 patched and configured for realtime. (realtime patches are available for 4.14)

I think it would be best to provide a 4.16. It is just around the corner (easter release date). The quick guide would be awesome.

Maybe I missed something, but what's with the USB support only in 4.17?
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 summers » Wed Mar 28, 2018 6:37 pm

campbell wrote:
tobetter wrote:I've spent few day to run 200Mhz on 3.14 kernel as well since it has little bit more code tune emmc bus. Unfortunately, no luck. FYI, maintainers are already merge the patch to set the clock to 100MHz.
https://patchwork.kernel.org/patch/10254653/

Maybe it would help to change the driver to accept the configuration from kernel command line or device tree itself if such configuration can improve the performance. My small doubt is that the configuration can be permanant to a board.

Just FYI, a couple weeks and 4.16 release candidates later, this change to 100 MHz doesn't appear to have taken effect in the Arch linux-aarch64-rc package yet.

[edit] Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?

If you check the bottom of the patch it says "Applied v4.17 and CCed to stable"

This to me means that we won't see it until 4.17, due to the kernel release schedule - but it *may* come out on 4.15 sooner or later.

It certainly isn't in linus tree yet ...
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby narmstrong » Fri Mar 30, 2018 12:28 am

FYI HDMI and CEC landed on 4.16-rc for Odroid-C2, it will be available in the next few days.
narmstrong
 
Posts: 8
Joined: Tue Mar 21, 2017 7:06 pm
Location: Villeneuve-Loubet, France
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Fri Mar 30, 2018 8:05 pm

@narmstrong Thanks Neil.

what all user apps need to looked into for this to work on ArchLinux.
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu Apr 05, 2018 2:34 am

summers wrote:
campbell wrote:Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?

If you check the bottom of the patch it says "Applied v4.17 and CCed to stable"

This to me means that we won't see it until 4.17, due to the kernel release schedule - but it *may* come out on 4.15 sooner or later.

It certainly isn't in linus tree yet ...

The merge window for 4.17 has been open for a few days now and this change still hasn't been applied to Linus's tree...are the right people submitting the patches at the right times? Don't want this to fall off the radar, because it's still broken.
campbell
 
Posts: 301
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 summers » Thu Apr 05, 2018 11:13 pm

campbell wrote:
summers wrote:
campbell wrote:Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?

If you check the bottom of the patch it says "Applied v4.17 and CCed to stable"

This to me means that we won't see it until 4.17, due to the kernel release schedule - but it *may* come out on 4.15 sooner or later.

It certainly isn't in linus tree yet ...

The merge window for 4.17 has been open for a few days now and this change still hasn't been applied to Linus's tree...are the right people submitting the patches at the right times? Don't want this to fall off the radar, because it's still broken.

As was the official kernel maintainers for meson that posted it, then yes I'd still expect it in 4.17. However meson is some way down the food chain in the linux kernel IIRC, so that needs to be merged into various other trees - before it reaches linus. I think the merging should be automatic, as official maintainers - but doesn't mean its fast. So think the crunch point only comes when when rc1 comes out.

For what its worth, its listed as appearing in 4.17 here http://linux-meson.com/doku.php, but that the same people again.
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Thu Apr 05, 2018 11:55 pm

By the way basic DRM/KMS GUI is working on odroid c2 on Archlinux.
Code: Select all
Linux archlinuxc2 4.16.0-1-ARCH #1 SMP Mon Apr 2 18:40:18 MDT 2018 aarch64 GNU/Linux


lsusb -t
Code: Select all
[alarm@archlinuxc2 ~]$ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 1: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 2: Dev 5, If 0, Class=Vendor Specific Class, Driver=rt2800usb, 480M
        |__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M


Their seem to be lots of promise ahead...
Code: Select all
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.16.0-1-ARCH (builduser@leming) (gcc version 7.3.1 20180312 (GCC)) #1 SMP Mon Apr 2 18:40:18 MDT 2018
[    0.000000] Machine model: Hardkernel ODROID-C2
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000071c00000, size 188 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] earlycon: meson0 at MMIO 0x00000000c81004c0 (options '115200n8')
[    0.000000] bootconsole [meson0] enabled
[    0.000000] On node 0 totalpages: 519680
[    0.000000]   DMA32 zone: 8128 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 519680 pages, LIFO batch:31
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 25 pages/cpu @        (ptrval) s61720 r8192 d32488 u102400
[    0.000000] pcpu-alloc: s61720 r8192 d32488 u102400 alloc=25*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 511552
[    0.000000] Kernel command line: console=ttyAML0,115200n8 root=PARTUUID=d9880000-01 rw rootwait earlycon
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1821668K/2078720K available (12796K kernel code, 2340K rwdata, 5568K rodata, 1536K init, 797K bss, 64540K reserved, 192512K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 45755 entries in 179 pages
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000]  Tasks RCU enabled.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] irq_meson_gpio: 133 to 8 gpio interrupt mux initialized
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000003] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.008422] Console: colour dummy device 80x25
[    0.012527] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.022930] pid_max: default: 32768 minimum: 301
[    0.027679] Security Framework initialized
[    0.031674] Yama: becoming mindful.
[    0.035254] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.041920] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.049917] ASID allocator initialised with 32768 entries
[    0.054553] Hierarchical SRCU implementation.
[    0.060884] EFI services will not be available.
[    0.063647] smp: Bringing up secondary CPUs ...
[    0.068869] Detected VIPT I-cache on CPU1
[    0.068913] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.069866] Detected VIPT I-cache on CPU2
[    0.069888] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.070783] Detected VIPT I-cache on CPU3
[    0.070802] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.070848] smp: Brought up 1 node, 4 CPUs
[    0.103865] SMP: Total of 4 processors activated.
[    0.108587] CPU features: detected feature: 32-bit EL0 Support
[    0.114454] CPU features: detected feature: Kernel page table isolation (KPTI)
[    0.124249] CPU: All CPU(s) started at EL2
[    0.125840] alternatives: patching kernel code
[    0.130940] devtmpfs: initialized
[    0.136632] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.143506] futex hash table entries: 1024 (order: 5, 131072 bytes)
[    0.153406] pinctrl core: initialized pinctrl subsystem
[    0.155605] DMI not present or invalid.
[    0.159134] NET: Registered protocol family 16
[    0.164279] cpuidle: using governor ladder
[    0.167528] cpuidle: using governor menu
[    0.171558] vdso: 2 pages (1 code @ 0000000034154758, 1 data @ 000000004dda4aff)
[    0.178872] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.186387] DMA: preallocated 256 KiB pool for atomic allocations
[    0.192048] Serial: AMBA PL011 UART driver
[    0.205528] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.206778] cryptd: max_cpu_qlen set to 1000
[    0.211378] ACPI: Interpreter disabled.
[    0.215628] vgaarb: loaded
[    0.217973] SCSI subsystem initialized
[    0.221324] libata version 3.00 loaded.
[    0.221442] usbcore: registered new interface driver usbfs
[    0.226751] usbcore: registered new interface driver hub
[    0.232109] usbcore: registered new device driver usb
[    0.237491] EDAC MC: Ver: 3.0.0
[    0.240748] Advanced Linux Sound Architecture Driver Initialized.
[    0.246679] NetLabel: Initializing
[    0.249819] NetLabel:  domain hash size = 128
[    0.254207] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.259919] NetLabel:  unlabeled traffic allowed by default
[    0.265684] clocksource: Switched to clocksource arch_sys_counter
[    0.330023] VFS: Disk quotas dquot_6.6.0
[    0.330090] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.335486] pnp: PnP ACPI: disabled
[    0.342615] NET: Registered protocol family 2
[    0.343423] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes)
[    0.351023] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.358305] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    0.365025] TCP: Hash tables configured (established 16384 bind 16384)
[    0.371517] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    0.377501] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    0.384110] NET: Registered protocol family 1
[    0.388663] RPC: Registered named UNIX socket transport module.
[    0.394264] RPC: Registered udp transport module.
[    0.399001] RPC: Registered tcp transport module.
[    0.403714] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.410199] PCI: CLS 0 bytes, default 128
[    0.410322] Unpacking initramfs...
[    0.566637] Freeing initrd memory: 4952K
[    0.567193] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.573317] kvm [1]: 8-bit VMID
[    0.577278] kvm [1]: vgic interrupt IRQ1
[    0.580290] kvm [1]: Hyp mode initialized successfully
[    0.624020] Initialise system trusted keyrings
[    0.624119] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[    0.632251] zbud: loaded
[    0.633872] NFS: Registering the id_resolver key type
[    0.636928] Key type id_resolver registered
[    0.641101] Key type id_legacy registered
[    0.645132] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.651983] SGI XFS with ACLs, security attributes, no debug enabled
[    1.505915] NET: Registered protocol family 38
[    1.505948] Key type asymmetric registered
[    1.508822] Asymmetric key parser 'x509' registered
[    1.513835] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.521262] io scheduler noop registered
[    1.525096] io scheduler deadline registered
[    1.529584] io scheduler cfq registered (default)
[    1.534110] io scheduler mq-deadline registered
[    1.538667] io scheduler kyber registered
[    1.542772] io scheduler bfq registered
[    1.548401] GPIO line 501 (usb-hub-reset) hogged as output/high
[    1.554959] ipmi message handler version 39.2
[    1.560019] soc soc0: Amlogic Meson GXBB (S905) Revision 1f:b (0:1) Detected
[    1.564216] meson_gx_pwrc_vpu c8100000.sys-ctrl:power-controller-vpu: failed to get reset lines
[    1.574028] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.580119] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 13, base_baud = 1500000) is a meson_uart
[    1.589608] console [ttyAML0] enabled
[    1.591258] bootconsole [meson0] disabled
[    1.599456] msm_serial: driver initialized
[    1.606430] libphy: Fixed MDIO Bus: probed
[    1.608309] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.613773] ehci-pci: EHCI PCI platform driver
[    1.618209] ehci-platform: EHCI generic platform driver
[    1.623427] ehci-orion: EHCI orion driver
[    1.627375] tegra-ehci: Tegra EHCI driver
[    1.631362] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.637416] ohci-pci: OHCI PCI platform driver
[    1.641819] ohci-platform: OHCI generic platform driver
[    1.647046] uhci_hcd: USB Universal Host Controller Interface driver
[    1.653571] usbcore: registered new interface driver uas
[    1.658566] usbcore: registered new interface driver usb-storage
[    1.664497] usbcore: registered new interface driver ums-alauda
[    1.670373] usbcore: registered new interface driver ums-cypress
[    1.676322] usbcore: registered new interface driver ums-datafab
[    1.682265] usbcore: registered new interface driver ums_eneub6250
[    1.688396] usbcore: registered new interface driver ums-freecom
[    1.694340] usbcore: registered new interface driver ums-isd200
[    1.700225] usbcore: registered new interface driver ums-jumpshot
[    1.706250] usbcore: registered new interface driver ums-karma
[    1.712020] usbcore: registered new interface driver ums-onetouch
[    1.718073] usbcore: registered new interface driver ums-realtek
[    1.724009] usbcore: registered new interface driver ums-sddr09
[    1.729882] usbcore: registered new interface driver ums-sddr55
[    1.735750] usbcore: registered new interface driver ums-usbat
[    1.741550] usbcore: registered new interface driver usbserial_generic
[    1.747997] usbserial: USB Serial support registered for generic
[    1.754745] mousedev: PS/2 mouse device common for all mice
[    1.761604] device-mapper: uevent: version 1.0.3
[    1.764213] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
[    1.772991] sdhci: Secure Digital Host Controller Interface driver
[    1.778517] sdhci: Copyright(c) Pierre Ossman
[    1.783149] Synopsys Designware Multimedia Card Interface Driver
[    1.789629] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[    1.819057] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.819943] ledtrig-cpu: registered to indicate activity on CPUs
[    1.825336] meson-sm: secure-monitor enabled
[    1.829387] hidraw: raw HID events driver (C) Jiri Kosina
[    1.834685] usbcore: registered new interface driver usbhid
[    1.840127] usbhid: USB HID core driver
[    1.844155] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[    1.853681] drop_monitor: Initializing network drop monitor service
[    1.857163] Initializing XFRM netlink socket
[    1.861676] NET: Registered protocol family 10
[    1.870678] Segment Routing with IPv6
[    1.870752] mip6: Mobile IPv6
[    1.872118] NET: Registered protocol family 17
[    1.876629] Key type dns_resolver registered
[    1.881152] registered taskstats version 1
[    1.884791] Loading compiled-in X.509 certificates
[    1.889644] zswap: loaded using pool lzo/zbud
[    1.898621] Key type big_key registered
[    1.902841] Key type encrypted registered
[    1.909029] dwc2 c9000000.usb: c9000000.usb supply vusb_d not found, using dummy regulator
[    1.911681] dwc2 c9000000.usb: c9000000.usb supply vusb_a not found, using dummy regulator
[    1.921019] phy phy-c0000000.phy.0: USB ID detect failed!
[    1.925178] phy phy-c0000000.phy.0: phy poweron failed --> -22
[    1.931051] dwc2: probe of c9000000.usb failed with error -22
[    1.937299] dwc2 c9100000.usb: c9100000.usb supply vusb_d not found, using dummy regulator
[    1.944865] dwc2 c9100000.usb: c9100000.usb supply vusb_a not found, using dummy regulator
[    2.085968] dwc2 c9100000.usb: DWC OTG Controller
[    2.086143] dwc2 c9100000.usb: new USB bus registered, assigned bus number 1
[    2.092036] dwc2 c9100000.usb: irq 34, io mem 0xc9100000
[    2.097443] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    2.104007] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.111173] usb usb1: Product: DWC OTG Controller
[    2.115829] usb usb1: Manufacturer: Linux 4.16.0-1-ARCH dwc2_hsotg
[    2.121946] usb usb1: SerialNumber: c9100000.usb
[    2.126778] hub 1-0:1.0: USB hub found
[    2.130240] hub 1-0:1.0: 1 port detected
[    2.135241] meson-gx-mmc d0072000.mmc: Got CD GPIO
[    2.166796] scpi_protocol scpi: SCP Protocol 0.0 Firmware 0.0.0 version
[    2.170621] hctosys: unable to open rtc device (rtc0)
[    2.173103] VCC3V3: disabling
[    2.175790] ALSA device list:
[    2.178672]   No soundcards found.
[    2.191144] Freeing unused kernel memory: 1536K
[    2.256188] mmc1: new high speed SDHC card at address 0007
[    2.257177] mmcblk1: mmc1:0007 SL32G 29.0 GiB
[    2.262021]  mmcblk1: p1
[    2.575737] usb 1-1: new high-speed USB device number 2 using dwc2
[    2.826966] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610
[    2.828016] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.835087] usb 1-1: Product: USB2.0 Hub
[    2.839510] hub 1-1:1.0: USB hub found
[    2.842953] hub 1-1:1.0: 4 ports detected
[    3.165708] usb 1-1.1: new low-speed USB device number 3 using dwc2
[    3.566021] usb 1-1.1: New USB device found, idVendor=0603, idProduct=0002
[    3.567248] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.574493] usb 1-1.1: Product: USB Composite Device
[    3.579447] usb 1-1.1: Manufacturer: SINO WEALTH
[    3.737444] input: SINO WEALTH USB Composite Device as /devices/platform/soc/c9100000.usb/usb1/1-1/1-1.1/1-1.1:1.0/0003:0603:0002.0001/input/input0
[    3.806177] hid-generic 0003:0603:0002.0001: input,hidraw0: USB HID v1.10 Keyboard [SINO WEALTH USB Composite Device] on usb-c9100000.usb-1.1/input0
[    4.257680] input: SINO WEALTH USB Composite Device as /devices/platform/soc/c9100000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:0603:0002.0002/input/input1
[    4.320884] random: crng init done
[    4.326249] hid-generic 0003:0603:0002.0002: input,hiddev96,hidraw1: USB HID v1.10 Mouse [SINO WEALTH USB Composite Device] on usb-c9100000.usb-1.1/input1
[    4.425701] usb 1-1.2: new high-speed USB device number 4 using dwc2
[    4.583203] usb 1-1.2: New USB device found, idVendor=148f, idProduct=5370
[    4.584428] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.591683] usb 1-1.2: Product: 802.11 n WLAN
[    4.595991] usb 1-1.2: Manufacturer: Ralink
[    4.600124] usb 1-1.2: SerialNumber: 1.0
[    4.705704] usb 1-1.4: new high-speed USB device number 5 using dwc2
[    4.837161] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=8176
[    4.838382] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.845627] usb 1-1.4: Product: 802.11n WLAN Adapter
[    4.850553] usb 1-1.4: Manufacturer: Realtek
[    4.854768] usb 1-1.4: SerialNumber: 00e04c000001
[   63.753065] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[   64.397862] systemd[1]: System time before build time, advancing clock.
[   64.429254] systemd[1]: systemd 238 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid)
[   64.445078] systemd[1]: Detected architecture arm64.
[   64.476921] systemd[1]: Set hostname to <archlinuxc2>.
[   65.594158] systemd[1]: Created slice User and Session Slice.
[   65.625802] systemd[1]: Reached target Slices.
[   65.655740] systemd[1]: Reached target Remote File Systems.
[   65.685908] systemd[1]: Listening on udev Kernel Socket.
[   65.715748] systemd[1]: Reached target Swap.
[   65.746910] systemd[1]: Created slice system-getty.slice.
[   65.775909] systemd[1]: Listening on Device-mapper event daemon FIFOs.
[   68.626433] systemd-journald[273]: Received request to flush runtime journal from PID 1
[   70.054768] systemd-journald[273]: File /var/log/journal/d32de2b71934459cb7e1416bb1cd767e/system.journal corrupted or uncleanly shut down, renaming and replacing.
[   72.736851] pps_core: LinuxPPS API ver. 1 registered
[   72.736884] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[   72.747869] rc_core: IR Remote Control driver registered, major 236
[   72.760696] PTP clock support registered
[   72.761139] Registered IR keymap rc-empty
[   72.763163] rc rc0: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0
[   72.770955] input: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0/input2
[   72.779313] rc rc0: lirc_dev: driver meson-ir registered at minor = 0
[   72.785637] meson-ir c8100580.ir: receiver initialized
[   72.866024] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[   72.866391] meson8b-dwmac c9410000.ethernet: no reset control found
[   72.873115] stmmac - user ID: 0x11, Synopsys ID: 0x37
[   72.877657] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[   72.883379] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[   72.890816] meson8b-dwmac c9410000.ethernet: Normal descriptors
[   72.896689] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[   72.904078] meson8b-dwmac c9410000.ethernet: COE Type 2
[   72.909264] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[   72.916245] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[   72.922700] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[   72.930749] libphy: stmmac: probed
[   73.009259] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[   73.049984] meson8b-dwmac c9410000.ethernet eth0: device MAC address 00:1e:06:33:37:7a
[   73.052390] meson-drm d0100000.vpu: Failed to create debugfs directory
[   73.058863] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   73.065271] [drm] No driver support for vblank timestamp query.
[   73.071249] meson-drm d0100000.vpu: CVBS Output connector not available
[   73.115848] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[   73.120530] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[   73.128911] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops [meson_dw_hdmi])
[   73.148132] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=35)
[   73.156378] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[   73.161943] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   73.210667] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   73.320235] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   73.327016] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   73.327027] cfg80211: failed to load regulatory.db
[   73.387061] rtl8192cu: Chip version 0x10
[   73.434711] Console: switching to colour frame buffer device 240x67
[   73.464660] rtl8192cu: Board Type 0
[   73.464895] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[   73.465038] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[   73.485723] usb 1-1.2: reset high-speed USB device number 4 using dwc2
[   73.488689] meson-drm d0100000.vpu: fb0:  frame buffer device
[   73.530133] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[   73.530911] usbcore: registered new interface driver rtl8192cu
[   73.556590] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[   73.615702] Registered IR keymap rc-cec
[   73.615861] rc rc1: RC for dw_hdmi as /devices/platform/soc/c883a000.hdmi-tx/rc/rc1
[   73.621607] input: RC for dw_hdmi as /devices/platform/soc/c883a000.hdmi-tx/rc/rc1/input3
[   73.646415] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5390, rev 0502 detected
[   73.676792] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 5370 detected
[   73.679134] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   73.680456] usbcore: registered new interface driver rt2800usb
[   76.762958] meson8b-dwmac c9410000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   76.766007] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  130.822741] fuse init (API version 7.26)
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby summers » Fri Apr 06, 2018 6:10 pm

summers wrote:
campbell wrote:
summers wrote:
campbell wrote:Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?

If you check the bottom of the patch it says "Applied v4.17 and CCed to stable"

This to me means that we won't see it until 4.17, due to the kernel release schedule - but it *may* come out on 4.15 sooner or later.

It certainly isn't in linus tree yet ...

The merge window for 4.17 has been open for a few days now and this change still hasn't been applied to Linus's tree...are the right people submitting the patches at the right times? Don't want this to fall off the radar, because it's still broken.

As was the official kernel maintainers for meson that posted it, then yes I'd still expect it in 4.17. However meson is some way down the food chain in the linux kernel IIRC, so that needs to be merged into various other trees - before it reaches linus. I think the merging should be automatic, as official maintainers - but doesn't mean its fast. So think the crunch point only comes when when rc1 comes out.

For what its worth, its listed as appearing in 4.17 here http://linux-meson.com/doku.php, but that the same people again.

Looks like its landed here:

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Apr 17, 2018 12:22 am



I can confirm that
Code: Select all
od -td4 --endian=big /proc/device-tree/soc/apb\@d0000000/mmc\@74000/max-frequency
reports 100 MHz in 4.17-rc1 in the Arch repository. Haven't tried running it on an emmc yet, will hopefully get to that this evening
campbell
 
Posts: 301
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 Flole » Tue Apr 17, 2018 2:06 am

Hey @brad,

have you already had time to look into compiling the kernel? I am still struggling converting the kernel into a uboot image I guess, it's simply not booting up no matter what I try. Even some descriptions on what you did last time would already help me.

Thanks for your help

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

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Tue Apr 17, 2018 2:24 pm

Flole wrote:Hey @brad,

have you already had time to look into compiling the kernel? I am still struggling converting the kernel into a uboot image I guess, it's simply not booting up no matter what I try. Even some descriptions on what you did last time would already help me.

Thanks for your help

Flole

Can I ask you what version of bootloader are you using now? Do you use 'boot.ini' or 'boot.scr'?
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Tue Apr 17, 2018 9:34 pm

I am using boot.ini, not sure about the exact bootloader version. I described the errors I am getting in that post before:

Flole wrote:Alright so I installed the Image, but I am having a hard time with the uboot stuff again.

My Uboot-Commands are

Code: Select all
setenv kernel  "fatload mmc 0:1 0x1080000 uImage"
setenv dtb     "fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb"
setenv bootseq "bootz 0x1080000 - 0x1000000"
setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"


so I created the uImage by running
Code: Select all
mkimage -A arm64 -O linux -T kernel -C gzip -a 0x1080000 -e 0x1080000 -n linux-next -d  vmlinuz-4.16.0-rc4-arm64-odroidc2 Image
which results in the bootloader saying

Code: Select all
cfgload: applying boot.ini...<\r><\n>
cfgload: setenv bootrootfs "root=/dev/nfs rw ip=dhcp,,C2Host nfsroot=192.168.45.45:/bootroot/,nfsvers=3"<\r><\n>
cfgload: setenv console "console=tty0 console=ttyAML0"<\r><\n>
cfgload: setenv odroid   "no_console_suspend consoleblank=0"<\r><\n>
cfgload: setenv kernel  "fatload mmc 0:1 0x1080000 Image"<\r><\n>
cfgload: setenv dtb     "fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb"<\r><\n>
cfgload: setenv bootseq "bootm 0x1080000 - 0x1000000"<\r><\n>
cfgload: setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"<\r><\n>
cfgload: setenv bootargs "${console} ${bootrootfs} ${odroid} ${libreelec}"<\r><\n>
cfgload: run bootcmd<\r><\n>
reading Image<\r><\n>
** Unable to read file Image **<\r><\n>
reading meson-gxbb-odroidc2.dtb<\r><\n>
20723 bytes read in 9 ms (2.2 MiB/s)<\r><\n>
ee_gate_off ...<\r><\n>
Wrong Image Format for bootm command<\r><\n>
ERROR: can't get kernel image!<\r><\n>


What am I missing here?
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Wed Apr 18, 2018 2:44 pm

Flole wrote:I am using boot.ini, not sure about the exact bootloader version. I described the errors I am getting in that post before:
Code: Select all
mkimage -A arm64 -O linux -T kernel -C gzip -a 0x1080000 -e 0x1080000 -n linux-next -d  vmlinuz-4.16.0-rc4-arm64-odroidc2 Image
which results in the bootloader saying
Code: Select all
Wrong Image Format for bootm command<\r><\n>
ERROR: can't get kernel image!<\r><\n>


From your 'mkimage' command, I suspect the file format of 'vmlinuz-4.16.0-rc4-arm64-odroidc2' and you can check its format with the command 'file'. If file vmlinuz-4.16.0-rc4-arm64-odroidc2 command give you MS-DOS executable, then the kernel image is not compressed so you must use -C none in mkimage command. If it shows, gzip compressed data, max compression, from Unix, -C gzip option should work.
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Wed Apr 18, 2018 10:30 pm

Hi tobetter,

I was able to get the 4.16-rc5 from your git repository to boot. I extracted the deb archive and then created the Image. However, the Image is missing USB-Serial drivers (I need the CH341 driver). Would it be possible that you compile a kernel with those drivers builtin or at least available as modules?

I really appreciate your work!
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Wed Apr 18, 2018 10:56 pm

Flole wrote:Hi tobetter,

I was able to get the 4.16-rc5 from your git repository to boot. I extracted the deb archive and then created the Image. However, the Image is missing USB-Serial drivers (I need the CH341 driver). Would it be possible that you compile a kernel with those drivers builtin or at least available as modules?

I really appreciate your work!

OH, I see..from my Github... Let me check if I can add the driver. By the way, are you able to boot with the kernel now? FYI, I also have v4. 17-rc1 kernel as a Debian package, you may try it if you can.
https://code.launchpad.net/~tobetter/+a ... d/14769591
I am building the Debian installer in which mainline kernel can be updated through Launchpad, planning to share the trivial version by end of this month.
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Thu Apr 19, 2018 1:25 am

Yes I was able to boot the kernel, thank you so much!! I will check the 4.17 out, but I assume it doesn't contain the USB-Serial drivers. Also if you are recompiling it anyways, could you include the zram module? That would be the perfect kernel for me :)

Thank you so much!!
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby hhh1 » Thu Apr 19, 2018 7:35 pm

Can somebody please help me! I've updated Ubuntu 16.04.4 LTS to from 3.14 to 4.16.0-rc7.

And HDMI screen turned green!

By boot.txt is:
Code: Select all
setenv m "1080p60hz" # Progressive 60Hz

# HDMI BPP Mode
setenv m_bpp "32"
# setenv m_bpp "24"
# setenv m_bpp "16"

# HDMI DVI/VGA modes
setenv vout "hdmi"

setenv hpd "true"
setenv monitor_onoff "false" # true or false
setenv nographics "0"
setenv mesontimer "1"

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

# MicroSD Card Detection enable/disable
setenv mmc_removable "false"

# USB Multi WebCam tweak
setenv usbmulticam "true"

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

# Default Console Device Setting
setenv condev "console=ttyS0,115200n8 console=tty0"   # on both

# CPU Frequency / Cores control
###########################################
setenv maxcpus "4"
setenv max_freq "1536"  # 1.536GHz
###########################################

# Boot Arguments
if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid; fi
if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi

setenv bootargs "console=ttyAML0,115200n8 root=/dev/mmcblk1p2 rw rootwait earlycon usbcore.autosuspend=-1 dtoverlay=dwc2 coherent_pool=4M cec=${cec} hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} serialno=${fbt_id#} ${hid_quirks}"

# Booting
setenv loadaddr "0x1080000"
setenv dtb_loadaddr "0x1000000"

load mmc 0:1 ${loadaddr} Image
load mmc 0:1 ${dtb_loadaddr} meson-gxbb-odroidc2.dtb


if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/cpu@0/timer; fdt rm /cpus/cpu@1/timer; fdt rm /cpus/cpu@2/timer; fdt rm /cpus/cpu@3/timer; fi
if test "${mesontimer}" = "1"; then fdt rm /timer; fi

booti ${loadaddr} - ${dtb_loadaddr}


result is: https://imgur.com/a/skLn7no
hhh1
 
Posts: 46
Joined: Wed Jun 15, 2016 3:35 am
languages_spoken: english
ODROIDs: c1 c1+ c2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Thu Apr 19, 2018 9:12 pm

Boot.ini setting for 3.14.x will not work for 4.x.x kernel. Here is the setting suggested by @brad with works for me.

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

#------------------------------------------------------------------------------------------------------
#
# Boot Specific Stuff
#
# Note: set root=root=/dev/mmcblk0p2 for mmc card boot
#------------------------------------------------------------------------------------------------------
setenv bootrootfs "boot=/dev/mmcblk1p1 disk=/dev/mmcblk1p2 root=/dev/mmcblk1p2"

#------------------------------------------------------------------------------------------------------
#
# 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 fsck.repair=yes net.ifnames=0"

# 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
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby emk2203 » Fri Apr 20, 2018 12:06 am

@tobetter: Is it possible to just install your kernel version with dpkg -i? I have Ubuntu 18.04 running on the C2 with kernel 3.14. Would I need to change the boot.ini, or is it done automatically?
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 tobetter » Fri Apr 20, 2018 12:42 am

emk2203 wrote:@tobetter: Is it possible to just install your kernel version with dpkg -i? I have Ubuntu 18.04 running on the C2 with kernel 3.14. Would I need to change the boot.ini, or is it done automatically?

Well, actually it's little bit tricky since we have many different type of installations, different bootloader and different distribution. I was building such hacky script for Hard kernel stock image first, may be next week if possible? FYI, I am building the Debian Installer instead of flashing pre-built image and can be updated through my Launchpad.
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Fri Apr 20, 2018 8:05 am

Flole wrote:Yes I was able to boot the kernel, thank you so much!! I will check the 4.17 out, but I assume it doesn't contain the USB-Serial drivers. Also if you are recompiling it anyways, could you include the zram module? That would be the perfect kernel for me :)

Thank you so much!!

I've built new kernel package with ZRAM, could you please check if it works for you?
https://code.launchpad.net/~tobetter/+a ... d/14777326
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Fri Apr 20, 2018 9:38 am

The new kernel doesn't contain NFS Root support? At least it is not able to mount my root fs over nfs like it used to before. Without that I am unable to test as I only have a 256MB SD Card in the C2 :D

EDIT: Booted with the old kernel and checked the 4.17 config: Indeed no CONFIG_ROOT_NFS in there
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Fri Apr 20, 2018 4:10 pm

Flole wrote:The new kernel doesn't contain NFS Root support? At least it is not able to mount my root fs over nfs like it used to before. Without that I am unable to test as I only have a 256MB SD Card in the C2 :D

EDIT: Booted with the old kernel and checked the 4.17 config: Indeed no CONFIG_ROOT_NFS in there

New package including CONFIG_ROOT_NFS with other kernel configuration updates is just published, please check if it works for you. I have no idea how exactly you manage the package to run on your ODROID-C2, it would be great if you can share.
https://code.launchpad.net/~tobetter/+a ... d/14780258

FYI, if you are installing the linux-image-4.17*.deb it would be a good idea to install the package linux-image-upstream-odroid that will pull up-to-date built kernel images with the ordinary apt update command. In order to register my repository for apt command, you must add my repository with this command.
Code: Select all
$ sudo add-apt-repository ppa:tobetter/ppa
$ sudo apt-get update
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Sun Apr 22, 2018 8:41 am

This kernel works perfectly! Thank you so much!

So what I have done is just installing and then running the mkimage command to copy the uImage onto my sd card (users without NFS would probably simply copy it to the boot partition). That was it in terms of switching from my 4.08 if i remember correctly to the kernels you are providing.

Thanks again, I am so glad it works now for me!
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby jit-010101 » Thu Apr 26, 2018 6:10 am

Am I seeing right that HW video decoding is making progress on GXBB/S905 as such ODroid C2 from skimming trough the latest submitted patches?

Mainline Kernel CoreELEC?

Yes, please! (one can dream) :shock:
jit-010101
 
Posts: 18
Joined: Tue Mar 13, 2018 9:40 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby hhh1 » Thu Apr 26, 2018 8:06 pm

Suspicious dwa2 behaviour in 4.16+
I'm running arch linux with nodejs
/proc/cmdline
Code: Select all
console=ttyAML0,115200n8 root=/dev/mmcblk0p1 ro rootwait earlycon hdmimode=auto m_bpp=32 vout=hdmi usbcore.autosuspend=-1 coherent_pool=4M fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=true max_freq=1536 maxcpus=4 monitor_onoff=false disableuhs=false mmc_removable=false usbmulticam=true

Current kernel 4.17.0-rc1
I have several connected usb peripherals and logs are flooded with
Code: Select all
[  325.033864] dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 5 - ChHltd set, but reason is unknown
[  325.037417] dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04600009
[  325.043538] dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length
[  325.095858] dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 9 - ChHltd set, but reason is unknown
[  325.099413] dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04600009
[  325.105536] dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length


and now I've got a kernel oops
Code: Select all
[  326.558454] Unable to handle kernel paging request at virtual address ffff7f454d0cac20
[  326.560744] Mem abort info:
[  326.563477]   ESR = 0x96000004
[  326.566511]   Exception class = DABT (current EL), IL = 32 bits
[  326.572373]   SET = 0, FnV = 0
[  326.575380]   EA = 0, S1PTW = 0
[  326.578493] Data abort info:
[  326.581338]   ISV = 0, ISS = 0x00000004
[  326.585133]   CM = 0, WnR = 0
[  326.588068] swapper pgtable: 4k pages, 48-bit VAs, pgdp = 00000000b7c46436
[  326.594879] [ffff7f454d0cac20] pgd=0000000000000000
[  326.599712] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[  326.605223] Modules linked in: ppp_deflate ppp_async crc_ccitt ppp_generic slhc option usb_wwan usbserial ipt_MASQUERADE nf_nat_mas
querade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c 8021q garp mrp cdc_ether usbnet br
idge stp llc 8812au(O) meson_dw_hdmi meson_drm dw_hdmi drm_kms_helper dwmac_generic cfg80211 realtek drm dwmac_meson8b stmmac_platform
 stmmac rfkill crc32_ce meson_ir meson_rng rc_core rng_core drm_panel_orientation_quirks meson_gxbb_wdt nvmem_meson_efuse ip_tables x_
tables ipv6
[  326.652578] CPU: 3 PID: 4102 Comm: node Tainted: G           O      4.17.0-rc1 #5
[  326.659991] Hardware name: Hardkernel ODROID-C2 (DT)
[  326.664909] pstate: 00000005 (nzcv daif -PAN -UAO)
[  326.669660] pc : copy_page_range+0x3f4/0x9d0
[  326.673878] lr : copy_page_range+0x3f0/0x9d0
[  326.678103] sp : ffff00000cbc3bf0
[  326.681381] x29: ffff00000cbc3bf0 x28: 000000004ec00000
[  326.686642] x27: ffff800075d11000 x26: ffff00000cbc3d18
[  326.691903] x25: ffff800072d2d000 x24: ffff8000739f53c0
[  326.697164] x23: 0400000000000001 x22: 000000004ec80000
[  326.702425] x21: 0000000000000000 x20: ffff7e0001d74440
[  326.707687] x19: 20325153432b0a8d x18: 0000ffff9768f980
[  326.712948] x17: 0000aaaaf18df020 x16: 000000007effd3b0
[  326.718209] x15: 0000000000000000 x14: 000000000000004c
[  326.723470] x13: 0000000000000000 x12: ffff80007efc7ca8
[  326.728732] x11: 0000800075f84000 x10: 0000000000000010
[  326.733993] x9 : ffff80007efc7c98 x8 : ffff000009043c98
[  326.739254] x7 : 0000000000100073 x6 : 0008000000000080
[  326.744515] x5 : 000000004ec00000 x4 : ffff8000739f53c0
[  326.749777] x3 : 00000005153432b0 x2 : 20325153432b0a8d
[  326.755038] x1 : ffff7e0000000000 x0 : ffff7f454d0cac00
[  326.760301] Process node (pid: 4102, stack limit = 0x000000005f6998c4)
[  326.766769] Call trace:
[  326.769187]  copy_page_range+0x3f4/0x9d0
[  326.773073]  copy_process.isra.48.part.49+0x12e0/0x1644
[  326.778245]  _do_fork+0xc8/0x344
[  326.781435]  sys_clone+0x18/0x20
[  326.784627]  __sys_trace_return+0x0/0x4
[  326.788421] Code: aa1c03e1 aa1803e0 97fff3b2 b40004e0 (f9401001)
[  326.794458] ---[ end trace 3a58368ad9f379ad ]---
[  326.799100] note: node[4102] exited with preempt_count 2
[  327.033839] dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown
[  327.037399] dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04600009
[  327.043521] dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length


Can somebody please help me figuring this out? What is it? How to fix it?
hhh1
 
Posts: 46
Joined: Wed Jun 15, 2016 3:35 am
languages_spoken: english
ODROIDs: c1 c1+ c2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Fri Apr 27, 2018 2:30 am

I collected some resources about c2 mainline kernel and finally put it all together in scripts to build and install required components.

Build scripts:
http://seafile.servator.de/sbc/odroid/build/next/

Ready to use binary packages:
http://seafile.servator.de/sbc/odroid/next/

The installation can run directly on c2 inside an existing Debian 9/Ubuntu 16.04 image with 3.14/3.16 kernel.
boot.ini will be automatically converted to a boot.cmd/boot.scr for new u-boot. But this only works if you did not change the original layout of boot.ini too much.

You will find a text file in each folder describing how it works and some other details.
It already contains some extra patches to make more components work or just enabling them:
- CPU frequency scaling
- Thermal handling
- HDMI Audio
- Mali acceleration (GLES2/EGL) with Amlogic mali lib and armsoc video driver

There seems to be an issue with the scpi protocol/mailbox timing, because sometimes you will get a message like this:
Code: Select all
[  320.718445] WARNING: CPU: 1 PID: 1139 at kernel/time/hrtimer.c:901 hrtimer_forward+0xd0/0x118
[  320.718445] WARNING: CPU: 1 PID: 1139 at kernel/time/hrtimer.c:901 hrtimer_forward+0xd0/0x118

I did not get a good solution for this, only some temporary workaround.
Mali works with 43 fps in glmark2-es2 and also in mpv with vo sdl I could play a 40 minute FHD video software decoded with no issues.
This is just a first try, so its more intended to get an overview of the work already done (not by me).

PS: I did see tobetters version too late, so there may be parts I did not include yet.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby hhh1 » Fri Apr 27, 2018 9:45 pm

I compiled the version above (4.16.5) and got an error in hrtimer
Code: Select all
[    2.519664] WARNING: CPU: 1 PID: 0 at kernel/time/hrtimer.c:901 hrtimer_forward+0xd0/0x118
[    2.523132] Modules linked in:
[    2.526152] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.16.5 #1
[    2.532013] Hardware name: Hardkernel ODROID-C2 (DT)
[    2.535812] Unable to handle kernel NULL pointer dereference at virtual address 00000023
[    2.536932] pstate: 20000085 (nzCv daIf -PAN -UAO)
[    2.544951] Mem abort info:
[    2.549697] pc : hrtimer_forward+0xd0/0x118
[    2.552455]   ESR = 0x96000004
[    2.556602] lr : txdone_hrtimer+0xf4/0x110
[    2.559615]   Exception class = DABT (current EL), IL = 32 bits
[    2.563669] sp : ffff00000800bdb0
[    2.569533]   SET = 0, FnV = 0
[    2.572810] x29: ffff00000800bdb0
[    2.575829]   EA = 0, S1PTW = 0
[    2.575829] x28: 000000000000000f
[    2.579193] Data abort info:
[    2.579824] scpi-hwmon: probe of scpi:sensors failed with error -62
[    2.579939] Unable to handle kernel paging request at virtual address 00808121
[    2.579940] Mem abort info:
[    2.579941]   ESR = 0x96000044
[    2.579943]   Exception class = DABT (current EL), IL = 32 bits
[    2.579944]   SET = 0, FnV = 0
[    2.579945]   EA = 0, S1PTW = 0
[    2.579946] Data abort info:
[    2.579947]   ISV = 0, ISS = 0x00000044
[    2.579949]   CM = 0, WnR = 1
[    2.579951] [0000000000808121] user address but active_mm is swapper
[    2.579956] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[    2.579961] Modules linked in:
[    2.579964] CPU: 2 PID: 30 Comm: kworker/u8:1 Not tainted 4.16.5 #1
[    2.579965] Hardware name: Hardkernel ODROID-C2 (DT)
[    2.579977] Workqueue: events_unbound call_usermodehelper_exec_work
[    2.579980] pstate: 00000005 (nzcv daif -PAN -UAO)
[    2.579986] pc : cpu_load_update+0x58/0x170
[    2.579992] lr : copy_process.isra.8.part.9+0x16d8/0x16f0
[    2.579993] sp : ffff0000095fbbb0
[    2.579994] x29: ffff0000095fbbc0 x28: ffff800070e10f00
[    2.579997] x27: ffff800070f59e00 x26: ffff80006fa00c00
[    2.580000] x25: ffff000008100260 x24: 0000000000000000
[    2.580003] x23: ffff8000709b2c00 x22: ffff800070f5a600
[    2.580007] x21: ffff800070f5a3b8 x20: ffff000009079000
[    2.580010] x19: 0000000000808111 x18: 000000000000003c
[    2.580012] x17: 0000000000000007 x16: 0000000000000001
[    2.580015] x15: 0000000000000000 x14: ffffffffffffffff
[    2.580018] x13: 0000000000000000 x12: 0000000000000000
[    2.580021] x11: 0000000000000000 x10: 0000000000000000
[    2.580023] x9 : 0000000000000000 x8 : 00000000000c8000
[    2.580026] x7 : 00000000000c8000 x6 : 0000000000000000
[    2.580029] x5 : 0000000000000001 x4 : 0000000000000000
[    2.580031] x3 : 0000000000000000 x2 : ffff0000091c52e8
[    2.580034] x1 : ffff000008dfdf60 x0 : ffff8000709b2fe0
[    2.580039] Process kworker/u8:1 (pid: 30, stack limit = 0x        (ptrval))
[    2.580041] Call trace:
[    2.580044]  cpu_load_update+0x58/0x170
[    2.580046]  _do_fork+0xd4/0x418
[    2.580048]  kernel_thread+0x48/0x58
[    2.580050]  call_usermodehelper_exec_work+0x48/0x100
[    2.580054]  process_one_work+0x1e0/0x458
[    2.580056]  worker_thread+0x58/0x458
[    2.580060]  kthread+0x104/0x130
[    2.580066]  ret_from_fork+0x10/0x1c
[    2.580070] Code: 91000400 52800047 52800025 9ac2254d (f9000a74)
[    2.580074] ---[ end trace ba49021323c54225 ]---
[    2.582298] x27: ffff000009051010
[    2.583803] Internal error: undefined instruction: 0 [#2] PREEMPT SMP
[    2.583804] Modules linked in:
[    2.583808] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D          4.16.5 #1
[    2.583810] Hardware name: Hardkernel ODROID-C2 (DT)
[    2.583811] pstate: 20000085 (nzCv daIf -PAN -UAO)
[    2.583815] pc : __hrtimer_run_queues+0xd8/0x380
[    2.583818] lr : hrtimer_interrupt+0xec/0x248
[    2.583819] sp : ffff000008013e20
[    2.583820] x29: ffff000008013e20 x28: 000000000000000f
[    2.583823] x27: ffff000009051010 x26: 0000000000000080
[    2.583826] x25: ffff000009051010 x24: ffff000009079df8
[    2.583828] x23: 0000000096eb4636 x22: ffff80007ffa4800
[    2.583831] x21: ffff80007ffa4800 x20: ffff80007ffa4880
[    2.583834] x19: ffff80007ffa4f80 x18: 000000000000001e
[    2.583837] x17: 0000000000000007 x16: 0000000000000001
[    2.583840] x15: 0000000000000000 x14: ffff80007102c118
[    2.583843] x13: ffff00000909aca8 x12: ffff80007102c000
[    2.583845] x11: 0000000000000040 x10: ffff800071000270
[    2.583848] x9 : ffff800071000288 x8 : 0000000000000000
[    2.583851] x7 : ffff80007143f800 x6 : ffff80007143f800
[    2.583854] x5 : ffff800071000248 x4 : 0000800076f4b000
[    2.583856] x3 : 000000000000000f x2 : 0000000000000001
[    2.583859] x1 : 0000000096eb4100 x0 : 00000000000003b5
[    2.583863] Process swapper/2 (pid: 0, stack limit = 0x        (ptrval))
[    2.583864] Call trace:
[    2.583867]  __hrtimer_run_queues+0xd8/0x380
[    2.583869]  hrtimer_interrupt+0xec/0x248
[    2.583875]  arch_timer_handler_phys+0x3c/0x50
[    2.583881]  handle_percpu_devid_irq+0x8c/0x290
[    2.583884]  generic_handle_irq+0x34/0x50
[    2.583887]  __handle_domain_irq+0x68/0xc0
[    2.583890]  gic_handle_irq+0x60/0xb8
[    2.583892]  el1_irq+0xb0/0x128
[    2.583894]  arch_cpu_idle+0x30/0x1a0
[    2.583899]  do_idle+0x124/0x1e8
[    2.583901]  cpu_startup_entry+0x2c/0x30
[    2.583907]  secondary_start_kernel+0x188/0x1c8
[    2.583911] Code: f9004eb3 b9401280 11000400 b9001280 (d5033abf)
[    2.583918] ---[ end trace ba49021323c54226 ]---
[    2.583921] Kernel panic - not syncing: Fatal exception in interrupt
[    2.583924] SMP: stopping secondary CPUs
[    2.585662]   ISV = 0, ISS = 0x00000004
[    2.588508] x26: 0000000000000080
[    2.594718]   CM = 0, WnR = 0
[    2.604636] [0000000000000023] user address but active_mm is swapper
[    2.607655] x25: ffff000009051010 x24: ffff80006f424780
[    3.026829] x23: 0000000000000001 x22: 00000000000000f8
[    3.032091] x21: 0000000093185335 x20: ffff80006f424780
[    3.037352] x19: 00000000000f4240 x18: 000000000000003a
[    3.042613] x17: 0000000000000007 x16: 0000000000000001
[    3.047874] x15: 0000000000000000 x14: ffff8000707a1fa0
[    3.053136] x13: ffff00000909aca8 x12: ffff8000707a1da8
[    3.058397] x11: 0000000000000040 x10: ffff800071000270
[    3.063658] x9 : ffff800071000288 x8 : 0000000000000000
[    3.068919] x7 : ffff80007143f800 x6 : 0000000009c1e474
[    3.074181] x5 : 00ffffffffffffff x4 : 001ba8140100d600
[    3.079442] x3 : 0000000093185212 x2 : 00000000000f4240
[    3.084703] x1 : 0000000000000001 x0 : 0000000000000123
[    3.089964] Call trace:
[    3.092381]  hrtimer_forward+0xd0/0x118
[    3.096175]  txdone_hrtimer+0xf4/0x110
[    3.099885]  __hrtimer_run_queues+0x118/0x380
[    3.104197]  hrtimer_interrupt+0xec/0x248
[    3.108165]  arch_timer_handler_phys+0x3c/0x50
[    3.112564]  handle_percpu_devid_irq+0x8c/0x290
[    3.117048]  generic_handle_irq+0x34/0x50
[    3.121015]  __handle_domain_irq+0x68/0xc0
[    3.125069]  gic_handle_irq+0x60/0xb8
[    3.128691]  el1_irq+0xb0/0x128
[    3.131798]  _raw_spin_unlock_irq+0x28/0x58
[    3.135938]  finish_task_switch+0x70/0x1f8
[    3.139992]  __schedule+0x244/0x790
[    3.143441]  schedule_idle+0x2c/0x48
[    3.146977]  do_idle+0xc4/0x1e8
[    3.150082]  cpu_startup_entry+0x28/0x30
[    3.153963]  secondary_start_kernel+0x188/0x1c8
[    3.158447] ---[ end trace ba49021323c54227 ]---
[    3.625579] SMP: failed to stop secondary CPUs 2-3
[    3.625599] Kernel Offset: disabled
[    3.628174] CPU features: 0x0802004
[    3.631623] Memory Limit: none
[    3.634645] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
hhh1
 
Posts: 46
Joined: Wed Jun 15, 2016 3:35 am
languages_spoken: english
ODROIDs: c1 c1+ c2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Sat Apr 28, 2018 5:18 am

Yes sometimes it also happens on boot, I am still working on this like described above. Just try to boot again.
If you dont want to wait for a fix: just remove the following patch from patches/series-odroidc2 and/or linux/patches/series:
odroidc2-enable-scpi-cpu-thermal.patch

For quick rebuild:
Code: Select all
cd linux
patch -p1 -R < patches/platform/odroidc2-enable-scpi-cpu-thermal.patch
cd ..
bash -e build-linux.sh
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby hhh1 » Sun Apr 29, 2018 7:14 am

After spending a week of my life patching/trying different kernel versions/sources/fixing drivers/usb/dwc2 in any possible way I give up. Mainline kernel is not usable with Odroid C2 and USB peripherals. It just floods logs with usb errors and than hangs a usb port with a device attached to it. 3.14 acts much much more stable that way.

Code: Select all
dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 13 - ChHltd set, but reason is unknown
dwc2 c9000000.usb: hcint 0x00000002, intsts 0x06200009
dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length
dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 11 - ChHltd set, but reason is unknown
dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04200009
dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length
dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown
dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04200009
dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length
dwc2 c9000000.usb: dwc2_hc_chhltd_intr_dma: Channel 2 - ChHltd set, but reason is unknown
dwc2 c9000000.usb: hcint 0x00000002, intsts 0x04200009
dwc2 c9000000.usb: dwc2_update_urb_state_abn(): trimming xfer length
usb 1-1.4: unable to read config index 0 descriptor/start: -71
usb 1-1.4: can't read configurations, error -71
hhh1
 
Posts: 46
Joined: Wed Jun 15, 2016 3:35 am
languages_spoken: english
ODROIDs: c1 c1+ c2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Sun Apr 29, 2018 3:56 pm

Update 20180429
- Added linux-4.14.y-le-amlogic-gx-scpi-1004-mailbox-revert_switch_to_hrtimer_for_tx_complete_polling.patch
- Removed all other scpi workaround patches

The mailbox handler (drivers/mailbox/mailbox.c) in kernel 4.1x uses a hrtimer. Since I switched back to a regular timer (like used in 3.14/3.16/4.9) frequency and thermal handling works without any issue.
Maybe the meson timer is not precise enough for a hrtimer or there is just a flag missing.

@hhh1
If it works in 3.14, does it work in 3.16 too?
It looks like the same error (err = -71) like you had here?
viewtopic.php?f=139&t=27445&p=194120#p194120
So maybe we need the "usbmulticam" related patches for mainline.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby hhh1 » Sun Apr 29, 2018 5:14 pm

scpcom wrote:So maybe we need the "usbmulticam" related patches for mainline.

Error is not quite the same. That error (-71) is a consequence but not a cause. 3.14 acts differently.
"usbmulticam" is not some serious patch but small increase in timing in drivers/usb/dwc2/hcd_queue.c
Code: Select all
   if (qh->dev_speed == USB_SPEED_HIGH || qh->do_split) {
/*                max_claimed_usecs = 100 - qh->host_us; */
                max_claimed_usecs = 125 - qh->host_us;
   } else {
/*                max_claimed_usecs = 900 - qh->host_us; */
                max_claimed_usecs = 1000 - qh->host_us;
   }


Of cause I've tried it but no luck.
hhh1
 
Posts: 46
Joined: Wed Jun 15, 2016 3:35 am
languages_spoken: english
ODROIDs: c1 c1+ c2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Mon Apr 30, 2018 9:11 am

Update 20180430
- Kernel 4.16.6
- Added linux-4.16-le-amlogic-gx-1001-usb-enable-otg-as-host.patch

On the old driver "USB-B ID detect" (ACA enable) is only called for usb1 (port B, host only):
https://github.com/tobetter/linux/blob/ ... phy.c#L269

In mainline driver it is called on every usb which has dr_mode set to "host":
https://github.com/tobetter/linux/blob/ ... sb2.c#L184
This does not work on usb0 (port A, OTG).

We may need a port_type in dts to allow running type OTG in mode host.
Currently I did not want to add too much extra code, the easiest way is to allow setting a different dr_mode on usbX_phy and if nothing is defined it will fall back to the value defined on usbX.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby campbell » Mon Apr 30, 2018 10:28 am

Mainline kernel appears to have regressed even further w/r USB. It used to work if you plugged in two or more USB devices. Now, with 4.17 rc3 on Arch, no modifications to boot.txt or anything, i can't even successfully boot if i have two things plugged in:

Code: Select all
[    6.353419] usb usb1-port1: connect-debounce failed
[    6.353513] Unable to handle kernel NULL pointer dereference at virtual address 00000005
[    6.360686] Mem abort info:
[    6.363444]   ESR = 0x96000004
[    6.366464]   Exception class = DABT (current EL), IL = 32 bits
[    6.372328]   SET = 0, FnV = 0
[    6.375347]   EA = 0, S1PTW = 0
[    6.378451] Data abort info:
[    6.381298]   ISV = 0, ISS = 0x00000004
[    6.385093]   CM = 0, WnR = 0
[    6.388028] user pgtable: 4k pages, 48-bit VAs, pgdp =         (ptrval)
[    6.394581] [0000000000000005] pgd=0000000000000000
[    6.399413] Internal error: Oops: 96000004 [#1] SMP
[    6.404241] Modules linked in:
[    6.407263] CPU: 0 PID: 195 Comm: kworker/0:2 Not tainted 4.17.0-rc3-1-ARCH #1
[    6.414418] Hardware name: Hardkernel ODROID-C2 (DT)
[    6.419347] Workqueue: pm pm_runtime_work
[    6.423303] pstate: 60000085 (nZCv daIf -PAN -UAO)
[    6.428051] pc : regulator_disable+0x18/0xa0
[    6.432277] lr : _dwc2_hcd_suspend+0xe8/0x168
[    6.436584] sp : ffff00000a223a50
[    6.439862] x29: ffff00000a223a50 x28: 0000000000000000
[    6.445123] x27: ffff000009477000 x26: 0000000000000000
[    6.450384] x25: ffff00000a223cb0 x24: 0000000000000001
[    6.455645] x23: 0000000000000000 x22: ffff80006f5f7c00
[    6.460906] x21: 0000000000000000 x20: ffff80006f55717c
[    6.466167] x19: ffffffffffffffed x18: 0000000000000010
[    6.471429] x17: fffffffffffffff0 x16: ffff00000829e958
[    6.476690] x15: ffffffffffffffff x14: ffff00008969f6bf
[    6.481951] x13: ffff00000969f6cd x12: ffff0000094a1000
[    6.487213] x11: ffff000009479b38 x10: 00000000000009d0
[    6.492474] x9 : ffff00000a223990 x8 : ffff80006f569830
[    6.497735] x7 : 0000000000000000 x6 : 0000000005ad946e
[    6.502996] x5 : 000000000000077c x4 : ffff0000095fa408
[    6.508257] x3 : 0000000000000000 x2 : 00000000ffffefd1
[    6.513519] x1 : ffff00000a380440 x0 : ffff00000890ebf8
[    6.518781] Process kworker/0:2 (pid: 195, stack limit = 0x        (ptrval))
[    6.525768] Call trace:
[    6.528184]  regulator_disable+0x18/0xa0
[    6.532065]  _dwc2_hcd_suspend+0xe8/0x168
[    6.536033]  hcd_bus_suspend+0xa8/0x218
[    6.539827]  generic_suspend+0x64/0x70
[    6.543536]  usb_suspend_both+0x1ac/0x228
[    6.547503]  usb_runtime_suspend+0x34/0x78
[    6.551558]  __rpm_callback+0xf8/0x280
[    6.555266]  rpm_callback+0x34/0xa0
[    6.558716]  rpm_suspend+0x110/0x5e0
[    6.562252]  __pm_runtime_suspend+0x70/0xb0
[    6.566392]  usb_runtime_idle+0x30/0x40
[    6.570187]  __rpm_callback+0xf8/0x280
[    6.573896]  rpm_idle+0x244/0x2d0
[    6.577173]  pm_runtime_work+0xb8/0xd8
[    6.580884]  process_one_work+0x1b8/0x3f0
[    6.584849]  worker_thread+0x54/0x440
[    6.588472]  kthread+0x134/0x138
[    6.591664]  ret_from_fork+0x10/0x1c
[    6.595200] Code: f9000bf3 aa0003f3 aa1e03e0 d503201f (39406260)
[    6.601238] ---[ end trace 444072529684a614 ]---
campbell
 
Posts: 301
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 ivanovic » Wed May 02, 2018 6:48 am

summers wrote:
summers wrote:
campbell wrote:
summers wrote:
campbell wrote:Still not fixed in 4.16-rc7. Do we have to wait for 4.17 or something?

If you check the bottom of the patch it says "Applied v4.17 and CCed to stable"

This to me means that we won't see it until 4.17, due to the kernel release schedule - but it *may* come out on 4.15 sooner or later.

It certainly isn't in linus tree yet ...

The merge window for 4.17 has been open for a few days now and this change still hasn't been applied to Linus's tree...are the right people submitting the patches at the right times? Don't want this to fall off the radar, because it's still broken.

As was the official kernel maintainers for meson that posted it, then yes I'd still expect it in 4.17. However meson is some way down the food chain in the linux kernel IIRC, so that needs to be merged into various other trees - before it reaches linus. I think the merging should be automatic, as official maintainers - but doesn't mean its fast. So think the crunch point only comes when when rc1 comes out.

For what its worth, its listed as appearing in 4.17 here http://linux-meson.com/doku.php, but that the same people again.

Looks like its landed here:

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts


The emmc fix is available in 4.16.6+ as well as in 4.14.36+. I just upgraded my system to kernel 4.16.6 via the archlinux package and the system (which was heavily affected before) seems to run nicely without corruption of the emmc. It is also part of the 4.17-rc series.
ivanovic
 
Posts: 5
Joined: Sun Feb 18, 2018 10:19 pm
languages_spoken: english, german
ODROIDs: Odroid C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Wed May 02, 2018 9:18 am

If you are interested to run headless Debian with mainline kernel, you could consider running Debian Stretch Installer which will set up Debian from scratch on ODROID-C2 itself with up to date Debian packages. The Debian installer is hacked version, you can arrange the partition layout with your preferred file system types on installation. Please visit another thread https://forum.odroid.com/viewtopic.php?f=55&t=30869#p222648 for the instruction and updates.

Currently, I've tested to run the headless machine with mainline kernel v4.17-rc1, GPU is not fully tested yet and not fully customized for ODROID-C2 yet. After having Debian Strech with my installer, the upstream kernel can be updated through my repository in Launchpad (https://launchpad.net/odroid-image), probably every week whenever a new upstream tag is released or updated. I hope myself can keep updating the repository with a new release. :lol:

I've missed some posts in this thread and will see if my branch can merge the patches from scpcom's one if he/she permits. :) Also, if you have a patch or like to request a kernel configuration to be updated, please post the request to my Launchpad or here.
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu May 03, 2018 5:04 am

campbell wrote:


I can confirm that
Code: Select all
od -td4 --endian=big /proc/device-tree/soc/apb\@d0000000/mmc\@74000/max-frequency
reports 100 MHz in 4.17-rc1 in the Arch repository. Haven't tried running it on an emmc yet, will hopefully get to that this evening

Two weeks late but I can confirm that a fresh install of arch with the 4.17-rc3 kernel works on my red emmc.
campbell
 
Posts: 301
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 scpcom » Thu May 03, 2018 10:01 am

tobetter wrote:I've missed some posts in this thread and will see if my branch can merge the patches from scpcom's one if he/she permits. :) Also, if you have a patch or like to request a kernel configuration to be updated, please post the request to my Launchpad or here.


Yes, you can merge whatever you want/is useful :-)
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Mon May 07, 2018 10:52 am

Update 20180506
- Kernel 4.16.7
- Added some drm backport patches (linux-4.17.y-amlogic-drm-00*.patch)
- Added linux-4.17.y-amlogic-drm-1000-wip_calculate_display_params-fix.patch
- Added support for ODROID VU7 Plus MultiTouch (linux-4.17.y-amlogic-drm-1001-drm-mode-quirks-vu7plus.patch and linux-4.16.y-input_touchscreen-vu5-vu7plus.patch)
- Backported patches to 4.14.y
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.39-20180506-c2-arm64.zip
linux-4.16-odroidc2-build.tar.gz linux-image-4.16.7-20180506-c2-arm64.zip

VU7 Plus EDID reports a mode with 32000 Hz clock/43 Hz refresh, which is not supported by mainline drm meson driver.
Also the old 51450 Hz clock/60 Hz refresh mode from kernel 3.14/3.16 does not work.
I tried to define the related clocks in meson_vclk.c but the result did not change.
The default 1024x768 (65000 Hz clock/60 Hz refresh) does work (with 128 out-of-screen lines at bottom), based on this I added a mode with modified dimensions and implemented a "mode quirk" in drm_edid.c which only applies if EDID vendor and product id matches.
All other VU5/VU7 may not work yet. For screens with HDMI connector only the resolution needs to be added to drm_edid.c and meson_venc.c. For I2C based screens more work may be needed because sx865x.c contains code that only works with old amlogic drivers.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby asavah » Tue May 15, 2018 2:37 am

Just built 4.17-rc5 - emmc is working perfectly now.
I have http://www.hardkernel.com/main/products ... 5622641989 (don't mind that it says android) which was giving me problems
forcing me to use sd card, now it runs great again.
asavah
 
Posts: 18
Joined: Sat Jul 16, 2016 7:00 am
languages_spoken: english
ODROIDs: c2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Tue May 15, 2018 3:20 pm

Hi tobetter,

Could you integrate these two patches in your build image, so that I could easily test UHS-I setting on various sd cards quickly.
Attachments
mmc.tar.gz
UHS-I dts patches
(1.08 KiB) Downloaded 51 times
moon.linux
 
Posts: 1163
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Tue May 15, 2018 7:09 pm

moon.linux wrote:Hi tobetter,

Could you integrate these two patches in your build image, so that I could easily test UHS-I setting on various sd cards quickly.

Can you use Github?
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Tue May 15, 2018 9:36 pm

Mainline kernel v4.17-rc5 is packaged,
https://code.launchpad.net/~tobetter/+a ... d/14883457
User avatar
tobetter
 
Posts: 2461
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Wed May 23, 2018 11:09 am

Update 20180522
- Kernel 4.16.10
- Removed linux-4.17.y-amlogic-drm-1001-drm-mode-quirks-vu7plus.patch
- Added linux-4.17.y-amlogic-drm-1001-drm-mode-32khz-vu7plus.patch

linux-4.16-odroidc2-build.tar.gz linux-image-4.16.10-20180522-c2-arm64.zip
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.43-20180522-c2-arm64.zip

Since I found and added the required pixel clock definitions to drm/meson no special mode is required anymore for VU7+.
It is now the same mode that is reported by EDID.

EDIT: My patch name is not right, the added pixel clock definition is 32000 KHz a.k.a 32 MHz.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby miskol » Fri May 25, 2018 5:32 am

You can try armbian development branch and odroid c2 dev kernel
board can boot up without any problem with mainline kernel(latest 4.17)
miskol
 
Posts: 145
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Mon May 28, 2018 8:38 am

Update 20180526
- Kernel 4.16.12
- Removed linux-4.17.y-amlogic-drm-1001-drm-mode-32khz-vu7plus.patch
- Added linux-4.17.y-amlogic-drm-1001-drm-mode-32000khz-vu7plus.patch

linux-4.16-odroidc2-build.tar.gz linux-image-4.16.12-20180526-c2-arm64.zip
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.44-20180526-c2-arm64.zip

The pixel clock is now real 32000 KHz, old definition was 32500.
scpcom
 
Posts: 75
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

PreviousNext

Return to General Chat

Who is online

Users browsing this forum: No registered users and 1 guest