serial-sh7720.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include <linux/serial_sci.h>
  2. #include <linux/serial_core.h>
  3. #include <linux/io.h>
  4. #include <cpu/serial.h>
  5. static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag)
  6. {
  7. unsigned short data;
  8. if (cflag & CRTSCTS) {
  9. /* enable RTS/CTS */
  10. if (port->mapbase == 0xa4430000) { /* SCIF0 */
  11. /* Clear PTCR bit 9-2; enable all scif pins but sck */
  12. data = __raw_readw(PORT_PTCR);
  13. __raw_writew((data & 0xfc03), PORT_PTCR);
  14. } else if (port->mapbase == 0xa4438000) { /* SCIF1 */
  15. /* Clear PVCR bit 9-2 */
  16. data = __raw_readw(PORT_PVCR);
  17. __raw_writew((data & 0xfc03), PORT_PVCR);
  18. }
  19. } else {
  20. if (port->mapbase == 0xa4430000) { /* SCIF0 */
  21. /* Clear PTCR bit 5-2; enable only tx and rx */
  22. data = __raw_readw(PORT_PTCR);
  23. __raw_writew((data & 0xffc3), PORT_PTCR);
  24. } else if (port->mapbase == 0xa4438000) { /* SCIF1 */
  25. /* Clear PVCR bit 5-2 */
  26. data = __raw_readw(PORT_PVCR);
  27. __raw_writew((data & 0xffc3), PORT_PVCR);
  28. }
  29. }
  30. }
  31. struct plat_sci_port_ops sh7720_sci_port_ops = {
  32. .init_pins = sh7720_sci_init_pins,
  33. };