intctl-regs.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* MN10300 On-board interrupt controller registers
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_INTCTL_REGS_H
  12. #define _ASM_INTCTL_REGS_H
  13. #include <asm/cpu-regs.h>
  14. #ifdef __KERNEL__
  15. /*
  16. * Interrupt controller registers
  17. * - Registers 64-191 are at addresses offset from the main array
  18. */
  19. #define GxICR(X) \
  20. __SYSREG(0xd4000000 + (X) * 4 + \
  21. (((X) >= 64) && ((X) < 192)) * 0xf00, u16)
  22. #define GxICR_u8(X) \
  23. __SYSREG(0xd4000000 + (X) * 4 + \
  24. (((X) >= 64) && ((X) < 192)) * 0xf00, u8)
  25. #include <proc/intctl-regs.h>
  26. #define XIRQ_TRIGGER_LOWLEVEL 0
  27. #define XIRQ_TRIGGER_HILEVEL 1
  28. #define XIRQ_TRIGGER_NEGEDGE 2
  29. #define XIRQ_TRIGGER_POSEDGE 3
  30. /* non-maskable interrupt control */
  31. #define NMIIRQ 0
  32. #define NMICR GxICR(NMIIRQ) /* NMI control register */
  33. #define NMICR_NMIF 0x0001 /* NMI pin interrupt flag */
  34. #define NMICR_WDIF 0x0002 /* watchdog timer overflow flag */
  35. #define NMICR_ABUSERR 0x0008 /* async bus error flag */
  36. /* maskable interrupt control */
  37. #define GxICR_DETECT 0x0001 /* interrupt detect flag */
  38. #define GxICR_REQUEST 0x0010 /* interrupt request flag */
  39. #define GxICR_ENABLE 0x0100 /* interrupt enable flag */
  40. #define GxICR_LEVEL 0x7000 /* interrupt priority level */
  41. #define GxICR_LEVEL_0 0x0000 /* - level 0 */
  42. #define GxICR_LEVEL_1 0x1000 /* - level 1 */
  43. #define GxICR_LEVEL_2 0x2000 /* - level 2 */
  44. #define GxICR_LEVEL_3 0x3000 /* - level 3 */
  45. #define GxICR_LEVEL_4 0x4000 /* - level 4 */
  46. #define GxICR_LEVEL_5 0x5000 /* - level 5 */
  47. #define GxICR_LEVEL_6 0x6000 /* - level 6 */
  48. #define GxICR_LEVEL_SHIFT 12
  49. #define GxICR_NMI 0x8000 /* nmi request flag */
  50. #define NUM2GxICR_LEVEL(num) ((num) << GxICR_LEVEL_SHIFT)
  51. #ifndef __ASSEMBLY__
  52. extern void set_intr_level(int irq, u16 level);
  53. extern void mn10300_set_lateack_irq_type(int irq);
  54. #endif
  55. /* external interrupts */
  56. #define XIRQxICR(X) GxICR((X)) /* external interrupt control regs */
  57. #endif /* __KERNEL__ */
  58. #endif /* _ASM_INTCTL_REGS_H */