{"id":2595,"date":"2019-08-19T16:42:22","date_gmt":"2019-08-19T23:42:22","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=2595"},"modified":"2019-08-19T16:42:22","modified_gmt":"2019-08-19T23:42:22","slug":"arm-odroid-c2-updated","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=2595","title":{"rendered":"ARM &#8211; Odroid C2 &#8211; Updated.."},"content":{"rendered":"<p>When the <strong>Odroid C2<\/strong> was first released way back in 2016, I spent ages trying to get it to function correctly with a mainstream kernel, and tested innumerable development versions of U-Boot, including functionality that was working OK at that time, but that &#8211; for some reason &#8211; then failed to be included in the &#8216;mainstream&#8217; U-Boot..<\/p>\n<p>One of the enduring problems was the lack of functionality for kernel upgrades, as U-Boot on the C2 did not include the facility for permanently updating the environment &#8211; no &#8216;<strong><em>saveenv<\/em><\/strong>&#8216; capability, and having to use boot script\/images was clumsy and time-consuming, to say the least..<\/p>\n<p>As I had Fedora 30 with grub2 working on the Raspberry Pi 3, I recently returned to the possibility of doing the same for the Odroid C2. The Pi 3 version of Fedora 30 with grub used the &#8216;traditional&#8217; Pi boot scripts, but I needed to get grub working with the C2 version of U-Boot etc..<br \/>\nI had already managed to get grub working, but it never got beyond the grub prompt, although it was then possible to load the grub config using<br \/>\n<code><strong>grub&gt; configfile (hd0,1)\/efi\/fedora\/grub.cfg<\/strong><\/code><\/p>\n<p>The usual search turned up a host of dead-end articles featuring not-quite-working setups, but I then decided to check the OpenSuse site, as I recalled that they were the first ones to get grub etc. working on the old Hikey ARM64 system that I had some years earlier.<\/p>\n<p>I found a working version of OpenSuse for the C2 &#8211; with full grub functionality &#8211; at:<br \/>\n<a href=\"https:\/\/en.opensuse.org\/HCL:OdroidC2\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/en.opensuse.org\/HCL:OdroidC2<\/a><\/p>\n<p>This used a two-stage loading of grub, with the <span style=\"text-decoration: underline;\">first<\/span> <strong>grub.cfg<\/strong> &#8211; that was able to be &#8216;found&#8217; OK by U-Boot &#8211; acting as a pointer to the location of the &#8216;real&#8217; <strong>grub.cfg<\/strong>, with the kernel menu etc., and then to load that.<\/p>\n<p>To get this to work with the C2 and Fedora, I used the Fedora Pi3 image (which included EFI etc) and removed the pi-specific info (cma-256 etc) from the grub configuration.<br \/>\nI then created an interim grub config <code><strong>\/boot\/efi\/EFI\/boot\/grub.cfg<\/strong><\/code> to point to the Fedora setup, with the following contents:<br \/>\n<code><span style=\"font-family: Courier New, Courier, monospace;\"><strong>search --fs-uuid --set=root 9999-9999<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>set prefix=($root)\/EFI\/fedora<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>normal<\/strong><\/span><\/code><br \/>\n&#8211; where 9999-9999 should be replaced by the actual UUID of the Fedora EFI partition.<br \/>\nThe standard Fedora grub configuration was then loaded from <code><strong>\/boot\/efi\/EFI\/fedora\/grub.cfg<\/strong><\/code> .<\/p>\n<p>At last I could see the complete grub kernel menu, but for some reason the system failed to boot each time, but did boot OK after several reboot attempts..<br \/>\nAfter more research, I found that the mainline version of U-Boot I was using (April 2019) was the culprit. I had tried using the latest (July) version, but that had failed to load anything from an EFI (fat32) partition, so I had reverted to the April version.<\/p>\n<p>I then noticed that OpenSuse had &#8211; helpfully &#8211; included copies of all the Hardkernel U-Boot components in the root directory of their disk image, so I copied these across and installed them on the C2 eMMC in place of the unreliable April 2019 U-Boot, and after that, everything worked OK.<\/p>\n<p>I use <strong># grub-customizer<\/strong> to update grub for new kernels etc, and have it configured to recognise the C2 serial console UART, which presents as <code><strong>ttyAML0<\/strong><\/code>.<\/p>\n<p><code><span style=\"font-family: Courier New, Courier, monospace;\"><strong>.............<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>Fedora 30 (Workstation Edition)<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>Kernel 5.3.0-rc5 on an aarch64 (ttyAML0)<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>]# uname -a<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>Linux rgodroid 5.3.0-rc5 #2 SMP Sun Aug 18 21:41:39 EDT 2019 aarch64 aarch64 aarch64 GNU\/Linux<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong># cat \/proc\/cmdline<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>BOOT_IMAGE=\/vmlinuz-5.3.0-rc5 root=UUID=99999999-9999-9999-9999-9999999999 ro rhgb console=tty0 console=ttyAML0,115200n8 noplymouth net.ifnames=0<\/strong><\/span><\/code><\/p>\n<p>The only recurring issue, is that the C2 seems to be somewhat unstable, with frequent kernel faults (also occurring on the released 5.2 kernel):<\/p>\n<p><code><span style=\"font-family: Courier New, Courier, monospace;\"><strong>.....................<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159821] ------------[ cut here ]------------<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159866] WARNING: CPU: 3 PID: 1080 at drivers\/regulator\/core.c:2036 _regulator_put.part.0+0xbc\/0xc8<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159868] Modules linked in: dwc2(+) usbcore meson_canvas ipv6 nf_defrag_ipv6<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159882] CPU: 3 PID: 1080 Comm: systemd-udevd Tainted: G W 5.3.0-rc3 #3<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159883] Hardware name: amlogic odroid-c2\/odroid-c2, BIOS 2019.04 04\/09\/2019<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>[ 3.159887] pstate: 40000005 (nZcv daif -PAN -UAO)<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>..................................<\/strong><\/span><\/code><\/p>\n<p><em>Robert Gadsdon.\u00a0\u00a0 August 19th 2019.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When the Odroid C2 was first released way back in 2016, I spent ages trying to get it to function correctly with a mainstream kernel, and tested innumerable development versions of U-Boot, including functionality that was working OK at that time, but that &#8211; for some reason &#8211; then failed to be included in the &#8216;mainstream&#8217; U-Boot.. <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=2595\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1132,10,1238,1375,11,15,1285,19,1535,937],"tags":[2034,1286,2091,2090],"class_list":["post-2595","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-fedora","category-fix","category-grub","category-hacks","category-linux-2","category-odroid-c2","category-opinion","category-quirks","category-u-boot-2","tag-fedora-30","tag-odroid-c2","tag-opensuse","tag-working-u-boot-with-grub"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2595"}],"version-history":[{"count":2,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2595\/revisions"}],"predecessor-version":[{"id":2597,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2595\/revisions\/2597"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}