I decided – after some time – to do some more with the Raspberry Pi 3, and set it up as a small network print server..
As there was now an ‘official’ version of Fedora 27 for the Pi3, I decided to use this.. Details are here, and links to aarch64 images are near the bottom of the article.. https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi
This version uses u-boot to load EFI, which then boots the Pi3 in the ‘traditional’ way.. After creating the system on the micro-sd card, I ‘saved/restored’ the root filesystem, and modified the partition layout to make it resident on a ‘primary’ partition, rather than ‘extended’, but this was just a personal preference..
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 342015 339968 166M 6 FAT16
/dev/mmcblk0p2 342016 2439167 2097152 1G 83 Linux
/dev/mmcblk0p3 2439168 3487743 1048576 512M 82 Linux swap / Solaris
/dev/mmcblk0p4 3487744 125042687 121554944 58G 83 Linux
# cat /etc/fstab
/dev/mmcblk0p1 /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/mmcblk0p2 /boot ext4 defaults 1 2
/dev/mmcblk0p3 swap swap defaults 0 0
/dev/mmcblk0p4 / ext4 defaults 1 1
As I needed to use a serial console, I uncommented enable_uart=1 in config.txt, and made the appropriate changes to the kernel boot command line..
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.. A search found some possible candidates, and I tried several of these..
As a result, I found that the Broadcom GPU/DRM driver caused multiple tombstones during the boot process, and killed the HDMI monitor connection:
OK ] Mounted Temporary Directory (/tmp).
vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping ok
vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])
vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
Console: switching to colour frame buffer device 240x67
vc4-drm soc:gpu: fb0: frame buffer device
[ OK ] Started udev Wait for Complete Device Initialization.
[ OK ] Started LVM2 metadata daemon.
[ OK ] Started Monitoring of LVM2 mirrors,…sing dmeventd or progress polling.
[ OK ] Reached target Local File Systems (Pre).
Starting File System Check on /dev/mmcblk0p1...
Starting File System Check on /dev/mmcblk0p2...
[ OK ] Started File System Check on /dev/mmcblk0p1.
[ OK ] Started File System Check on /dev/mmcblk0p2.
[CRTC:67:crtc-2] vblank wait timed out
------------[ cut here ]------------
WARNING: CPU: 2 PID: 21 at drm_atomic_helper_wait_for_vblanks.part.7+0x248/0x278 [drm_kms_helper]
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
CPU: 2 PID: 21 Comm: kworker/2:0 Not tainted 4.14.5 #1
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
Hardware name: raspberrypi rpi/rpi, BIOS 2017.09 10/10/2017
Workqueue: events output_poll_execute [drm_kms_helper]
task: ffffffc03c85c600 task.stack: ffffff80088c0000
PC is at drm_atomic_helper_wait_for_vblanks.part.7+0x248/0x278 [drm_kms_helper]
LR is at drm_atomic_helper_wait_for_vblanks.part.7+0x248/0x278 [drm_kms_helper]
pc : [<ffffff80007423e8>] lr : [<ffffff80007423e8>] pstate: 40000145
sp : ffffff80088c3aa0
................ etc... etc...
So, I disabled this ( ‘Broadcom VC4 Graphics‘ ), and just used the framebuffer option.. The device will (obviously) be used ‘headless’, so this is not an issue..
It was a refreshing change to be able to use the x86-standard kernel compile/install commands, and to be able to use grub-customizer to handle boot options etc.. I set up the dtb link in the /boot directory to match the Fedora example..
I did find slightly confusing behaviour with the console options… I had (temporarily) modified grub.cfg to include the usual console=tty0 console=ttyS0,115200n8, 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..
I then discovered that – for some reason – the ports had changed, and now required console=tty1 console=ttyS1,115200n8. This worked OK for the Fedora-supplied kernels, but not for the self-compiled ones.. I then found that the uart/port selections in the kernel configs I was testing had been – deliberately – disabled, probably due to the fact that these console options cause performance degradation, because of design tradeoffs on the Pi3..
So, I modified the kernel config in the appropriate areas:
Select ‘Console on 8250/16550 serial port‘
Change ‘Maximum 8250/16550 and compatible serial ports‘ to ‘4‘
Change ‘Maximum 8250/16550 serial ports to register at runtime‘ to ‘4‘
After this, all was well:
[ 0.000349] console [tty1] enabled
[ 0.722248] 3f215040.serial: ttyS1 at MMIO 0x0 (irq = 61, base_baud = 31250000) is a 16550
[ 1.279189] console [ttyS1] enabled
Fedora 27 (Workstation Edition)
Kernel 4.14.5 on an aarch64 (ttyS1)
$ uname -a
Linux rgprint 4.14.5 #2 SMP PREEMPT Mon Dec 11 23:20:51 PST 2017 aarch64 aarch64 aarch64 GNU/Linux
I have put a copy of the kernel config at https://pastebin.com/thmebsn0
Robert Gadsdon. December 12, 2017.