The serial console is enabled by default on ARM for obvious reasons.
However, if you need the uart for other tasks, it is very complicated to disable the serial console when it is hardwired in more than one place.
I wish we could have something similar to Linux where you can just edit config.txt and cmdline.txt to achieve this.
This thread pretty much sums it up:
I am running into the same problem and made a tiny bit of progress on this.
echo 'hw.fdt.console="NO"' >> /boot/loader.conf.local
Will disable the serial console! uart0 aka /dev/cuau0 is now not used by the FreeBSD console. This of course still needs a u-boot compiled with nulldev for stdin, stdout, and stderr.
I came upon this undocumented (?) kernel tunable after a long search and someone mentioning on twitter to clear the fdt's /chosen/stdout-path entry.
Setting this tunable to a non existing device will also skip the hardcoded fallback. see /usr/src/sys/dev/uart/uart_cpu_fdt.c
This still results in a unusable /dev/cuau0 for me though I think it might be because 112500 buadrate is hardcoded in the PL011 driver. (Still looking into this.)
Hopefully this is of some use to someone.
I will try you tip, thank you.
The string 115200 (not 112500, probably a typo?) is found in many places in src and I think you may be right, for example
*(int*)data = 115200;
However, I think the uart will ajust to your preferred speed if you ask it to, at least ntpd manages to set it to 9600 but then in my case the serial console interferred with the output from the GPS and made the result just gibberish.
Yes, that was a typo. I think that ioctl just returns the 'current set baudrate' to always be 115200 regardless of what it actually is.
I looked at the PL011 code a bit more, although I'm not that good at reading C I think it gets the speed it runs at from the FDT. So some patching there to set it to the one required might be needed. My GPS runs at 9600 so that is a bit problematic :(
After a lot more tinkering and some help on twitter...
the PL011 UART driver does NOT allow setting of baudrate when running on aarch64 on raspberry pi's... probably all devices that boot via u-boot.
If you just need a fixed baudrate you can work around it by having u-boot set it. If you need to switch it while in use, you seem to be out of luck.
Add the following to /boot/msdos/config.txt
I will file a followup ticket.