ip22-hpc.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * ip22-hpc.c: Routines for generic manipulation of the HPC controllers.
  4. *
  5. * Copyright (C) 1996 David S. Miller ([email protected])
  6. * Copyright (C) 1998 Ralf Baechle
  7. */
  8. #include <linux/export.h>
  9. #include <linux/init.h>
  10. #include <linux/types.h>
  11. #include <asm/io.h>
  12. #include <asm/sgi/hpc3.h>
  13. #include <asm/sgi/ioc.h>
  14. #include <asm/sgi/ip22.h>
  15. struct hpc3_regs *hpc3c0, *hpc3c1;
  16. EXPORT_SYMBOL(hpc3c0);
  17. EXPORT_SYMBOL(hpc3c1);
  18. struct sgioc_regs *sgioc;
  19. EXPORT_SYMBOL(sgioc);
  20. /* We need software copies of these because they are write only. */
  21. u8 sgi_ioc_reset, sgi_ioc_write;
  22. extern char *system_type;
  23. void __init sgihpc_init(void)
  24. {
  25. /* ioremap can't fail */
  26. hpc3c0 = (struct hpc3_regs *)
  27. ioremap(HPC3_CHIP0_BASE, sizeof(struct hpc3_regs));
  28. hpc3c1 = (struct hpc3_regs *)
  29. ioremap(HPC3_CHIP1_BASE, sizeof(struct hpc3_regs));
  30. /* IOC lives in PBUS PIO channel 6 */
  31. sgioc = (struct sgioc_regs *)hpc3c0->pbus_extregs[6];
  32. hpc3c0->pbus_piocfg[6][0] |= HPC3_PIOCFG_DS16;
  33. if (ip22_is_fullhouse()) {
  34. /* Full House comes with INT2 which lives in PBUS PIO
  35. * channel 4 */
  36. sgint = (struct sgint_regs *)hpc3c0->pbus_extregs[4];
  37. system_type = "SGI Indigo2";
  38. } else {
  39. /* Guiness comes with INT3 which is part of IOC */
  40. sgint = &sgioc->int3;
  41. system_type = "SGI Indy";
  42. }
  43. sgi_ioc_reset = (SGIOC_RESET_PPORT | SGIOC_RESET_KBDMOUSE |
  44. SGIOC_RESET_EISA | SGIOC_RESET_ISDN |
  45. SGIOC_RESET_LC0OFF);
  46. sgi_ioc_write = (SGIOC_WRITE_EASEL | SGIOC_WRITE_NTHRESH |
  47. SGIOC_WRITE_TPSPEED | SGIOC_WRITE_EPSEL |
  48. SGIOC_WRITE_U0AMODE | SGIOC_WRITE_U1AMODE);
  49. sgioc->reset = sgi_ioc_reset;
  50. sgioc->write = sgi_ioc_write;
  51. }