ip27-console.c 933 B

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