Pteridium

008-34Kc-MT-platform-specific-changes.patch

Nov 22nd, 2014
202
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: linux/arch/mips/kernel/irq_cpu.c
  2. ===================================================================
  3. --- linux.orig/arch/mips/kernel/irq_cpu.c   2010-04-02 04:29:14.000000000 +0530
  4. +++ linux/arch/mips/kernel/irq_cpu.c    2010-11-02 15:17:42.917480000 +0530
  5. @@ -69,8 +69,13 @@
  6.     unsigned int vpflags = dvpe();
  7.  
  8.     clear_c0_cause(0x100 << (irq - MIPS_CPU_IRQ_BASE));
  9. +#if !(defined(CONFIG_AR9) || defined(CONFIG_VR9))
  10.     evpe(vpflags);
  11. +#endif
  12.     unmask_mips_mt_irq(irq);
  13. +#if defined(CONFIG_AR9) || defined(CONFIG_VR9)
  14. +   evpe(vpflags);
  15. +#endif
  16.  
  17.     return 0;
  18.  }
  19. @@ -115,7 +120,13 @@
  20.             set_irq_chip_and_handler(i, &mips_mt_cpu_irq_controller,
  21.                          handle_percpu_irq);
  22.  
  23. +/* Avoid reinitialisation of the 6 hardware interrupts incase of AR9 and VR9 platfoms
  24. +   incase of Danube/ASE initialises 6 hw interrupt.
  25. +   Need to Check ??
  26. +*/
  27. +#if !(defined(CONFIG_AR9) || defined(CONFIG_VR9))
  28.     for (i = irq_base + 2; i < irq_base + 8; i++)
  29.         set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
  30.                      handle_percpu_irq);
  31. +#endif
  32.  }
  33. Index: linux/arch/mips/kernel/smtc.c
  34. ===================================================================
  35. --- linux.orig/arch/mips/kernel/smtc.c  2010-10-31 23:39:29.000000000 +0530
  36. +++ linux/arch/mips/kernel/smtc.c   2010-11-02 15:49:10.164401000 +0530
  37. @@ -503,10 +503,17 @@
  38.              * Clear ERL/EXL of VPEs other than 0
  39.              * and set restricted interrupt enable/mask.
  40.              */
  41. +
  42. +#if defined(CONFIG_AR9) || defined(CONFIG_VR9)  // Enable IE and IM bits for all the intr lines.
  43. +                        write_vpe_c0_status((read_vpe_c0_status()
  44. +                                & ~(ST0_BEV | ST0_ERL | ST0_EXL))
  45. +                                | (ST0_IM | ST0_IE));
  46. +#else
  47.             write_vpe_c0_status((read_vpe_c0_status()
  48.                 & ~(ST0_BEV | ST0_ERL | ST0_EXL | ST0_IM))
  49.                 | (STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP7
  50.                 | ST0_IE));
  51. +#endif
  52.             /*
  53.              * set config to be the same as vpe0,
  54.              *  particularly kseg0 coherency alg
  55. Index: linux/arch/mips/kernel/traps.c
  56. ===================================================================
  57. --- linux.orig/arch/mips/kernel/traps.c 2010-04-02 04:29:14.000000000 +0530
  58. +++ linux/arch/mips/kernel/traps.c  2010-11-02 15:51:40.786351000 +0530
  59. @@ -1237,7 +1237,11 @@
  60.     die("NMI", regs);
  61.  }
  62.  
  63. +#if defined(CONFIG_AR9) || defined(CONFIG_VR9)
  64. +#define VECTORSPACING 0x200     /* for EI/VI mode */
  65. +#else
  66.  #define VECTORSPACING 0x100    /* for EI/VI mode */
  67. +#endif
  68.  
  69.  unsigned long ebase;
  70.  unsigned long exception_handlers[32];
  71. Index: linux/include/linux/skbuff.h
  72. ===================================================================
  73. --- linux.orig/include/linux/skbuff.h   2010-10-31 23:39:18.000000000 +0530
  74. +++ linux/include/linux/skbuff.h    2010-11-02 15:55:08.272255000 +0530
  75. @@ -1389,8 +1389,12 @@
  76.   * and wireless, but only for new allocations
  77.   */
  78.  #ifndef NET_SKB_PAD
  79. +#if defined (CONFIG_AR9) || defined (CONFIG_VR9)
  80. +#define NET_SKB_PAD     64
  81. +#else
  82.  #define NET_SKB_PAD    32
  83.  #endif
  84. +#endif
  85.  
  86.  #ifndef NET_SKB_PAD_ALLOC
  87.  #define NET_SKB_PAD_ALLOC  64
  88. Index: linux/arch/mips/kernel/smp-mt.c
  89. ===================================================================
  90. --- linux.orig/arch/mips/kernel/smp-mt.c    2010-04-02 04:29:14.000000000 +0530
  91. +++ linux/arch/mips/kernel/smp-mt.c 2010-11-02 16:25:59.000389000 +0530
  92. @@ -157,9 +157,14 @@
  93.     if (gic_present)
  94.         change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
  95.                      STATUSF_IP6 | STATUSF_IP7);
  96. -   else
  97. +   else {
  98. +#if defined(CONFIG_AR9) || defined(CONFIG_VR9)
  99. +       set_c0_status(ST0_IM); //enable all the interrupt lines.
  100. +#else
  101.         change_c0_status(ST0_IM, STATUSF_IP0 | STATUSF_IP1 |
  102.                      STATUSF_IP6 | STATUSF_IP7);
  103. +#endif
  104. +   }
  105.  }
  106.  
  107.  static void __cpuinit vsmp_smp_finish(void)
  108. Index: linux/arch/mips/kernel/irq_cpu.c
  109. ===================================================================
  110. --- linux.orig/arch/mips/kernel/irq_cpu.c   2010-11-11 16:25:37.000000000 +0530
  111. +++ linux/arch/mips/kernel/irq_cpu.c    2010-11-11 17:42:06.568891000 +0530
  112. @@ -48,6 +48,7 @@
  113.     irq_disable_hazard();
  114.  }
  115.  
  116. +#if !(defined(CONFIG_AR9) || defined(CONFIG_VR9))
  117.  static struct irq_chip mips_cpu_irq_controller = {
  118.     .name       = "MIPS",
  119.     .ack        = mask_mips_irq,
  120. @@ -56,6 +57,7 @@
  121.     .unmask     = unmask_mips_irq,
  122.     .eoi        = unmask_mips_irq,
  123.  };
  124. +#endif
  125.  
  126.  /*
  127.   * Basically the same as above but taking care of all the MT stuff
  128. Index: linux/arch/mips/kernel/irq_cpu.c
  129. ===================================================================
  130. --- linux.orig/arch/mips/kernel/irq_cpu.c   2010-11-12 16:12:13.000000000 +0530
  131. +++ linux/arch/mips/kernel/irq_cpu.c    2010-11-12 16:26:35.972726000 +0530
  132. @@ -36,6 +36,10 @@
  133.  #include <asm/mipsmtregs.h>
  134.  #include <asm/system.h>
  135.  
  136. +#if defined(CONFIG_AR9) || defined(CONFIG_VR9)
  137. +#include <asm/ifx/irq.h>
  138. +#endif
  139. +
  140.  static inline void unmask_mips_irq(unsigned int irq)
  141.  {
  142.     set_c0_status(0x100 << (irq - MIPS_CPU_IRQ_BASE));
  143. Index: linux/arch/mips/kernel/vpe.c
  144. ===================================================================
  145. --- linux.orig/arch/mips/kernel/vpe.c   2010-11-12 16:12:13.000000000 +0530
  146. +++ linux/arch/mips/kernel/vpe.c    2010-11-12 16:28:31.506724000 +0530
  147. @@ -1874,9 +1874,10 @@
  148.  
  149.                 goto out_reenable;
  150.             }
  151. -
  152.             v->ntcs = hw_tcs - tclimit;
  153.  
  154. +           write_tc_c0_tcbind((read_tc_c0_tcbind() & ~TCBIND_CURVPE) | 1);
  155. +
  156.             /* add the tc to the list of this vpe's tc's. */
  157.             list_add(&t->tc, &v->tc);
RAW Paste Data