setup.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * arch/sh/boards/shmin/setup.c
  3. *
  4. * Copyright (C) 2006 Takashi YOSHII
  5. *
  6. * SHMIN Support.
  7. */
  8. #include <linux/init.h>
  9. #include <linux/irq.h>
  10. #include <asm/machvec.h>
  11. #include <asm/shmin.h>
  12. #include <asm/clock.h>
  13. #include <asm/io.h>
  14. #define PFC_PHCR 0xa400010eUL
  15. #define INTC_ICR1 0xa4000010UL
  16. #define INTC_IPRC 0xa4000016UL
  17. static struct ipr_data ipr_irq_table[] = {
  18. { 32, 0, 0, 0 },
  19. { 33, 0, 4, 0 },
  20. { 34, 0, 8, 8 },
  21. { 35, 0, 12, 0 },
  22. };
  23. static unsigned long ipr_offsets[] = {
  24. INTC_IPRC,
  25. };
  26. static struct ipr_desc ipr_irq_desc = {
  27. .ipr_offsets = ipr_offsets,
  28. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  29. .ipr_data = ipr_irq_table,
  30. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  31. .chip = {
  32. .name = "IPR-shmin",
  33. },
  34. };
  35. static void __init init_shmin_irq(void)
  36. {
  37. ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ
  38. ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active.
  39. register_ipr_controller(&ipr_irq_desc);
  40. }
  41. static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
  42. {
  43. static int dummy;
  44. if ((port & ~0x1f) == SHMIN_NE_BASE)
  45. return (void __iomem *)(SHMIN_IO_BASE + port);
  46. dummy = 0;
  47. return &dummy;
  48. }
  49. static struct sh_machine_vector mv_shmin __initmv = {
  50. .mv_name = "SHMIN",
  51. .mv_init_irq = init_shmin_irq,
  52. .mv_ioport_map = shmin_ioport_map,
  53. };