Completely disabling messages on RS232.

Is there a way to completely disable all messages on the RS232 port (/dev/ttyS0)? I would like that, because I want to communicate with another device over this port and don’t want “garbage” to be received by this device.
From what I’ve gathered, there are three sources of messages on this port:

  • getty (launched via upstart)
  • kernel
  • bootloader

I’ve managed to disable getty on this port (by adding an override file in /etc/init) and also kernel messages by changing the kernel commandline.

However, I don’t know how to stop the bootloader from using that port on boot. Both fastboot and u-boot do this. Can this be somehow disabled on either of those?

The sources for U-Boot are provided as well as instructions about how to build it, so it should be possible to do for U-Boot. I don’t know any details about how exactly to do it though.