Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

Unread postby cdu13a » Sun Dec 24, 2017 3:51 am

@tuxx: Hardkernel has used emmc chips from different manufactures over the years they have been making the emmc modules. So it may just be that the emmc chips on the two modules are different. It's possible that there are some emmc chips that might not be as well supported yet by the mainline drivers.
cdu13a
 
Posts: 47
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1

Re: Odroid C2 mainline kernel support

Unread postby brad » Sun Dec 24, 2017 6:07 am

tuxx wrote:Ok, I really apologize, but I wrote a post full of mistakes. Just to clarify:

- My board is odroid C2
- My kernel is 4.14.8

I did my tests and I noticed something very strange. I have two emmc cards: one bought with my C2 and one bought years ago with my C1+.

- The C2 card is fully functional with hardkernel kernel but when I upgrade to mainline, I get all the above errors.
- I do the same procedure with the old C1+ emmc card (using Odroid C2 of course) and everything is perfect.

So either the cards are different and C2 card has issues with mainline, or the C2 emmc card is dying.


Hi tux, I too have an emmc card which produces errors with all the latest fixes (im using 4.14.5). My card that has issues is a 16Gb (its from the first orig batch) but I can get it working with some hacks to the current driver. Now that I know it might be related to specific card versions I will look into it some more.

Edit: for completeness and so I dont forget, 2 possible methods for a fix
2nd Edit: Option 1 below had some issues on 2 occasions for me (so I made it hard to read)
[color=#00FFBF]1) Edit "drivers/mmc/host/meson-gx-mmc.c" change the initialisation tx phase to 0 and recompile (sequential reads of 142Mb/s)....

clk_set_phase(host->tx_clk, 270);
should become
clk_set_phase(host->tx_clk, 0);
[/color]
2) teknoid's fix, edit your device tree as per this post viewtopic.php?f=135&t=22717&start=600#p203209

The "max-frequency = <100000000>;" is the key line, I had success with a value of 150,000,000 (approx 115Mb/s sequential read, 100,000,000 is about 95Mb/s read.
Last edited by brad on Mon Dec 25, 2017 8:18 pm, edited 3 times in total.
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby brad » Sun Dec 24, 2017 6:16 am

gügü wrote:What? Are you saying that Odroid C1 can boot mainline kernel 4.18?

If it is so then create a new Thread for Odroid C1 mainline kernel support and we can follow in parallel.

Thanx for your input.


Hi gügü, I don't have an Odroid C1 and im not sure of the current status but the work has begun and it is possible to boot.
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tuxx » Sun Dec 24, 2017 8:35 am

@cdu13a
@brad

thanks for your feedback!
User avatar
tuxx
 
Posts: 47
Joined: Fri Mar 11, 2016 6:42 am
languages_spoken: english
ODROIDs: C1+, C2

Re: Odroid C2 mainline kernel support

Unread postby brad » Mon Dec 25, 2017 8:21 pm

tuxx wrote:@cdu13a
@brad

thanks for your feedback!


I edited my post above, I think option 2 is only suitable now for emmc fix (my clock at 150000000). I had some issues today on 2 restarts which resulted in CRC errors on boot with option 1.
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby gügü » Wed Dec 27, 2017 4:50 pm

brad wrote:
gügü wrote:What? Are you saying that Odroid C1 can boot mainline kernel 4.18?

If it is so then create a new Thread for Odroid C1 mainline kernel support and we can follow in parallel.

Thanx for your input.


Hi gügü, I don't have an Odroid C1 and im not sure of the current status but the work has begun and it is possible to boot.


Please let me know because I want to test mainline kernel for Odroid C1. I have 2 boards and I'm looking for a compiled kernel I could test.

Thanx for the feedback!
gügü
 
Posts: 68
Joined: Sun Dec 20, 2015 6:35 am
languages_spoken: english
ODROIDs: C1 - C2

Re: Odroid C2 mainline kernel support

Unread postby Michi » Wed Dec 27, 2017 8:30 pm

I am using a C2 with Arch Linux and mainline kernel (4.14.8) and U-Boot mainline.
To make the eMMC module (black Hardkernel version) work, I reduced the max-frequency to 150000000 in meson-gxbb-odroidc2.dts to avoid CRC errors.
However, I don't have trim support under the mainline kernel anymore. "lsblk --discard" indicates a "0." With the Hardkernel kernel I could still use trim for the eMMC module. Does trim work for you under the mainline kernel?
Michi
 
Posts: 6
Joined: Wed Dec 27, 2017 8:20 pm
languages_spoken: english; german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby mcloaked » Sat Jan 06, 2018 5:56 am

I am running archlinuxarm and upgraded to the mainline kernel with the advice in the archlinuxarm forums according to:

Code: Select all
pacman -R uboot-odroid-c2
pacman -S uboot-odroid-c2-mainline linux-aarch64
reboot


The system boots, and I can ssh in to this headless system, but I have several issues that I would appreciate any advice on.

1) haveged systemd service fails:

Code: Select all
[root@odroid-c2 ~]# systemctl status haveged             
* haveged.service - Entropy Harvesting Daemon
   Loaded: loaded (/usr/lib/systemd/system/haveged.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-01-05 20:29:59 UTC; 10min ago
     Docs: man:haveged(8)
  Process: 303 ExecStart=/usr/bin/haveged -F -w 1024 -v 1 (code=exited, status=1/FAILURE)
 Main PID: 303 (code=exited, status=1/FAILURE)

Jan 05 20:29:58 odroid-c2 systemd[1]: Started Entropy Harvesting Daemon.
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged: Couldn't initialize HAVEGE rng 5
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged starting up
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Failed with result 'exit-code'.


Is there a workaround?

2) systemd-modules-load also fails:

Code: Select all
[root@odroid-c2 ~]# systemctl status systemd-modules-load
* systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2017-12-21 13:33:56 UTC; 2 weeks 1 days ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 254 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 254 (code=exited, status=1/FAILURE)

Dec 21 13:33:55 odroid-c2 systemd-modules-load[254]: Failed to find module 'aml_i2c'
Dec 21 13:33:56 odroid-c2 systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAIL
Dec 21 13:33:56 odroid-c2 systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Dec 21 13:33:56 odroid-c2 systemd[1]: Failed to start Load Kernel Modules.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.


Is there a workaround for this?

3) The RTC shield hardware clock is not working:

Code: Select all
[root@odroid-c2 ~]# hwclock -r
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[root@odroid-c2 ~]# timedatectl
                      Local time: Fri 2018-01-05 20:31:46 UTC
                  Universal time: Fri 2018-01-05 20:31:46 UTC
                        RTC time: n/a
                       Time zone: UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
[root@odroid-c2 ~]# ./timeupd
Couldn't open blob from '/boot/dtbs/meson64_odroidc2.dtb': No such file or directory
modprobe: FATAL: Module aml_i2c not found in directory /lib/modules/4.14.11-1-ARCH


the content of timeupd is:

Code: Select all
#!/bin/bash
fdtput -t s /boot/dtbs/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"
modprobe aml_i2c
#hwclock --systohc --utc
exit


that used to work previously with the old kernel ( linux-odroid-c2-3.14.79-28 ). The RTC and system-modules-load issue are related since the RTC needs the aml_i2c module!

It is now running 4.14.11-1-ARCH
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 campbell » Sat Jan 06, 2018 6:44 am

There is some work that needs to be done within the device tree to enable the RTC. Merely setting the status to okay isn't enough, because that whole section of the dtb doesn't exist. You need to add it to the dts file and recompile the dtb. I've done this before with the 4.14 kernel but it's not enabled right now. I'll do it again tonight and post the relevant changes.
campbell
 
Posts: 287
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby campbell » Sat Jan 06, 2018 6:56 am

mcloaked wrote:fdtput -t s /boot/dtbs/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

So instead of doing this, you have to do (in the /boot/dtbs/amlogic/ dir):
Code: Select all
dtc -I dtb -O dts meson-gxbb-odroidc2.dtb > meson-gxbb-odroidc2.dts

Add this section at the end of the i2c@8500 section:
Code: Select all
pcf8563@51 {
   status = "okay";
   compatible = "nxp,pcf8563";
   reg = <0x51>;
   #clock-cells = <0x0>;
};

and then rebuild the dtb:
Code: Select all
dtc -I dts -O dtb meson-gxbb-odroidc2.dts > meson-gxbb-odroidc2.dtb


If anyone knows how to do this with fdt commands in boot.ini PLEASE let me know.
campbell
 
Posts: 287
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 mcloaked » Sat Jan 06, 2018 7:27 am

Thank you Campbell, I tried that but maybe I followed up by doing the next step wrong.

I changed timeupd

Code: Select all
#!/bin/bash
fdtput -t s /boot/dtbs/amlogic/meson-gxbb-odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"
modprobe aml_i2c
#hwclock --systohc --utc
exit


then trying to execute that:

Code: Select all
[root@odroid-c2 ~]# ./timeupd
Error at '/i2c@c1108500/pcf8563@51': FDT_ERR_NOTFOUND
modprobe: FATAL: Module aml_i2c not found in directory /lib/modules/4.14.11-1-ARCH


So I guess I need to get the aml_i2c module loaded?
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 brad » Sat Jan 06, 2018 8:31 am

mcloaked wrote:So I guess I need to get the aml_i2c module loaded?


Hi mcloaked,
mainline kernel has i2c drivers built into the kernel with default settings so there is no need to load any aml_i2c driver. What you are likely missing is the driver for the actual RTC chip which is not enabled by default. The guys from archlinux might be able to add this as an option for you to their kernel release or alternatively you can compile a new kernel with this module. Module would be named rtc-pcf8563 and it would somehow need to be added into the device tree similar to what campbell has suggested (or it might possibly be automatically detected). I haven't used RTC and not sure exactly what might be required int he devicetree.

Device Drivers > Real Time Clock ->
CONFIG_RTC_DRV_PCF8563: │
│ │
│ If you say yes here you get support for the │
│ Philips PCF8563 RTC chip. The Epson RTC8564 │
│ should work as well. │
│ │
│ This driver can also be built as a module. If so, the module │
│ will be called rtc-pcf8563. │
│ │
│ Symbol: RTC_DRV_PCF8563 [=n] │
│ Type : tristate │
│ Prompt: Philips PCF8563/Epson RTC8564 │
│ Location: │
│ -> Device Drivers │
│ -> Real Time Clock (RTC_CLASS [=y]) │
│ Defined at drivers/rtc/Kconfig:449 │
│ Depends on: RTC_CLASS [=y] && I2C [=y]
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Sat Jan 06, 2018 8:48 am

Try creating /etc/modules-load.d/rtc.conf with:
Code: Select all
i2c_dev
rtc_pcf8563

"hwclock -r" is working for me even with those commented out, though. I'm using Arch Linux with the same kernel version you've got, although there may have been other hoops I had to jump through to get it working.
campbell
 
Posts: 287
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 tobetter » Sat Jan 06, 2018 7:24 pm

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

The interface eth0 is missing altogether (only lo is present when invoking ifconfig). Has anyone faced this problem? If so, how could I resolve it?
I already tried to set something in /etc/network/interfaces but to no avail.


I've observed that 'eth0' is not present in the mainline kernel 4.13.x and have tried 4.15.x recently. After fixing kernel configuration, finally I am able to make the on-board ethernet run on ODROID-C2.
Code: Select all
root@odroidc2:/home/tobetter# uname -a
Linux odroidc2 4.15.0-rc6 #2 SMP PREEMPT Sat Jan 6 04:53:52 EST 2018 aarch64 GNU/Linux
root@odroidc2:/home/tobetter# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1e:06:33:0d:3f 
          inet addr:192.168.0.14  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:6ff:fe33:d3f/64 Scope:Link
          inet6 addr: fd00:ac20:2e25:7682:21e:6ff:fe33:d3f/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2745 (2.6 KiB)  TX bytes:2174 (2.1 KiB)
          Interrupt:18


You can find my working kernel source tree at https://github.com/tobetter/linux/tree/odroidc2-v4.15, I am running U-boot (2017.11) plus Linux mainline (4.15-rc6) on Debian Jessie.
tobetter
 
Posts: 2372
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 Michi » Sat Jan 06, 2018 7:39 pm

mcloaked wrote:1) haveged systemd service fails:

Code: Select all
[root@odroid-c2 ~]# systemctl status haveged             
* haveged.service - Entropy Harvesting Daemon
   Loaded: loaded (/usr/lib/systemd/system/haveged.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-01-05 20:29:59 UTC; 10min ago
     Docs: man:haveged(8)
  Process: 303 ExecStart=/usr/bin/haveged -F -w 1024 -v 1 (code=exited, status=1/FAILURE)
 Main PID: 303 (code=exited, status=1/FAILURE)

Jan 05 20:29:58 odroid-c2 systemd[1]: Started Entropy Harvesting Daemon.
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged: Couldn't initialize HAVEGE rng 5
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged starting up
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Failed with result 'exit-code'.


Is there a workaround?



I use rng-tools instead of haveged with mainline kernel and i got an entropy value > 3400 with the hardware TRNG.
Michi
 
Posts: 6
Joined: Wed Dec 27, 2017 8:20 pm
languages_spoken: english; german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby mcloaked » Sat Jan 06, 2018 9:02 pm

Michi wrote:
mcloaked wrote:1) haveged systemd service fails:

Code: Select all
[root@odroid-c2 ~]# systemctl status haveged             
* haveged.service - Entropy Harvesting Daemon
   Loaded: loaded (/usr/lib/systemd/system/haveged.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-01-05 20:29:59 UTC; 10min ago
     Docs: man:haveged(8)
  Process: 303 ExecStart=/usr/bin/haveged -F -w 1024 -v 1 (code=exited, status=1/FAILURE)
 Main PID: 303 (code=exited, status=1/FAILURE)

Jan 05 20:29:58 odroid-c2 systemd[1]: Started Entropy Harvesting Daemon.
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged: Couldn't initialize HAVEGE rng 5
Jan 05 20:29:58 odroid-c2 haveged[303]: haveged starting up
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 20:29:59 odroid-c2 systemd[1]: haveged.service: Failed with result 'exit-code'.


Is there a workaround?



I use rng-tools instead of haveged with mainline kernel and i got an entropy value > 3400 with the hardware TRNG.


Thank you Michi - I installed rng-tools, disabled and stopped the haveged systemd service, and then started and enabled the rngd service. Now this passes the test doing

Code: Select all
[root@odroid-c2 ~]# dd if=/dev/random of=/dev/null bs=1024 count=1 iflag=fullblock
1+0 records in
1+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.0013131 s, 780 kB/s


as suggested in the arch wiki and the output was instantaneous in response. I also updated to kernel 4.14.12-1-ARCH before doing this. So hopefully on reboot the rngd service will start and the only remaining issue is the RTC and associated module load problem that I have not yet been able to resolve.

Edit: after rebooting the rngd service started fine, and there is no longer a failed haveged service so the problem with haveged is resolved (by switching to rngd).
Also
Code: Select all
[root@odroid-c2 ~]# cat /proc/sys/kernel/random/entropy_avail
3101
Last edited by mcloaked on Sat Jan 06, 2018 9:23 pm, edited 2 times in total.
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 mcloaked » Sat Jan 06, 2018 9:17 pm

campbell wrote:Try creating /etc/modules-load.d/rtc.conf with:
Code: Select all
i2c_dev
rtc_pcf8563

"hwclock -r" is working for me even with those commented out, though. I'm using Arch Linux with the same kernel version you've got, although there may have been other hoops I had to jump through to get it working.


This morning I did a system update which brought in kernel 4.14.12-1-ARCH - with the same issues as previously. I presume that the changes to the file you suggested ( rebuilding meson-gxbb-odroidc2.dtb ) don't need to be repeated?

However the hwclock -r command still fails - and the modules load service also still fails for aml_i2c (presume that can be switched to not attempt to load if it doesn't need to do so? What needs to be changed to do that?).

Code: Select all
[root@odroid-c2 ~]# hwclock -r
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[root@odroid-c2 ~]# systemctl --failed
  UNIT                         LOAD   ACTIVE SUB    DESCRIPTION                       
* systemd-modules-load.service loaded failed failed Load Kernel Modules               

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
[root@odroid-c2 ~]# systemctl status systemd-modules-load
* systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor
   Active: failed (Result: exit-code) since Thu 2017-12-21 13:34:08 UTC; 2 weeks 1 days
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 252 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FA
 Main PID: 252 (code=exited, status=1/FAILURE)

Dec 21 13:34:07 odroid-c2 systemd-modules-load[252]: Failed to find module 'aml_i2c'
Dec 21 13:34:08 odroid-c2 systemd-modules-load[252]: Inserted module 'i2c_dev'
Dec 21 13:34:08 odroid-c2 systemd-modules-load[252]: Inserted module 'rtc_pcf8563'
Dec 21 13:34:08 odroid-c2 systemd[1]: systemd-modules-load.service: Main process exited,
Dec 21 13:34:08 odroid-c2 systemd[1]: systemd-modules-load.service: Failed with result '
Dec 21 13:34:08 odroid-c2 systemd[1]: Failed to start Load Kernel Modules.
Warning: Journal has been rotated since unit was started. Log output is incomplete or un


Presumably I don't need to try to run my old timeupd file to use the RTC but perhaps I haven't jumped through the correct hoops to complete what is necessary so maybe there was something you did in the past that is a critical step that I am missing?

I found that the changes I made to meson-gxbb-odroidc2.dtb were overwridden since the time stamp on that file was from today at the time the new kernel was installed, so I re-did the changes you suggested last night, and then rebooted. Now the system-modules-load service still fails but without the aml_i2c module error:

Code: Select all
[root@odroid-c2 ~]# systemctl status systemd-modules-load
* systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor
   Active: failed (Result: exit-code) since Thu 2017-12-21 13:34:07 UTC; 2 weeks 1 days
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 250 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FA
 Main PID: 250 (code=exited, status=1/FAILURE)

Warning: Journal has been rotated since unit was started. Log output is incomplete or un
[root@odroid-c2 ~]# hwclock -r
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
[root@odroid-c2 ~]# timedatectl
                      Local time: Sat 2018-01-06 12:39:40 UTC
                  Universal time: Sat 2018-01-06 12:39:40 UTC
                        RTC time: n/a
                       Time zone: UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no


The RTC is still not accessible though.

If it is useful here is the hwdetect output:

Code: Select all
[root@odroid-c2 ~]# hwdetect --kernel_version=4.14.12-1-ARCH --show-modules
DRM      : drm drm_kms_helper meson-drm
MEDIA    : meson-ir rc-core
NET      : dwmac-generic dwmac-meson8b stmmac-platform stmmac
WATCHDOG : meson_gxbb_wdt
OTHER    : nvmem_meson_efuse pps_core ptp rtc-pcf8563 fb_sys_fops syscopyarea sysfillrect sysimgblt


So presumably there is another step missing? So it would be nice to find the steps needed to get this working again, but also as you said in your post yesterday that it would be good to know how to automate it once it is working.
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 brad » Sun Jan 07, 2018 7:43 am

mcloaked wrote:So presumably there is another step missing? So it would be nice to find the steps needed to get this working again, but also as you said in your post yesterday that it would be good to know how to automate it once it is working.


Looks like you have the rtc driver included so try to modify your device tree file like below for the i2c_A entry. I don't have a RTC to test sorry.

Code: Select all
&i2c_A {
   status = "okay";
   pinctrl-0 = <&i2c_a_pins>;
   pinctrl-names = "default";

   pcf8563: pcf8563@51 {
      compatible = "nxp,pcf8563";
      reg = <0x51>;
   };
};
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Sun Jan 07, 2018 11:58 am

There is no aml_i2c driver in the mainline kernel. There IS an i2c_dev driver, but its not clear to me whether it's necessary.

It's entirely possible for pacman to replace your modified dtb file with a newer version without the mods in it, so in general you may have to repeat that step after updating.
campbell
 
Posts: 287
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 mcloaked » Sun Jan 07, 2018 11:44 pm

brad wrote:
mcloaked wrote:So presumably there is another step missing? So it would be nice to find the steps needed to get this working again, but also as you said in your post yesterday that it would be good to know how to automate it once it is working.


Looks like you have the rtc driver included so try to modify your device tree file like below for the i2c_A entry. I don't have a RTC to test sorry.

Code: Select all
&i2c_A {
   status = "okay";
   pinctrl-0 = <&i2c_a_pins>;
   pinctrl-names = "default";

   pcf8563: pcf8563@51 {
      compatible = "nxp,pcf8563";
      reg = <0x51>;
   };
};


If adding this entry does it have to go in a specific place in the dts file, and then processing to create the new dtc file, as Cambell suggested previously? I am not an expert with device tree changes so I am reliant on more expert knowledge that others have. Once this change has been made does the system need to be rebooted to bring the change in - and once that has been done should the RTC access then just work without any further action? Thanks for any additional input.
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 gügü » Sun Jan 14, 2018 6:14 am

Can someone confirm my thoughts about Odroid C1 running mainline kernel?

I found this link and it shows that it pass all tests.

https://kernelci.org/boot/meson8b-odroidc1/

Thank you!
gügü
 
Posts: 68
Joined: Sun Dec 20, 2015 6:35 am
languages_spoken: english
ODROIDs: C1 - C2

Re: Odroid C2 mainline kernel support

Unread postby brad » Sun Jan 14, 2018 7:15 am

gügü wrote:Can someone confirm my thoughts about Odroid C1 running mainline kernel?

I found this link and it shows that it pass all tests.

https://kernelci.org/boot/meson8b-odroidc1/

Thank you!


I recall the developers debugging some ethernet issues on the C1 around 3 months ago with the board booting mainline. I'm sure the dev's would be happy to give you an update, try IRC channel #linux-amlogic on Freenode
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby gügü » Sun Jan 14, 2018 9:30 am

brad wrote:
gügü wrote:Can someone confirm my thoughts about Odroid C1 running mainline kernel?

I found this link and it shows that it pass all tests.

https://kernelci.org/boot/meson8b-odroidc1/

Thank you!


I recall the developers debugging some ethernet issues on the C1 around 3 months ago with the board booting mainline. I'm sure the dev's would be happy to give you an update, try IRC channel #linux-amlogic on Freenode


Thanx I'm just going to do that :D
gügü
 
Posts: 68
Joined: Sun Dec 20, 2015 6:35 am
languages_spoken: english
ODROIDs: C1 - C2

Re: Odroid C2 mainline kernel support

Unread postby mcloaked » Wed Jan 17, 2018 7:32 am

After my posts a few weeks ago my odroid c2 simply stopped booting. So whatever changes I had made trying to get the rtc working I guess caused a problem that I couldn't diagnose or rectify. So I had to pull out the eMMC card, and write a new clean system (following the arch linux method). The system is back up and running but with the original series 3 kernel and not mainline. So until a time when there is a more risk free method of upgrading the kernel to mainline that has no RTC issues I will stick with 3.14.79-28-ARCH
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 campbell » Wed Jan 17, 2018 12:36 pm

mcloaked wrote:until a time when there is a more risk free method of upgrading the kernel to mainline that has no RTC issues

I've got exactly this on my todo list, I'll post it here when it's done. It's possible, I assure you, I just don't remember exactly everything I did and need to redo it on a clean SD card.
campbell
 
Posts: 287
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 mad_ady » Wed Jan 17, 2018 4:15 pm

@campbell: once you document all the steps submit an article for Odroid Magazine also.
User avatar
mad_ady
 
Posts: 4453
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu Jan 18, 2018 2:31 am

I've just gone through the following procedure from a blank SD card, installing no other packages and making no other edits, and it works. This results in Arch Linux with kernel 4.14.13-1 and a working RTC. Some of the reboots here might not be necessary, but this worked. Note that after any package update that touches the dtbs (generally any time the kernel or uboot is updated) you will have to redo the steps to patch the dtb file, in order to re-enable the RTC.

- Follow the instructions at https://archlinuxarm.org/platforms/armv ... /odroid-c2 for deploying a vanilla Arch Linux installation with the Hardkernel 3.14.79 kernel

- Boot the board with the new SD/eMMC and log in as root

- Update the package manager and all packages with:
Code: Select all
pacman -Syu
reboot

- Log in as root, and run:
Code: Select all
pacman -R uboot-odroid-c2
pacman -S uboot-odroid-c2-mainline linux-aarch64
reboot

- Log in as root, and run:
Code: Select all
pacman -S dtc
cd /boot/dtbs/amlogic/
cp -p meson-gxbb-odroidc2{,_backup}.dtb
dtc -I dtb -O dts meson-gxbb-odroidc2.dtb > meson-gxbb-odroidc2.dts
nano meson-gxbb-odroidc2.dts

- Add the pcf8563@51 section within i2c@8500:
Code: Select all
pcf8563@51 {
   status = "okay";
   compatible = "nxp,pcf8563";
   reg = <0x51>;
   #clock-cells = <0x0>;
};

- Rebuild the dtb with:
Code: Select all
dtc -I dts -O dtb meson-gxbb-odroidc2.dts > meson-gxbb-odroidc2.dtb
reboot

- Log in as root, and test:
Code: Select all
hwclock -r
campbell
 
Posts: 287
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 mad_ady » Thu Jan 18, 2018 3:29 am

You can automate the dtb edits further and place a script that does it in /etc/kernel/post-install.d/
User avatar
mad_ady
 
Posts: 4453
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu Jan 18, 2018 7:51 am

mad_ady wrote:You can automate the dtb edits further and place a script that does it in /etc/kernel/post-install.d/

There SHOULD be a way to make it happen with fdt commands inside the uboot script. I haven't figured it out yet and I keep rendering it non bootable while trying, so I gave up. That file (boot.txt/boot.scr) is generally NOT replaced when upgrading the kernel.
campbell
 
Posts: 287
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 mad_ady » Thu Jan 18, 2018 3:20 pm

By the looks of it you need to make bigger changes that require decompiling the dtb, making edits with tools like patch or sed and rebuilding it. You can do this with a more complicated post-install script (even if that script means rewriting the dtb file with a known good one (quick and dirty).
User avatar
mad_ady
 
Posts: 4453
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Odroid C2 mainline kernel support

Unread postby brad » Thu Jan 18, 2018 3:22 pm

campbell wrote:
mad_ady wrote:You can automate the dtb edits further and place a script that does it in /etc/kernel/post-install.d/

There SHOULD be a way to make it happen with fdt commands inside the uboot script. I haven't figured it out yet and I keep rendering it non bootable while trying, so I gave up. That file (boot.txt/boot.scr) is generally NOT replaced when upgrading the kernel.


Good work campbell this does raise some interesting questions on the best path forward for device tree customisation's. From my understanding we have a few possible options

1) as per mad_ady drop in the mod to /etc/kernel/post-install.d/ and reinstall kernel package (persistant change)
2) Manually edit the device tree with dtc tool (not persistant)
3) Edit the device tree by uboot device tree commands in boot.[scr|txt|ini] (Persistant)
4) Utilise device tree overlays in uboot to make the changes (persistent)
5) Utilise device tree overlays in uboot a modify boot.ini/ boot.src to be able to detect certain hardware automatically and apply the appropriate overlay file (persistant)

I can now think of a few common use cases where it would be beneficial
- MMC frequency mods to allow my old emmc to boot without errors
- Add support for I2S audio via detection of common codecs on the I2C bus (ie hifi shield)
- Add RTC's detected on I2C bus's
- Automatically re-enable frequency scaling for users with up to date firmware limited to 1.5GHz

I will look into feasibility in both hardkernel u boot and mainline uboot for the overlay option.

Edit: crap linux machine I use for serial console has died with a dead fan detected on boot. I've temporarily secondment my windows gaming machine to the task but this means the games are distracting me and no Linux for debug of boot. Wish me luck I never wanted linux so bad :lol: I hope I can spin up an linux VM and connect to the serial port on the C2
Last edited by brad on Thu Jan 18, 2018 5:25 pm, edited 1 time in total.
brad
 
Posts: 700
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby rooted » Thu Jan 18, 2018 3:24 pm

Overlay FTW
User avatar
rooted
 
Posts: 5474
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Odroid C2 mainline kernel support

Unread postby Michi » Thu Jan 18, 2018 8:02 pm

I also have to update the Device Tree for my Odroid C2 after linux-aarch installation/upgrade. Therefore i created a small script with the needed changes and a pacman hook. The hook is running after the linux-aarch64 package installation.
The hook is placed in "/etc/pacman.d/hooks/" and the content is:

Code: Select all
[Trigger]
Operation = Upgrade
Operation = Install
Type = Package
Target = linux-aarch64

[Action]
Description = Modify Orodid C2 Device Tree for eMMC...
When = PostTransaction
Exec = /usr/local/bin/modify_odroid_c2_dtb.sh


This works perfectly for me.
Michi
 
Posts: 6
Joined: Wed Dec 27, 2017 8:20 pm
languages_spoken: english; german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Fri Jan 19, 2018 1:53 am

brad wrote:Edit: crap linux machine I use for serial console has died with a dead fan detected on boot. I've temporarily secondment my windows gaming machine to the task but this means the games are distracting me and no Linux for debug of boot. Wish me luck I never wanted linux so bad :lol: I hope I can spin up an linux VM and connect to the serial port on the C2

Off topic but I don't have a dedicated Windows machine - instead I have Windows installed on an mSATA drive mounted on a USB3 carrier card...plug it in and reboot my machine (a Mac in my case) and I'm in Windows, unplug it and it was never there :) Highly recommended if you only spend 5% of your time in Windows and/or don't want to mess with bootloaders or don't want to give up the hard drive space for a second OS
campbell
 
Posts: 287
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby campbell » Fri Jan 19, 2018 1:56 am

mad_ady wrote:By the looks of it you need to make bigger changes that require decompiling the dtb, making edits with tools like patch or sed and rebuilding it. You can do this with a more complicated post-install script (even if that script means rewriting the dtb file with a known good one (quick and dirty).

I think you probably CAN do this with a script and a (maybe inline) patch file, but I think the better solution is one of the others, like modifying boot.txt. I already have other dtb mods in my boot.txt that are persistent across updates, but they're all only removals or status switches, not insertions of a branch.
campbell
 
Posts: 287
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 otec » Tue Jan 23, 2018 8:12 am

Sorry for a newb question, but does anyone have a guide how to compile/install 4.14* kernel on odroid c2/ubuntu ?
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 miskol » Tue Feb 06, 2018 4:52 pm

otec wrote:Sorry for a newb question, but does anyone have a guide how to compile/install 4.14* kernel on odroid c2/ubuntu ?

try armbian
Download some version with 4.14 kernel or build your own image.
armbian support Debian 9
miskol
 
Posts: 145
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby gügü » Wed Feb 07, 2018 1:46 pm

I'm trying to compile the Tamarin VM on my odroid C1 not C1+ and I'm wondering what kind of FPU does it have? Do I need to compile a simulation software FPU or does it have its own hardware FPU.

Right now when I compile on the board I get this error :

Code: Select all
In file included from /usr/include/features.h:398:0,
                 from /usr/include/string.h:25,
                 from ../other-licenses/zlib/zutil.h:23,
                 from ../other-licenses/zlib/crc32.c:29:
/usr/include/arm-linux-gnueabihf/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
 # include <gnu/stubs-soft.h>


This is the options for compiler:

Code: Select all
FLOAT_ABI = None;
    EXTRA_CFLAGS = "";
    print("ARM FPU : %s" % arm_fpu)
    if arm_fpu:
        print("Hardware FPU : %s" % arm_fpu)
        FLOAT_ABI = "-mfloat-abi=softfp "
        EXTRA_CFLAGS = "-mfpu=vfp -march=%s " % arm_arch # compile to use hardware fpu
    else:
        print("Software FPU : %s" % arm_fpu)
        FLOAT_ABI = "-mfloat-abi=soft "
        EXTRA_CFLAGS = "-mfpu=vfp -march=%s " % arm_arch # compile to use soft fpu
    #BASE_CXX_FLAGS = "%s -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mno-thumb -fno-section-anchors -D__ARM_ARCH__=7 " \
    #                    "-DARMV6_ASSEMBLY " % BASE_M_FLAGS
    #APP_CXXFLAGS += BASE_CXX_FLAGS
    print("ARM HARD FLOAT : %s" % arm_hard_float)
    if arm_hard_float:
        FLOAT_ABI = "-mfloat-abi=hard -march=%s " % arm_arch # compile to use neon vfp
        AVMSHELL_LDFLAGS += "-static "
    print("ARM NEON : %s" % arm_neon)
    if arm_neon:
        if FLOAT_ABI == None:
            FLOAT_ABI = "-mfloat-abi=softfp "
        EXTRA_CFLAGS = "-mfpu=neon -march=%s -DTARGET_NEON " % arm_arch # compile to use neon vfp
    print("ARM THUMB : %s" % arm_thumb)
    if arm_thumb:
        EXTRA_CFLAGS += "-mthumb -DTARGET_THUMB2 "
    if arm_thumb != False and arm_arch == "armv7-a":
        print("CORTEX-A : %s" % arm_thumb)
        EXTRA_CFLAGS += "-mtune=cortex-a8 "
    if arm_arch:
        print("ARM ARCH: %s" % arm_thumb)
        OPT_CXXFLAGS += "-march=%s " % arm_arch
        DEBUG_CXXFLAGS += "-march=%s " % arm_arch
    if EXTRA_CFLAGS != None:
        APP_CXXFLAGS += EXTRA_CFLAGS
        APP_CFLAGS += EXTRA_CFLAGS
    if FLOAT_ABI != None:
        APP_CXXFLAGS += FLOAT_ABI
        APP_CFLAGS += FLOAT_ABI
        AVMSHELL_LDFLAGS += FLOAT_ABI


Can someone help me with this ?
gügü
 
Posts: 68
Joined: Sun Dec 20, 2015 6:35 am
languages_spoken: english
ODROIDs: C1 - C2

Re: Odroid C2 mainline kernel support

Unread postby peak3d » Thu Feb 08, 2018 2:08 am

tobetter wrote:You can find my working kernel source tree at https://github.com/tobetter/linux/tree/odroidc2-v4.15, I am running U-boot (2017.11) plus Linux mainline (4.15-rc6) on Debian Jessie.


Thanx for that!

I tried the kernel but unfortunately kernel boot stopps with: random: crng init done
and no login prompt.

I'm on u-boot with u-boot_20180116-491e9bb-12_arm64
boot.ini options below in log.

I use the minimal ubuntu OS with ubuntu 16.04

Anyone an idea what is the missing piece to continue the boot sequence?

Complete log output:

Code: Select all
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: Load bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x000769f0
ef be ad de d f0 ad ba ef be ad de not ES chip
[0.414299 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-00014-g2e4380b-dirty (Jan 16 2018 - 02:09:02)

DRAM:  2 GiB
Relocation Offset is: 76f2f000
-------------------------------------------------
* Welcome to Hardkernel's ODROID-C2
-------------------------------------------------
CPU : AMLogic S905
S/N : HKC213254DFD076B
MAC : 00:1e:06:33:53:eb
BID : HKC2211605
-------------------------------------------------
register usb cfg[1][0] = 0000000077f95010
register usb cfg[0][1] = 0000000077f95030
vpu detect type: 5
vpu clk_level = 7
set vpu clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   aml_priv->desc_buf = 0x0000000073f27d30
aml_priv->desc_buf = 0x0000000073f29ec0
SDIO Port B: 0, SDIO Port C: 1
ret = 1 .[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
----------------------------------
MMC Size : 16 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
Saving Environment to MMC...
Writing to MMC(0)... done
Net:   Meson_Ethernet
Hit [Enter] key twice to stop autoboot:  0
reading boot.ini
2597 bytes read in 3 ms (844.7 KiB/s)
cfgload: applying boot.ini...
cfgload: setenv console "console=ttyAML0,115200n8"
cfgload: setenv odroid   "earlyprintk debug root=/dev/mmcblk0p2 rootwait ro fsck.fix=no net.ifnames=0 no_console_suspend consoleblank=0"
cfgload: setenv kernel  "fatload mmc 0:1 0x1080000 uImage"
cfgload: setenv dtb     "fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb"
cfgload: setenv bootseq "bootm 0x1080000 - 0x1000000"
cfgload: setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"
cfgload: setenv bootargs "${console} ${bootrootfs} ${odroid} ${libreelec}"
cfgload: run bootcmd
reading uImage
13832768 bytes read in 615 ms (21.5 MiB/s)
reading meson-gxbb-odroidc2.dtb
22127 bytes read in 6 ms (3.5 MiB/s)
ee_gate_off ...
## Booting kernel from Legacy Image at 01080000 ...
   Image Name:   linux-next
   Image Type:   AArch64 Linux Kernel Image (uncompressed)
   Data Size:    13832704 Bytes = 13.2 MiB
   Load Address: 01080000
   Entry Point:  01080000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
   Loading Kernel Image ... OK
   kernel loaded at 0x01080000, end = 0x01db1200
   Loading Device Tree to 000000001fff7000, end 000000001ffff66e ... OK

Starting kernel ...

uboot time: 4322630 us
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.15.0-rc8-dirty (pfau@ubuntu) (gcc version 4.9.4 (Linaro GCC 4.9-2017.01)) #3 SMP PREEMPT Wed Feb 7 16:30:12 CET 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 0x000000006c400000, size 188 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x0000000077ffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x6c3d6500-0x6c3d7fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000001000000-0x0000000077ffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000001000000-0x000000000fffffff]
[    0.000000]   node   0: [mem 0x0000000010200000-0x0000000077ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000001000000-0x0000000077ffffff]
[    0.000000] On node 0 totalpages: 486912
[    0.000000]   DMA zone: 7616 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 486912 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 23 pages/cpu @        (ptrval) s55168 r8192 d30848 u94208
[    0.000000] pcpu-alloc: s55168 r8192 d30848 u94208 alloc=23*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 479296
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: console=ttyAML0,115200n8  earlyprintk debug root=/dev/mmcblk0p2 rootwait ro fsck.fix=no net.ifnames=0 no_console_suspend consoleblank=0
[    0.000000] Memory: 1707868K/1947648K available (8828K kernel code, 644K rwdata, 3332K rodata, 640K init, 387K bss, 47268K reserved, 192512K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
[    0.000000]     vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000   (129022 GB)
[    0.000000]       .text : 0x        (ptrval) - 0x        (ptrval)   (  8832 KB)
[    0.000000]     .rodata : 0x        (ptrval) - 0x        (ptrval)   (  3392 KB)
[    0.000000]       .init : 0x        (ptrval) - 0x        (ptrval)   (   640 KB)
[    0.000000]       .data : 0x        (ptrval) - 0x        (ptrval)   (   645 KB)
[    0.000000]        .bss : 0x        (ptrval) - 0x        (ptrval)   (   388 KB)
[    0.000000]     fixed   : 0xffff7dfffe7fb000 - 0xffff7dfffec00000   (  4116 KB)
[    0.000000]     PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000   (    16 MB)
[    0.000000]     vmemmap : 0xffff7e0000000000 - 0xffff800000000000   (  2048 GB maximum)
[    0.000000]               0xffff7e0000040000 - 0xffff7e0001e00000   (    29 MB actual)
[    0.000000]     memory  : 0xffff800001000000 - 0xffff800078000000   (  1904 MB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=64 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.000269] Console: colour dummy device 80x25
[    0.000307] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.000314] pid_max: default: 32768 minimum: 301
[    0.000365] Security Framework initialized
[    0.001078] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.001437] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.001464] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.001480] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.016013] ASID allocator initialised with 65536 entries
[    0.024004] Hierarchical SRCU implementation.
[    0.032211] EFI services will not be available.
[    0.040025] smp: Bringing up secondary CPUs ...
[    0.068706] Detected VIPT I-cache on CPU1
[    0.068748] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.096723] Detected VIPT I-cache on CPU2
[    0.096744] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.124754] Detected VIPT I-cache on CPU3
[    0.124772] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.124813] smp: Brought up 1 node, 4 CPUs
[    0.124826] SMP: Total of 4 processors activated.
[    0.124831] CPU features: detected feature: 32-bit EL0 Support
[    0.124993] CPU: All CPU(s) started at EL2
[    0.125008] alternatives: patching kernel code
[    0.125472] devtmpfs: initialized
[    0.128379] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.128417] futex hash table entries: 1024 (order: 5, 131072 bytes)
[    0.131662] pinctrl core: initialized pinctrl subsystem
[    0.132300] DMI not present or invalid.
[    0.132497] NET: Registered protocol family 16
[    0.132810] audit: initializing netlink subsys (disabled)
[    0.132883] audit: type=2000 audit(0.132:1): state=initialized audit_enabled=0 res=1
[    0.133463] cpuidle: using governor menu
[    0.133941] vdso: 2 pages (1 code @ 00000000d6209fee, 1 data @ 00000000e3ea0414)
[    0.133956] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.134663] DMA: preallocated 256 KiB pool for atomic allocations
[    0.135088] Serial: AMBA PL011 UART driver
[    0.145386] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.146084] ACPI: Interpreter disabled.
[    0.146809] vgaarb: loaded
[    0.146997] SCSI subsystem initialized
[    0.147120] libata version 3.00 loaded.
[    0.147300] usbcore: registered new interface driver usbfs
[    0.147328] usbcore: registered new interface driver hub
[    0.147370] usbcore: registered new device driver usb
[    0.147637] pps_core: LinuxPPS API ver. 1 registered
[    0.147642] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.147656] PTP clock support registered
[    0.147752] EDAC MC: Ver: 3.0.0
[    0.147965] dmi: Firmware registration failed.
[    0.148077] Advanced Linux Sound Architecture Driver Initialized.
[    0.148684] clocksource: Switched to clocksource arch_sys_counter
[    0.148785] VFS: Disk quotas dquot_6.6.0
[    0.148824] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.148958] pnp: PnP ACPI: disabled
[    0.152885] NET: Registered protocol family 2
[    0.153248] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.153383] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    0.153586] TCP: Hash tables configured (established 16384 bind 16384)
[    0.153677] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    0.153714] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    0.153826] NET: Registered protocol family 1
[    0.154064] RPC: Registered named UNIX socket transport module.
[    0.154069] RPC: Registered udp transport module.
[    0.154072] RPC: Registered tcp transport module.
[    0.154075] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.154082] PCI: CLS 0 bytes, default 128
[    0.154699] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.154913] kvm [1]: 8-bit VMID
[    0.154917] kvm [1]: IDMAP page: 190d000
[    0.154921] kvm [1]: HYP VA range: 800000000000:ffffffffffff
[    0.155446] kvm [1]: vgic-v2@c4304000
[    0.155491] kvm [1]: vgic interrupt IRQ1
[    0.155502] kvm [1]: virtual timer IRQ4
[    0.155553] kvm [1]: Hyp mode initialized successfully
[    0.156775] Initialise system trusted keyrings
[    0.156876] workingset: timestamp_bits=44 max_order=19 bucket_order=0
[    0.161198] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.161617] NFS: Registering the id_resolver key type
[    0.161635] Key type id_resolver registered
[    0.161639] Key type id_legacy registered
[    0.161648] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.161765] 9p: Installing v9fs 9p2000 file system support
[    0.163307] Key type asymmetric registered
[    0.163312] Asymmetric key parser 'x509' registered
[    0.163428] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.163435] io scheduler noop registered
[    0.163556] io scheduler cfq registered (default)
[    0.163561] io scheduler mq-deadline registered
[    0.163565] io scheduler kyber registered
[    0.164554] GPIO line 501 (usb-hub-reset) hogged as output/high
[    0.167939] soc soc0: Amlogic Meson GXBB (S905) Revision 1f:b (0:1) Detected
[    0.171362] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.172869] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 13, base_baud = 1500000) is a meson_uart
[    1.030240] console [ttyAML0] enabled
[    1.034727] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    1.039828] meson-drm d0100000.vpu: Failed to create debugfs directory
[    1.045867] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.052392] [drm] No driver support for vblank timestamp query.
[    1.058308] meson-drm d0100000.vpu: CVBS Output connector not available
[    1.092728] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    1.097052] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    1.104848] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops)
[    1.420955] Console: switching to colour frame buffer device 240x67
[    1.454851] meson-drm d0100000.vpu: fb0:  frame buffer device
[    1.460826] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[    1.472248] loop: module loaded
[    1.473949] libphy: Fixed MDIO Bus: probed
[    1.475304] tun: Universal TUN/TAP device driver, 1.6
[    1.480337] thunder-xcv, ver 1.0
[    1.483089] thunder-BGX, ver 1.0
[    1.486285] thunder-nic, ver 1.0
[    1.489650] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.495217] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.501115] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[    1.507989] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.513529] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    1.521267] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.527238] sky2: driver version 1.30
[    1.531352] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[    1.536718] meson8b-dwmac c9410000.ethernet: no reset control found
[    1.543066] stmmac - user ID: 0x11, Synopsys ID: 0x37
[    1.547917] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[    1.553700] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[    1.561116] meson8b-dwmac c9410000.ethernet: Normal descriptors
[    1.566978] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[    1.574397] meson8b-dwmac c9410000.ethernet: COE Type 2
[    1.579569] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[    1.586558] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[    1.592959] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    2.652685] libphy: stmmac: probed
[    2.653643] VFIO - User Level meta-driver version: 0.3
[    2.656538] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.662024] ehci-pci: EHCI PCI platform driver
[    2.666446] ehci-platform: EHCI generic platform driver
[    2.671698] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.677730] ohci-pci: OHCI PCI platform driver
[    2.682138] ohci-platform: OHCI generic platform driver
[    2.687576] usbcore: registered new interface driver usb-storage
[    2.694315] i2c /dev entries driver
[    2.698186] sdhci: Secure Digital Host Controller Interface driver
[    2.702833] sdhci: Copyright(c) Pierre Ossman
[    2.707192] Synopsys Designware Multimedia Card Interface Driver
[    2.713873] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[    2.757094] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.757917] ledtrig-cpu: registered to indicate activity on CPUs
[    2.766684] meson-sm: secure-monitor enabled
[    2.767781] usbcore: registered new interface driver usbhid
[    2.772949] usbhid: USB HID core driver
[    2.776914] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[    2.785827] NET: Registered protocol family 17
[    2.787990] 9pnet: Installing 9P2000 support
[    2.792211] Key type dns_resolver registered
[    2.796891] registered taskstats version 1
[    2.801438] Loading compiled-in X.509 certificates
[    2.810188] dwc2 c9000000.usb: c9000000.usb supply vusb_d not found, using dummy regulator
[    2.813302] dwc2 c9000000.usb: c9000000.usb supply vusb_a not found, using dummy regulator
[    2.822647] phy phy-c0000000.phy.0: USB ID detect failed!
[    2.826809] phy phy-c0000000.phy.0: phy poweron failed --> -22
[    2.832663] dwc2: probe of c9000000.usb failed with error -22
[    2.838654] dwc2 c9100000.usb: c9100000.usb supply vusb_d not found, using dummy regulator
[    2.846504] dwc2 c9100000.usb: c9100000.usb supply vusb_a not found, using dummy regulator
[    2.972926] dwc2 c9100000.usb: DWC OTG Controller
[    2.972961] dwc2 c9100000.usb: new USB bus registered, assigned bus number 1
[    2.979009] dwc2 c9100000.usb: irq 34, io mem 0xc9100000
[    2.984716] hub 1-0:1.0: USB hub found
[    2.987970] hub 1-0:1.0: 1 port detected
[    2.992706] meson-gx-mmc d0072000.mmc: Got CD GPIO
[    3.038247] scpi_protocol scpi: SCP Protocol 0.0 Firmware 0.0.0 version
[    3.044275] hctosys: unable to open rtc device (rtc0)
[    3.044438] VCC3V3: disabling
[    3.047155] ALSA device list:
[    3.050080]   No soundcards found.
[    3.059110] Waiting for root device /dev/mmcblk0p2...
[    3.200128] mmc1: new high speed SDHC card at address aaaa
[    3.200418] mmcblk1: mmc1:aaaa SL16G 14.8 GiB
[    3.206324]  mmcblk1: p1 p2
[    3.384696] usb 1-1: new high-speed USB device number 2 using dwc2
[    3.594391] hub 1-1:1.0: USB hub found
[    3.594688] hub 1-1:1.0: 4 ports detected
[    3.884692] usb 1-1.3: new low-speed USB device number 3 using dwc2
[    3.994165] input: DELL Dell QuietKey Keyboard as /devices/platform/soc/c9100000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:413C:2106.0001/input/input0
[    4.061028] hid-generic 0003:413C:2106.0001: input: USB HID v1.10 Keyboard [DELL Dell QuietKey Keyboard] on usb-c9100000.usb-1.3/input0
[    5.141560] random: crng init done
peak3d
 
Posts: 277
Joined: Wed Jan 28, 2015 8:12 pm
languages_spoken: english,german
ODROIDs: XU3,C1

Re: Odroid C2 mainline kernel support

Unread postby OverSun » Thu Feb 08, 2018 2:14 am

your command line has root=/dev/mmcblk0p2, while your SD card was detected as mmcblk1, so root partition is at /dev/mmcblk1p2
It just waits for root filesystem, that's all.
Code: Select all
[    3.059110] Waiting for root device /dev/mmcblk0p2...
[    3.200128] mmc1: new high speed SDHC card at address aaaa
[    3.200418] mmcblk1: mmc1:aaaa SL16G 14.8 GiB
[    3.206324]  mmcblk1: p1 p2
User avatar
OverSun
 
Posts: 1373
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby peak3d » Thu Feb 08, 2018 2:20 am

uhh, thx @Oversun!
peak3d
 
Posts: 277
Joined: Wed Jan 28, 2015 8:12 pm
languages_spoken: english,german
ODROIDs: XU3,C1

Re: Odroid C2 mainline kernel support

Unread postby arny91 » Mon Feb 12, 2018 6:57 pm

I report HDMI finally working with kernel version 4.16-rc1 on archlinuxarm. Hoo-ray!
arny91
 
Posts: 16
Joined: Sat Aug 13, 2016 9:12 pm
languages_spoken: english
ODROIDs: Odroid C2

Re: Odroid C2 mainline kernel support

Unread postby rooted » Mon Feb 12, 2018 7:19 pm

arny91 wrote:I report HDMI finally working with kernel version 4.16-rc1 on archlinuxarm. Hoo-ray!
That is good news.
User avatar
rooted
 
Posts: 5474
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Odroid C2 mainline kernel support

Unread postby ivanovic » Sun Feb 18, 2018 10:39 pm

Michi wrote:I also have to update the Device Tree for my Odroid C2 after linux-aarch installation/upgrade. Therefore i created a small script with the needed changes and a pacman hook. The hook is running after the linux-aarch64 package installation.
The hook is placed in "/etc/pacman.d/hooks/" and the content is:

Code: Select all
[Trigger]
Operation = Upgrade
Operation = Install
Type = Package
Target = linux-aarch64

[Action]
Description = Modify Orodid C2 Device Tree for eMMC...
When = PostTransaction
Exec = /usr/local/bin/modify_odroid_c2_dtb.sh


This works perfectly for me.


Can you maybe post the content of your script modify_odroid_c2_dtb.sh. How do you make sure that it will work with more recent kernel versions changing the dtb file?

I hope I am not going to feel the impact of the limitation to 100MHz too much. Since right now with kernel 4.13.12 I do get very decent read speeds from the emmc:
Code: Select all
[someuser@odroid ~]# sudo dd if=/dev/mmcblk0 of=/dev/null bs=2048 status=progress
15586736128 bytes (16 GB, 15 GiB) copied, 96 s, 162 MB/s
7633920+0 records in
7633920+0 records out
15634268160 bytes (16 GB, 15 GiB) copied, 96.2677 s, 162 MB/s

But maybe speed of the sdcard will be improved?
Code: Select all
[someuser@odroid ~]# sudo dd if=/dev/mmcblk1 of=/dev/null bs=2048 status=progress
18188195840 bytes (18 GB, 17 GiB) copied, 921 s, 19.7 MB/s^C
8886459+0 records in
8886458+0 records out
18199465984 bytes (18 GB, 17 GiB) copied, 921.574 s, 19.7 MB/s

Seems as if the UHS-1 card (some Samsung Pro card rated U3) is only initialized as "high speed":
Code: Select all
[someuser@odroid ~]$ dmesg | grep "card at"
[    1.249291] mmc0: new HS200 MMC card at address 0001
[    1.968641] mmc1: new high speed SDXC card at address 0001
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 Michi » Mon Feb 19, 2018 1:30 am

ivanovic wrote:Can you maybe post the content of your script modify_odroid_c2_dtb.sh. How do you make sure that it will work with more recent kernel versions changing the dtb file?


This is the content of the script. The script has no intelligence. It is just changing the max frequency value from 200 to 150.
Since this is a kernel update, I also check if it worked before rebooting. In the worst case, I have to make the adjustment again later.

Code: Select all
#!/bin/bash

VAR_ORG=0xbebc200
VAR_NEW=0x8f0d180
VAR_DTB=/boot/dtbs/amlogic/meson-gxbb-odroidc2.dtb
VAR_DTS=/boot/dtbs/amlogic/meson-gxbb-odroidc2.dts

# decompile meson-gxbb-odroidc2.dtb
/usr/bin/dtc -I dtb -O dts -o ${VAR_DTS} ${VAR_DTB}

# change max-frequency for eMMC from 0xbebc200 to 0x8f0d180
/usr/bin/sed -i "s/${VAR_ORG}/${VAR_NEW}/g" ${VAR_DTS}

# compile modified dts to meson-gxbb-odroidc2.dtb
/usr/bin/dtc -O dtb -b O -o ${VAR_DTB} ${VAR_DTS}
Michi
 
Posts: 6
Joined: Wed Dec 27, 2017 8:20 pm
languages_spoken: english; german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Mon Feb 19, 2018 2:35 am

Fix for eMMC issue might have got merger with following pull request, with stable back-port so dont worry too much.
https://lkml.org/lkml/2018/2/17/51
Code: Select all
Jerome Brunet (1):
      Revert "mmc: meson-gx: include tx phase in the tuning process"
moon.linux
 
Posts: 1159
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby ivanovic » Mon Feb 19, 2018 4:12 pm

moon.linux wrote:Fix for eMMC issue might have got merger with following pull request, with stable back-port so dont worry too much.
https://lkml.org/lkml/2018/2/17/51
Code: Select all
Jerome Brunet (1):
      Revert "mmc: meson-gx: include tx phase in the tuning process"

Ah, nice. This change is already part of 4.16-rc2. So at least the 4.16 series should be good again even as default package. Let's see if this change gets a backport to 4.15 as well, it is not part of 4.15.4.
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 KARL23 » Tue Feb 20, 2018 9:21 pm

For mmc SD card the higher transfer Modes are not enabled so far in mainline kernel.

I have enabled in my kernel build higher Modes:
Code: Select all
[    4.309486] mmc0: new ultra high speed SDR50 SDXC card at address 0001
[    4.314966] mmcblk0: mmc0:0001 ED4QT 119 GiB


They are working stable.

Code: Select all
/dev/mmcblk0:
 Timing cached reads:   1884 MB in  2.00 seconds = 942.20 MB/sec
 Timing buffered disk reads: 126 MB in  3.04 seconds =  41.44 MB/sec


the following lines in meson-gxbb-odroidc2.dts enable the higher speeds:

Code: Select all
         bus-width = <4>
         cap-sd-highspeed;
         sd-uhs-sdr12;          //SD UHS SDR12 speed is supported
         sd-uhs-sdr25;          //SD UHS SDR25 speed is supported
         sd-uhs-sdr50;         // SD UHS SDR50 speed is supported
         max-frequency = <100000000>;
         disable-wp;
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 summers » Wed Feb 21, 2018 3:17 am

campbell wrote:
mad_ady wrote:You can automate the dtb edits further and place a script that does it in /etc/kernel/post-install.d/

There SHOULD be a way to make it happen with fdt commands inside the uboot script. I haven't figured it out yet and I keep rendering it non bootable while trying, so I gave up. That file (boot.txt/boot.scr) is generally NOT replaced when upgrading the kernel.

See my thread here:
https://forum.odroid.com/viewtopic.php?f=138&t=30156#p215724
So somewhere in your uboot script after the device tree block is loaded to memory:
Code: Select all
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}

Add a command so uboot knows where to find the device tree:
Code: Select all
fdt addr ${fdt_addr_r}

Then modify values with:
Code: Select all
fdt set /soc/apb@d0000000/mmc@74000 max-frequency <0x08f0d180>

You can add new nodes as well, check the uboot manual on the denx site ...

Som not knowing quite what you are trying to do I think you need something like:
Code: Select all
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize
fdt mknode /soc/cbus@c1100000/i2c@8500 pcf8563@51
fdt set /soc/cbus@c1100000/i2c@8500/pcf8563@51 status "okay"
fdt set /soc/cbus@c1100000/i2c@8500/pcf8563@51 compatible "nxp,pcf8563"
fdt set /soc/cbus@c1100000/i2c@8500/pcf8563@51 reg <0x51>
fdt set /soc/cbus@c1100000/i2c@8500/pcf8563@51 #clock-cells <0x0>

I've not used the mknode stuff myself, so don't know if it works. You can always interrupt uboot, and type the commands by hand.

Oh and I've guessed the i2c port - there seem three in the device tree
i2c@8500/
i2c@87c0/
i2c@87e0/
Last edited by summers on Mon Mar 05, 2018 7:06 pm, edited 2 times in total.
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 emk2203 » Thu Feb 22, 2018 4:39 pm

Since it looks like that 4.16 could be a usable mainline kernel for the C2 with all major functionality, could someone who is experienced (@campbell?) put together some kernel compile instructions here? And maybe @odroid could put them in the wiki?

I am not looking for a 'for dummies' version, but a specific guide which takes care of things like .dtb, eMMC frequency, USB issues, HDMI - all the C2 specific things. It can be brief, just a checklist-like thing with references where to find the information. I am reading this thread since a long while, there are excellent informations in it, but never at one accessible place. From what I see, there are lots of people reinventing the wheel at the moment
User avatar
emk2203
 
Posts: 31
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1

PreviousNext

Return to General Chat

Who is online

Users browsing this forum: No registered users and 1 guest