{"id":2689,"date":"2020-02-17T13:43:28","date_gmt":"2020-02-17T21:43:28","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=2689"},"modified":"2020-02-17T13:45:09","modified_gmt":"2020-02-17T21:45:09","slug":"arm64-odroid-n2-latest-u-boot-kernel-5-6-rc2-efi-fedora-31-plasma-wayland","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=2689","title":{"rendered":"ARM64 &#8211; Odroid N2 &#8211; Latest U-Boot, Kernel 5.6-rc2, EFI, Fedora 31, Plasma\/Wayland"},"content":{"rendered":"<p>I have recently acquired an Odroid N2 (4GB) and managed &#8211; with some difficulty &#8211; to get it to run a &#8216;modern&#8217; U-Boot, Kernel 5.6-rc2, with EFI support, and Fedora 31.<\/p>\n<div id=\"attachment_2690\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2020\/02\/odroid-n2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2690\" class=\"size-medium wp-image-2690\" src=\"https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2020\/02\/odroid-n2-300x242.jpg\" alt=\"\" width=\"300\" height=\"242\" srcset=\"https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2020\/02\/odroid-n2-300x242.jpg 300w, https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2020\/02\/odroid-n2-768x620.jpg 768w, https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2020\/02\/odroid-n2.jpg 850w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-2690\" class=\"wp-caption-text\">Odroid N2<\/p><\/div>\n<p>This time, there were no clues from <em>OpenSuse<\/em>, and all the examples I found still used the ancient\/custom Hardkernel u-boot and a kernel.img &#8216;blob.<\/p>\n<p>Fortunately, the process I had used to get all this working &#8211; including the &#8216;two-stage&#8217; grub &#8211; on the Odroid C2, still applied in to this Odroid N2, and this is documented in my previous article here: <a href=\"https:\/\/rglinuxtech.com\/?p=2595\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/rglinuxtech.com\/?p=2595<\/a><br \/>\nThis time, I was forced to compile a &#8216;new&#8217; u-boot from scratch, including the Hardkernel binary bits, and this proved a pain, as expected. The latest mainline version of u-boot compiles OK with gcc 9 (Fedora 31) but the proprietary bits need the ancient Hardkernel version of u-boot, which only compiles with a now-obsolete version of gcc 4. \u00a0 Details of this process are here: <a href=\"https:\/\/wiki.odroid.com\/odroid-n2\/software\/building_u-boot\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.odroid.com\/odroid-n2\/software\/building_u-boot<\/a> .<br \/>\nI had all sorts of odd problems with the compile, and repeated &#8221; <strong><span style=\"font-family: Courier New, Courier, monospace;\">error: redefinition of \u2018fdt_offset_ptr_<\/span><\/strong>&#8221; errors, and eventually had to (temporarily) uninstall the F31 version of <strong>libfdt-devel<\/strong> to get the compile to work.<br \/>\nThe complete instructions to build the hybrid u-boot can be found in the mainline source tree, at <strong><span style=\"font-family: Courier New, Courier, monospace;\">~\/u-boot\/board\/amlogic\/w400\/README.odroid-n2<\/span><\/strong>, and &#8211; yes &#8211; the instruction to copy the same <span style=\"font-family: Courier New, Courier, monospace;\"><strong>u-boot.bin.sd.bin<\/strong><\/span> file to two different places is correct..<\/p>\n<p>After all was finished, the system booted into 5.6-rc2:<\/p>\n<p><code><strong><span style=\"font-family: Courier New, Courier, monospace;\">GNU GRUB version 2.02<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2502*Fedora (5.6.0-rc2) 31 (Workstation Edition) \u2502<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2502 Fedora (5.6.0-rc1) 31 (Workstation Edition) \u2502<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2502 Fedora (5.4.19-200.fc31.aarch64) 31 (Workstation Edition) \u2502<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2502 Fedora (0-rescue-458dfe492c2e4f2e83ddee12c38f36af) 31 (Workstation Edition\u25ba\u2502<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2502 \u2502<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/strong><\/code><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">EFI stub: Booting Linux Kernel&#8230;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">EFI stub: EFI_RNG_PROTOCOL unavailable, no randomness supplied<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">EFI stub: Using DTB from configuration table<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">EFI stub: Exiting boot services and installing virtual address map&#8230;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Booting Linux on physical CPU 0x0000000000 [0x410fd034]<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Linux version 5.6.0-rc2 (root@rgodroidn2) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #2 SMP PREEMPT Sun Feb 16 20:50:26 PST 2020<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Machine model: Hardkernel ODROID-N2<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">efi: Getting EFI parameters from FDT:<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">efi: EFI v2.80 by Das U-Boot<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">&#8230;&#8230;&#8230;&#8230;&#8230;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Fedora 31 (Workstation Edition)<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Kernel 5.6.0-rc2 on an aarch64 (ttyAML0)<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">&#8230;&#8230;&#8230;&#8230;&#8230;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">[root@rgodroidn2 ~]# uname -a<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Linux rgodroidn2 5.6.0-rc2 #1 SMP PREEMPT Sun Feb 16 16:45:26 PST 2020 aarch64 aarch64 aarch64 GNU\/Linux<\/span><\/strong><\/p>\n<p>The only problem, was that the HDMI had no output. I double-checked that it was not a hardware problem by booting from a <em>CoreElec<\/em> sdcard, and the display worked OK. The kernel was loading the correct drivers, so it looked like a hardware initialization issue..<br \/>\n&#8230;.<br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">meson-drm ff900000.vpu: master bind failed: -517<\/span><\/strong><br \/>\n&#8230;..<br \/>\nI then found that the u-boot command to load the N2 dtb was not functioning, even though it was in the correct location.. I then stopped the boot process in u-boot, and manually loaded the dtb:<br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">=&gt; load mmc 1:2 0x08008000 \/dtb\/amlogic\/meson-g12b-odroid-n2.dtb<\/span><\/strong><br \/>\nand then<br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">=&gt; boot<\/span><\/strong><br \/>\n&#8211; then HDMI worked OK, and the console appeared on the screen.<br \/>\nIn the past, I would have changed the u-boot command set to make it work, but this version does not have any &#8216;saveenv&#8217; capability. After examining the output of <strong><span style=\"font-family: Courier New, Courier, monospace;\">=&gt; printenv<\/span> <\/strong>, I copied the dtb from <strong><span style=\"font-family: Courier New, Courier, monospace;\">~\/dtb\/amlogic\/meson-g12b-odroid-n2.dtb<\/span><\/strong> to <strong><span style=\"font-family: Courier New, Courier, monospace;\">~\/amlogic\/meson-g12b-odroid-n2.dtb<\/span><\/strong>, and then the HDMI was recognised correctly, until it just stopped working again.. I found that continued reboots would sometimes recognise the dtb, and sometimes not.. This may be another example of an <em>unreliable<\/em> version of u-boot, which is what happened with my tests for the Odroid C2..<\/p>\n<p>To fix this, I created a one-line <strong><span style=\"font-family: Courier New, Courier, monospace;\">boot.scr<\/span><\/strong> in <strong><span style=\"font-family: Courier New, Courier, monospace;\">\/boot\/efi<\/span><\/strong>, with:<br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">load mmc 1:2 0x08008000 \/dtb\/amlogic\/meson-g12b-odroid-n2.dtb<\/span><\/strong><\/p>\n<p>When HDMI worked, I tried to get some sort of graphical output, and found that KDE\/Plasma\/Wayland actually worked quite well, apart from video playback &#8211; as expected &#8211; not being very smooth. The <em>panfrost<\/em> kernel drivers are in 5.6-rc, and hopefully this will improve with better userland Wayland support in time&#8230;<\/p>\n<p><em>Robert Gadsdon.\u00a0\u00a0 February 17th 2020<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have recently acquired an Odroid N2 (4GB) and managed &#8211; with some difficulty &#8211; to get it to run a &#8216;modern&#8217; U-Boot, Kernel 5.6-rc2, with EFI support, and Fedora 31. This time, there were no clues from OpenSuse, and all the examples I found still used the ancient\/custom Hardkernel u-boot and a kernel.img &#8216;blob. Fortunately, the <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=2689\"><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,1131,10,11,14,16,2171,1535,937,1160],"tags":[1133,2174,2092,2173,2172,2175,372],"class_list":["post-2689","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-arm64","category-fedora","category-hacks","category-kernel","category-linux-arm","category-odroid-n2","category-quirks","category-u-boot-2","category-uefi","tag-arm64","tag-efi","tag-fedora-31","tag-kernel-5-6-rc2","tag-odroid-n2","tag-plasma-wayland","tag-u-boot"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2689","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=2689"}],"version-history":[{"count":3,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2689\/revisions"}],"predecessor-version":[{"id":2693,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2689\/revisions\/2693"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}