We have a need to dynamically disable a serial port, both for output and input. Our board is an AM3517EVM derivative, running Linux 2.6.37.
When the kernel boots, we read a strap on the board, and based on that strap, we must either allow the port to function, or not. We need this for security purposes, and we must eliminate all possibility of the port being used for any purpose. The port happens to be ttyS2 (used for the serial console).
It seems to me that the most secure, and likely the simplest, means of doing this is to patch a low level serial driver, perhaps right above where it deals with the uart. The patch would simply ignore an outgoing byte, and toss (or never read) any incoming bytes, based on our board strap.
But, so far I haven't found the right place for the patches. I would have thought the patches would go into either 8250.c, serial_core.c, or omap-serial.c, and maybe they do.
Can anyone point me to a solution for this?
Thanks,
Ron