Advertisement
Guest User

openwrt BB brcm6358 ext irqs 4, 5 fix

a guest
Feb 20th, 2016
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.38 KB | None | 0 0
  1. --- a/arch/mips/bcm63xx/irq.c
  2. +++ b/arch/mips/bcm63xx/irq.c
  3. @@ -30,6 +30,7 @@
  4.  static int is_ext_irq_cascaded;
  5.  static unsigned int ext_irq_count;
  6.  static unsigned int ext_irq_start, ext_irq_end;
  7. +static int ext_irqs[6];
  8.  static unsigned int ext_irq_cfg_reg1, ext_irq_cfg_reg2;
  9.  static void (*internal_irq_mask)(struct irq_data *d);
  10.  static void (*internal_irq_unmask)(struct irq_data *d, const struct cpumask *m);
  11. @@ -47,6 +48,9 @@
  12.     if (is_ext_irq_cascaded &&
  13.         intbit >= ext_irq_start && intbit <= ext_irq_end)
  14.         do_IRQ(intbit - ext_irq_start + IRQ_EXTERNAL_BASE);
  15. +   else if (BCMCPU_IS_6358() &&
  16. +       intbit >= ext_irqs[4] && intbit <= ext_irqs[5])
  17. +       do_IRQ(intbit - ext_irq_start + IRQ_EXTERNAL_BASE + 9);
  18.     else
  19.         do_IRQ(intbit + IRQ_INTERNAL_BASE);
  20.  }
  21. @@ -230,7 +234,9 @@
  22.     bcm_perf_writel(reg, regaddr);
  23.     spin_unlock_irqrestore(&epic_lock, flags);
  24.  
  25. -   if (is_ext_irq_cascaded)
  26. +   if (BCMCPU_IS_6358())
  27. +       internal_irq_mask(irq_get_irq_data(ext_irqs[irq]));
  28. +   else if (is_ext_irq_cascaded)
  29.         internal_irq_mask(irq_get_irq_data(irq + ext_irq_start));
  30.  }
  31.  
  32. @@ -252,7 +258,10 @@
  33.     bcm_perf_writel(reg, regaddr);
  34.     spin_unlock_irqrestore(&epic_lock, flags);
  35.  
  36. -   if (is_ext_irq_cascaded)
  37. +   if (BCMCPU_IS_6358())
  38. +       internal_irq_unmask(irq_get_irq_data(ext_irqs[irq]),
  39. +                   NULL);
  40. +   else if (is_ext_irq_cascaded)
  41.         internal_irq_unmask(irq_get_irq_data(irq + ext_irq_start),
  42.                     NULL);
  43.  }
  44. @@ -496,11 +505,18 @@
  45.         irq_stat_addr[1] += PERF_IRQSTAT_6358_REG(1);
  46.         irq_mask_addr[1] += PERF_IRQMASK_6358_REG(1);
  47.         irq_bits = 32;
  48. -       ext_irq_count = 4;
  49. +       ext_irq_count = 6;
  50.         is_ext_irq_cascaded = 1;
  51. +       ext_irqs[0] = BCM_6358_EXT_IRQ0 - IRQ_INTERNAL_BASE;
  52. +       ext_irqs[1] = BCM_6358_EXT_IRQ1 - IRQ_INTERNAL_BASE;
  53. +       ext_irqs[2] = BCM_6358_EXT_IRQ2 - IRQ_INTERNAL_BASE;
  54. +       ext_irqs[3] = BCM_6358_EXT_IRQ3 - IRQ_INTERNAL_BASE;
  55. +       ext_irqs[4] = BCM_6358_EXT_IRQ4 - IRQ_INTERNAL_BASE;
  56. +       ext_irqs[5] = BCM_6358_EXT_IRQ5 - IRQ_INTERNAL_BASE;
  57.         ext_irq_start = BCM_6358_EXT_IRQ0 - IRQ_INTERNAL_BASE;
  58.         ext_irq_end = BCM_6358_EXT_IRQ3 - IRQ_INTERNAL_BASE;
  59.         ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6358;
  60. +       ext_irq_cfg_reg2 = PERF_EXTIRQ_CFG_REG2_6358;
  61.         break;
  62.     case BCM6362_CPU_ID:
  63.         irq_stat_addr[0] += PERF_IRQSTAT_6362_REG(0);
  64. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  65. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  66. @@ -1138,7 +1138,8 @@
  67.  #define BCM_6358_EXT_IRQ1      (IRQ_INTERNAL_BASE + 26)
  68.  #define BCM_6358_EXT_IRQ2      (IRQ_INTERNAL_BASE + 27)
  69.  #define BCM_6358_EXT_IRQ3      (IRQ_INTERNAL_BASE + 28)
  70. -
  71. +#define BCM_6358_EXT_IRQ4      (IRQ_INTERNAL_BASE + 20)
  72. +#define BCM_6358_EXT_IRQ5      (IRQ_INTERNAL_BASE + 21)
  73.  /*
  74.   * 6362 irqs
  75.   */
  76. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
  77. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
  78. @@ -11,5 +11,7 @@
  79.  #define IRQ_EXT_1          (IRQ_EXTERNAL_BASE + 1)
  80.  #define IRQ_EXT_2          (IRQ_EXTERNAL_BASE + 2)
  81.  #define IRQ_EXT_3          (IRQ_EXTERNAL_BASE + 3)
  82. +#define IRQ_EXT_4          (IRQ_EXTERNAL_BASE + 4)
  83. +#define IRQ_EXT_5          (IRQ_EXTERNAL_BASE + 5)
  84.  
  85.  #endif /* ! BCM63XX_IRQ_H_ */
  86. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  87. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  88. @@ -346,6 +346,7 @@
  89.  #define PERF_EXTIRQ_CFG_REG_6368   0x18
  90.  #define PERF_EXTIRQ_CFG_REG_63268  0x18
  91.  
  92. +#define PERF_EXTIRQ_CFG_REG2_6358  0x1c
  93.  #define PERF_EXTIRQ_CFG_REG2_6368  0x1c
  94.  
  95.  /* for 6348 only */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement