Odroid C2 mainline kernel support

Moderators: mdrjr, odroid

Re: Odroid C2 mainline kernel support

Unread postby campbell » Thu Feb 22, 2018 4:49 pm

emk2203 wrote: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

Agreed on the need for a guide in one place, but I'm not the one to do it - I'm just a user, I've been running the Arch mainline kernel, and only headless, and figuring out how to disable things like USB as well because I don't need them. There are others here who have been compiling their own kernels from source.
campbell
 
Posts: 284
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 odroid » Thu Feb 22, 2018 5:22 pm

I agree Kernel 4.16 is quite usable.
But there are still many missing/incomplete items like video decoder, encoder, I2S, CEC, IR, GPIO, IRQ, clock-gating and so on.
So we have no plan to make an official guide for normal users in near future.
Once 2K/4K video playback is feasible, we will consider our official support since many people use the C2 as a media player.
User avatar
odroid
Site Admin
 
Posts: 28214
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Odroid C2 mainline kernel support

Unread postby campbell » Mon Feb 26, 2018 1:37 am

Anyone else unable to boot or even fdisk an eMMC after updating to either 4.15.5 or 4.16-RC2 ? I updated my normal install (on a red eMMC, stable for a really long time now) to 4-15.5, rebooted, it wouldn't boot, booted from an SD card with 4.15.5 on it, couldn't make any changes to the MMC made in fdisk persist, updated to 4.16-2-RC, same situation, then booted from a different SD card running the 3.14 kernel and it can fdisk just fine. Same situation with a black eMMC.
campbell
 
Posts: 284
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby ivanovic » Mon Feb 26, 2018 2:16 am

campbell wrote:Anyone else unable to boot or even fdisk an eMMC after updating to either 4.15.5 or 4.16-RC2 ? I updated my normal install (on a red eMMC, stable for a really long time now) to 4-15.5, rebooted, it wouldn't boot, booted from an SD card with 4.15.5 on it, couldn't make any changes to the MMC made in fdisk persist, updated to 4.16-2-RC, same situation, then booted from a different SD card running the 3.14 kernel and it can fdisk just fine. Same situation with a black eMMC.

Which kernel were you using before the reboot? Was it by chance a 4.13.x kernel? Stating with 4.14.x the way how eMMC is handled was changed. As a fallout of this many users reported that the speed with which the emmc is addressed needs to be lowered by altering the DTS file for the odroid c2. From what I heard, especially the black modules were affected by issues with the red ones (more) often working.
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 campbell » Mon Feb 26, 2018 2:21 am

No, I've been updating it regularly, the problem happened after updating from 4.15.4 to 4.15.5. Never had any problems with the 4.14 kernel or the earlier 4.15 kernels. I suspect this is related to the change that was just made within the last couple weeks and backported to stable.
campbell
 
Posts: 284
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 » Mon Feb 26, 2018 5:55 am

Update: if I update straight from a fresh 3.14.79 install to 4.16-RC2, it boots, but mounts the filesystem read only. I can't successfully remount it read-write. Any ideas?
Code: Select all
[root@alarm boot]# mount -o remount,rw /dev/mmcblk0p1 /
[  233.071141] print_req_error: I/O error, dev mmcblk0, sector 2048
[  233.071514] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[  233.079229] EXT4-fs error (device mmcblk0p1): ext4_remount:5053: Abort forced by user
mount: /: cannot remount /dev/mmcblk0p1 read-write, is write-protected.
campbell
 
Posts: 284
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 tuxx » Tue Feb 27, 2018 12:46 am

I also upgraded my ArchlinuxARM from 4.15.5 to 4.15.6 and and my system became read-only.
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 Michi » Tue Feb 27, 2018 2:45 am

Have you checked your filesystem for CRC errors? Probably there is also the issue with the frequency of the eMMC module.
You could try to reduce it. Summers posted a solution: viewtopic.php?f=135&t=22717&start=700#p215868
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 » Tue Feb 27, 2018 3:05 am

Michi wrote:Probably there is also the issue with the frequency of the eMMC module.
You could try to reduce it. Summers posted a solution: viewtopic.php?f=135&t=22717&start=700#p215868

There's a chicken and egg problem there. The file you need to edit to reduce the frequency doesn't exist until after you install the mainline kernel and u-boot, and once you do that the system is read-only and you can't make the change.
campbell
 
Posts: 284
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 Michi » Tue Feb 27, 2018 3:18 am

You can mount the eMMC module on another device to make the changes afterwards. A Linux VM is also possible.
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 ivanovic » Tue Feb 27, 2018 4:20 pm

campbell wrote:
Michi wrote:Probably there is also the issue with the frequency of the eMMC module.
You could try to reduce it. Summers posted a solution: viewtopic.php?f=135&t=22717&start=700#p215868

There's a chicken and egg problem there. The file you need to edit to reduce the frequency doesn't exist until after you install the mainline kernel and u-boot, and once you do that the system is read-only and you can't make the change.

It only becomes read only after reboot. So fix the file after install and only then reboot. It should not be an "instant read-only" thing just with installing.
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 redhad » Tue Feb 27, 2018 8:40 pm

campbell wrote:Update: if I update straight from a fresh 3.14.79 install to 4.16-RC2, it boots, but mounts the filesystem read only. I can't successfully remount it read-write. Any ideas?
Code: Select all
[root@alarm boot]# mount -o remount,rw /dev/mmcblk0p1 /
[  233.071141] print_req_error: I/O error, dev mmcblk0, sector 2048
[  233.071514] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[  233.079229] EXT4-fs error (device mmcblk0p1): ext4_remount:5053: Abort forced by user
mount: /: cannot remount /dev/mmcblk0p1 read-write, is write-protected.


I updated yesterday to 4.15.5 and had the pleasure to deal with it.

The source of this hiccup seems to be this patch:

https://github.com/torvalds/linux/commi ... 160be4ac01

Before this revert everything worked very fine.

So, in theory, reapplying this patch again should bring back the mmc in working condition again for those who are affected by this mess:

https://github.com/torvalds/linux/commi ... 5c20.patch

EDIT:

Patch applied well, 4.15.6 works as it was supposed to do.
redhad
 
Posts: 20
Joined: Wed May 03, 2017 10:58 pm
languages_spoken: english, german, russian, french
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby daggs » Wed Feb 28, 2018 3:05 am

if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon
Last edited by daggs on Wed Feb 28, 2018 3:13 am, edited 1 time in total.
daggs
 
Posts: 219
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Wed Feb 28, 2018 3:11 am

redhad wrote:The source of this hiccup seems to be this patch:

https://github.com/torvalds/linux/commi ... 160be4ac01

Before this revert everything worked very fine.

So, in theory, reapplying this patch again should bring back the mmc in working condition again for those who are affected by this mess:

https://github.com/torvalds/linux/commi ... 5c20.patch

EDIT:

Patch applied well, 4.15.6 works as it was supposed to do.

Someone with their ear should inform them that the revert broke things for a lot of people - they seem to have reverted it based only on having heard that the original patch hadn't fixed things for everybody.

Workaround or no, eMMC's are not currently worth the extra trouble until this gets fixed - a bungled application of the workaround requires a disproportionate amount of effort to get back to a working state.
campbell
 
Posts: 284
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby summers » Mon Mar 05, 2018 6:55 pm

Apols for the slow reply, been distracted trying to get a PocketBeagle onto mainline ...

Anyway my odroid is on kernel 4.15.7 and is fine, the eMMC though is clocked down to 150MHz. My plan is that once 4.16 hits, I'll try upping to the speed slowly to 200MHz which is whats in the default device tree.

For what its worth, to my mind https://github.com/torvalds/linux/commit/fe0e58048f005fdce315eb4d185e5c160be4ac01 is doing the right thing. The crux is the last line "According to amlogic, the Tx phase should not be tuned and left in its default configuration" - to my mind that says that this patch will be applied to kernel - and I can't see it changing. For what its worth, the patch was posted by BayLibre, and they are the amlogic kernel maintainers. You only have to look at what BayLibre have done with amlogic in the kernel (http://linux-meson.com/doku.php) to know they are doing the right thing.

But anyway, yes we are having problems with the Odroid-c2 and the eMMC, and lets face it - they are genuine problems, and shouldn't be happening. So if we can't do anything about the kernel, where is the problem? Myself I just think that the timing on the odroid-c2 is probably just a little bit marginal for eMMC at full speed. Now if we take this to be the case (and I'd expect there to be discussion, before deciding it to be the case), then to my mind the correct solution is to down clock the eMMC in the device tree. Now as this will probably vary from device to device, I can't see the default device tree wanting to apply a change in eMMC speed; this means all we can do is make the change ourselves - and the best way to do that is modifying the device tree in uboot. Hence why I posted the solution I did.

This doesn't make it a good solution, but hey - what other options do we have?

Oh yes. For anyone that can't boot, or finds they can only boot read only, try this (I havn't tried it myself btw, so your milage may vary). if you have the sD-eMMC adaptor, use it to plug the eMMC into the odroid via the sD slot. That should boot I think. Then you can make the modifications needed to uboot, to change the device tree. Having done this the machine should boot with the eMMC in the usual (correct) socket.
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Mon Mar 05, 2018 9:52 pm

As per the S905 datasheet it

The HS200 mode offers the following features:
SDR Data sampling method
CLK frequency up to 200MHz Data rate – up to 200MB/s
4 or 8-bits bus width supported
Single ended signaling with 4 Drive Strengths
Signaling levels of 1.8V and 1.2V
Tuning concept for Read Operations
The HS400 mode has the following features
DDR Data sampling method
CLK frequency up to 200MHz, Data rate is up to 400MB/s
Only 8-bit bus width supported
Signaling levels of 1.8V and 1.2V
Support up to 5 Drive Strengths
Data strobe signal is toggled only for Data out and CRC response

So could you check the signal voltage level it set for 1.8V and 3.3V in the dts, could we change to 1.8V and 1.2V see if it make any difference.
I will try to check this at my end once I set up a dedicated Odroid c2 for testing.
moon.linux
 
Posts: 1104
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby summers » Mon Mar 05, 2018 10:57 pm

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

says

/* eMMC */
&sd_emmc_c {
status = "okay";
pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
pinctrl-1 = <&emmc_clk_gate_pins>;
pinctrl-names = "default", "clk-gate";

bus-width = <8>;
max-frequency = <200000000>;
non-removable;
disable-wp;
cap-mmc-highspeed;
mmc-ddr-1_8v;
mmc-hs200-1_8v;

mmc-pwrseq = <&emmc_pwrseq>;
vmmc-supply = <&vcc3v3>;
vqmmc-supply = <&vcc1v8>;
};

vcc1v8: regulator-vcc1v8 {
compatible = "regulator-fixed";
regulator-name = "VCC1V8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};

vcc3v3: regulator-vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "VCC3V3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

So I take that as its on 3.3 and 1.8 V by default.
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby moon.linux » Tue Mar 06, 2018 12:34 am

Opps sorry. From the "Documentation/devicetree/bindings/mmc/mmc.txt" we could enable below mmc property.

- mmc-hs200-1_8v: eMMC HS200 mode(1.8V I/O) is supported
- mmc-hs200-1_2v: eMMC HS200 mode(1.2V I/O) is supported
- mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported
- mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
moon.linux
 
Posts: 1104
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby summers » Tue Mar 06, 2018 1:05 am

Well not tested, but I'd guess the uboot command would be:

Code: Select all
fdt rm /soc/apb@d0000000/mmc@74000 mmc-hs200-1_8v
fdt set /soc/apb@d0000000/mmc@74000 mmc-hs200-1_2v


etc. you may need a resize in there, as I'm not sure if the "rm" will shorten the device tree allocated memory. I guess also needed is a definition of 1.2V; I guess hope is that the 1.8V can be reprogrammed - alas I don't know the amlogic hardware that well, or maybe odroid2. E.g. I don't know which voltages are generated off the cpu, and which can be generated on the cpu. Anyway if reprogrammed - at least you know the line is wired to the eMMC.

Is there a reason why we would expect lower voltages to be better?
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 » Tue Mar 06, 2018 2:38 am

daggs wrote:if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon

What's the easiest way to get a working C2 config going? I started with make nconfig, but got a default i386 configuration. How can I load sensible C2 defaults?
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 moon.linux » Tue Mar 06, 2018 2:51 am

Opps ! I was wrong in my previous post on lower voltage, we should be looking into sdcard/eMMC capability tune the device.
moon.linux
 
Posts: 1104
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Wed Mar 07, 2018 11:54 am

emk2203 wrote:
daggs wrote:if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon

What's the easiest way to get a working C2 config going? I started with make nconfig, but got a default i386 configuration. How can I load sensible C2 defaults?

For the error, you could try to build like this. defconfig in the make command can be replaced any other configuration.
Code: Select all
export ARCH=arm64
make defconfig
make
tobetter
 
Posts: 2225
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 moon.linux » Thu Mar 08, 2018 3:01 am

I just gave fry for the archlinux on my eMMC module and now I see the issue with read-only and crc error.

Code: Select all
[  325.020191] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.027761] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.035250] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.042754] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.050275] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.057838] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[  325.064671] print_req_error: I/O error, dev mmcblk0, sector 2048
[  325.070636] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[  325.078329] EXT4-fs error (device mmcblk0p1): ext4_remount:5049: Abort forced by user


On remounting as rw also fails.
Code: Select all
[root@alarm alarm]# mount / -o remount,rw
[ 2360.210206] EXT4-fs (mmcblk0p1): previous I/O error to superblock detected
[ 2360.211965] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.219546] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.227050] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.234523] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.242113] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.249545] mmcblk0: response CRC error sending r/w cmd command, card status 0xd00
[ 2360.256469] print_req_error: I/O error, dev mmcblk0, sector 2048
[ 2360.262409] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[ 2360.270117] EXT4-fs error (device mmcblk0p1): ext4_remount:5049: Abort forced by user
mount: /: cannot remount /dev/mmcblk0p1 read-write, is write-protected.
moon.linux
 
Posts: 1104
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby daggs » Thu Mar 08, 2018 4:22 am

tobetter wrote:
emk2203 wrote:
daggs wrote:if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon

What's the easiest way to get a working C2 config going? I started with make nconfig, but got a default i386 configuration. How can I load sensible C2 defaults?

For the error, you could try to build like this. defconfig in the make command can be replaced any other configuration.
Code: Select all
export ARCH=arm64
make defconfig
make

actually that's incorrect.
you run on your desktop:
Code: Select all
make odroidc2_defconfig

for hardkernel's config or
Code: Select all
make odroidc2_mainline_defconfig

for the mainline support.

if you want to add more packages, you run
Code: Select all
make menuconfig

and select them.
to build an working image run
Code: Select all
make

and after it is done, dd the sdcard.img file into the sd card, insert it into the slot and boot the machine.
daggs
 
Posts: 219
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2

Re: Odroid C2 mainline kernel support

Unread postby summers » Thu Mar 08, 2018 11:44 pm

@moon.linux did you try my trick of mounting the eMMC via the adaptor into the sd slot? That should boot, so you can add my fixes to your uboot init files (something in /boot typically).

Now as phasing on the RX and TX seems for some to help, but amlogic references is to leave phasing unset, been wondering if there is a way forward.

best I've come up with, is to allow definition of RX and TX phase in the device tree, then users could modify their device trees with the uboot commands. This puts power in the hands of the user.

Now the question is, should users be given access to this? If I were a kernel maintainer, I would at least raise an eyebrow. Afterall, amlogic has a suggested configuration, so why should users have the ability to change it.

Now I'm not minded to follow this line myself, I take it as a hardware issue I can solve by down clocking. But if anyone sees this as a solution, suggest. First check with the kernel maintainers if they would accept such a change. I think the people you need are:

. Device Tree maintainers: Carlo Caione <carlo@caione.org> & Kevin Hilman <khilman@baylibre.com>
. Amlogic maintainers: Neil Armstrong <narmstrong@baylibre.com> & Jerome Brunet <jbrunet@baylibre.com>

If they agree in principle, then someone needs to put together the kernel patches needed. As we can see the original patch, shouldn't be too bad to code ...

So what do others think?
summers
 
Posts: 20
Joined: Sun Feb 18, 2018 2:36 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Fri Mar 09, 2018 3:25 am

summers wrote:best I've come up with, is to allow definition of RX and TX phase in the device tree, then users could modify their device trees with the uboot commands. This puts power in the hands of the user.

Now the question is, should users be given access to this? If I were a kernel maintainer, I would at least raise an eyebrow. Afterall, amlogic has a suggested configuration, so why should users have the ability to change it.

The default in the device tree SHOULD be an overly conservative configuration that allows the widest range of hardware to successfully boot. Only then should the user need to modify the device tree to make it faster IF they so desire, and have the hardware to support it. Contrast that with the current situation where the user has to downclock the device tree before they can boot at all, unless they happen to be lucky and have the same kind of eMMC as that particular kernel maintainer who reverted the patch.
campbell
 
Posts: 284
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 » Fri Mar 09, 2018 3:37 am

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

Maybe it would help to change the driver to accept the configuration from kernel command line or device tree itself if such configuration can improve the performance. My small doubt is that the configuration can be permanant to a board.
tobetter
 
Posts: 2225
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 summers » Fri Mar 09, 2018 3:44 am

Ah - I hadn't noticed that patch. There solution doesn't surprise me, as it is a solution that work for all.

However still leaves open the question of why the configuration doesn't work at its designed speed.

Oh yes I though people had problems with the red eMMC as well? Am I misremembering this?
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 rpcameron » Fri Mar 09, 2018 4:24 am

summers wrote:Ah - I hadn't noticed that patch. There solution doesn't surprise me, as it is a solution that work for all.

However still leaves open the question of why the configuration doesn't work at its designed speed.

Oh yes I though people had problems with the red eMMC as well? Am I misremembering this?

I'm using the "red" eMMC, and had to use the ftd command in my boot.scr to get it lower the clock rate to be able to mount rw. This is with mainline 4.15 on Arch.
rpcameron
 
Posts: 277
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Fri Mar 09, 2018 9:31 am

Yes, I am having problems with both the red and black emmc
campbell
 
Posts: 284
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 brad » Fri Mar 09, 2018 3:58 pm

summers wrote:Oh yes I though people had problems with the red eMMC as well? Am I misremembering this?


I have a red emmc as well which would generally boot with errors at 200Mhz. I have long term stability at 150Mhz on this card but I think 100Mhz is a good "default"
brad
 
Posts: 686
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby emk2203 » Sat Mar 10, 2018 9:51 pm

daggs wrote:
tobetter wrote:
emk2203 wrote:
daggs wrote:if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon

What's the easiest way to get a working C2 config going? I started with make nconfig, but got a default i386 configuration. How can I load sensible C2 defaults?

For the error, you could try to build like this. defconfig in the make command can be replaced any other configuration.
Code: Select all
export ARCH=arm64
make defconfig
make

actually that's incorrect.
you run on your desktop:
Code: Select all
make odroidc2_defconfig

for hardkernel's config or
Code: Select all
make odroidc2_mainline_defconfig

for the mainline support.

if you want to add more packages, you run
Code: Select all
make menuconfig

and select them.
to build an working image run
Code: Select all
make

and after it is done, dd the sdcard.img file into the sd card, insert it into the slot and boot the machine.


Thanks! Straight from the horse's mouth is always best information. :lol:

I must have missed the odroidc2_mainline_defconfig location, because when I cloned the repo and looked through the directory, I found only the odroidc2_defconfig, leading to much disappointment when kernel 3.something came out after some churning on the C2.

That's easy enough to follow, I give it a try. Any more caveats from your side? I am assuming now that it will build and be useable without further modifications.
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 Flole » Sun Mar 11, 2018 1:30 am

Is there any place where precompiled kernels with NFS Root and DHCP are available? I am using 4.13.0-rc4-g216e4a1 right now, but when I use more than one CH340 USB Serial Converter, ksoftirqd/0 takes away 100% CPU and slows down everything. The problem only appears when it's open, so it's not doing it because it is connected but because it is in use. If I stop using one of them, everything is fine again (so it's not a faulty device).

Thats why I am looking for a newer kernel, hoping that this is fixed. Last time I self compiled the kernel something went teribly wrong and everything was super slow (I already posted this about a year ago in this thread).

I would really appreciate it, if someone has an Image with NFS root and DHCP support flying around and could help me out.
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Sun Mar 11, 2018 2:00 am

Flole wrote:Is there any place where precompiled kernels with NFS Root and DHCP are available? I am using 4.13.0-rc4-g216e4a1 right now, but when I use more than one CH340 USB Serial Converter, ksoftirqd/0 takes away 100% CPU and slows down everything. The problem only appears when it's open, so it's not doing it because it is connected but because it is in use. If I stop using one of them, everything is fine again (so it's not a faulty device).

Thats why I am looking for a newer kernel, hoping that this is fixed. Last time I self compiled the kernel something went teribly wrong and everything was super slow (I already posted this about a year ago in this thread).

I would really appreciate it, if someone has an Image with NFS root and DHCP support flying around and could help me out.

I'm not sure if this helps you out, I am uploading a debian package for a mainline kernel to my Github. Probably my debian package is not compatible with your platform, but you can find a kernel image and driver modules.
https://github.com/tobetter/linux/relea ... roidc2-188
tobetter
 
Posts: 2225
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 daggs » Sun Mar 11, 2018 3:05 am

emk2203 wrote:
daggs wrote:
tobetter wrote:
emk2203 wrote:
daggs wrote:if anyone interested, my upstream buildroot c2 next includes support for mainline uboot (2017.11) and kernel (4.14.4).
the address is https://github.com/daggs1/buildroot/tree/odroidc2-next
I'll update to later version soon

What's the easiest way to get a working C2 config going? I started with make nconfig, but got a default i386 configuration. How can I load sensible C2 defaults?

For the error, you could try to build like this. defconfig in the make command can be replaced any other configuration.
Code: Select all
export ARCH=arm64
make defconfig
make

actually that's incorrect.
you run on your desktop:
Code: Select all
make odroidc2_defconfig

for hardkernel's config or
Code: Select all
make odroidc2_mainline_defconfig

for the mainline support.

if you want to add more packages, you run
Code: Select all
make menuconfig

and select them.
to build an working image run
Code: Select all
make

and after it is done, dd the sdcard.img file into the sd card, insert it into the slot and boot the machine.


Thanks! Straight from the horse's mouth is always best information. :lol:

I must have missed the odroidc2_mainline_defconfig location, because when I cloned the repo and looked through the directory, I found only the odroidc2_defconfig, leading to much disappointment when kernel 3.something came out after some churning on the C2.

That's easy enough to follow, I give it a try. Any more caveats from your side? I am assuming now that it will build and be useable without further modifications.

you need to change to the next branch, just run after clone this:
Code: Select all
git checkout odroidc2-next
and then the rest of the cmds, forgot about that, sorry.
I was able to boot it to login.
please note that I don't know the level hdmi support, that will be more functional when I'll commit the support for 4.15.x
daggs
 
Posts: 219
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2

Re: Odroid C2 mainline kernel support

Unread postby Flole » Sun Mar 11, 2018 3:28 am

tobetter wrote:I'm not sure if this helps you out, I am uploading a debian package for a mainline kernel to my Github. Probably my debian package is not compatible with your platform, but you can find a kernel image and driver modules.
https://github.com/tobetter/linux/relea ... roidc2-188


Just to be sure: Your package supports NFS Root and DHCP? I'm double-checking because otherwise my odroid would not boot anymore and it would be a pain to put the old kernel back onto it.
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby tobetter » Sun Mar 11, 2018 3:41 am

Flole wrote:
tobetter wrote:I'm not sure if this helps you out, I am uploading a debian package for a mainline kernel to my Github. Probably my debian package is not compatible with your platform, but you can find a kernel image and driver modules.
https://github.com/tobetter/linux/relea ... roidc2-188


Just to be sure: Your package supports NFS Root and DHCP? I'm double-checking because otherwise my odroid would not boot anymore and it would be a pain to put the old kernel back onto it.

You can check in my kernel config, and it would be a good idea to test with another sdcard which is copied from your current one before installing my built images.
https://github.com/tobetter/linux/blob/ ... onfig#L756
https://github.com/tobetter/linux/blob/ ... nfig#L5668
tobetter
 
Posts: 2225
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 mainline kernel support

Unread postby Flole » Mon Mar 12, 2018 5:54 am

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

My Uboot-Commands are

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


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

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


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

Re: Odroid C2 mainline kernel support

Unread postby rpcameron » Mon Mar 12, 2018 6:57 am

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

My Uboot-Commands are

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


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

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


What am I missing here?

Which uboot version are you using? HK's uboot uses the boot.ini, which is just plaintext. However, mainline uboot uses the compiled boot.txt/boot.scr format. It sounds like you're trying to use mainline techniques with HK's non-mainline uboot.
rpcameron
 
Posts: 277
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby Flole » Mon Mar 12, 2018 7:01 am

As it used to work before, just the Image was changed I guess it's fine like this. I am running U-Boot 2015.01-00070-g5785ef8 (Feb 01 2016 - 16:31:38) which seems to be the HK Version.
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby rpcameron » Mon Mar 12, 2018 1:07 pm

Flole wrote:As it used to work before, just the Image was changed I guess it's fine like this. I am running U-Boot 2015.01-00070-g5785ef8 (Feb 01 2016 - 16:31:38) which seems to be the HK Version.

After re-reading your post, I realize I read it incorrectly. Are the steps you're using to create your uImage the same a previously used? (I'm away from a real computer right now, so I can't quite see the command I've used in the past to package up a kennel.)
rpcameron
 
Posts: 277
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby Flole » Mon Mar 12, 2018 2:55 pm

I am not sure. It was one year ago last time. The commands are probably different now (which is causing the issues).
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby rpcameron » Mon Mar 12, 2018 3:41 pm

Flole wrote:I am not sure. It was one year ago last time. The commands are probably different now (which is causing the issues).


I use Arch, and looking at their build scripts for the mainline kernel, they do:
Code: Select all
make prepare
unset LDFLAGS
make ${MAKEFLAGS} Image Image.gz modules dtbs
make modules_install
make dtbs_install
cp arch/arm64/boot/Image{,.gz} /boot


(There are a few other bits, but that gives the overall gist. Essentially, the Arch build process doesn't manually compile a uImage. It also does something very similar for the HK kernel, so it's not like there's a big difference between mainline and 3.14. Have you tried simply doing a make Image instead of manually creating your uImage?)
rpcameron
 
Posts: 277
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby Flole » Mon Mar 12, 2018 4:23 pm

I can not create a working kernel myself, it simply doesn't work. Isn't the vmlinuz gzipped and is there any unzip work needed?
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby Flole » Mon Mar 12, 2018 10:22 pm

Also I tried to use extract-vmlinux to extract the vmlinuz-4.16.0-rc4-arm64-odroidc2 and vmlinuz-3.14.29-23-odrobian+ file (the 3.x i had floating around). For both it says extract-vmlinux: Cannot find vmlinux.

Can anybody tell me what went wrong here, or at this moment a working uImage with NFS Root support would already be enough for me.
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby campbell » Tue Mar 13, 2018 12:41 am

Have you tried starting from a working distribution that includes a mainline kernel (Arch) and then swapping it out for your own?
campbell
 
Posts: 284
Joined: Thu Sep 03, 2015 1:13 pm
languages_spoken: english
ODROIDs: XU3, XU4, C2, C1+, Cloudshell, Smart Power

Re: Odroid C2 mainline kernel support

Unread postby Flole » Tue Mar 13, 2018 12:49 am

I used a mainline kernel someone compiled for me before. It was working perfectly, just one little issue with the USB. Now I tried to switch the kernel, but I am having lots of issues.

The file I used before is the uImage from here http://repo.builtonline.net/testing/custom/4.13.0-rc4/

I just reverted back to it and it boots without any problems.
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby brad » Tue Mar 13, 2018 3:32 pm

Flole wrote:I used a mainline kernel someone compiled for me before. It was working perfectly, just one little issue with the USB. Now I tried to switch the kernel, but I am having lots of issues.

The file I used before is the uImage from here http://repo.builtonline.net/testing/custom/4.13.0-rc4/

I just reverted back to it and it boots without any problems.

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

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

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

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

If there is an interest I can probably provide a 4.14 patched and configured for realtime. (realtime patches are available for 4.14)
brad
 
Posts: 686
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2

Re: Odroid C2 mainline kernel support

Unread postby jit-010101 » Tue Mar 13, 2018 10:00 pm

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

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


Hasn't HMDI just got support in 4.16? If so I'd prefer 4.16 for now until 4.14 gets it unless you can add that patch for your build as well then I'm fine with what you judge to be the most stable. :)
Last edited by jit-010101 on Tue Mar 13, 2018 10:45 pm, edited 1 time in total.
jit-010101
 
Posts: 18
Joined: Tue Mar 13, 2018 9:40 pm
languages_spoken: english

Re: Odroid C2 mainline kernel support

Unread postby Flole » Tue Mar 13, 2018 10:02 pm

I think 4.16 is really stable as far as I have understood things here.

If you could also compile in the zram module that would be awesome!
Flole
 
Posts: 26
Joined: Thu Apr 13, 2017 10:14 pm
languages_spoken: english, german
ODROIDs: C2

PreviousNext

Return to General Chat

Who is online

Users browsing this forum: No registered users and 4 guests