]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Sep 2015 23:55:55 +0000 (16:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Sep 2015 23:55:55 +0000 (16:55 -0700)
Pull MIPS updates from Ralf Baechle:
 "This is the main pull request for 4.3 for MIPS.  Here's the summary:

  Three fixes that didn't make 4.2-stable:

   - a -Os build might compile the kernel using the MIPS16 instruction
     set but the R2 optimized inline functions in <uapi/asm/swab.h> are
     implemented using 32-bit wide instructions which is invalid.

   - a build error in pgtable-bits.h for a particular kernel
     configuration.

   - accessing registers of the CM GCR might have been compiled to use
     64 bit accesses but these registers are onl 32 bit wide.

  And also a few new bits:

   - move the ATH79 GPIO driver to drivers/gpio

   - the definition of IRQCHIP_DECLARE has moved to linux/irqchip.h,
     change ATH79 accordingly.

   - fix definition of pgprot_writecombine

   - add an implementation of dma_map_ops.mmap

   - fix alignment of quiet build output for vmlinuz link

   - BCM47xx: Use kmemdup rather than duplicating its implementation

   - Netlogic: Fix 0x0x prefixes of constants.

   - merge Bjorn Helgaas' series to remove most of the weak keywords
     from function declarations.

   - CP0 and CP1 registers are best considered treated as unsigned
     values to avoid large values from becoming negative values.

   - improve support for the MIPS GIC timer.

   - enable common clock framework for Malta and SEAD3.

   - a number of improvments and fixes to dump_tlb().

   - document the MIPS TLB dump functionality in Magic SysRq.

   - Cavium Octeon CN68XX improvments.

   - NetLogic improvments.

   - irq: Use access helper irq_data_get_affinity_mask.

   - handle MSA unaligned accesses.

   - a number of R6-related math-emu fixes.

   - support for I6400.

   - improvments to MSA support.

   - add uprobes support.

   - move from deprecated __initcall to arch_initcall.

   - remove finish_arch_switch().

   - IRQ cleanups by Thomas Gleixner.

   - migrate to new 'set-state' interface.

   - random small cleanups"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (148 commits)
  MIPS: UAPI: Fix unrecognized opcode WSBH/DSBH/DSHD when using MIPS16.
  MIPS: Fix alignment of quiet build output for vmlinuz link
  MIPS: math-emu: Remove unused handle_dsemul function declaration
  MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 RINT FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 SELNEZ FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 SELEQZ FPU instruction
  MIPS: math-emu: Add support for the CMP.condn.fmt R6 instruction
  MIPS: inst.h: Add new MIPS R6 FPU opcodes
  MIPS: Octeon: Fix management port MII address on Kontron S1901
  MIPS: BCM47xx: Use kmemdup rather than duplicating its implementation
  STAGING: Octeon: Use common helpers for determining interface and port
  MIPS: Octeon: Support interfaces 4 and 5
  MIPS: Octeon: Set up 1:1 mapping between CN68XX PKO queues and ports
  MIPS: Octeon: Initialize CN68XX PKO
  STAGING: Octeon: Support CN68XX style WQE
  ...

1  2 
arch/mips/Kconfig
arch/mips/ar7/platform.c
arch/mips/kernel/Makefile
drivers/clocksource/Kconfig
drivers/clocksource/mips-gic-timer.c
drivers/irqchip/irq-mips-gic.c
drivers/staging/octeon/ethernet-tx.c
drivers/staging/octeon/ethernet.c

diff --combined arch/mips/Kconfig
index 4ab9a794bbcd4cc5121ff6c6f8e2b062c75474ad,233d338c24b4a67a367128c2fb8afaec0c2e463f..752acca8de1fa9f6f73aaf1d218840c04cd1abc7
@@@ -1,8 -1,10 +1,10 @@@
  config MIPS
        bool
        default y
+       select ARCH_SUPPORTS_UPROBES
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
+       select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
        select HAVE_CONTEXT_TRACKING
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_IDE
@@@ -13,7 -15,6 +15,6 @@@
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_BPF_JIT if !CPU_MICROMIPS
-       select ARCH_HAVE_CUSTOM_GPIO_H
        select HAVE_FUNCTION_TRACER
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD
@@@ -118,7 -119,6 +119,7 @@@ config ATH2
  
  config ATH79
        bool "Atheros AR71XX/AR724X/AR913X based boards"
 +      select ARCH_HAS_RESET_CONTROLLER
        select ARCH_REQUIRE_GPIOLIB
        select BOOT_RAW
        select CEVT_R4K
@@@ -409,6 -409,7 +410,7 @@@ config MIPS_MALT
        select CEVT_R4K
        select CSRC_R4K
        select CLKSRC_MIPS_GIC
+       select COMMON_CLK
        select DMA_MAYBE_COHERENT
        select GENERIC_ISA_DMA
        select HAVE_PCSPKR_PLATFORM
@@@ -459,6 -460,7 +461,7 @@@ config MIPS_SEAD
        select CEVT_R4K
        select CSRC_R4K
        select CLKSRC_MIPS_GIC
+       select COMMON_CLK
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
        select DMA_NONCOHERENT
@@@ -899,6 -901,7 +902,7 @@@ config NLM_XLP_BOAR
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_64BIT_KERNEL
        select ARCH_PHYS_ADDR_T_64BIT
+       select ARCH_REQUIRE_GPIOLIB
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
@@@ -948,6 -951,7 +952,7 @@@ source "arch/mips/jazz/Kconfig
  source "arch/mips/jz4740/Kconfig"
  source "arch/mips/lantiq/Kconfig"
  source "arch/mips/lasat/Kconfig"
+ source "arch/mips/pistachio/Kconfig"
  source "arch/mips/pmcs-msp71xx/Kconfig"
  source "arch/mips/ralink/Kconfig"
  source "arch/mips/sgi-ip27/Kconfig"
@@@ -1041,6 -1045,9 +1046,9 @@@ config FW_CF
  config ARCH_DMA_ADDR_T_64BIT
        def_bool (HIGHMEM && ARCH_PHYS_ADDR_T_64BIT) || 64BIT
  
+ config ARCH_SUPPORTS_UPROBES
+       bool
  config DMA_MAYBE_COHERENT
        select DMA_NONCOHERENT
        bool
@@@ -1071,6 -1078,10 +1079,6 @@@ config HOTPLUG_CP
  config SYS_SUPPORTS_HOTPLUG_CPU
        bool
  
 -config I8259
 -      bool
 -      select IRQ_DOMAIN
 -
  config MIPS_BONITO64
        bool
  
@@@ -1364,7 -1375,7 +1372,7 @@@ config CPU_MIPS32_R
          otherwise CPU_MIPS32_R1 is a safe bet for any MIPS32 system.
  
  config CPU_MIPS32_R6
-       bool "MIPS32 Release 6 (EXPERIMENTAL)"
+       bool "MIPS32 Release 6"
        depends on SYS_HAS_CPU_MIPS32_R6
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
@@@ -1415,7 -1426,7 +1423,7 @@@ config CPU_MIPS64_R
          otherwise CPU_MIPS64_R1 is a safe bet for any MIPS64 system.
  
  config CPU_MIPS64_R6
-       bool "MIPS64 Release 6 (EXPERIMENTAL)"
+       bool "MIPS64 Release 6"
        depends on SYS_HAS_CPU_MIPS64_R6
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
@@@ -1965,6 -1976,7 +1973,7 @@@ config 32BI
        select TRAD_SIGNALS
        help
          Select this option if you want to build a 32-bit kernel.
  config 64BIT
        bool "64-bit kernel"
        depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
@@@ -2110,7 -2122,7 +2119,7 @@@ config CPU_R4K_CACHE_TL
  
  config MIPS_MT_SMP
        bool "MIPS MT SMP support (1 TC on each available VPE)"
-       depends on SYS_SUPPORTS_MULTITHREADING
+       depends on SYS_SUPPORTS_MULTITHREADING && !CPU_MIPSR6
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
        select SYNC_R4K
@@@ -2211,7 -2223,7 +2220,7 @@@ config MIPS_VPE_APSP_API_M
  
  config MIPS_CMP
        bool "MIPS CMP framework support (DEPRECATED)"
-       depends on SYS_SUPPORTS_MIPS_CMP
+       depends on SYS_SUPPORTS_MIPS_CMP && !CPU_MIPSR6
        select MIPS_GIC_IPI
        select SMP
        select SYNC_R4K
  
  config MIPS_CPS
        bool "MIPS Coherent Processing System support"
-       depends on SYS_SUPPORTS_MIPS_CPS
+       depends on SYS_SUPPORTS_MIPS_CPS && !CPU_MIPSR6
        select MIPS_CM
        select MIPS_CPC
        select MIPS_CPS_PM if HOTPLUG_CPU
@@@ -2303,7 -2315,7 +2312,7 @@@ config CPU_MICROMIP
  endchoice
  
  config CPU_HAS_MSA
-       bool "Support for the MIPS SIMD Architecture (EXPERIMENTAL)"
+       bool "Support for the MIPS SIMD Architecture"
        depends on CPU_SUPPORTS_MSA
        depends on 64BIT || MIPS_O32_FP64_SUPPORT
        help
@@@ -2643,7 -2655,7 +2652,7 @@@ config SECCOM
          If unsure, say Y. Only embedded should say N here.
  
  config MIPS_O32_FP64_SUPPORT
-       bool "Support for O32 binaries using 64-bit FP (EXPERIMENTAL)"
+       bool "Support for O32 binaries using 64-bit FP"
        depends on 32BIT || MIPS32_O32
        help
          When this is enabled, the kernel will support use of 64-bit floating
diff --combined arch/mips/ar7/platform.c
index 298b97715d5fe1844ecbb99d3f2a5c4b8c0998e8,462a252ea6e62364cbc276a80b5d5463abb64581..58fca9ad5fcc1650b432afb57743c3476b6b50e1
@@@ -39,7 -39,6 +39,6 @@@
  
  #include <asm/addrspace.h>
  #include <asm/mach-ar7/ar7.h>
- #include <asm/mach-ar7/gpio.h>
  #include <asm/mach-ar7/prom.h>
  
  /*****************************************************************************
@@@ -679,8 -678,7 +678,8 @@@ static int __init ar7_register_devices(
        }
  
        if (ar7_has_high_cpmac()) {
 -              res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
 +              res = fixed_phy_add(PHY_POLL, cpmac_high.id,
 +                                  &fixed_phy_status, -1);
                if (!res) {
                        cpmac_get_mac(1, cpmac_high_data.dev_addr);
  
        } else
                cpmac_low_data.phy_mask = 0xffffffff;
  
 -      res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
 +      res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status, -1);
        if (!res) {
                cpmac_get_mac(0, cpmac_low_data.dev_addr);
                res = platform_device_register(&cpmac_low);
index 3156c8d253c1c03d70958137d44d3e41cdd26d83,a61435b1ceb122e446016c4f2250f24b802bfb30..d982be1ea1c3f3125da9762f3e1b203ae939b1d0
@@@ -61,6 -61,7 +61,6 @@@ obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx
  obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx-cmp.o
  obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o
  
 -obj-$(CONFIG_I8259)           += i8259.o
  obj-$(CONFIG_IRQ_CPU_RM7K)    += irq-rm7000.o
  obj-$(CONFIG_MIPS_MSC)                += irq-msc01.o
  obj-$(CONFIG_IRQ_TXX9)                += irq_txx9.o
@@@ -99,6 -100,7 +99,7 @@@ obj-$(CONFIG_PERF_EVENTS)    += perf_event
  obj-$(CONFIG_HW_PERF_EVENTS)  += perf_event_mipsxx.o
  
  obj-$(CONFIG_JUMP_LABEL)      += jump_label.o
+ obj-$(CONFIG_UPROBES)         += uprobes.o
  
  obj-$(CONFIG_MIPS_CM)         += mips-cm.o
  obj-$(CONFIG_MIPS_CPC)                += mips-cpc.o
index c03f04d82c6a42788fa1a4e5f2efd30080b33718,74e002e80fd3c91919ec60f0cb37882befad5005..552c9b134cc52adaf52da0ce08e3575b2ec1b1c4
@@@ -111,6 -111,10 +111,10 @@@ config CLKSRC_LPC32X
        select CLKSRC_MMIO
        select CLKSRC_OF
  
+ config CLKSRC_PISTACHIO
+       bool
+       select CLKSRC_OF
  config CLKSRC_STM32
        bool "Clocksource for STM32 SoCs" if !ARCH_STM32
        depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST)
@@@ -277,7 -281,7 +281,7 @@@ config CLKSRC_MIPS_GI
  
  config CLKSRC_PXA
        def_bool y if ARCH_PXA || ARCH_SA1100
 -      select CLKSRC_OF if USE_OF
 +      select CLKSRC_OF if OF
        help
          This enables OST0 support available on PXA and SA-11x0
          platforms.
index c3810b61c815f7cd846fecb2ade2575cdc02a099,a155bec06d18a713c89e3745013b40f4ee3aca1d..02a1945e5093f7c3c9efa83ee1af822ecc2b127d
@@@ -33,6 -33,12 +33,6 @@@ static int gic_next_event(unsigned lon
        return res;
  }
  
 -static void gic_set_clock_mode(enum clock_event_mode mode,
 -                              struct clock_event_device *evt)
 -{
 -      /* Nothing to do ...  */
 -}
 -
  static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
  {
        struct clock_event_device *cd = dev_id;
@@@ -61,6 -67,7 +61,6 @@@ static void gic_clockevent_cpu_init(str
        cd->irq                 = gic_timer_irq;
        cd->cpumask             = cpumask_of(cpu);
        cd->set_next_event      = gic_next_event;
 -      cd->set_mode            = gic_set_clock_mode;
  
        clockevents_config_and_register(cd, gic_frequency, 0x300, 0x7fffffff);
  
@@@ -72,6 -79,13 +72,13 @@@ static void gic_clockevent_cpu_exit(str
        disable_percpu_irq(gic_timer_irq);
  }
  
+ static void gic_update_frequency(void *data)
+ {
+       unsigned long rate = (unsigned long)data;
+       clockevents_update_freq(this_cpu_ptr(&gic_clockevent_device), rate);
+ }
  static int gic_cpu_notifier(struct notifier_block *nb, unsigned long action,
                                void *data)
  {
        return NOTIFY_OK;
  }
  
+ static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
+                           void *data)
+ {
+       struct clk_notifier_data *cnd = data;
+       if (action == POST_RATE_CHANGE)
+               on_each_cpu(gic_update_frequency, (void *)cnd->new_rate, 1);
+       return NOTIFY_OK;
+ }
  static struct notifier_block gic_cpu_nb = {
        .notifier_call = gic_cpu_notifier,
  };
  
+ static struct notifier_block gic_clk_nb = {
+       .notifier_call = gic_clk_notifier,
+ };
  static int gic_clockevent_init(void)
  {
+       int ret;
        if (!cpu_has_counter || !gic_frequency)
                return -ENXIO;
  
-       setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
+       ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
+       if (ret < 0)
+               return ret;
  
-       register_cpu_notifier(&gic_cpu_nb);
+       ret = register_cpu_notifier(&gic_cpu_nb);
+       if (ret < 0)
+               pr_warn("GIC: Unable to register CPU notifier\n");
  
        gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
  
@@@ -118,18 -154,17 +147,17 @@@ static struct clocksource gic_clocksour
  
  static void __init __gic_clocksource_init(void)
  {
+       int ret;
        /* Set clocksource mask. */
        gic_clocksource.mask = CLOCKSOURCE_MASK(gic_get_count_width());
  
        /* Calculate a somewhat reasonable rating value. */
        gic_clocksource.rating = 200 + gic_frequency / 10000000;
  
-       clocksource_register_hz(&gic_clocksource, gic_frequency);
-       gic_clockevent_init();
-       /* And finally start the counter */
-       gic_start_count();
+       ret = clocksource_register_hz(&gic_clocksource, gic_frequency);
+       if (ret < 0)
+               pr_warn("GIC: Unable to register clocksource\n");
  }
  
  void __init gic_clocksource_init(unsigned int frequency)
                GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_COMPARE);
  
        __gic_clocksource_init();
+       gic_clockevent_init();
+       /* And finally start the counter */
+       gic_start_count();
  }
  
  static void __init gic_clocksource_of_init(struct device_node *node)
  {
        struct clk *clk;
+       int ret;
  
        if (WARN_ON(!gic_present || !node->parent ||
                    !of_device_is_compatible(node->parent, "mti,gic")))
  
        clk = of_clk_get(node, 0);
        if (!IS_ERR(clk)) {
+               if (clk_prepare_enable(clk) < 0) {
+                       pr_err("GIC failed to enable clock\n");
+                       clk_put(clk);
+                       return;
+               }
                gic_frequency = clk_get_rate(clk);
-               clk_put(clk);
        } else if (of_property_read_u32(node, "clock-frequency",
                                        &gic_frequency)) {
                pr_err("GIC frequency not specified.\n");
        }
  
        __gic_clocksource_init();
+       ret = gic_clockevent_init();
+       if (!ret && !IS_ERR(clk)) {
+               if (clk_notifier_register(clk, &gic_clk_nb) < 0)
+                       pr_warn("GIC: Unable to register clock notifier\n");
+       }
+       /* And finally start the counter */
+       gic_start_count();
  }
  CLOCKSOURCE_OF_DECLARE(mips_gic_timer, "mti,gic-timer",
                       gic_clocksource_of_init);
index dae5914578834050751b3fe2283046add588ea09,7d4616963b5ae6bc7e4b578265f5cf0b7d243fbc..1764bcf8ee6bedc5619abec9f319b9ba5ca5f441
@@@ -11,7 -11,6 +11,7 @@@
  #include <linux/init.h>
  #include <linux/interrupt.h>
  #include <linux/irq.h>
 +#include <linux/irqchip.h>
  #include <linux/irqchip/mips-gic.h>
  #include <linux/of_address.h>
  #include <linux/sched.h>
@@@ -23,6 -22,8 +23,6 @@@
  
  #include <dt-bindings/interrupt-controller/mips-gic.h>
  
 -#include "irqchip.h"
 -
  unsigned int gic_present;
  
  struct gic_pcpu_mask {
@@@ -41,20 -42,46 +41,46 @@@ static struct irq_chip gic_level_irq_co
  
  static void __gic_irq_dispatch(void);
  
- static inline unsigned int gic_read(unsigned int reg)
+ static inline u32 gic_read32(unsigned int reg)
  {
        return __raw_readl(gic_base + reg);
  }
  
- static inline void gic_write(unsigned int reg, unsigned int val)
+ static inline u64 gic_read64(unsigned int reg)
  {
-       __raw_writel(val, gic_base + reg);
+       return __raw_readq(gic_base + reg);
  }
  
- static inline void gic_update_bits(unsigned int reg, unsigned int mask,
-                                  unsigned int val)
+ static inline unsigned long gic_read(unsigned int reg)
  {
-       unsigned int regval;
+       if (!mips_cm_is64)
+               return gic_read32(reg);
+       else
+               return gic_read64(reg);
+ }
+ static inline void gic_write32(unsigned int reg, u32 val)
+ {
+       return __raw_writel(val, gic_base + reg);
+ }
+ static inline void gic_write64(unsigned int reg, u64 val)
+ {
+       return __raw_writeq(val, gic_base + reg);
+ }
+ static inline void gic_write(unsigned int reg, unsigned long val)
+ {
+       if (!mips_cm_is64)
+               return gic_write32(reg, (u32)val);
+       else
+               return gic_write64(reg, (u64)val);
+ }
+ static inline void gic_update_bits(unsigned int reg, unsigned long mask,
+                                  unsigned long val)
+ {
+       unsigned long regval;
  
        regval = gic_read(reg);
        regval &= ~mask;
  static inline void gic_reset_mask(unsigned int intr)
  {
        gic_write(GIC_REG(SHARED, GIC_SH_RMASK) + GIC_INTR_OFS(intr),
-                 1 << GIC_INTR_BIT(intr));
+                 1ul << GIC_INTR_BIT(intr));
  }
  
  static inline void gic_set_mask(unsigned int intr)
  {
        gic_write(GIC_REG(SHARED, GIC_SH_SMASK) + GIC_INTR_OFS(intr),
-                 1 << GIC_INTR_BIT(intr));
+                 1ul << GIC_INTR_BIT(intr));
  }
  
  static inline void gic_set_polarity(unsigned int intr, unsigned int pol)
  {
        gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_POLARITY) +
-                       GIC_INTR_OFS(intr), 1 << GIC_INTR_BIT(intr),
-                       pol << GIC_INTR_BIT(intr));
+                       GIC_INTR_OFS(intr), 1ul << GIC_INTR_BIT(intr),
+                       (unsigned long)pol << GIC_INTR_BIT(intr));
  }
  
  static inline void gic_set_trigger(unsigned int intr, unsigned int trig)
  {
        gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_TRIGGER) +
-                       GIC_INTR_OFS(intr), 1 << GIC_INTR_BIT(intr),
-                       trig << GIC_INTR_BIT(intr));
+                       GIC_INTR_OFS(intr), 1ul << GIC_INTR_BIT(intr),
+                       (unsigned long)trig << GIC_INTR_BIT(intr));
  }
  
  static inline void gic_set_dual_edge(unsigned int intr, unsigned int dual)
  {
        gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_DUAL) + GIC_INTR_OFS(intr),
-                       1 << GIC_INTR_BIT(intr),
-                       dual << GIC_INTR_BIT(intr));
+                       1ul << GIC_INTR_BIT(intr),
+                       (unsigned long)dual << GIC_INTR_BIT(intr));
  }
  
  static inline void gic_map_to_pin(unsigned int intr, unsigned int pin)
  {
-       gic_write(GIC_REG(SHARED, GIC_SH_INTR_MAP_TO_PIN_BASE) +
-                 GIC_SH_MAP_TO_PIN(intr), GIC_MAP_TO_PIN_MSK | pin);
+       gic_write32(GIC_REG(SHARED, GIC_SH_INTR_MAP_TO_PIN_BASE) +
+                   GIC_SH_MAP_TO_PIN(intr), GIC_MAP_TO_PIN_MSK | pin);
  }
  
  static inline void gic_map_to_vpe(unsigned int intr, unsigned int vpe)
@@@ -113,10 -140,13 +139,13 @@@ cycle_t gic_read_count(void
  {
        unsigned int hi, hi2, lo;
  
+       if (mips_cm_is64)
+               return (cycle_t)gic_read(GIC_REG(SHARED, GIC_SH_COUNTER));
        do {
-               hi = gic_read(GIC_REG(SHARED, GIC_SH_COUNTER_63_32));
-               lo = gic_read(GIC_REG(SHARED, GIC_SH_COUNTER_31_00));
-               hi2 = gic_read(GIC_REG(SHARED, GIC_SH_COUNTER_63_32));
+               hi = gic_read32(GIC_REG(SHARED, GIC_SH_COUNTER_63_32));
+               lo = gic_read32(GIC_REG(SHARED, GIC_SH_COUNTER_31_00));
+               hi2 = gic_read32(GIC_REG(SHARED, GIC_SH_COUNTER_63_32));
        } while (hi2 != hi);
  
        return (((cycle_t) hi) << 32) + lo;
@@@ -135,10 -165,14 +164,14 @@@ unsigned int gic_get_count_width(void
  
  void gic_write_compare(cycle_t cnt)
  {
-       gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI),
-                               (int)(cnt >> 32));
-       gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO),
-                               (int)(cnt & 0xffffffff));
+       if (mips_cm_is64) {
+               gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE), cnt);
+       } else {
+               gic_write32(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI),
+                                       (int)(cnt >> 32));
+               gic_write32(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO),
+                                       (int)(cnt & 0xffffffff));
+       }
  }
  
  void gic_write_cpu_compare(cycle_t cnt, int cpu)
        local_irq_save(flags);
  
        gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), cpu);
-       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_HI),
-                               (int)(cnt >> 32));
-       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_LO),
-                               (int)(cnt & 0xffffffff));
+       if (mips_cm_is64) {
+               gic_write(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE), cnt);
+       } else {
+               gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_HI),
+                                       (int)(cnt >> 32));
+               gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_LO),
+                                       (int)(cnt & 0xffffffff));
+       }
  
        local_irq_restore(flags);
  }
@@@ -160,8 -199,11 +198,11 @@@ cycle_t gic_read_compare(void
  {
        unsigned int hi, lo;
  
-       hi = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI));
-       lo = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO));
+       if (mips_cm_is64)
+               return (cycle_t)gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE));
+       hi = gic_read32(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI));
+       lo = gic_read32(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO));
  
        return (((cycle_t) hi) << 32) + lo;
  }
@@@ -196,7 -238,7 +237,7 @@@ static bool gic_local_irq_is_routable(i
        if (cpu_has_veic)
                return true;
  
-       vpe_ctl = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_CTL));
+       vpe_ctl = gic_read32(GIC_REG(VPE_LOCAL, GIC_VPE_CTL));
        switch (intr) {
        case GIC_LOCAL_INT_TIMER:
                return vpe_ctl & GIC_VPE_CTL_TIMER_RTBL_MSK;
@@@ -262,7 -304,7 +303,7 @@@ int gic_get_c0_fdc_int(void
  
  static void gic_handle_shared_int(bool chained)
  {
-       unsigned int i, intr, virq;
+       unsigned int i, intr, virq, gic_reg_step = mips_cm_is64 ? 8 : 4;
        unsigned long *pcpu_mask;
        unsigned long pending_reg, intrmask_reg;
        DECLARE_BITMAP(pending, GIC_MAX_INTRS);
        for (i = 0; i < BITS_TO_LONGS(gic_shared_intrs); i++) {
                pending[i] = gic_read(pending_reg);
                intrmask[i] = gic_read(intrmask_reg);
-               pending_reg += 0x4;
-               intrmask_reg += 0x4;
+               pending_reg += gic_reg_step;
+               intrmask_reg += gic_reg_step;
        }
  
        bitmap_and(pending, pending, intrmask, gic_shared_intrs);
@@@ -357,12 -399,15 +398,12 @@@ static int gic_set_type(struct irq_dat
                break;
        }
  
 -      if (is_edge) {
 -              __irq_set_chip_handler_name_locked(d->irq,
 -                                                 &gic_edge_irq_controller,
 -                                                 handle_edge_irq, NULL);
 -      } else {
 -              __irq_set_chip_handler_name_locked(d->irq,
 -                                                 &gic_level_irq_controller,
 -                                                 handle_level_irq, NULL);
 -      }
 +      if (is_edge)
 +              irq_set_chip_handler_name_locked(d, &gic_edge_irq_controller,
 +                                               handle_edge_irq, NULL);
 +      else
 +              irq_set_chip_handler_name_locked(d, &gic_level_irq_controller,
 +                                               handle_level_irq, NULL);
        spin_unlock_irqrestore(&gic_lock, flags);
  
        return 0;
@@@ -392,7 -437,7 +433,7 @@@ static int gic_set_affinity(struct irq_
                clear_bit(irq, pcpu_masks[i].pcpu_mask);
        set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask);
  
 -      cpumask_copy(d->affinity, cpumask);
 +      cpumask_copy(irq_data_get_affinity_mask(d), cpumask);
        spin_unlock_irqrestore(&gic_lock, flags);
  
        return IRQ_SET_MASK_OK_NOCOPY;
@@@ -425,8 -470,8 +466,8 @@@ static void gic_handle_local_int(bool c
        unsigned long pending, masked;
        unsigned int intr, virq;
  
-       pending = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_PEND));
-       masked = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_MASK));
+       pending = gic_read32(GIC_REG(VPE_LOCAL, GIC_VPE_PEND));
+       masked = gic_read32(GIC_REG(VPE_LOCAL, GIC_VPE_MASK));
  
        bitmap_and(&pending, &pending, &masked, GIC_NUM_LOCAL_INTRS);
  
@@@ -449,14 -494,14 +490,14 @@@ static void gic_mask_local_irq(struct i
  {
        int intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
  
-       gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_RMASK), 1 << intr);
+       gic_write32(GIC_REG(VPE_LOCAL, GIC_VPE_RMASK), 1 << intr);
  }
  
  static void gic_unmask_local_irq(struct irq_data *d)
  {
        int intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
  
-       gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_SMASK), 1 << intr);
+       gic_write32(GIC_REG(VPE_LOCAL, GIC_VPE_SMASK), 1 << intr);
  }
  
  static struct irq_chip gic_local_irq_controller = {
@@@ -474,7 -519,7 +515,7 @@@ static void gic_mask_local_irq_all_vpes
        spin_lock_irqsave(&gic_lock, flags);
        for (i = 0; i < gic_vpes; i++) {
                gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), i);
-               gic_write(GIC_REG(VPE_OTHER, GIC_VPE_RMASK), 1 << intr);
+               gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_RMASK), 1 << intr);
        }
        spin_unlock_irqrestore(&gic_lock, flags);
  }
@@@ -488,7 -533,7 +529,7 @@@ static void gic_unmask_local_irq_all_vp
        spin_lock_irqsave(&gic_lock, flags);
        for (i = 0; i < gic_vpes; i++) {
                gic_write(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), i);
-               gic_write(GIC_REG(VPE_OTHER, GIC_VPE_SMASK), 1 << intr);
+               gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_SMASK), 1 << intr);
        }
        spin_unlock_irqrestore(&gic_lock, flags);
  }
@@@ -608,7 -653,7 +649,7 @@@ static void __init gic_basic_init(void
                for (j = 0; j < GIC_NUM_LOCAL_INTRS; j++) {
                        if (!gic_local_irq_is_routable(j))
                                continue;
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_RMASK), 1 << j);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_RMASK), 1 << j);
                }
        }
  }
@@@ -653,27 -698,32 +694,32 @@@ static int gic_local_irq_domain_map(str
  
                switch (intr) {
                case GIC_LOCAL_INT_WD:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_WD_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_WD_MAP), val);
                        break;
                case GIC_LOCAL_INT_COMPARE:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_MAP),
+                                   val);
                        break;
                case GIC_LOCAL_INT_TIMER:
                        /* CONFIG_MIPS_CMP workaround (see __gic_init) */
                        val = GIC_MAP_TO_PIN_MSK | timer_cpu_pin;
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_TIMER_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_TIMER_MAP),
+                                   val);
                        break;
                case GIC_LOCAL_INT_PERFCTR:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_PERFCTR_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_PERFCTR_MAP),
+                                   val);
                        break;
                case GIC_LOCAL_INT_SWINT0:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_SWINT0_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_SWINT0_MAP),
+                                   val);
                        break;
                case GIC_LOCAL_INT_SWINT1:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_SWINT1_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_SWINT1_MAP),
+                                   val);
                        break;
                case GIC_LOCAL_INT_FDC:
-                       gic_write(GIC_REG(VPE_OTHER, GIC_VPE_FDC_MAP), val);
+                       gic_write32(GIC_REG(VPE_OTHER, GIC_VPE_FDC_MAP), val);
                        break;
                default:
                        pr_err("Invalid local IRQ %d\n", intr);
@@@ -778,7 -828,7 +824,7 @@@ static void __init __gic_init(unsigned 
                 */
                if (IS_ENABLED(CONFIG_MIPS_CMP) &&
                    gic_local_irq_is_routable(GIC_LOCAL_INT_TIMER)) {
-                       timer_cpu_pin = gic_read(GIC_REG(VPE_LOCAL,
+                       timer_cpu_pin = gic_read32(GIC_REG(VPE_LOCAL,
                                                         GIC_VPE_TIMER_MAP)) &
                                        GIC_MAP_MSK;
                        irq_set_chained_handler(MIPS_CPU_IRQ_BASE +
index e2df041ca82d4e9f7c978c62f7ae9ea4a9c1bf8d,588354756c57e5e94608d2ffdc0cb61d76b20a9c..9e2116f4c9153827a288dfa8a5701d28cecc0b56
@@@ -396,12 -396,10 +396,12 @@@ dont_put_skbuff_in_hw
  
        /* Check if we can use the hardware checksumming */
        if ((skb->protocol == htons(ETH_P_IP)) &&
 -          (ip_hdr(skb)->version == 4) && (ip_hdr(skb)->ihl == 5) &&
 -          ((ip_hdr(skb)->frag_off == 0) || (ip_hdr(skb)->frag_off == htons(1 << 14)))
 -          && ((ip_hdr(skb)->protocol == IPPROTO_TCP)
 -              || (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
 +          (ip_hdr(skb)->version == 4) &&
 +          (ip_hdr(skb)->ihl == 5) &&
 +          ((ip_hdr(skb)->frag_off == 0) ||
 +           (ip_hdr(skb)->frag_off == htons(1 << 14))) &&
 +          ((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
 +           (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
                /* Use hardware checksum calc */
                pko_command.s.ipoffp1 = sizeof(struct ethhdr) + 1;
        }
@@@ -591,13 -589,14 +591,14 @@@ int cvm_oct_xmit_pow(struct sk_buff *sk
         * Fill in some of the work queue fields. We may need to add
         * more if the software at the other end needs them.
         */
-       work->hw_chksum = skb->csum;
-       work->len = skb->len;
-       work->ipprt = priv->port;
-       work->qos = priv->port & 0x7;
-       work->grp = pow_send_group;
-       work->tag_type = CVMX_HELPER_INPUT_TAG_TYPE;
-       work->tag = pow_send_group;     /* FIXME */
+       if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
+               work->word0.pip.cn38xx.hw_chksum = skb->csum;
+       work->word1.len = skb->len;
+       cvmx_wqe_set_port(work, priv->port);
+       cvmx_wqe_set_qos(work, priv->port & 0x7);
+       cvmx_wqe_set_grp(work, pow_send_group);
+       work->word1.tag_type = CVMX_HELPER_INPUT_TAG_TYPE;
+       work->word1.tag = pow_send_group;       /* FIXME */
        /* Default to zero. Sets of zero later are commented out */
        work->word2.u64 = 0;
        work->word2.s.bufs = 1;
        }
  
        /* Submit the packet to the POW */
-       cvmx_pow_work_submit(work, work->tag, work->tag_type, work->qos,
-                            work->grp);
+       cvmx_pow_work_submit(work, work->word1.tag, work->word1.tag_type,
+                            cvmx_wqe_get_qos(work), cvmx_wqe_get_grp(work));
        priv->stats.tx_packets++;
        priv->stats.tx_bytes += skb->len;
        dev_consume_skb_any(skb);
index 0718b35f7335758794d8e65b44796543f275da3c,fbde4191e717b972125092757656ca4b3899cce0..7274fda0b77b9f4f89939ff3f477d6b25a2a0244
@@@ -152,12 -152,11 +152,12 @@@ static void cvm_oct_configure_common_hw
                             num_packet_buffers);
        if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
                cvm_oct_mem_fill_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL,
-                                    CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128);
+                                    CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 1024);
  
  #ifdef __LITTLE_ENDIAN
        {
                union cvmx_ipd_ctl_status ipd_ctl_status;
 +
                ipd_ctl_status.u64 = cvmx_read_csr(CVMX_IPD_CTL_STATUS);
                ipd_ctl_status.s.pkt_lend = 1;
                ipd_ctl_status.s.wqe_lend = 1;
@@@ -860,7 -859,10 +860,10 @@@ static int cvm_oct_remove(struct platfo
        int port;
  
        /* Disable POW interrupt */
-       cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0);
+       if (OCTEON_IS_MODEL(OCTEON_CN68XX))
+               cvmx_write_csr(CVMX_SSO_WQ_INT_THRX(pow_receive_group), 0);
+       else
+               cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0);
  
        cvmx_ipd_disable();