core.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * linux/arch/arm/mm/mm-lusl7200.c
  3. *
  4. * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
  5. *
  6. * Extra MM routines for L7200 architecture
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/init.h>
  10. #include <linux/irq.h>
  11. #include <linux/device.h>
  12. #include <asm/types.h>
  13. #include <asm/irq.h>
  14. #include <asm/mach-types.h>
  15. #include <mach/hardware.h>
  16. #include <asm/page.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. #include <asm/mach/irq.h>
  20. /*
  21. * IRQ base register
  22. */
  23. #define IRQ_BASE (IO_BASE_2 + 0x1000)
  24. /*
  25. * Normal IRQ registers
  26. */
  27. #define IRQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x000))
  28. #define IRQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x004))
  29. #define IRQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x008))
  30. #define IRQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x00c))
  31. #define IRQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x010))
  32. #define IRQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x018))
  33. /*
  34. * Fast IRQ registers
  35. */
  36. #define FIQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x100))
  37. #define FIQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x104))
  38. #define FIQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x108))
  39. #define FIQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x10c))
  40. #define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))
  41. #define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118))
  42. static void l7200_mask_irq(unsigned int irq)
  43. {
  44. IRQ_ENABLECLEAR = 1 << irq;
  45. }
  46. static void l7200_unmask_irq(unsigned int irq)
  47. {
  48. IRQ_ENABLE = 1 << irq;
  49. }
  50. static struct irq_chip l7200_irq_chip = {
  51. .ack = l7200_mask_irq,
  52. .mask = l7200_mask_irq,
  53. .unmask = l7200_unmask_irq
  54. };
  55. static void __init l7200_init_irq(void)
  56. {
  57. int irq;
  58. IRQ_ENABLECLEAR = 0xffffffff; /* clear all interrupt enables */
  59. FIQ_ENABLECLEAR = 0xffffffff; /* clear all fast interrupt enables */
  60. for (irq = 0; irq < NR_IRQS; irq++) {
  61. set_irq_chip(irq, &l7200_irq_chip);
  62. set_irq_flags(irq, IRQF_VALID);
  63. set_irq_handler(irq, handle_level_irq);
  64. }
  65. init_FIQ();
  66. }
  67. static struct map_desc l7200_io_desc[] __initdata = {
  68. { IO_BASE, IO_START, IO_SIZE, MT_DEVICE },
  69. { IO_BASE_2, IO_START_2, IO_SIZE_2, MT_DEVICE },
  70. { AUX_BASE, AUX_START, AUX_SIZE, MT_DEVICE },
  71. { FLASH1_BASE, FLASH1_START, FLASH1_SIZE, MT_DEVICE },
  72. { FLASH2_BASE, FLASH2_START, FLASH2_SIZE, MT_DEVICE }
  73. };
  74. static void __init l7200_map_io(void)
  75. {
  76. iotable_init(l7200_io_desc, ARRAY_SIZE(l7200_io_desc));
  77. }
  78. MACHINE_START(L7200, "LinkUp Systems L7200")
  79. /* Maintainer: Steve Hill / Scott McConnell */
  80. .phys_io = 0x80040000,
  81. .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc,
  82. .map_io = l7200_map_io,
  83. .init_irq = l7200_init_irq,
  84. MACHINE_END