ramips: add support for 6.1 kernel
[openwrt/openwrt.git] / target / linux / ramips / patches-6.1 / 320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch
index 0eb667641403f5b5b0450b31dcc9eb8e5df94f04..ef54835f89c2a3bcf7bf4192705a4800e6a0bca4 100644 (file)
@@ -31,7 +31,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
 
 --- a/arch/mips/include/asm/mips-cps.h
 +++ b/arch/mips/include/asm/mips-cps.h
-@@ -10,6 +10,8 @@
+@@ -11,6 +11,8 @@
  #include <linux/io.h>
  #include <linux/types.h>
  
@@ -40,7 +40,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  extern unsigned long __cps_access_bad_size(void)
        __compiletime_error("Bad size for CPS accessor");
  
-@@ -165,11 +167,30 @@ static inline uint64_t mips_cps_cluster_
+@@ -162,12 +164,31 @@ static inline uint64_t mips_cps_cluster_
   */
  static inline unsigned int mips_cps_numcores(unsigned int cluster)
  {
@@ -50,8 +50,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
                return 0;
  
        /* Add one before masking to handle 0xff indicating no cores */
--      return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
-+      ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
+-      return FIELD_GET(CM_GCR_CONFIG_PCORES,
++      ncores = FIELD_GET(CM_GCR_CONFIG_PCORES,
+                        mips_cps_cluster_config(cluster) + 1);
 +
 +      if (IS_ENABLED(CONFIG_SOC_MT7621)) {
 +              struct cpulaunch *launch;