ip27-console.c 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <linux/init.h>
  9. #include <asm/page.h>
  10. #include <asm/semaphore.h>
  11. #include <asm/sn/addrs.h>
  12. #include <asm/sn/sn0/hub.h>
  13. #include <asm/sn/klconfig.h>
  14. #include <asm/sn/ioc3.h>
  15. #include <asm/sn/sn_private.h>
  16. #include <linux/serial.h>
  17. #include <linux/serial_core.h>
  18. #define IOC3_CLK (22000000 / 3)
  19. #define IOC3_FLAGS (0)
  20. static inline struct ioc3_uartregs *console_uart(void)
  21. {
  22. struct ioc3 *ioc3;
  23. nasid_t nasid;
  24. nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
  25. ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
  26. return &ioc3->sregs.uarta;
  27. }
  28. void __init prom_putchar(char c)
  29. {
  30. struct ioc3_uartregs *uart = console_uart();
  31. while ((uart->iu_lsr & 0x20) == 0);
  32. uart->iu_thr = c;
  33. }