core.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 <asm/hardware.h>
  11. #include <asm/page.h>
  12. #include <asm/mach/map.h>
  13. #include <asm/arch/hardware.h>
  14. /*
  15. * IRQ base register
  16. */
  17. #define IRQ_BASE (IO_BASE_2 + 0x1000)
  18. /*
  19. * Normal IRQ registers
  20. */
  21. #define IRQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x000))
  22. #define IRQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x004))
  23. #define IRQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x008))
  24. #define IRQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x00c))
  25. #define IRQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x010))
  26. #define IRQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x018))
  27. /*
  28. * Fast IRQ registers
  29. */
  30. #define FIQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x100))
  31. #define FIQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x104))
  32. #define FIQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x108))
  33. #define FIQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x10c))
  34. #define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))
  35. #define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118))
  36. static void l7200_mask_irq(unsigned int irq)
  37. {
  38. IRQ_ENABLECLEAR = 1 << irq;
  39. }
  40. static void l7200_unmask_irq(unsigned int irq)
  41. {
  42. IRQ_ENABLE = 1 << irq;
  43. }
  44. static void __init l7200_init_irq(void)
  45. {
  46. int irq;
  47. IRQ_ENABLECLEAR = 0xffffffff; /* clear all interrupt enables */
  48. FIQ_ENABLECLEAR = 0xffffffff; /* clear all fast interrupt enables */
  49. for (irq = 0; irq < NR_IRQS; irq++) {
  50. irq_desc[irq].valid = 1;
  51. irq_desc[irq].probe_ok = 1;
  52. irq_desc[irq].mask_ack = l7200_mask_irq;
  53. irq_desc[irq].mask = l7200_mask_irq;
  54. irq_desc[irq].unmask = l7200_unmask_irq;
  55. }
  56. init_FIQ();
  57. }
  58. static struct map_desc l7200_io_desc[] __initdata = {
  59. { IO_BASE, IO_START, IO_SIZE, MT_DEVICE },
  60. { IO_BASE_2, IO_START_2, IO_SIZE_2, MT_DEVICE },
  61. { AUX_BASE, AUX_START, AUX_SIZE, MT_DEVICE },
  62. { FLASH1_BASE, FLASH1_START, FLASH1_SIZE, MT_DEVICE },
  63. { FLASH2_BASE, FLASH2_START, FLASH2_SIZE, MT_DEVICE }
  64. };
  65. static void __init l7200_map_io(void)
  66. {
  67. iotable_init(l7200_io_desc, ARRAY_SIZE(l7200_io_desc));
  68. }
  69. MACHINE_START(L7200, "LinkUp Systems L7200")
  70. /* Maintainer: Steve Hill / Scott McConnell */
  71. .phys_ram = 0xf0000000,
  72. .phys_io = 0x80040000,
  73. .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc,
  74. .map_io = l7200_map_io,
  75. .init_irq = l7200_init_irq,
  76. MACHINE_END