board-secureedge5410.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C) 2002 David McCullough <davidm@snapgear.com>
  3. * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  4. *
  5. * Based on files with the following comments:
  6. *
  7. * Copyright (C) 2000 Kazumoto Kojima
  8. *
  9. * Modified for 7751 Solution Engine by
  10. * Ian da Silva and Jeremy Siegel, 2001.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/irq.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/timer.h>
  16. #include <linux/delay.h>
  17. #include <linux/sched.h>
  18. #include <asm/machvec.h>
  19. #include <mach/secureedge5410.h>
  20. #include <asm/irq.h>
  21. #include <asm/io.h>
  22. #include <cpu/timer.h>
  23. unsigned short secureedge5410_ioport;
  24. /*
  25. * EraseConfig handling functions
  26. */
  27. static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
  28. {
  29. printk("SnapGear: erase switch interrupt!\n");
  30. return IRQ_HANDLED;
  31. }
  32. static int __init eraseconfig_init(void)
  33. {
  34. unsigned int irq = evt2irq(0x240);
  35. printk("SnapGear: EraseConfig init\n");
  36. /* Setup "EraseConfig" switch on external IRQ 0 */
  37. if (request_irq(irq, eraseconfig_interrupt, 0, "Erase Config", NULL))
  38. printk("SnapGear: failed to register IRQ%d for Reset witch\n",
  39. irq);
  40. else
  41. printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
  42. irq);
  43. return 0;
  44. }
  45. device_initcall(eraseconfig_init);
  46. /*
  47. * Initialize IRQ setting
  48. *
  49. * IRL0 = erase switch
  50. * IRL1 = eth0
  51. * IRL2 = eth1
  52. * IRL3 = crypto
  53. */
  54. static void __init init_snapgear_IRQ(void)
  55. {
  56. printk("Setup SnapGear IRQ/IPR ...\n");
  57. /* enable individual interrupt mode for externals */
  58. plat_irq_setup_pins(IRQ_MODE_IRQ);
  59. }
  60. /*
  61. * The Machine Vector
  62. */
  63. static struct sh_machine_vector mv_snapgear __initmv = {
  64. .mv_name = "SnapGear SecureEdge5410",
  65. .mv_init_irq = init_snapgear_IRQ,
  66. };