Raspberry Pi has UART interface on GPIO pins 14 and 15.
FreeBSD uses it as serial console.
It outputs system messages and provides terminal mode on it.
This is good for first time setup and for debugging.
But if you plan to use this interface for connection to any special device especially in a standalone project, you need to liberate this interface.
Here is a description how to do this.
Terminal mode
UART interface in the Raspberry Pi in the FreeBSD shown as /dev/ttyu0
First step is remove getty(8) from /dev/ttyu0
To do this we need just to change «on» to «off» for the ttyu0 in the file /etc/ttys:
After that we can use /dev/ttyu0 with different programms to communicate with our devices.
System messages
For liberation UART interface from system messages we need to change Device tree source file.
The device tree source (DTS) is a text file which describes hardware resources of a computer system in a human-readable form.
We need to commented out strings 377 and 378 in the file /usr/src/sys/boot/fdt/dts/arm/rpi.dts:
After changing this file we need to compile Device tree blob (DTB) file and to copy it in our boot environment.
To do that we need to run this commands:
# cd /usr/src/sys/tools/fdt
# setenv MACHINE arm
# ./make_dtb.sh /usr/src/sys /usr/src/sys/boot/fdt/dts/arm/rpi.dts rpi.dtb
# cp /boot/msdos/rpi.dtb /boot/msdos/rpidtb.old
# cp rpi.dtb /boot/msdos
New dtb file less than old one, but it works.
U-Boot messages
Unfortunately that’s not all.
We still have some messages from U-Boot on the UART interface:
I tried to change files /boot/msdos/config.txt, /boot/msdos/cmdline.txt and /boot/msdos/uenv.txt, but nothing helps.




Thanks for a very interesting blog. I have a question about GPIO and FreeBSD. I have bought a Pi and a GPS with PPS output. My understanding is that FreeBSD only takes PPS input on serial DCD pin (https://docs.freebsd.org/doc/8.0-RELEASE/usr/share/doc/ntp/pps.html). But since the Pi doesn’t have such a pin I would like to give the PPS somewhere else. Do you know how this could be done?
Hello. Good question.
As I see, to work with PPS people use regular COM port with PPS pin (http://www.satsignal.eu/ntp/FreeBSD-GPS-PPS.htm)
As you see, Pi doesn’t have such pin, it has only RX and TX.
Serial port in Pi described in the DTS file https://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/arm/rpi.dts?revision=290321&view=markup
May be it is possible to change it and add additional pin as a PPS pin, but I don’t know how at this time.
Thanks again for your blog. There is now a pps on gpio kernel module in FreeBSD. I write about it at my blog: https://framkant.org/2017/03/stratum-1-ntp-server-with-freebsd-on-raspberry-pi/
This is very interesting. Thank you for information.
Hi, its easy to recompile uboot and disable serial output completely. See my blog for the details
Hi! This is interesting, I will look into it.