step 1 - If You # out the line "::askconsole:/bin/ash --login" or similar (ttyS0/ttyATH0 might be included) in /etc/inittab, then You can use the port as input at default 115200 baud, but kernel messages like connected / disconnected wired devices and several other message and uboot/bootlog will still appear on it, so its not ideal as output.
step 2 - To remove kernel messages, You should play with conloglevel and kconloglevel in Luci>System>Logging - i dont remember, wich value makes it silent
step 3 - But uboot and bootlog will still appear on it, so You have to take care about it! And if You send any garbage character to serial port during uboot, then You might break the boot and enter to uboot or failsafe command line... To remove the bootlog, You should re-compile the whole openwrt with disabled kernel console options in kernel hacking menu and char devices menu too.
step 4 - Then only the uboot remains on every bootup > to disable it, You have to modify and recompile the uboot too - but its very risky due to You will have no failsafe option anymore, You need to desolder the flash and write it with external device to restore the system in a fatal case!
So the best solution would be to remove console and kernel messages from it (first 2 steps) and use an additional GPIO pin to control the external device:
- if its a uC, GPS or similar, then You can keep it in reset until the boot is ready and there is no more activity on serial port
- if its a different external device, then You can use a logical AND gate to filter every noise from output and input until bootup
You can use an SPI/I2C serial port expander or USB>serial adapter...