{"id":2147,"date":"2017-12-12T13:57:01","date_gmt":"2017-12-12T21:57:01","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=2147"},"modified":"2017-12-12T13:57:01","modified_gmt":"2017-12-12T21:57:01","slug":"arm64-fedora-27-uefi-and-pi3","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=2147","title":{"rendered":"ARM64 &#8211; Fedora 27, UEFI and Pi3.."},"content":{"rendered":"<p>I decided &#8211; after some time &#8211; to do some more with the Raspberry Pi 3, and set it up as a small network print server..<\/p>\n<p>As there was now an &#8216;official&#8217; version of Fedora 27 for the Pi3, I decided to use this..\u00a0\u00a0 Details are here, and links to <strong>aarch64<\/strong> images are near the bottom of the article..\u00a0\u00a0 <a href=\"https:\/\/fedoraproject.org\/wiki\/Architectures\/ARM\/Raspberry_Pi\" target=\"_blank\" rel=\"noopener\">https:\/\/fedoraproject.org\/wiki\/Architectures\/ARM\/Raspberry_Pi<\/a><\/p>\n<p>This version uses u-boot to load EFI, which then boots the Pi3 in the &#8216;traditional&#8217; way..\u00a0\u00a0 After creating the system on the micro-sd card, I &#8216;saved\/restored&#8217; the root filesystem, and modified the partition layout to make it resident on a &#8216;primary&#8217; partition, rather than &#8216;extended&#8217;, but this was just a personal preference..<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">Fdisk:\r\nDevice       Boot    Start   End       Sectors   Size  Id Type<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/dev\/mmcblk0p1 *     2048    342015    339968    166M  6  FAT16<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/dev\/mmcblk0p2       342016  2439167   2097152   1G    83 Linux<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/dev\/mmcblk0p3       2439168 3487743   1048576   512M  82 Linux swap \/ Solaris<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">\/dev\/mmcblk0p4       3487744 125042687 121554944 58G   83 Linux\r\n............\r\n# cat \/etc\/fstab\r\n\/dev\/mmcblk0p1 \/boot\/efi vfat umask=0077,shortname=winnt 0 2\r\n\/dev\/mmcblk0p2 \/boot     ext4 defaults 1 2\r\n\/dev\/mmcblk0p3 swap      swap defaults 0 0\r\n\/dev\/mmcblk0p4 \/         ext4 defaults 1 1\r\n<\/span><\/strong><\/pre>\n<p>As I needed to use a serial console, I uncommented\u00a0 <strong><span style=\"font-family: courier new,courier;\">enable_uart=1<\/span><\/strong> in <strong>config.txt<\/strong>, and made the appropriate changes to the kernel boot command line..<\/p>\n<p>As usual, the standard Fedora kernel config included many unwanted device selections and options, and so I decided to create a more Pi3-specific one..\u00a0\u00a0 A search found some possible candidates, and I tried several of these..<\/p>\n<p>As a result, I found that the Broadcom GPU\/DRM driver caused multiple tombstones during the boot process, and killed the HDMI monitor connection:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">..................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> OK ] Mounted Temporary Directory (\/tmp).<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi &lt;-&gt; 3f902000.hdmi mapping ok<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[drm] Driver supports precise vblank timestamp query.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Console: switching to colour frame buffer device 240x67<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">vc4-drm soc:gpu: fb0: frame buffer device<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Started udev Wait for Complete Device Initialization.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Started LVM2 metadata daemon.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Started Monitoring of LVM2 mirrors,\u2026sing dmeventd or progress polling.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Reached target Local File Systems (Pre).<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> Starting File System Check on \/dev\/mmcblk0p1...<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> Starting File System Check on \/dev\/mmcblk0p2...<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Started File System Check on \/dev\/mmcblk0p1.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ OK ] Started File System Check on \/dev\/mmcblk0p2.<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"> Mounting \/boot...<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[CRTC:67:crtc-2] vblank wait timed out<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">------------[ cut here ]------------<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">WARNING: CPU: 2 PID: 21 at drm_atomic_helper_wait_for_vblanks.part.7+0x248\/0x278 [drm_kms_helper]<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Modules linked in: vc4 snd_soc_core snd_pcm_dmaengine snd_seq snd_seq_device snd_pcm snd_timer snd smsc95xx drm_kms_helper usbnet cfbfillrect cfbimgblt mii cfbcopyarea drm syscopyarea sysfillrect sysimgblt fb_sys_fops uio_pdrv_genirq uio efivarfs pwm_bcm2835 i2c_bcm2835 ipv6<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">CPU: 2 PID: 21 Comm: kworker\/2:0 Not tainted 4.14.5 #1<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Hardware name: raspberrypi rpi\/rpi, BIOS 2017.09 10\/10\/2017<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Workqueue: events output_poll_execute [drm_kms_helper]<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">task: ffffffc03c85c600 task.stack: ffffff80088c0000<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">PC is at drm_atomic_helper_wait_for_vblanks.part.7+0x248\/0x278 [drm_kms_helper]<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">LR is at drm_atomic_helper_wait_for_vblanks.part.7+0x248\/0x278 [drm_kms_helper]<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">pc : [&lt;ffffff80007423e8&gt;] lr : [&lt;ffffff80007423e8&gt;] pstate: 40000145<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">sp : ffffff80088c3aa0<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">................\u00a0\u00a0\u00a0\u00a0 etc... etc...<\/span><\/strong><\/pre>\n<p>So, I disabled this ( &#8216;<span style=\"font-family: courier new,courier;\"><strong>Broadcom VC4 Graphics<\/strong><\/span>&#8216; ), and just used the framebuffer option..\u00a0\u00a0\u00a0\u00a0 The device will (obviously) be used &#8216;headless&#8217;, so this is not an issue..<\/p>\n<p>It was a refreshing change to be able to use the x86-standard kernel compile\/install commands, and to be able to use <strong>grub-customizer<\/strong> to handle boot options etc..\u00a0\u00a0 I set up the <em><strong>dtb<\/strong><\/em> link in the <span style=\"font-family: courier new,courier;\"><strong>\/boot<\/strong><\/span> directory to match the Fedora example..<\/p>\n<p>I did find slightly confusing behaviour with the console options&#8230;\u00a0\u00a0 I had (temporarily) modified grub.cfg to include the usual <span style=\"font-family: courier new,courier;\"><strong>console=tty0 console=ttyS0,115200n8<\/strong><\/span>, and this worked OK at first boot, but after I had compiled\/installed later kernels, and included this in the grub parameters, this stopped working, and there was no output on the serial\/uart connection at boot time, after the usual grub menu dialogue..<\/p>\n<p>I then discovered that &#8211; for some reason &#8211; the ports had changed, and now required <span style=\"font-family: courier new,courier;\"><strong>console=tty1 console=ttyS1,115200n8. <\/strong><span style=\"font-family: arial,helvetica,sans-serif;\">This worked OK for the Fedora-supplied kernels, but not for the self-compiled ones..\u00a0\u00a0 I then found that the uart\/port selections in the kernel configs I was testing had been &#8211; deliberately &#8211; disabled, probably due to the fact that these console options cause performance degradation, because of design tradeoffs on the Pi3..<\/span><\/span><\/p>\n<p>So, I modified the kernel config in the appropriate areas:<\/p>\n<p>Select &#8216;<strong><span style=\"font-family: courier new,courier;\">Console on 8250\/16550 serial port<\/span><\/strong>&#8216;<br \/>\nChange &#8216;<strong><span style=\"font-family: courier new,courier;\">Maximum 8250\/16550 and compatible serial ports<\/span><\/strong>&#8216;\u00a0 to &#8216;<span style=\"font-family: courier new,courier;\"><strong>4<\/strong><span style=\"font-family: arial,helvetica,sans-serif;\">&#8216;<\/span><\/span><br \/>\nChange &#8216;<span style=\"font-family: courier new,courier;\"><strong>Maximum 8250\/16550 serial ports to register at runtime<\/strong><\/span>&#8216;\u00a0 to &#8216;<strong><span style=\"font-family: courier new,courier;\">4<\/span><\/strong><span style=\"font-family: courier new,courier;\"><span style=\"font-family: arial,helvetica,sans-serif;\">&#8216;<\/span><\/span><\/p>\n<p>After this, all was well:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">..................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 0.000349] console [tty1] enabled<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">.............<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 0.722248] 3f215040.serial: ttyS1 at MMIO 0x0 (irq = 61, base_baud = 31250000) is a 16550<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 1.279189] console [ttyS1] enabled<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">.....................\r\nFedora 27 (Workstation Edition)\r\nKernel 4.14.5 on an aarch64 (ttyS1)\r\n...................\r\n$ uname -a\r\nLinux rgprint 4.14.5 #2 SMP PREEMPT Mon Dec 11 23:20:51 PST 2017 aarch64 aarch64 aarch64 GNU\/Linux<\/span><\/strong><\/pre>\n<p>I have put a copy of the\u00a0 kernel config at <a href=\"https:\/\/pastebin.com\/thmebsn0\" target=\"_blank\" rel=\"noopener\">https:\/\/pastebin.com\/thmebsn0<\/a><\/p>\n<p><em>Robert Gadsdon.\u00a0 December 12, 2017.<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided &#8211; after some time &#8211; to do some more with the Raspberry Pi 3, and set it up as a small network print server.. As there was now an &#8216;official&#8217; version of Fedora 27 for the Pi3, I decided to use this..\u00a0\u00a0 Details are here, and links to aarch64 images are near the bottom of <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=2147\"><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,10,11,14,15,16,19,21,1160],"tags":[1135,1770,1768,1173,1767,242,1766,1769,1162],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-compilation","category-fedora","category-hacks","category-kernel","category-linux-2","category-linux-arm","category-opinion","category-raspberry-pi","category-uefi","tag-aarch64","tag-custom-config","tag-fedora-27","tag-kernel","tag-kernel-4-14-5","tag-linux","tag-pi3","tag-uart-console","tag-uefi"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2147","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=2147"}],"version-history":[{"count":3,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2147\/revisions"}],"predecessor-version":[{"id":2150,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2147\/revisions\/2150"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}