ip27-console.c 898 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2001, 2002 Ralf Baechle
  7. */
  8. #include <asm/page.h>
  9. #include <asm/sn/addrs.h>
  10. #include <asm/sn/sn0/hub.h>
  11. #include <asm/sn/klconfig.h>
  12. #include <asm/sn/ioc3.h>
  13. #include <asm/sn/sn_private.h>
  14. #include <linux/serial.h>
  15. #include <linux/serial_core.h>
  16. #define IOC3_CLK (22000000 / 3)
  17. #define IOC3_FLAGS (0)
  18. static inline struct ioc3_uartregs *console_uart(void)
  19. {
  20. struct ioc3 *ioc3;
  21. nasid_t nasid;
  22. nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
  23. ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
  24. return &ioc3->sregs.uarta;
  25. }
  26. void prom_putchar(char c)
  27. {
  28. struct ioc3_uartregs *uart = console_uart();
  29. while ((uart->iu_lsr & 0x20) == 0);
  30. uart->iu_thr = c;
  31. }