mtk-gic-extend.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2014 MediaTek Inc.
  3. * Author: Maoguang.Meng <maoguang.meng@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef __MTK_GIC_EXTEND_H
  15. #define __MTK_GIC_EXTEND_H
  16. #define MT_EDGE_SENSITIVE 0
  17. #define MT_LEVEL_SENSITIVE 1
  18. #define MT_POLARITY_LOW 0
  19. #define MT_POLARITY_HIGH 1
  20. enum {
  21. IRQ_MASK_HEADER = 0xF1F1F1F1,
  22. IRQ_MASK_FOOTER = 0xF2F2F2F2
  23. };
  24. struct mtk_irq_mask {
  25. unsigned int header; /* for error checking */
  26. __u32 mask0;
  27. __u32 mask1;
  28. __u32 mask2;
  29. __u32 mask3;
  30. __u32 mask4;
  31. __u32 mask5;
  32. __u32 mask6;
  33. __u32 mask7;
  34. __u32 mask8;
  35. __u32 mask9;
  36. __u32 mask10;
  37. __u32 mask11;
  38. __u32 mask12;
  39. unsigned int footer; /* for error checking */
  40. };
  41. void mt_irq_unmask_for_sleep(unsigned int irq);
  42. void mt_irq_mask_for_sleep(unsigned int irq);
  43. int mt_irq_mask_all(struct mtk_irq_mask *mask);
  44. int mt_irq_mask_restore(struct mtk_irq_mask *mask);
  45. void mt_irq_set_pending_for_sleep(unsigned int irq);
  46. extern void mt_irq_set_pending(unsigned int irq);
  47. extern unsigned int mt_irq_get_pending(unsigned int irq);
  48. void mt_gic_set_priority(unsigned int irq);
  49. /* set the priority mask to 0x10 for masking all irqs to this cpu */
  50. void gic_set_primask(void);
  51. /* restore the priority mask value */
  52. void gic_clear_primask(void);
  53. #endif