setup.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * arch/sh/boards/titan/setup.c - Setup for Titan
  3. *
  4. * Copyright (C) 2006 Jamie Lenehan
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/irq.h>
  12. #include <asm/titan.h>
  13. #include <asm/io.h>
  14. static struct ipr_data ipr_irq_table[] = {
  15. /* IRQ, IPR idx, shift, prio */
  16. { TITAN_IRQ_WAN, 3, 12, 8 }, /* eth0 (WAN) */
  17. { TITAN_IRQ_LAN, 3, 8, 8 }, /* eth1 (LAN) */
  18. { TITAN_IRQ_MPCIA, 3, 4, 8 }, /* mPCI A (top) */
  19. { TITAN_IRQ_USB, 3, 0, 8 }, /* mPCI B (bottom), USB */
  20. };
  21. static unsigned long ipr_offsets[] = { /* stolen from setup-sh7750.c */
  22. 0xffd00004UL, /* 0: IPRA */
  23. 0xffd00008UL, /* 1: IPRB */
  24. 0xffd0000cUL, /* 2: IPRC */
  25. 0xffd00010UL, /* 3: IPRD */
  26. };
  27. static struct ipr_desc ipr_irq_desc = {
  28. .ipr_offsets = ipr_offsets,
  29. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  30. .ipr_data = ipr_irq_table,
  31. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  32. .chip = {
  33. .name = "IPR-titan",
  34. },
  35. };
  36. static void __init init_titan_irq(void)
  37. {
  38. /* enable individual interrupt mode for externals */
  39. ipr_irq_enable_irlm();
  40. /* register ipr irqs */
  41. register_ipr_controller(&ipr_irq_desc);
  42. }
  43. static struct sh_machine_vector mv_titan __initmv = {
  44. .mv_name = "Titan",
  45. .mv_inb = titan_inb,
  46. .mv_inw = titan_inw,
  47. .mv_inl = titan_inl,
  48. .mv_outb = titan_outb,
  49. .mv_outw = titan_outw,
  50. .mv_outl = titan_outl,
  51. .mv_inb_p = titan_inb_p,
  52. .mv_inw_p = titan_inw,
  53. .mv_inl_p = titan_inl,
  54. .mv_outb_p = titan_outb_p,
  55. .mv_outw_p = titan_outw,
  56. .mv_outl_p = titan_outl,
  57. .mv_insl = titan_insl,
  58. .mv_outsl = titan_outsl,
  59. .mv_ioport_map = titan_ioport_map,
  60. .mv_init_irq = init_titan_irq,
  61. };