Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

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

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

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

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

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

Re: Odroid C2 mainline kernel support

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

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

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

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

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

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

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

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

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


The i2c shows there is a slot at 51

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


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

Is the aml_i2c module crucial to using the rtc?

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


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

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

Re: Odroid C2 mainline kernel support

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

scpcom wrote:Update 20180602
- Kernel 4.17.0

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


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

Re: Odroid C2 mainline kernel support

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

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

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

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

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

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

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


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

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

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

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

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

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

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

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

Re: Odroid C2 mainline kernel support

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

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

Re: Odroid C2 mainline kernel support

Unread postby waka324 » Thu Jul 26, 2018 10:23 am

What defconfig are people using for 4.17? arm64 or a modified version?
waka324
 
Posts: 2
Joined: Thu Jul 26, 2018 10:20 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby waka324 » Thu Jul 26, 2018 2:47 pm

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


Just tried your build out (4.17.10) but found USB would only work if more than one device was plugged in at boot. Very odd.
waka324
 
Posts: 2
Joined: Thu Jul 26, 2018 10:20 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby nayr » Sun Jul 29, 2018 3:38 am

I got RTC working by building my own kernel with 'Philips PCF8563/Epson RTC8564' statically linked and following the instructions earlier and putting this within i2c@8500
Code: Select all
            pcf8563@51 {
               status = "okay";
               compatible = "nxp,pcf8563";
               reg = <0x51>;
               #clock-cells = <0x0>;
            };

meson-gxbb-odroidc2.dtb

It would save alot of trouble and headache if you guys pre-building kernels included that, changing the dtb is alot simpler than rebuilding.. My service needs to maintain time even w/out internet connectivity.

Unfortunately I'm having audio issues after building it with usb-sound support (which was also missing??), I'm using my C2 as a packet radio and the TNC I'm using complains the volume input is too high, even if I mute it or I mute the radio sending packets.. dunno what the problem is but it worked fine on the 3.x kernel, so I guess I'll be downgrading after this adventure.

Code: Select all
Audio device for both receive and transmit: plughw:CARD=CODEC  (channel 0)
Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, E+, 44100 sample rate.
Digipeater WIDE1 (probably KC0D) audio level = 174(22/20)   [NONE]   __|______
Audio input level is too high.  Reduce so most stations are around 50.
ADEVICE0: Sample rate approx. 44.1 k, 0 errors, receive audio level CH0 174
ADEVICE0: Sample rate approx. 44.1 k, 0 errors, receive audio level CH0 179
ADEVICE0: Sample rate approx. 44.1 k, 0 errors, receive audio level CH0 177
ADEVICE0: Sample rate approx. 44.1 k, 0 errors, receive audio level CH0 171


previous kernel those audio levels were ~50, and if I turned the pots or changed the volume in the mixer i could move it up/down.. with 4.17.10 kernel it just stays here @ ~170 regardless of what knobs I turn.. and its ignoring 90% of packets, got lucky to grab that one above and was unable to decode the following 100 packets that I heard the radio receive clearly.
nayr
 
Posts: 1
Joined: Sun Jul 29, 2018 3:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Wed Aug 01, 2018 6:19 am

Update 20180726
- Kernel 4.17.11
- Added UMP ioctls to drm fb (linux-4.14.y-drm-fb_helper-ump-ioctls.patch)
- Added Mali and UMP compatibility patches for Kernel 4.1x (series-mali-r6p2 and mali-r6p2-*.patch)
- Added meson drm to fbturbo (fbturbo-add-meson-and-sun4i-drm.patch)

linux-4.14-odroidc2-build.tar.gz linux-image-4.14.59-20180726-c2-arm64.zip
linux-4.17-odroidc2-build.tar.gz linux-image-4.17.11-20180726-c2-arm64.zip
xserver-xorg-video-fbturbo-c2.zip xserver-xorg-video-fbturbo-c2-stretch-arm64.zip xserver-xorg-video-fbturbo-c2-bionic-arm64.zip

Replacing mali and fbturbo is now optional. I added UMP support to mainline kernel.
I just added the missing ioctls to drm_fb_helper.c and added drm_fb_ump.c, which is based on osd_ump.c from kernel 3.14/3.16 so I kept the Hardkernel copyright statement.
Why UMP again? Because on kernel 4.14/4.17
- with armsoc and without UMP I get a glmark2-es2 score of 38 and below, sometimes if all glmark-es2 tests are done the application hangs.
- with fbturbo and UMP I get a glmark2-es2 score of 90 and even higher, nothing hangs.

Anyway the same kernel works with both variants now.
And the same fbturbo works with kernel 3.14/3.16 and 4.14/4.17 now.

Tested with UMP libs:
mali-x11 (20161003-r6p1-ee42997-15 from http://deb.odroid.in/c2/ xenial main)
mali-x11 (20180710-r6p1-10 from http://deb.odroid.in/c2/ bionic main)
mali450-odroid (20161218-r6p1-1 from http://oph.mdrjr.net/meveric/ all c2 main)

...and libs without UMP:
mali450-meson (20170630-r6p1-1, from amlogic buildroot openlinux 20170630)

@waka324
Interesting, I will take a look at it, maybe next weekend.
@nayr
I am not familiar with RTC on C2.
Is USB Audio missing? I will take a look at the defconfig. I did not recognize it myself because I lost my USB audio card :-) So I only use HDMI audio currently.
scpcom
 
Posts: 55
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby otec » Sun Aug 05, 2018 4:32 pm

scpcom wrote:Update 20180726
- Kernel 4.17.11
- Added UMP ioctls to drm fb (linux-4.14.y-drm-fb_helper-ump-ioctls.patch)
- Added Mali and UMP compatibility patches for Kernel 4.1x (series-mali-r6p2 and mali-r6p2-*.patch)
- Added meson drm to fbturbo (fbturbo-add-meson-and-sun4i-drm.patch)



Sorry for a newbie question, but do you have a short guide how to install it ?

I've downloaded 4.17.11 zip, unzipped it, installed *.deb packages using dpkg -i.
I see that it updated /media/boot with new Image and uInitrd.

I tried to reboot, but c2 kept autorebooting without even loading the kernel.

Code: Select all
--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@dr                                                                     oid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipidLoad bl33 from eMMC, src: 0x00034200, des: 0x01000000, size: 0x00073510
: ef be ad de d f0 ad ba ef be ad de not ES chip
[0.175214 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00189-g205c7b3 (Feb 27 2017 - 10:53:13)

DRAM:  2 GiB
Relocation Offset is: 76f32000
-------------------------------------------------
* Welcome to Hardkernel's ODROID-C2
-------------------------------------------------
CPU : AMLogic S905
S/N : HKC213254DFCC287
MAC : 00:1e:06:33:0f:07
BID : HKC2211602
-------------------------------------------------
register usb cfg[1][0] = 0000000077f95058
register usb cfg[0][1] = 0000000077f95078
vpu detect type: 5
vpu clk_level = 7
set vpu clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   aml_priv->desc_buf = 0x0000000073f2ad30
aml_priv->desc_buf = 0x0000000073f2cec0
SDIO Port C: 0, SDIO Port B: 1
[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
----------------------------------
MMC Size : 64 GB
----------------------------------
reading boot-logo.bmp.gz
** Unable to read file boot-logo.bmp.gz **
reading boot-logo.bmp
** Unable to read file boot-logo.bmp **
movi: the partiton 'logo' is reading...

MMC read: dev # 0, block # 61024, count 2048 ... 2048 blocks read: OK
hpd_state=1
[CANVAS]addr=0x3f800000 width=3840, height=1440

set hdmitx VIC = 16
hdmitx phy setting done
set hdmitx VIC = 16
hdmitx phy setting done
Error: Bad gzipped data
There is no valid bmp file at the given address
Net:   Meson_Ethernet
Hit [Enter] key twice to stop autoboot:  0
reading boot.ini
6806 bytes read in 3 ms (2.2 MiB/s)
cfgload: applying boot.ini...
cfgload: setenv display_autodetect "true"
cfgload: setenv m "1080p60hz" # Progressive 60Hz
cfgload: setenv m_bpp "32"
cfgload: setenv hpd "true"
cfgload: setenv monitor_onoff "false" # true or false
cfgload: setenv nographics "0"
cfgload: setenv mesontimer "0"
cfgload: setenv disableuhs "false"
cfgload: setenv mmc_removable "true"
cfgload: setenv usbmulticam "false"
cfgload: setenv disable_vu7 "true"
cfgload: setenv condev "console=ttyS0,115200n8 console=tty0"   # on both
cfgload: setenv maxcpus "4"
cfgload: setenv max_freq "1536"  # 1.536GHz
cfgload: if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid;                                                                      fi
USB0:   dwc_usb driver version: 2.94 6-June-2012
USB (1) peri reg base: c0000020
USB (1) use clock source: XTAL input, div: 1
USB (1) base addr: 0xc9100000
Force id mode: Host
dwc_otg: Highspeed device found !

..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
edid extension block number : 1
No header found
Manufacturer: @@@ Model 0 Serial Number 0
EDID version: 0.0
Analog display, Input voltage level: 0.7/0.3 V
Sync:
Established timings supported:
Standard timings supported:
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
non-conformant standard timing (0 horiz)
Manufacturer-specified data, tag 0
Manufacturer-specified data, tag 0
Manufacturer-specified data, tag 0
Manufacturer-specified data, tag 0
Checksum: 0x0 (valid)
bestmode is 1080p60hz, IEEEOUI 0x000000
DVI Mode
cfgload: if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}                                                                     "; fi
cfgload: if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quir                                                                     ks=0x0eef:0x0005:0x0004"; fi
cfgload: setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwai                                                                     t ro ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${v                                                                     out} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${ma                                                                     x_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuh                                                                     s} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} ${hid_quirks} coher                                                                     ent_pool=1M"
cfgload: setenv loadaddr "0x11000000"
cfgload: setenv dtb_loadaddr "0x1000000"
cfgload: setenv initrd_loadaddr "0x13000000"
cfgload: fatload mmc 0:1 ${initrd_loadaddr} uInitrd
reading uInitrd
11761167 bytes read in 276 ms (40.6 MiB/s)
cfgload: fatload mmc 0:1 ${loadaddr} Image
reading Image
18356736 bytes read in 429 ms (40.8 MiB/s)
cfgload: fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb
reading meson64_odroidc2.dtb
29164 bytes read in 4 ms (7 MiB/s)
cfgload: fdt addr ${dtb_loadaddr}
cfgload: if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/c                                                                     pu@0/timer; fdt rm /cpus/cpu@1/timer; fdt rm /cpus/cpu@2/timer; fdt rm /cpus/cpu                                                                     @3/timer; fi
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
cfgload: if test "${mesontimer}" = "1"; then fdt rm /timer; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /reserved-memory; fdt rm /ao                                                                     cec; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /meson-fb; fdt rm /amhdmitx;                                                                      fdt rm /picdec; fdt rm /ppmgr; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /meson-vout; fdt rm /mesonst                                                                     ream; fdt rm /meson-fb; fi
cfgload: if test "${nographics}" = "1"; then fdt rm /deinterlace; fdt rm /codec_                                                                     mm; fi
cfgload: booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
"Synchronous Abort" handler, esr 0x96000010
ELR:     77f3d5d0
LR:      77f3d5c4
x0 : 0000000077fa6048 x1 : 0000000000080000
x2 : 0000000001387000 x3 : 0000000001387000
x4 : 000000000000000d x5 : 0000000011000000
x6 : 0000000077f7f6f8 x7 : 0000000000000044
x8 : 0000000000000001 x9 : 0000000000000002
x10: 000000000000000f x11: 0000000077f809b8
x12: 0000000000000000 x13: 0000000000000000
x14: 0000000000000000 x15: 0000000077f330d0
x16: 0000000077f332b4 x17: 0000000000000000
x18: 0000000073f29e28 x19: 0000000077fa5f08
x20: 0000000000000003 x21: 0000000073f350b8
x22: 0000000077fa5000 x23: 0000000077fa5f08
x24: 0000000000000000 x25: 0000000073f350b0
x26: 0000000077f99188 x27: 0000000073f350e0
x28: 0000000000000000 x29: 0000000073f295d0


I'm running on eMMC card. Do I need to change anything in boot.init ?
otec
 
Posts: 168
Joined: Sat Feb 06, 2016 7:08 pm
languages_spoken: english
ODROIDs: C2 + eMMC 64Gb

Re: Odroid C2 mainline kernel support

Unread postby otec » Sun Aug 05, 2018 6:05 pm

I followed the guide in this file http://seafile.servator.de/sbc/odroid/n ... nstall.txt

I used to have FAT partition on mmc at address 0:1 in boot.ini, it looks like now it migrated to 1:1.

Now when C2 boots it hangs on Starting Kernel:

Code: Select all
=> setenv loadaddr "0x11000000"
=> setenv dtb_loadaddr "0x1000000"
=> setenv initrd_loadaddr "0x13000000"
=> fatload mmc 1:1 ${initrd_loadaddr} uInitrd
11762175 bytes read in 260 ms (43.1 MiB/s)
=> fatload mmc 1:1 ${loadaddr} Image
18356736 bytes read in 405 ms (43.2 MiB/s)
=> fatload mmc 1:1 ${dtb_loadaddr} meson64_odroidc2.dtb
29164 bytes read in 2 ms (13.9 MiB/s)
=> fdt addr ${dtb_loadaddr}
=> booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
   Data Size:    11762111 Bytes = 11.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
   Loading Ramdisk to 7d427000, end 7df5e9bf ... OK
   Loading Device Tree to 000000007d41c000, end 000000007d4261eb ... OK

Starting kernel ...



any ideas why it doesnt want to load kernel ?
otec
 
Posts: 168
Joined: Sat Feb 06, 2016 7:08 pm
languages_spoken: english
ODROIDs: C2 + eMMC 64Gb

Re: Odroid C2 mainline kernel support

Unread postby otec » Sun Aug 05, 2018 8:53 pm

Re-installed Ubuntu from scratch && followed guide again. All works fine!
otec
 
Posts: 168
Joined: Sat Feb 06, 2016 7:08 pm
languages_spoken: english
ODROIDs: C2 + eMMC 64Gb

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Mon Aug 06, 2018 8:47 am

@otec
Thank you for testing.
Sorry I did not answer earlier, I am still researching on the mainline kernels for meson and sunxi.

@memeka
I built a kernel with the video decoder patches successfuly but I really do not know yet how to test it.
Firefox & Co. still use software decoding, maybe some extra libva/libdrm is needed.
For sunxi I found this, they seem to work on a solution too:
https://github.com/bootlin/linux-cedrus ... /4.17/h264
https://github.com/bootlin/libdrm-sun4i
https://github.com/bootlin/libva-v4l2-request
But I am not done with testing to get a working result.
scpcom
 
Posts: 55
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby memeka » Mon Aug 06, 2018 8:56 am

in theory, https://github.com/bootlin/libva-v4l2-request should work with C2 as well.
User avatar
memeka
 
Posts: 4002
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Odroid C2 mainline kernel support

Unread postby lnxsrt » Thu Aug 09, 2018 9:58 am

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


Just tried your build out (4.17.10) but found USB would only work if more than one device was plugged in at boot. Very odd.


Same exact issue using linux-aarch64 (4.17.12-1-ARCH) on Arch. Besides that, it is very stable, even better than the standard 3.14 IMO.
lnxsrt
 
Posts: 1
Joined: Thu Aug 09, 2018 9:55 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Aug 14, 2018 3:06 am

lnxsrt wrote:
waka324 wrote:Just tried your build out (4.17.10) but found USB would only work if more than one device was plugged in at boot. Very odd.


Same exact issue using linux-aarch64 (4.17.12-1-ARCH) on Arch. Besides that, it is very stable, even better than the standard 3.14 IMO.

On the (Arch) 4.18.0 kernel this morning, what I'm seeing is:

with an iPhone plugged in at boot:
- it works (charges, and shows up in lsusb)
- the FTDI cable shows up when plugged in after boot, any number of times
- after the iPhone is unplugged, with the FTDI cable still plugged in, the FTDI cable still works
- if the iPhone is plugged back in, with the FTDI cable still plugged in, then the iPhone works too
- if both are unplugged, then nothing works anymore when plugged back in, even if you plug in both

I did the same experiments in the same order with the iPhone and FTDI cable swapped and there was no difference. Short version: if you have something plugged in at boot, and have at least one thing plugged in at all times, then your USB will work as expected.

This is an Odroid C2 rev 20170830 with the jumper off, running vanilla latest Arch Linux with the mainline kernel and uboot.

I'm pretty disappointed that more effort hasn't been put into fixing this by people in a position to do so, after all this time. Clearly there is code in the 3.14 kernel that makes it work, what exactly is the problem with getting it into mainline?
campbell
 
Posts: 286
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 BarTender » Tue Aug 14, 2018 4:08 pm

Sorry for the noobie question but I had a read through this thread and couldn't find the specific issue with eMMC.
Using a C2 Rev0.2 20160226 with 32GB red eMMC which works fine with the Ubtuntu 18 ubuntu-18.04-3.16-minimal-odroid-c2-20180626.img.xz minimal image. Then I tried to upgrade to mainline kernel following the instructions.

http://seafile.servator.de/sbc/odroid/n ... nstall.txt

Since it's minimal I only am able to upgrade the uboot and kernel as I am not using the HDMI port as this is a headless node.

Checking the serial console I see the error:

Found U-Boot script /boot.scr
6289 bytes read in 1 ms (6 MiB/s)
## Executing script at 1f000000
Unknown command 'ODROIDC2-UBOOT-CONFIG' - try 'help'
Unknown command 'usb' - try 'help'
Unknown command 'hdmitx' - try 'help'
Card did not respond to voltage select!
** Bad device mmc 0 **
Card did not respond to voltage select!
** Bad device mmc 0 **
Card did not respond to voltage select!

Inside uboot I try and get the card info and it fails
=> mmc info
Card did not respond to voltage select!

Should I build uboot and the kernel from source and start again? As doing the uboot upgrade effectively bricks the image. Is it worth doing a backup of the uboot so I can recover back to the 3.14 kernel?
BarTender
 
Posts: 10
Joined: Tue Sep 27, 2016 8:54 pm
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby OverSun » Tue Aug 14, 2018 5:45 pm

I wouldn't advise you to tamper with u-boot if you don't know what you're doing or you are really eager to learn what it is. As you already noticed, blindly throwing stuff in effectively prevent the board from booting. That's not something that is going to report you errors and still work.
In this case you renamed "boot.ini" to "boot.scr" which are completely different things. boot.ini is odroid specific invention which is a file with a header, possible comments and commands going one after another. and boot.scr is a memory dump of a portion of a memory that file read produces.
User avatar
OverSun
 
Posts: 1370
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby BarTender » Tue Aug 14, 2018 6:57 pm

OverSun wrote:I wouldn't advise you to tamper with u-boot if you don't know what you're doing or you are really eager to learn what it is. As you already noticed, blindly throwing stuff in effectively prevent the board from booting. That's not something that is going to report you errors and still work.
In this case you renamed "boot.ini" to "boot.scr" which are completely different things. boot.ini is odroid specific invention which is a file with a header, possible comments and commands going one after another. and boot.scr is a memory dump of a portion of a memory that file read produces.

I didn't touch the boot.ini or create a boot.scr but I suspect the uboot installer may have done that.
What is the recommended approach to upgrade uboot from U-Boot 2015.01-00014-g2e4380b-dirty to the 2018-03/head version which is required for 4.x mainline kernel?
I would think it would be logical to upgrade uboot first keeping the current 3.14 kernel, then be able to write the updated 4.x kernel and modify the boot.ini script so that I can failback to the 3.14 if it goes wrong.
BarTender
 
Posts: 10
Joined: Tue Sep 27, 2016 8:54 pm
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby OverSun » Tue Aug 14, 2018 7:27 pm

The recommended way would be to wait for a package that does the upgrade.
Manually that would be yes, upgrading u-boot first, so it can boot 3.14 (also can have issues, depends), then update the kernel.
Most complicated thing here that if you upgrade to the version that is not compiled from odroid github - you are not going to have odroid specific functionality that the whole boot process of odroid images is based around right now. There is going to be nothing wrong with u-boot, nothing wrong with system, it's just scripts that command u-boot what to do and where to look for kernels are going to be not working. And at this points you will need to understand how to work with u-boot and its commands. If you know what all the fatloat, booti commands are, then it's pretty ok to work that around and boot any kernel you want. But no, it's not going to "just work", you will end up with a boot prompt of u-boot on the serial port.
User avatar
OverSun
 
Posts: 1370
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Fri Aug 17, 2018 2:54 am

Update 20180815
- Kernel 4.18.1
- Added yocto-meson64 v4l2-m2m patches (https://github.com/superna9999/meta-mes ... son64-4.18)
linux-4.14-odroidc2-build.tar.gz linux-image-4.14.63-20180815-c2-arm64.zip
linux-4.18-odroidc2-build.tar.gz linux-image-4.18.1-20180815-c2-arm64.zip

@BarTender and @OverSun
My install-linux.sh does automatically convert boot.ini to boot.scr (only if boot.cmd/boot.scr did not exist before).
boot.scr is the binary version of boot.cmd.
The boot.ini syntax is not odroid specific, it is the same syntax as in boot.cmd, the only lines that need to be removed are the fdt manipulations, that only work on the 3.1x device tree.
Other parameters maybe ignored because the mainline kernel does not implement them, but they do not cause any boot trouble.
The MMC problem must be something else. I also have a red 32GB eMMC module, so I can look If I find something.
scpcom
 
Posts: 55
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby rockla » Fri Aug 17, 2018 3:19 am

I'm only interested in headless server the main post does not clearly explains how to upgrade to new kernel cleanly what works what does not work.
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Fri Aug 17, 2018 7:19 am

Update 20180816
- Conversion from boot.ini to boot.cmd supports eMMC now (install-linux.sh)
Download links same like 20180815 above

Installing u-boot and kernel on image with 3.1x kernel (like ubuntu-18.04-3.16-minimal-odroid-c2-20180626.img.xz) runs with eMMC too know.
I just added one line to make boot.cmd independent from the MMC slot:
Code: Select all
sudo sed -i s/' mmc .:. '/' ${devtype} ${devnum}:${rootpart} '/g /media/boot/boot.cmd

You do not need to set this three new variables yourself because u-boot does this for you (no hack, tested with mainline u-boot 2018.03 and 2018.07).
PS: If you build your own u-boot, CONFIG_BOOTCOMMAND must contain "run distro_bootcmd" to make this work.

@rockia
You can find an good overview here: http://linux-meson.com/doku.php
(My extra patches/collected patches are mostly for multimedia issuses)
scpcom
 
Posts: 55
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby rockla » Fri Aug 17, 2018 10:35 am

Thanks looked at doc usb support is missing
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Odroid C2 mainline kernel support

Unread postby BarTender » Fri Aug 17, 2018 12:46 pm

scpcom wrote:Update 20180816
- Conversion from boot.ini to boot.cmd supports eMMC now (install-linux.sh)
Download links same like 20180815 above

Installing u-boot and kernel on image with 3.1x kernel (like ubuntu-18.04-3.16-minimal-odroid-c2-20180626.img.xz) runs with eMMC too know.
I just added one line to make boot.cmd independent from the MMC slot:
Code: Select all
sudo sed -i s/' mmc .:. '/' ${devtype} ${devnum}:${rootpart} '/g /media/boot/boot.cmd

You do not need to set this three new variables yourself because u-boot does this for you (no hack, tested with mainline u-boot 2018.03 and 2018.07).
PS: If you build your own u-boot, CONFIG_BOOTCOMMAND must contain "run distro_bootcmd" to make this work.

@rockia
You can find an good overview here: http://linux-meson.com/doku.php
(My extra patches/collected patches are mostly for multimedia issuses)


So would it be safe to upgrade just uboot and stick with the 3.14 kernel? or do I need to upgrade both at the same time?
BarTender
 
Posts: 10
Joined: Tue Sep 27, 2016 8:54 pm
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby scpcom » Sat Aug 18, 2018 1:54 am

You need to upgrade both, u-boot and kernel.

@rockia
In the table S905 USB: Yes, USB OTG: No
USB is supported, but needs bugfixing the issue discussed above.
scpcom
 
Posts: 55
Joined: Thu Jun 23, 2016 8:07 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby BarTender » Sat Aug 18, 2018 6:25 am

I have found my issue, it seems I wasn't RTFMing and was running the uboot sd_fusing *after* installing the kernel. Because of that the initrd was never properly built during the kernel install and the image was toast after I ran the sd_fusing.
Now have Ubuntu 18.04 minimal with 4.14.63 and 4.18.1 and the ethernet drivers are working at 1GB as I can do a 1GB iperf3 between nodes at home getting 940Mbit.
Many thanks for the image builds :)
BarTender
 
Posts: 10
Joined: Tue Sep 27, 2016 8:54 pm
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby mad_ady » Sat Aug 18, 2018 1:24 pm

I could do ~920M on 3.14/3.16 as well.
User avatar
mad_ady
 
Posts: 4259
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Previous

Return to General Chat

Who is online

Users browsing this forum: No registered users and 2 guests