ip22-hpc.c 1.6 KB

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