{"id":1522,"date":"2015-07-22T20:25:13","date_gmt":"2015-07-22T19:25:13","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=1522"},"modified":"2015-07-22T20:25:13","modified_gmt":"2015-07-22T19:25:13","slug":"arm64-hikey-change-to-uefi-boot","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=1522","title":{"rendered":"ARM64 &#8211; HiKey &#8211; Change to UEFI Boot.."},"content":{"rendered":"<p>After some more testing, including trying (<em>unsuccessfully<\/em>) the HiKey version of Kernel 4.1-rc4 <span style=\"font-family: courier new,courier,monospace;\"><strong># git clone -b hikey-mainline-rebase &#8211;single-branch https:\/\/github.com\/96boards\/linux\/<\/strong><\/span><strong>\u00a0\u00a0 <\/strong>I was frustrated by the complete lack of kernel boot info on screen, after the proprietary bootloader had finished.. More research found that this bootloader was described as somewhat deficient in the &#8216;fit for purpose&#8217; department, and I really ought to update to a more <em>effective<\/em> one&#8230;<\/p>\n<p>There is a pre-release version of U-Boot available, but UEFI\/grub is also now an option, which made more sense..\u00a0\u00a0\u00a0\u00a0 The only drawback to the current version of UEFI is that it can only boot from Emmc, not an SD Card, but as long as the kernel image (<span style=\"font-family: courier new,courier,monospace;\"><strong>Image<\/strong><\/span>) and dtb (<span style=\"font-family: courier new,courier,monospace;\"><strong>hi6220-hikey.dtb<\/strong><\/span>) and initrd are resident on the Emmc boot partition, then the rootfs can still be on the SD Card..\u00a0\u00a0\u00a0\u00a0 I also created a SWAP file on the Emmc root partition..<\/p>\n<pre><span style=\"font-family: courier new,courier,monospace;\">[root@rghikey ~]#<\/span> <span style=\"font-family: courier new,courier,monospace;\">cat \/etc\/fstab<\/span>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/dev\/mmcblk1p2  \/           ext4  defaults 1 1<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/dev\/mmcblk1p1  \/boot       vfat  defaults 1 2<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/dev\/mmcblk0p6  \/boot-emmc  vfat  defaults 1 2<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/dev\/mmcblk0p9  \/root-emmc  ext4  defaults 1 2<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/root-emmc\/SWAP none        swap  defaults 0 0<\/span><\/strong><\/pre>\n<p>So.. I have the root filesystem on the SD Card, and mount the Emmc boot and root partitions as <span style=\"font-family: courier new,courier,monospace;\"><strong>\/boot-emmc<\/strong><\/span> and <strong><span style=\"font-family: courier new,courier,monospace;\">\/root-emmc<\/span><\/strong> respectively, and then copy the Image and .dtb files to the \/boot-emmc partition after compilation..\u00a0\u00a0\u00a0\u00a0 This is far more useful, as by editing the grub configuration file in the Emmc boot directory (<strong><span style=\"font-family: courier new,courier,monospace;\">\/boot-emmc\/grub\/grub.cfg<\/span><\/strong>) I can arrange for multiple Kernel versions to be available for booting, to fall-back to a known\/good version if the boot fails..<\/p>\n<pre><span style=\"font-family: courier new,courier,monospace;\"><strong>$ <\/strong>cat \/boot-emmc\/grub\/grub.cfg <\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>set default=\"0\" <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>set timeout=10 <\/strong><\/span>\r\n \r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>menuentry 'Fedora Linux' { <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0linux \/Image console=ttyAMA0,115200n8 earlycon=pl011,0xf8015000 root=\/dev\/mmcblk1p2 rw roo<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>twait initrd=initrd.img efi=noruntime <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0initrd \/initrd.img <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0devicetree \/hi6220-hikey.dtb <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>} <\/strong><\/span>\r\n \r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>menuentry 'Fedora Linux OLD' { <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0linux \/Image.old console=ttyAMA0,115200n8 earlycon=pl011,0xf8015000 root=\/dev\/mmcblk1p2 rw<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> rootwait initrd=initrd.img efi=noruntime <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0initrd \/initrd.img <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0devicetree \/hi6220-hikey.dtb.old <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>} <\/strong><\/span>\r\n \r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>menuentry 'Fedora Linux 4.1-rc4' { <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0linux \/Image-41rc4 console=ttyAMA0,115200n8 earlycon=pl011,0xf8015000 root=\/dev\/mmcblk1p2 <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>rw rootwait initrd=initrd.img efi=noruntime <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0initrd \/initrd.img <\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> \u00a0\u00a0\u00a0devicetree \/hi6220-hikey.dtb-41rc4 <\/strong><\/span>\r\n<strong>}<\/strong><\/pre>\n<div>Apart from the multi-version boot convenience, the resulting console output gives far more early-kernel-boot info than the old bootloader, enabling proper diagnosis of boot failures, rather than an empty screen.<\/div>\n<div><\/div>\n<div><em>Caveats..<\/em>\u00a0\u00a0\u00a0 You may need to try different versions of the UEFI binaries, as I found that the July 19 version failed, but an earlier version worked OK..\u00a0\u00a0\u00a0 You will also need to connect\u00a0 a proper uart\/usb console to the circuit board, which may involve some careful soldering.. (see previous article <a href=\"https:\/\/rglinuxtech.com\/?p=1509\" target=\"_blank\">https:\/\/rglinuxtech.com\/?p=1509<\/a>)<\/div>\n<div><\/div>\n<div>More to come &#8211; including the USB port catch-22, and Bluetooth woes..!<\/div>\n<div><\/div>\n<div><em>Robert Gadsdon.\u00a0\u00a0\u00a0 July 22, 2015.<\/em><\/div>\n","protected":false},"excerpt":{"rendered":"<p>After some more testing, including trying (unsuccessfully) the HiKey version of Kernel 4.1-rc4 # git clone -b hikey-mainline-rebase &#8211;single-branch https:\/\/github.com\/96boards\/linux\/\u00a0\u00a0 I was frustrated by the complete lack of kernel boot info on screen, after the proprietary bootloader had finished.. More research found that this bootloader was described as somewhat deficient in the &#8216;fit for purpose&#8217; department, and <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=1522\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1132,1131,5,6,1146,16,1160],"tags":[1133,1161,1163,1164,1147,242,1175,1162],"class_list":["post-1522","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-arm64","category-compilation","category-crash-and-burn","category-hikey","category-linux-arm","category-uefi","tag-arm64","tag-bootloader","tag-emmc","tag-grub","tag-hikey","tag-linux","tag-success","tag-uefi"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1522","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1522"}],"version-history":[{"count":4,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1522\/revisions"}],"predecessor-version":[{"id":1526,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1522\/revisions\/1526"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}