{"id":1606,"date":"2015-11-10T04:49:38","date_gmt":"2015-11-10T04:49:38","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=1606"},"modified":"2015-11-12T20:35:52","modified_gmt":"2015-11-12T20:35:52","slug":"arm64-dragonboard-410c-now-with-u-boot","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=1606","title":{"rendered":"ARM64 &#8211; Dragonboard 410c &#8211; Now with U-Boot.."},"content":{"rendered":"<p>One of the shortcomings of the DragonBoard 410c was that it relied on the Android-phone-centric <strong><em>fastboot<\/em><\/strong> for any Kernel updates, but now there is a version of U-Boot available, thanks to <strong>Mateusz Kulikowski<\/strong>..<\/p>\n<p>This is very much a work-in-progress, but I thought I would give it a try&#8230;<\/p>\n<p>I started with the version at <a href=\"https:\/\/github.com\/hallor\/u-boot\/tree\/dragonboard-2015.11.01\" target=\"_blank\">https:\/\/github.com\/hallor\/u-boot\/tree\/dragonboard-2015.11.01<\/a>, and made some modifications to get it working on my 410c (Fedora 23, EXT4 rootfs, boot from SDCard)..<\/p>\n<p>I should emphasize that I am a complete novice when it comes to hacking u-boot, and there may well be a better way of doing all this, but this worked, for me..<\/p>\n<p>Modify <strong><span style=\"font-family: courier new,courier,monospace;\">u-boot\/include\/configs\/dragonboard.h<\/span><\/strong><\/p>\n<p>add:<br \/>\n<strong><span style=\"font-family: courier new,courier,monospace;\">#define CONFIG_CMD_EXT4 \/* EXT4 support *\/<br \/>\n<\/span><\/strong><strong><span style=\"font-family: courier new,courier,monospace;\">#define CONFIG_SYS_BOOTM_LEN (16 &lt;&lt; 20) \/* Increase max image size *\/<\/span><\/strong><\/p>\n<p>And.. as the SAVEENV command was not included, for some reason &#8211; and I could not work out how to reenable it &#8211; I hard-coded the boot parameters, as follows:<br \/>\nafter:<br \/>\n<strong><span style=\"font-family: courier new,courier,monospace;\">\/* Environment &#8211; Boot*\/<\/span><\/strong><br \/>\n<strong><span style=\"font-family: courier new,courier,monospace;\">#define CONFIG_BOOTDELAY 5 \/* autoboot after 5 seconds *\/<br \/>\n<\/span><\/strong><span style=\"font-family: courier new,courier,monospace;\"><span style=\"font-family: arial,helvetica,sans-serif;\">insert:<\/span><\/span><br \/>\n<strong><span style=\"font-family: courier new,courier,monospace;\">#define CONFIG_BOOTARGS &#8220;root=\/dev\/mmcblk1p1 rw rootwait console=tty0 console=ttyMSM0,115200n8 rootfs=ext4 noinitrd selinux=0&#8221;<\/span><\/strong><br \/>\n<strong><span style=\"font-family: courier new,courier,monospace;\">#define CONFIG_BOOTCOMMAND &#8220;ext4load mmc 1:1 0x90000000 \/boot\/uImage; ext4load mmc 1:1 0x89000000 \/boot\/apq8016-sbc.dtb; bootm 0x90000000 &#8211; 0x89000000; &#8221;<br \/>\n<\/span><\/strong><span style=\"font-family: arial,helvetica,sans-serif;\">&lt; each of these #defines should be a single line..&gt;<strong><br \/>\n<\/strong><\/span><\/p>\n<p>Then:<\/p>\n<pre><span style=\"font-family: courier new,courier,monospace;\"><strong>#] make distclean<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>#] make dragonboard_config<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>#] make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-<\/strong><\/span>  (or whatever cross-compiler you are using..)<\/pre>\n<p>And make a &#8216;fake kernel&#8217; image to use with fastboot, to install u-boot&#8230;<\/p>\n<p><strong><em>mkbootimg<\/em><\/strong> can be found at <span style=\"font-family: courier new,courier,monospace;\"><strong>git:\/\/codeaurora.org\/quic\/kernel\/skales<\/strong><\/span>, and I just installed it in <strong>\/opt<\/strong>, and then added the location to the <strong><em>$PATH<\/em><\/strong>..<\/p>\n<pre><strong><span style=\"font-family: courier new,courier,monospace;\">#] export PATH=\/opt\/skales:$PATH\r\n#] mkbootimg --kernel=u-boot.bin --output=u-boot.img --dt=fake_dt --pagesize 2048 --base 0x80000000 --ramdisk=fake_ramdisk --cmdline=\"\"\r\n<\/span><\/strong><span style=\"font-family: courier new,courier,monospace;\">(su, and enable fastboot on the 410c, after connecting the USB cable, etc. etc..)<\/span><strong><span style=\"font-family: courier new,courier,monospace;\">\r\n#] fastboot flash boot u-boot.img\r\n<\/span><\/strong><\/pre>\n<p>So.. the fastboot-enabled &#8216;boot&#8217; image is not the kernel now, but actually the u-boot executable.. You will only need to use fastboot to install\/update u-boot.<\/p>\n<p>The kernel can now be compiled on the Dragonboard, now, but the arm64 kernels do not include any built-in <strong><span style=\"font-family: courier new,courier,monospace;\">#make uImage<\/span><\/strong> or <strong><span style=\"font-family: courier new,courier,monospace;\">#make zImage<\/span><\/strong> capability, and so you will need to create a uImage after the <strong><span style=\"font-family: courier new,courier,monospace;\">#make Image<\/span><\/strong> kernel compile..<\/p>\n<pre><strong><span style=\"font-family: courier new,courier,monospace;\">#] make defconfig <\/span><\/strong><span style=\"font-family: courier new,courier,monospace;\">(if necessary..)<\/span>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make xconfig <\/span><\/strong><span style=\"font-family: courier new,courier,monospace;\">(select qcom...)<\/span>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make -j5 Image<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make dtbs<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] cp arch\/arm64\/boot\/dts\/qcom\/apq8016-sbc.dtb \/boot<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make -j5 modules<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make modules_install<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] make firmware_install<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] cp System.map \/boot<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier,monospace;\">#] cp arch\/arm64\/boot\/Image \/boot<\/span><\/strong><\/pre>\n<p>Then in the \/boot directory:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier,monospace;\">#] mkimage -A arm64 -O linux -C none -T kernel -a 0x80080000 -e 0x80080000 -n Dragonboard -d Image uImage<\/span><\/strong><\/pre>\n<p>U-boot boot sequence &#8211; after u-boot is loaded by the old android bootloader:<\/p>\n<pre><span style=\"font-family: courier new,courier,monospace;\"><strong>U-Boot 2015.10-00449-g8e0b5c4-dirty (Nov 09 2015 - 14:13:46 -0800)<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Qualcomm-DragonBoard 410C<\/strong><\/span>\r\n\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>DRAM: 986 MiB<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>MMC: msm_sdhci: 0, msm_sdhci: 1<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Using default environment<\/strong><\/span>\r\n\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>In: serial<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Out: serial<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Err: serial<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Net: Net Initialization Skipped<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>No ethernet found.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Hit any key to stop autoboot: 0<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>=&gt; printenv<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>baudrate=115200<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>bootargs=root=\/dev\/mmcblk1p1 rw rootwait console=tty0 console=ttyMSM0,115200n8 rootfs=ext4 noinitrd selinux=0<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>bootcmd=ext4load mmc 1:1 0x90000000 \/boot\/uImage; ext4load mmc 1:1 0x89000000 \/boot\/apq8016-sbc.dtb; bootm 0x90000000 - 0x89000000;<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>bootdelay=5<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>stderr=serial<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>stdin=serial<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>stdout=serial<\/strong><\/span>\r\n\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Environment size: 327\/4092 bytes<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>=&gt; boot<\/strong><\/span><\/pre>\n<p>&lt;&lt; Linux Kernel boots&#8230; &gt;&gt;<\/p>\n<pre><span style=\"font-family: courier new,courier,monospace;\"><strong>.................<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Reached target Network is Online.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting LSB: Start or stop the Webmin server...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting rolekit - role server...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting Availability of block devices...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Reached target Remote File Systems (Pre).<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Reached target Remote File Systems.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting Permit User Sessions...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Started OpenSSH server daemon.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting OpenSSH server daemon...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Started Availability of block devices.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Started Permit User Sessions.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting Terminate Plymouth Boot Screen...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>[ OK ] Started Command Scheduler.<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting Command Scheduler...<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong> Starting Wait for Plymouth Boot Screen to Quit...<\/strong><\/span>\r\n\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Fedora 23 (Twenty Three)<\/strong><\/span>\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>Kernel 4.2.0 on an aarch64 (ttyMSM0)<\/strong><\/span>\r\n\r\n<span style=\"font-family: courier new,courier,monospace;\"><strong>rg410c login:<\/strong><\/span><\/pre>\n<p>So.. I now have a Dragonboard 410c that I can compile the kernel on, and boot, without having to cross-compile or connect USB cables!<\/p>\n<p><em>Robert Gadsdon.\u00a0\u00a0 November 9, 2015.<br \/>\nUpdated November 12, to add info on mkbootimg..<br \/>\n<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the shortcomings of the DragonBoard 410c was that it relied on the Android-phone-centric fastboot for any Kernel updates, but now there is a version of U-Boot available, thanks to Mateusz Kulikowski.. This is very much a work-in-progress, but I thought I would give it a try&#8230; I started with the version at https:\/\/github.com\/hallor\/u-boot\/tree\/dragonboard-2015.11.01, and made <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=1606\"><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,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1132,5,6,1130,10,11,14,16,937],"tags":[1133,1137,182,1175,372],"class_list":["post-1606","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-compilation","category-crash-and-burn","category-dragonboard","category-fedora","category-hacks","category-kernel","category-linux-arm","category-u-boot-2","tag-arm64","tag-dragonboard-410c","tag-hack","tag-success","tag-u-boot"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1606","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=1606"}],"version-history":[{"count":4,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":1614,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions\/1614"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}