Merge tag 'mips_4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Nov 2017 19:36:08 +0000 (11:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Nov 2017 19:36:08 +0000 (11:36 -0800)
Pull MIPS updates from James Hogan:
 "These are the main MIPS changes for 4.15.

  Fixes:
   - ralink: Fix MT7620 PCI build issues (4.5)
   - Disable cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN for 32-bit SMP
     (4.1)
   - Fix MIPS64 FP save/restore on 32-bit kernels (4.0)
   - ptrace: Pick up ptrace/seccomp changed syscall numbers (3.19)
   - ralink: Fix MT7628 pinmux (3.19)
   - BCM47XX: Fix LED inversion on WRT54GSv1 (3.17)
   - Fix n32 core dumping as o32 since regset support (3.13)
   - ralink: Drop obsolete USB_ARCH_HAS_HCD select

  Build system:
   - Default to "generic" (multiplatform) system type instead of IP22
   - Use generic little endian MIPS32 r2 configuration as default
     defconfig instead of ip22_defconfig

  FPU emulation:
   - Fix exception generation for certain R6 FPU instructions

  SMP:
   - Allow __cpu_number_map to be larger than NR_CPUS for sparse CPU id
     spaces

  Miscellaneous:
   - Add iomem resource for kernel bss section for kexec/kdump
   - Atomics: Nudge writes on bit unlock
   - DT files: Standardise "ok" -> "okay"

  Minor cleanups:
   - Define virt_to_pfn()
   - Make thread_saved_pc static
   - Simplify 32-bit sign extension in __read_64bit_c0_split()
   - DMA: Use vma_pages() helper
   - FPU emulation: Replace unsigned with unsigned int
   - MM: Removed unused lastpfn
   - Alchemy: Make clk_ops const
   - Lasat: Use setup_timer() helper
   - ralink: Use BIT() in MT7620 PCI driver

  Platform support:

  BMIPS:
  - Enable HARDIRQS_SW_RESEND

  Broadcom BCM63XX:
  - Add clkdev lookup support
  - Update clk driver, UART driver, DTs to handle named refclk from DTs
  - Split apart various clocks to more closely match hardware
  - Add ethernet clocks

  Cavium Octeon:
  - Remove usage of cvmx_wait() in favour of __delay()

  ImgTec Pistachio:
  - DT: Drop deprecated dwmmc num-slots property

  Ingenic JZ4780:
  - Add NFS root to Ci20 defconfig
  - Add watchdog to Ci20 DT & defconfig, and allow building of watchdog
    driver with this SoC

  Generic (multiplatform):
  - Migrate xilfpga (MIPSfpga) platform to the generic platform

  Lantiq xway:
  - Fix ASC0/ASC1 clocks"

* tag 'mips_4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips: (46 commits)
  MIPS: Add iomem resource for kernel bss section.
  MIPS: cmpxchg64() and HAVE_VIRT_CPU_ACCOUNTING_GEN don't work for 32-bit SMP
  MIPS: BMIPS: Enable HARDIRQS_SW_RESEND
  MIPS: pci: Make use of the BIT() macro inside the mt7620 driver
  MIPS: pci: Remove KERN_WARN instance inside the mt7620 driver
  MIPS: pci: Remove duplicate define in mt7620 driver
  MIPS: ralink: Fix typo in mt7628 pinmux function
  MIPS: ralink: Fix MT7628 pinmux
  MIPS: Fix odd fp register warnings with MIPS64r2
  watchdog: jz4780: Allow selection of jz4740-wdt driver
  MIPS/ptrace: Update syscall nr on register changes
  MIPS/ptrace: Pick up ptrace/seccomp changed syscalls
  MIPS: Fix an n32 core file generation regset support regression
  MIPS: Fix MIPS64 FP save/restore on 32-bit kernels
  MIPS: page.h: Define virt_to_pfn()
  MIPS: Xilfpga: Switch to using generic defconfigs
  MIPS: generic: Add support for MIPSfpga
  MIPS: Set defconfig target to a generic system for 32r2el
  MIPS: Kconfig: Set default MIPS system type as generic
  MIPS: DTS: Remove num-slots from Pistachio SoC
  ...

72 files changed:
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
arch/mips/Kbuild.platforms
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/alchemy/common/clock.c
arch/mips/bcm47xx/leds.c
arch/mips/bcm63xx/clk.c
arch/mips/boot/dts/brcm/bcm3368.dtsi
arch/mips/boot/dts/brcm/bcm63268-comtrend-vr-3032u.dts
arch/mips/boot/dts/brcm/bcm63268.dtsi
arch/mips/boot/dts/brcm/bcm6328.dtsi
arch/mips/boot/dts/brcm/bcm6358-neufbox4-sercomm.dts
arch/mips/boot/dts/brcm/bcm6358.dtsi
arch/mips/boot/dts/brcm/bcm6362.dtsi
arch/mips/boot/dts/brcm/bcm6368.dtsi
arch/mips/boot/dts/img/pistachio.dtsi
arch/mips/boot/dts/ingenic/jz4780.dtsi
arch/mips/boot/dts/ralink/rt3052_eval.dts
arch/mips/boot/dts/xilfpga/Makefile
arch/mips/boot/dts/xilfpga/nexys4ddr.dts
arch/mips/cavium-octeon/executive/cvmx-helper.c
arch/mips/cavium-octeon/executive/cvmx-spi.c
arch/mips/configs/ci20_defconfig
arch/mips/configs/generic/board-xilfpga.config [new file with mode: 0644]
arch/mips/configs/ip22_defconfig
arch/mips/configs/xilfpga_defconfig [deleted file]
arch/mips/generic/Kconfig
arch/mips/generic/board-xilfpga.its.S [new file with mode: 0644]
arch/mips/include/asm/asmmacro.h
arch/mips/include/asm/bitops.h
arch/mips/include/asm/cmpxchg.h
arch/mips/include/asm/mipsregs.h
arch/mips/include/asm/octeon/cvmx-fpa.h
arch/mips/include/asm/octeon/cvmx.h
arch/mips/include/asm/page.h
arch/mips/include/asm/processor.h
arch/mips/include/asm/smp.h
arch/mips/include/asm/syscall.h
arch/mips/kernel/process.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace32.c
arch/mips/kernel/r4k_fpu.S
arch/mips/kernel/setup.c
arch/mips/kernel/smp.c
arch/mips/lantiq/xway/sysctrl.c
arch/mips/lasat/picvue_proc.c
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/dp_maddf.c
arch/mips/math-emu/dp_mul.c
arch/mips/math-emu/dp_sqrt.c
arch/mips/math-emu/ieee754.h
arch/mips/math-emu/ieee754int.h
arch/mips/math-emu/ieee754sp.c
arch/mips/math-emu/ieee754sp.h
arch/mips/math-emu/sp_div.c
arch/mips/math-emu/sp_fint.c
arch/mips/math-emu/sp_maddf.c
arch/mips/math-emu/sp_mul.c
arch/mips/mm/dma-default.c
arch/mips/mm/init.c
arch/mips/pci/pci-mt7620.c
arch/mips/pci/pcie-octeon.c
arch/mips/ralink/Kconfig
arch/mips/ralink/mt7620.c
arch/mips/xilfpga/Kconfig [deleted file]
arch/mips/xilfpga/Makefile [deleted file]
arch/mips/xilfpga/Platform [deleted file]
arch/mips/xilfpga/init.c [deleted file]
arch/mips/xilfpga/intc.c [deleted file]
arch/mips/xilfpga/time.c [deleted file]
drivers/tty/serial/bcm63xx_uart.c
drivers/watchdog/Kconfig

index 5c52e5e..8b2b046 100644 (file)
@@ -11,6 +11,11 @@ Required properties:
 - clocks: Clock driving the hardware; used to figure out the baud rate
   divisor.
 
+
+Optional properties:
+
+- clock-names: Should be "refclk".
+
 Example:
 
        uart0: serial@14e00520 {
@@ -19,6 +24,7 @@ Example:
                interrupt-parent = <&periph_intc>;
                interrupts = <2>;
                clocks = <&periph_clk>;
+               clock-names = "refclk";
        };
 
        clocks {
index f5f1bdb..ac7ad54 100644 (file)
@@ -34,7 +34,6 @@ platforms += sibyte
 platforms += sni
 platforms += txx9
 platforms += vr41xx
-platforms += xilfpga
 
 # include the platform specific files
 include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
index 5d3284d..350a990 100644 (file)
@@ -65,7 +65,7 @@ config MIPS
        select HAVE_PERF_EVENTS
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_SYSCALL_TRACEPOINTS
-       select HAVE_VIRT_CPU_ACCOUNTING_GEN
+       select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP
        select IRQ_FORCED_THREADING
        select MODULES_USE_ELF_RELA if MODULES && 64BIT
        select MODULES_USE_ELF_REL if MODULES
@@ -78,7 +78,7 @@ menu "Machine selection"
 
 choice
        prompt "System type"
-       default SGI_IP22
+       default MIPS_GENERIC
 
 config MIPS_GENERIC
        bool "Generic board-agnostic MIPS kernel"
@@ -233,6 +233,7 @@ config BMIPS_GENERIC
        select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
        select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
        select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+       select HARDIRQS_SW_RESEND
        help
          Build a generic DT-based kernel image that boots on select
          BCM33xx cable modem chips, BCM63xx DSL chips, and BCM7xxx set-top
@@ -276,6 +277,7 @@ config BCM63XX
        select GPIOLIB
        select HAVE_CLK
        select MIPS_L1_CACHE_SHIFT_4
+       select CLKDEV_LOOKUP
        help
         Support for BCM63XX based boards
 
@@ -468,29 +470,6 @@ config MACH_PISTACHIO
        help
          This enables support for the IMG Pistachio SoC platform.
 
-config MACH_XILFPGA
-       bool "MIPSfpga Xilinx based boards"
-       select BOOT_ELF32
-       select BOOT_RAW
-       select BUILTIN_DTB
-       select CEVT_R4K
-       select COMMON_CLK
-       select CSRC_R4K
-       select GPIOLIB
-       select IRQ_MIPS_CPU
-       select LIBFDT
-       select MIPS_CPU_SCACHE
-       select SYS_HAS_EARLY_PRINTK
-       select SYS_HAS_CPU_MIPS32_R2
-       select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_SUPPORTS_ZBOOT_UART16550
-       select USE_OF
-       select USE_GENERIC_EARLY_PRINTK_8250
-       select XILINX_INTC
-       help
-         This enables support for the IMG University Program MIPSfpga platform.
-
 config MIPS_MALTA
        bool "MIPS Malta board"
        select ARCH_MAY_HAVE_PC_FDC
@@ -916,7 +895,8 @@ config CAVIUM_OCTEON_SOC
        select USE_OF
        select ARCH_SPARSEMEM_ENABLE
        select SYS_SUPPORTS_SMP
-       select NR_CPUS_DEFAULT_16
+       select NR_CPUS_DEFAULT_64
+       select MIPS_NR_CPU_NR_MAP_1024
        select BUILTIN_DTB
        select MTD_COMPLEX_MAPPINGS
        select SYS_SUPPORTS_RELOCATABLE
@@ -1034,7 +1014,6 @@ source "arch/mips/loongson32/Kconfig"
 source "arch/mips/loongson64/Kconfig"
 source "arch/mips/netlogic/Kconfig"
 source "arch/mips/paravirt/Kconfig"
-source "arch/mips/xilfpga/Kconfig"
 
 endmenu
 
@@ -2726,6 +2705,15 @@ config NR_CPUS
 config MIPS_PERF_SHARED_TC_COUNTERS
        bool
 
+config MIPS_NR_CPU_NR_MAP_1024
+       bool
+
+config MIPS_NR_CPU_NR_MAP
+       int
+       depends on SMP
+       default 1024 if MIPS_NR_CPU_NR_MAP_1024
+       default NR_CPUS if !MIPS_NR_CPU_NR_MAP_1024
+
 #
 # Timer Interrupt Frequency Configuration
 #
index a96d97a..9f6a26d 100644 (file)
@@ -15,7 +15,7 @@
 archscripts: scripts_basic
        $(Q)$(MAKE) $(build)=arch/mips/boot/tools relocs
 
-KBUILD_DEFCONFIG := ip22_defconfig
+KBUILD_DEFCONFIG := 32r2el_defconfig
 
 #
 # Select the object file format to substitute into the linker script.
@@ -544,3 +544,7 @@ sead3_defconfig:
 .PHONY: sead3micro_defconfig
 sead3micro_defconfig:
        $(Q)$(MAKE) -f $(srctree)/Makefile micro32r2el_defconfig BOARDS=sead-3
+
+.PHONY: xilfpga_defconfig
+xilfpga_defconfig:
+       $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=xilfpga
index a83c7b7..6b6f685 100644 (file)
@@ -143,7 +143,7 @@ void __init alchemy_set_lpj(void)
        preset_lpj /= 2 * HZ;
 }
 
-static struct clk_ops alchemy_clkops_cpu = {
+static const struct clk_ops alchemy_clkops_cpu = {
        .recalc_rate    = alchemy_clk_cpu_recalc,
 };
 
@@ -224,7 +224,7 @@ static long alchemy_clk_aux_roundr(struct clk_hw *hw,
        return (*parent_rate) * mult;
 }
 
-static struct clk_ops alchemy_clkops_aux = {
+static const struct clk_ops alchemy_clkops_aux = {
        .recalc_rate    = alchemy_clk_aux_recalc,
        .set_rate       = alchemy_clk_aux_setr,
        .round_rate     = alchemy_clk_aux_roundr,
@@ -576,7 +576,7 @@ static int alchemy_clk_fgv1_detr(struct clk_hw *hw,
 }
 
 /* Au1000, Au1100, Au15x0, Au12x0 */
-static struct clk_ops alchemy_clkops_fgenv1 = {
+static const struct clk_ops alchemy_clkops_fgenv1 = {
        .recalc_rate    = alchemy_clk_fgv1_recalc,
        .determine_rate = alchemy_clk_fgv1_detr,
        .set_rate       = alchemy_clk_fgv1_setr,
@@ -717,7 +717,7 @@ static int alchemy_clk_fgv2_detr(struct clk_hw *hw,
 }
 
 /* Au1300 larger input mux, no separate disable bit, flexible divider */
-static struct clk_ops alchemy_clkops_fgenv2 = {
+static const struct clk_ops alchemy_clkops_fgenv2 = {
        .recalc_rate    = alchemy_clk_fgv2_recalc,
        .determine_rate = alchemy_clk_fgv2_detr,
        .set_rate       = alchemy_clk_fgv2_setr,
@@ -925,7 +925,7 @@ static int alchemy_clk_csrc_detr(struct clk_hw *hw,
        return alchemy_clk_fgcs_detr(hw, req, scale, 4);
 }
 
-static struct clk_ops alchemy_clkops_csrc = {
+static const struct clk_ops alchemy_clkops_csrc = {
        .recalc_rate    = alchemy_clk_csrc_recalc,
        .determine_rate = alchemy_clk_csrc_detr,
        .set_rate       = alchemy_clk_csrc_setr,
index d4f2407..8307a8a 100644 (file)
@@ -331,7 +331,7 @@ bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = {
 /* Verified on: WRT54GS V1.0 */
 static const struct gpio_led
 bcm47xx_leds_linksys_wrt54g_type_0101[] __initconst = {
-       BCM47XX_GPIO_LED(0, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED(0, "green", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
        BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
        BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
 };
index 19577f7..1641159 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/mutex.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/clkdev.h>
 #include <linux/delay.h>
 #include <bcm63xx_cpu.h>
 #include <bcm63xx_io.h>
@@ -120,22 +121,57 @@ static struct clk clk_ephy = {
        .set    = ephy_set,
 };
 
+/*
+ * Ethernet switch SAR clock
+ */
+static void swpkt_sar_set(struct clk *clk, int enable)
+{
+       if (BCMCPU_IS_6368())
+               bcm_hwclock_set(CKCTL_6368_SWPKT_SAR_EN, enable);
+       else
+               return;
+}
+
+static struct clk clk_swpkt_sar = {
+       .set    = swpkt_sar_set,
+};
+
+/*
+ * Ethernet switch USB clock
+ */
+static void swpkt_usb_set(struct clk *clk, int enable)
+{
+       if (BCMCPU_IS_6368())
+               bcm_hwclock_set(CKCTL_6368_SWPKT_USB_EN, enable);
+       else
+               return;
+}
+
+static struct clk clk_swpkt_usb = {
+       .set    = swpkt_usb_set,
+};
+
 /*
  * Ethernet switch clock
  */
 static void enetsw_set(struct clk *clk, int enable)
 {
-       if (BCMCPU_IS_6328())
+       if (BCMCPU_IS_6328()) {
                bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable);
-       else if (BCMCPU_IS_6362())
+       } else if (BCMCPU_IS_6362()) {
                bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable);
-       else if (BCMCPU_IS_6368())
-               bcm_hwclock_set(CKCTL_6368_ROBOSW_EN |
-                               CKCTL_6368_SWPKT_USB_EN |
-                               CKCTL_6368_SWPKT_SAR_EN,
-                               enable);
-       else
+       } else if (BCMCPU_IS_6368()) {
+               if (enable) {
+                       clk_enable_unlocked(&clk_swpkt_sar);
+                       clk_enable_unlocked(&clk_swpkt_usb);
+               } else {
+                       clk_disable_unlocked(&clk_swpkt_usb);
+                       clk_disable_unlocked(&clk_swpkt_sar);
+               }
+               bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable);
+       } else {
                return;
+       }
 
        if (enable) {
                /* reset switch core afer clock change */
@@ -247,6 +283,10 @@ static struct clk clk_hsspi = {
        .set    = hsspi_set,
 };
 
+/*
+ * HSSPI PLL
+ */
+static struct clk clk_hsspi_pll;
 
 /*
  * XTM clock
@@ -256,8 +296,12 @@ static void xtm_set(struct clk *clk, int enable)
        if (!BCMCPU_IS_6368())
                return;
 
-       bcm_hwclock_set(CKCTL_6368_SAR_EN |
-                       CKCTL_6368_SWPKT_SAR_EN, enable);
+       if (enable)
+               clk_enable_unlocked(&clk_swpkt_sar);
+       else
+               clk_disable_unlocked(&clk_swpkt_sar);
+
+       bcm_hwclock_set(CKCTL_6368_SAR_EN, enable);
 
        if (enable) {
                /* reset sar core afer clock change */
@@ -359,44 +403,128 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL_GPL(clk_round_rate);
 
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       if (!strcmp(id, "enet0"))
-               return &clk_enet0;
-       if (!strcmp(id, "enet1"))
-               return &clk_enet1;
-       if (!strcmp(id, "enetsw"))
-               return &clk_enetsw;
-       if (!strcmp(id, "ephy"))
-               return &clk_ephy;
-       if (!strcmp(id, "usbh"))
-               return &clk_usbh;
-       if (!strcmp(id, "usbd"))
-               return &clk_usbd;
-       if (!strcmp(id, "spi"))
-               return &clk_spi;
-       if (!strcmp(id, "hsspi"))
-               return &clk_hsspi;
-       if (!strcmp(id, "xtm"))
-               return &clk_xtm;
-       if (!strcmp(id, "periph"))
-               return &clk_periph;
-       if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
-               return &clk_pcm;
-       if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
-               return &clk_ipsec;
-       if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
-               return &clk_pcie;
-       return ERR_PTR(-ENOENT);
-}
+static struct clk_lookup bcm3368_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+       CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
+       CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
+};
 
-EXPORT_SYMBOL(clk_get);
+static struct clk_lookup bcm6328_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
+       CLKDEV_INIT(NULL, "pcie", &clk_pcie),
+};
 
-void clk_put(struct clk *clk)
-{
-}
+static struct clk_lookup bcm6338_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+       CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
+};
 
-EXPORT_SYMBOL(clk_put);
+static struct clk_lookup bcm6345_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+       CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
+};
+
+static struct clk_lookup bcm6348_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+       CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
+       CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc),
+};
+
+static struct clk_lookup bcm6358_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+       CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+       CLKDEV_INIT(NULL, "swpkt_sar", &clk_swpkt_sar),
+       CLKDEV_INIT(NULL, "swpkt_usb", &clk_swpkt_usb),
+       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
+       CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
+};
+
+static struct clk_lookup bcm6362_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
+       CLKDEV_INIT(NULL, "pcie", &clk_pcie),
+       CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
+};
+
+static struct clk_lookup bcm6368_clks[] = {
+       /* fixed rate clocks */
+       CLKDEV_INIT(NULL, "periph", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+       /* gated clocks */
+       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+       CLKDEV_INIT(NULL, "spi", &clk_spi),
+       CLKDEV_INIT(NULL, "xtm", &clk_xtm),
+       CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
+};
 
 #define HSSPI_PLL_HZ_6328      133333333
 #define HSSPI_PLL_HZ_6362      400000000
@@ -404,11 +532,31 @@ EXPORT_SYMBOL(clk_put);
 static int __init bcm63xx_clk_init(void)
 {
        switch (bcm63xx_get_cpu_id()) {
+       case BCM3368_CPU_ID:
+               clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
+               break;
        case BCM6328_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6328;
+               clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328;
+               clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
+               break;
+       case BCM6338_CPU_ID:
+               clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks));
+               break;
+       case BCM6345_CPU_ID:
+               clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks));
+               break;
+       case BCM6348_CPU_ID:
+               clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks));
+               break;
+       case BCM6358_CPU_ID:
+               clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
                break;
        case BCM6362_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6362;
+               clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362;
+               clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
+               break;
+       case BCM6368_CPU_ID:
+               clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks));
                break;
        }
 
index 277cde0..7a3e5c8 100644 (file)
@@ -83,6 +83,7 @@
                        interrupts = <2>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
@@ -95,6 +96,7 @@
                        interrupts = <3>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
index 2bc0d84..8d010b9 100644 (file)
@@ -19,7 +19,7 @@
 };
 
 &leds0 {
-       status = "ok";
+       status = "okay";
        brcm,serial-leds;
        brcm,serial-dat-low;
        brcm,serial-shift-inv;
index 3b09f44..58790b1 100644 (file)
@@ -84,6 +84,7 @@
                        interrupts = <5>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
@@ -96,6 +97,7 @@
                        interrupts = <34>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
index 644486f..bf6716a 100644 (file)
@@ -69,6 +69,7 @@
                        interrupt-parent = <&periph_intc>;
                        interrupts = <28>;
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
                        status = "disabled";
                };
 
@@ -78,6 +79,7 @@
                        interrupt-parent = <&periph_intc>;
                        interrupts = <39>;
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
                        status = "disabled";
                };
 
index 5e62190..53e57cc 100644 (file)
@@ -19,7 +19,7 @@
 };
 
 &leds0 {
-       status = "ok";
+       status = "okay";
 
        led@0 {
                reg = <0>;
index 682df7f..26ddae5 100644 (file)
@@ -93,6 +93,7 @@
                        interrupts = <2>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
                        interrupts = <3>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
index a82a5e5..c387793 100644 (file)
@@ -84,6 +84,7 @@
                        interrupts = <3>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
@@ -96,6 +97,7 @@
                        interrupts = <4>;
 
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
 
                        status = "disabled";
                };
index 7a72f59..e116a38 100644 (file)
@@ -90,6 +90,7 @@
                        interrupt-parent = <&periph_intc>;
                        interrupts = <2>;
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
                        status = "disabled";
                };
 
                        interrupt-parent = <&periph_intc>;
                        interrupts = <3>;
                        clocks = <&periph_clk>;
+                       clock-names = "refclk";
                        status = "disabled";
                };
 
index 57809f6..f8d7e6f 100644 (file)
                pinctrl-0 = <&sdhost_pins>;
                pinctrl-names = "default";
                fifo-depth = <0x20>;
-               num-slots = <1>;
                clock-frequency = <50000000>;
                bus-width = <8>;
                cap-mmc-highspeed;
index ff3298f..9b57946 100644 (file)
                status = "disabled";
        };
 
+       watchdog: watchdog@10002000 {
+               compatible = "ingenic,jz4780-watchdog";
+               reg = <0x10002000 0x100>;
+       };
+
        nemc: nemc@13410000 {
                compatible = "ingenic,jz4780-nemc";
                reg = <0x13410000 0x10000>;
index 674efdd..6408ff6 100644 (file)
@@ -47,6 +47,6 @@
        };
 
        usb@101c0000 {
-               status = "ok";
+               status = "okay";
        };
 };
index 5d222c9..6163224 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_XILFPGA_NEXYS4DDR)        += nexys4ddr.dtb
+dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA)    += nexys4ddr.dtb
 
 obj-y                          += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 
index 41fee03..2152b7b 100644 (file)
@@ -6,6 +6,14 @@
 / {
        compatible = "digilent,nexys4ddr";
 
+       aliases {
+               serial0 = &axi_uart16550;
+       };
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
+       };
+
        memory {
                device_type = "memory";
                reg = <0x0 0x08000000>;
index f24be0b..75108ec 100644 (file)
@@ -862,7 +862,7 @@ int __cvmx_helper_errata_fix_ipd_ptr_alignment(void)
         */
        cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), 0);
 
-       cvmx_wait(100000000ull);
+       __delay(100000000ull);
 
        for (retry_loop_cnt = 0; retry_loop_cnt < 10; retry_loop_cnt++) {
                retry_cnt = 100000;
index 459e3b1..f51957a 100644 (file)
@@ -215,7 +215,7 @@ int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode)
        spxx_clk_ctl.u64 = 0;
        spxx_clk_ctl.s.runbist = 1;
        cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64);
-       cvmx_wait(10 * MS);
+       __delay(10 * MS);
        spxx_bist_stat.u64 = cvmx_read_csr(CVMX_SPXX_BIST_STAT(interface));
        if (spxx_bist_stat.s.stat0)
                cvmx_dprintf
@@ -265,14 +265,14 @@ int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode)
        spxx_clk_ctl.s.rcvtrn = 0;
        spxx_clk_ctl.s.srxdlck = 0;
        cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64);
-       cvmx_wait(100 * MS);
+       __delay(100 * MS);
 
        /* Reset SRX0 DLL */
        spxx_clk_ctl.s.srxdlck = 1;
        cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64);
 
        /* Waiting for Inf0 Spi4 RX DLL to lock */
-       cvmx_wait(100 * MS);
+       __delay(100 * MS);
 
        /* Enable dynamic alignment */
        spxx_trn4_ctl.s.trntest = 0;
@@ -527,7 +527,7 @@ int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, int timeout)
        spxx_clk_ctl.s.rcvtrn = 1;
        spxx_clk_ctl.s.srxdlck = 1;
        cvmx_write_csr(CVMX_SPXX_CLK_CTL(interface), spxx_clk_ctl.u64);
-       cvmx_wait(1000 * MS);
+       __delay(1000 * MS);
 
        /* SRX0 clear the boot bit */
        spxx_trn4_ctl.u64 = cvmx_read_csr(CVMX_SPXX_TRN4_CTL(interface));
@@ -536,7 +536,7 @@ int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, int timeout)
 
        /* Wait for the training sequence to complete */
        cvmx_dprintf("SPI%d: Waiting for training\n", interface);
-       cvmx_wait(1000 * MS);
+       __delay(1000 * MS);
        /* Wait a really long time here */
        timeout_time = cvmx_get_cycle() + 1000ull * MS * 600;
        /*
index 5ea3104..b5f4ad8 100644 (file)
@@ -38,6 +38,8 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
@@ -93,6 +95,8 @@ CONFIG_I2C_JZ4780=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_INGENIC=y
 # CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_JZ4740_WDT=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_DEBUG=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -110,7 +114,8 @@ CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_CONFIGFS_FS=y
 CONFIG_UBIFS_FS=y
-# CONFIG_NETWORK_FILESYSTEMS is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_737=y
diff --git a/arch/mips/configs/generic/board-xilfpga.config b/arch/mips/configs/generic/board-xilfpga.config
new file mode 100644 (file)
index 0000000..9cce573
--- /dev/null
@@ -0,0 +1,22 @@
+# require CONFIG_CPU_MIPS32_R2=y
+# require CONFIG_CPU_LITTLE_ENDIAN=y
+
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_FIT_IMAGE_FDT_XILFPGA=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_XILINX=y
+CONFIG_SENSORS_ADT7410=y
+CONFIG_TMPFS=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_NETDEVICES=y
+CONFIG_XILINX_EMACLITE=y
+CONFIG_SMSC_PHY=y
index 83e8fe2..7ddfb4e 100644 (file)
@@ -1,3 +1,4 @@
+CONFIG_SGI_IP22=y
 CONFIG_ARC_CONSOLE=y
 CONFIG_CPU_R5000=y
 CONFIG_NO_HZ=y
diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
deleted file mode 100644 (file)
index 829c637..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-CONFIG_MACH_XILFPGA=y
-# CONFIG_COMPACTION is not set
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_EMBEDDED=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-# CONFIG_BLOCK is not set
-# CONFIG_SUSPEND is not set
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_IPV6 is not set
-# CONFIG_WIRELESS is not set
-# CONFIG_UEVENT_HELPER is not set
-CONFIG_DEVTMPFS=y
-CONFIG_DEVTMPFS_MOUNT=y
-# CONFIG_STANDALONE is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FW_LOADER is not set
-# CONFIG_ALLOW_DEV_COREDUMP is not set
-CONFIG_NETDEVICES=y
-# CONFIG_NET_CORE is not set
-# CONFIG_NET_VENDOR_ARC is not set
-# CONFIG_NET_CADENCE is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_EZCHIP is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_NETRONOME is not set
-# CONFIG_NET_VENDOR_QUALCOMM is not set
-# CONFIG_NET_VENDOR_RENESAS is not set
-# CONFIG_NET_VENDOR_ROCKER is not set
-# CONFIG_NET_VENDOR_SAMSUNG is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-# CONFIG_NET_VENDOR_SMSC is not set
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NET_VENDOR_SYNOPSYS is not set
-# CONFIG_NET_VENDOR_VIA is not set
-# CONFIG_NET_VENDOR_WIZNET is not set
-CONFIG_XILINX_EMACLITE=y
-CONFIG_SMSC_PHY=y
-# CONFIG_WLAN is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_VT_HW_CONSOLE_BINDING=y
-# CONFIG_UNIX98_PTYS is not set
-# CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_OF_PLATFORM=y
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_XILINX=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_XILINX=y
-CONFIG_SENSORS_ADT7410=y
-# CONFIG_USB_SUPPORT is not set
-# CONFIG_MIPS_PLATFORM_DEVICES is not set
-# CONFIG_IOMMU_SUPPORT is not set
-# CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_TMPFS=y
-# CONFIG_MISC_FILESYSTEMS is not set
-CONFIG_PANIC_ON_OOPS=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_FTRACE is not set
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,115200"
index 0b67c46..52e0286 100644 (file)
@@ -43,4 +43,10 @@ config FIT_IMAGE_FDT_NI169445
          Enable this to include the FDT for the 169445 platform from
          National Instruments in the FIT kernel image.
 
+config FIT_IMAGE_FDT_XILFPGA
+       bool "Include FDT for Xilfpga"
+       help
+         Enable this to include the FDT for the MIPSfpga platform
+         from Imagination Technologies in the FIT kernel image.
+
 endif
diff --git a/arch/mips/generic/board-xilfpga.its.S b/arch/mips/generic/board-xilfpga.its.S
new file mode 100644 (file)
index 0000000..a2e773d
--- /dev/null
@@ -0,0 +1,22 @@
+/ {
+       images {
+               fdt@xilfpga {
+                       description = "MIPSfpga (xilfpga) Device Tree";
+                       data = /incbin/("boot/dts/xilfpga/nexys4ddr.dtb");
+                       type = "flat_dt";
+                       arch = "mips";
+                       compression = "none";
+                       hash@0 {
+                               algo = "sha1";
+                       };
+               };
+       };
+
+       configurations {
+               conf@xilfpga {
+                       description = "MIPSfpga Linux kernel";
+                       kernel = "kernel@0";
+                       fdt = "fdt@xilfpga";
+               };
+       };
+};
index 83054f7..feb069c 100644 (file)
@@ -19,6 +19,9 @@
 #include <asm/asmmacro-64.h>
 #endif
 
+/* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */
+#undef fp
+
 /*
  * Helper macros for generating raw instruction encodings.
  */
        .macro  fpu_save_16odd thread
        .set    push
        .set    mips64r2
+       .set    fp=64
        SET_HARDFLOAT
        sdc1    $f1,  THREAD_FPR1(\thread)
        sdc1    $f3,  THREAD_FPR3(\thread)
        .endm
 
        .macro  fpu_save_double thread status tmp
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \
+               defined(CONFIG_CPU_MIPSR6)
        sll     \tmp, \status, 5
        bgez    \tmp, 10f
        fpu_save_16odd \thread
        .macro  fpu_restore_16odd thread
        .set    push
        .set    mips64r2
+       .set    fp=64
        SET_HARDFLOAT
        ldc1    $f1,  THREAD_FPR1(\thread)
        ldc1    $f3,  THREAD_FPR3(\thread)
        .endm
 
        .macro  fpu_restore_double thread status tmp
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \
+               defined(CONFIG_CPU_MIPSR6)
        sll     \tmp, \status, 5
        bgez    \tmp, 10f                               # 16 register mode?
 
        .endm
 
 #ifdef TOOLCHAIN_SUPPORTS_MSA
-/* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */
-#undef fp
-
        .macro  _cfcmsa rd, cs
        .set    push
        .set    mips32r2
index fa57cef..da1b871 100644 (file)
@@ -456,6 +456,7 @@ static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *
 {
        smp_mb__before_llsc();
        __clear_bit(nr, addr);
+       nudge_writes();
 }
 
 /*
index 7e25c5c..89e9fb7 100644 (file)
@@ -204,8 +204,10 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 #else
 #include <asm-generic/cmpxchg-local.h>
 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+#ifndef CONFIG_SMP
 #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
 #endif
+#endif
 
 #undef __scbeqz
 
index a681092..6b1f1ad 100644 (file)
@@ -1355,19 +1355,17 @@ do {                                                                    \
        if (sel == 0)                                                   \
                __asm__ __volatile__(                                   \
                        ".set\tmips64\n\t"                              \
-                       "dmfc0\t%M0, " #source "\n\t"                   \
-                       "dsll\t%L0, %M0, 32\n\t"                        \
-                       "dsra\t%M0, %M0, 32\n\t"                        \
-                       "dsra\t%L0, %L0, 32\n\t"                        \
+                       "dmfc0\t%L0, " #source "\n\t"                   \
+                       "dsra\t%M0, %L0, 32\n\t"                        \
+                       "sll\t%L0, %L0, 0\n\t"                          \
                        ".set\tmips0"                                   \
                        : "=r" (__val));                                \
        else                                                            \
                __asm__ __volatile__(                                   \
                        ".set\tmips64\n\t"                              \
-                       "dmfc0\t%M0, " #source ", " #sel "\n\t"         \
-                       "dsll\t%L0, %M0, 32\n\t"                        \
-                       "dsra\t%M0, %M0, 32\n\t"                        \
-                       "dsra\t%L0, %L0, 32\n\t"                        \
+                       "dmfc0\t%L0, " #source ", " #sel "\n\t"         \
+                       "dsra\t%M0, %L0, 32\n\t"                        \
+                       "sll\t%L0, %L0, 0\n\t"                          \
                        ".set\tmips0"                                   \
                        : "=r" (__val));                                \
        local_irq_restore(__flags);                                     \
index c00501d..29ae636 100644 (file)
@@ -36,6 +36,8 @@
 #ifndef __CVMX_FPA_H__
 #define __CVMX_FPA_H__
 
+#include <linux/delay.h>
+
 #include <asm/octeon/cvmx-address.h>
 #include <asm/octeon/cvmx-fpa-defs.h>
 
@@ -165,7 +167,7 @@ static inline void cvmx_fpa_enable(void)
                }
 
                /* Enforce a 10 cycle delay between config and enable */
-               cvmx_wait(10);
+               __delay(10);
        }
 
        /* FIXME: CVMX_FPA_CTL_STATUS read is unmodelled */
index 205ab2c..25854ab 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/delay.h>
 
 enum cvmx_mips_space {
        CVMX_MIPS_SPACE_XKSEG = 3LL,
@@ -428,18 +429,6 @@ static inline uint64_t cvmx_get_cycle(void)
        return cycle;
 }
 
-/**
- * Wait for the specified number of cycle
- *
- */
-static inline void cvmx_wait(uint64_t cycles)
-{
-       uint64_t done = cvmx_get_cycle() + cycles;
-
-       while (cvmx_get_cycle() < done)
-               ; /* Spin */
-}
-
 /**
  * Reads a chip global cycle counter.  This counts CPU cycles since
  * chip reset. The counter is 64 bit.
@@ -481,7 +470,7 @@ static inline uint64_t cvmx_get_cycle_global(void)
                                result = -1;                            \
                                break;                                  \
                        } else                                          \
-                               cvmx_wait(100);                         \
+                               __delay(100);                           \
                }                                                       \
        } while (0);                                                    \
        result;                                                         \
index 5f98759..ad46121 100644 (file)
@@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)
 
 #endif
 
-#define virt_to_page(kaddr)    pfn_to_page(PFN_DOWN(virt_to_phys((void *)     \
-                                                                 (kaddr))))
+#define virt_to_pfn(kaddr)     PFN_DOWN(virt_to_phys((void *)(kaddr)))
+#define virt_to_page(kaddr)    pfn_to_page(virt_to_pfn(kaddr))
 
 extern int __virt_addr_valid(const volatile void *kaddr);
 #define virt_addr_valid(kaddr)                                         \
index 95b8c47..af34afb 100644 (file)
@@ -368,8 +368,6 @@ struct task_struct;
 /* Free all resources held by a thread. */
 #define release_thread(thread) do { } while(0)
 
-extern unsigned long thread_saved_pc(struct task_struct *tsk);
-
 /*
  * Do necessary setup to start up a newly executed thread.
  */
index 9e494f8..88ebd83 100644 (file)
@@ -29,7 +29,7 @@ extern cpumask_t cpu_foreign_map[];
 
 /* Map from cpu id to sequential logical cpu number.  This will only
    not be idempotent when cpus failed to come on-line. */
-extern int __cpu_number_map[NR_CPUS];
+extern int __cpu_number_map[CONFIG_MIPS_NR_CPU_NR_MAP];
 #define cpu_number_map(cpu)  __cpu_number_map[cpu]
 
 /* The reverse map from sequential logical cpu number to cpu id.  */
index 7c71302..0170602 100644 (file)
 #define __NR_syscall 4000
 #endif
 
+static inline bool mips_syscall_is_indirect(struct task_struct *task,
+                                           struct pt_regs *regs)
+{
+       /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
+       return (IS_ENABLED(CONFIG_32BIT) ||
+               test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
+               (regs->regs[2] == __NR_syscall);
+}
+
 static inline long syscall_get_nr(struct task_struct *task,
                                  struct pt_regs *regs)
 {
        return current_thread_info()->syscall;
 }
 
+static inline void mips_syscall_update_nr(struct task_struct *task,
+                                         struct pt_regs *regs)
+{
+       /*
+        * v0 is the system call number, except for O32 ABI syscall(), where it
+        * ends up in a0.
+        */
+       if (mips_syscall_is_indirect(task, regs))
+               task_thread_info(task)->syscall = regs->regs[4];
+       else
+               task_thread_info(task)->syscall = regs->regs[2];
+}
+
 static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
        struct task_struct *task, struct pt_regs *regs, unsigned int n)
 {
@@ -98,10 +120,9 @@ static inline void syscall_get_arguments(struct task_struct *task,
                                         unsigned long *args)
 {
        int ret;
-       /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
-       if ((IS_ENABLED(CONFIG_32BIT) ||
-           test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
-           (regs->regs[2] == __NR_syscall))
+
+       /* O32 ABI syscall() */
+       if (mips_syscall_is_indirect(task, regs))
                i++;
 
        while (n--)
index c5ff6bf..45d0b6b 100644 (file)
@@ -487,7 +487,7 @@ arch_initcall(frame_info_init);
 /*
  * Return saved PC of a blocked thread.
  */
-unsigned long thread_saved_pc(struct task_struct *tsk)
+static unsigned long thread_saved_pc(struct task_struct *tsk)
 {
        struct thread_struct *t = &tsk->thread;
 
index 1395654..efbd8df 100644 (file)
@@ -144,6 +144,9 @@ int ptrace_setregs(struct task_struct *child, struct user_pt_regs __user *data)
 
        /* badvaddr, status, and cause may not be written.  */
 
+       /* System call number may have been changed */
+       mips_syscall_update_nr(child, regs);
+
        return 0;
 }
 
@@ -345,6 +348,9 @@ static int gpr32_set(struct task_struct *target,
                }
        }
 
+       /* System call number may have been changed */
+       mips_syscall_update_nr(target, regs);
+
        return 0;
 }
 
@@ -405,6 +411,9 @@ static int gpr64_set(struct task_struct *target,
                }
        }
 
+       /* System call number may have been changed */
+       mips_syscall_update_nr(target, regs);
+
        return 0;
 }
 
@@ -618,6 +627,19 @@ static const struct user_regset_view user_mips64_view = {
        .n              = ARRAY_SIZE(mips64_regsets),
 };
 
+#ifdef CONFIG_MIPS32_N32
+
+static const struct user_regset_view user_mipsn32_view = {
+       .name           = "mipsn32",
+       .e_flags        = EF_MIPS_ABI2,
+       .e_machine      = ELF_ARCH,
+       .ei_osabi       = ELF_OSABI,
+       .regsets        = mips64_regsets,
+       .n              = ARRAY_SIZE(mips64_regsets),
+};
+
+#endif /* CONFIG_MIPS32_N32 */
+
 #endif /* CONFIG_64BIT */
 
 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
@@ -628,6 +650,10 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
 #ifdef CONFIG_MIPS32_O32
        if (test_tsk_thread_flag(task, TIF_32BIT_REGS))
                return &user_mips_view;
+#endif
+#ifdef CONFIG_MIPS32_N32
+       if (test_tsk_thread_flag(task, TIF_32BIT_ADDR))
+               return &user_mipsn32_view;
 #endif
        return &user_mips64_view;
 #endif
@@ -753,6 +779,12 @@ long arch_ptrace(struct task_struct *child, long request,
                switch (addr) {
                case 0 ... 31:
                        regs->regs[addr] = data;
+                       /* System call number may have been changed */
+                       if (addr == 2)
+                               mips_syscall_update_nr(child, regs);
+                       else if (addr == 4 &&
+                                mips_syscall_is_indirect(child, regs))
+                               mips_syscall_update_nr(child, regs);
                        break;
                case FPR_BASE ... FPR_BASE + 31: {
                        union fpureg *fregs = get_fpu_regs(child);
@@ -864,9 +896,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
 
        current_thread_info()->syscall = syscall;
 
-       if (test_thread_flag(TIF_SYSCALL_TRACE) &&
-           tracehook_report_syscall_entry(regs))
-               return -1;
+       if (test_thread_flag(TIF_SYSCALL_TRACE)) {
+               if (tracehook_report_syscall_entry(regs))
+                       return -1;
+               syscall = current_thread_info()->syscall;
+       }
 
 #ifdef CONFIG_SECCOMP
        if (unlikely(test_thread_flag(TIF_SECCOMP))) {
@@ -884,6 +918,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
                ret = __secure_computing(&sd);
                if (ret == -1)
                        return ret;
+               syscall = current_thread_info()->syscall;
        }
 #endif
 
index 40e212d..2b9260f 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <asm/reg.h>
+#include <asm/syscall.h>
 #include <linux/uaccess.h>
 #include <asm/bootinfo.h>
 
@@ -195,6 +196,12 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
                switch (addr) {
                case 0 ... 31:
                        regs->regs[addr] = data;
+                       /* System call number may have been changed */
+                       if (addr == 2)
+                               mips_syscall_update_nr(child, regs);
+                       else if (addr == 4 &&
+                                mips_syscall_is_indirect(child, regs))
+                               mips_syscall_update_nr(child, regs);
                        break;
                case FPR_BASE ... FPR_BASE + 31: {
                        union fpureg *fregs = get_fpu_regs(child);
index 0a83b17..8e3a602 100644 (file)
@@ -40,8 +40,8 @@
  */
 LEAF(_save_fp)
 EXPORT_SYMBOL(_save_fp)
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \
+               defined(CONFIG_CPU_MIPSR6)
        mfc0    t0, CP0_STATUS
 #endif
        fpu_save_double a0 t0 t1                # clobbers t1
@@ -52,8 +52,8 @@ EXPORT_SYMBOL(_save_fp)
  * Restore a thread's fp context.
  */
 LEAF(_restore_fp)
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \
+               defined(CONFIG_CPU_MIPSR6)
        mfc0    t0, CP0_STATUS
 #endif
        fpu_restore_double a0 t0 t1             # clobbers t1
@@ -246,11 +246,11 @@ LEAF(_save_fp_context)
        cfc1    t1, fcr31
        .set    pop
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \
+               defined(CONFIG_CPU_MIPSR6)
        .set    push
        SET_HARDFLOAT
-#ifdef CONFIG_CPU_MIPS32_R2
+#ifdef CONFIG_CPU_MIPSR2
        .set    mips32r2
        .set    fp=64
        mfc0    t0, CP0_STATUS
@@ -314,11 +314,11 @@ LEAF(_save_fp_context)
 LEAF(_restore_fp_context)
        EX      lw t1, 0(a1)
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)  || \
-               defined(CONFIG_CPU_MIPS32_R6)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2)  || \
+               defined(CONFIG_CPU_MIPSR6)
        .set    push
        SET_HARDFLOAT
-#ifdef CONFIG_CPU_MIPS32_R2
+#ifdef CONFIG_CPU_MIPSR2
        .set    mips32r2
        .set    fp=64
        mfc0    t0, CP0_STATUS
index fe39397..702c678 100644 (file)
@@ -80,6 +80,7 @@ EXPORT_SYMBOL(mips_io_port_base);
 
 static struct resource code_resource = { .name = "Kernel code", };
 static struct resource data_resource = { .name = "Kernel data", };
+static struct resource bss_resource = { .name = "Kernel bss", };
 
 static void *detect_magic __initdata = detect_memory_region;
 
@@ -927,6 +928,8 @@ static void __init resource_init(void)
        code_resource.end = __pa_symbol(&_etext) - 1;
        data_resource.start = __pa_symbol(&_etext);
        data_resource.end = __pa_symbol(&_edata) - 1;
+       bss_resource.start = __pa_symbol(&__bss_start);
+       bss_resource.end = __pa_symbol(&__bss_stop) - 1;
 
        for (i = 0; i < boot_mem_map.nr_map; i++) {
                struct resource *res;
@@ -966,6 +969,7 @@ static void __init resource_init(void)
                 */
                request_resource(res, &code_resource);
                request_resource(res, &data_resource);
+               request_resource(res, &bss_resource);
                request_crashkernel(res);
        }
 }
index 88be966..d84b906 100644 (file)
@@ -48,7 +48,7 @@
 #include <asm/setup.h>
 #include <asm/maar.h>
 
-int __cpu_number_map[NR_CPUS];         /* Map physical to logical */
+int __cpu_number_map[CONFIG_MIPS_NR_CPU_NR_MAP];   /* Map physical to logical */
 EXPORT_SYMBOL(__cpu_number_map);
 
 int __cpu_logical_map[NR_CPUS];                /* Map logical to physical */
index 7611c30..52500d3 100644 (file)
@@ -446,9 +446,9 @@ void __init ltq_soc_init(void)
 
        /* add our generic xway clocks */
        clkdev_add_pmu("10000000.fpi", NULL, 0, 0, PMU_FPI);
-       clkdev_add_pmu("1e100400.serial", NULL, 0, 0, PMU_ASC0);
        clkdev_add_pmu("1e100a00.gptu", NULL, 1, 0, PMU_GPT);
        clkdev_add_pmu("1e100bb0.stp", NULL, 1, 0, PMU_STP);
+       clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1);
        clkdev_add_pmu("1e104100.dma", NULL, 1, 0, PMU_DMA);
        clkdev_add_pmu("1e100800.spi", NULL, 1, 0, PMU_SPI);
        clkdev_add_pmu("1e105300.ebu", NULL, 0, 0, PMU_EBU);
@@ -462,10 +462,8 @@ void __init ltq_soc_init(void)
                clkdev_add_pmu("1e180000.etop", NULL, 1, 0, PMU_PPE);
        }
 
-       if (!of_machine_is_compatible("lantiq,ase")) {
-               clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1);
+       if (!of_machine_is_compatible("lantiq,ase"))
                clkdev_add_pci();
-       }
 
        if (of_machine_is_compatible("lantiq,grx390") ||
            of_machine_is_compatible("lantiq,ar10")) {
index dd292dc..a8103f6 100644 (file)
@@ -197,8 +197,7 @@ static int __init pvc_proc_init(void)
        if (proc_entry == NULL)
                goto error;
 
-       init_timer(&timer);
-       timer.function = pvc_proc_timerfunc;
+       setup_timer(&timer, pvc_proc_timerfunc, 0UL);
 
        return 0;
 error:
index 16d9ef5..da6c1c0 100644 (file)
@@ -810,7 +810,7 @@ do {                                                                        \
 #define SITOREG(si, x)                                                 \
 do {                                                                   \
        if (cop1_64bit(xcp) && !hybrid_fprs()) {                        \
-               unsigned i;                                             \
+               unsigned int i;                                         \
                set_fpr32(&ctx->fpr[x], 0, si);                         \
                for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)     \
                        set_fpr32(&ctx->fpr[x], i, 0);                  \
@@ -823,7 +823,7 @@ do {                                                                        \
 
 #define SITOHREG(si, x)                                                        \
 do {                                                                   \
-       unsigned i;                                                     \
+       unsigned int i;                                                 \
        set_fpr32(&ctx->fpr[x], 1, si);                                 \
        for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)             \
                set_fpr32(&ctx->fpr[x], i, 0);                          \
@@ -834,7 +834,7 @@ do {                                                                        \
 
 #define DITOREG(di, x)                                                 \
 do {                                                                   \
-       unsigned fpr, i;                                                \
+       unsigned int fpr, i;                                            \
        fpr = (x) & ~(cop1_64bit(xcp) ^ 1);                             \
        set_fpr64(&ctx->fpr[fpr], 0, di);                               \
        for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++)             \
@@ -1465,7 +1465,7 @@ DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
 static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
        mips_instruction ir, void __user **fault_addr)
 {
-       unsigned rcsr = 0;      /* resulting csr */
+       unsigned int rcsr = 0;  /* resulting csr */
 
        MIPS_FPU_EMU_INC_STATS(cp1xops);
 
@@ -1661,10 +1661,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
        mips_instruction ir)
 {
        int rfmt;               /* resulting format */
-       unsigned rcsr = 0;      /* resulting csr */
+       unsigned int rcsr = 0;  /* resulting csr */
        unsigned int oldrm;
        unsigned int cbit;
-       unsigned cond;
+       unsigned int cond;
        union {
                union ieee754dp d;
                union ieee754sp s;
@@ -1795,7 +1795,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        SPFROMREG(fd, MIPSInst_FD(ir));
                        rv.s = ieee754sp_maddf(fd, fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmsubf_op: {
@@ -1809,7 +1809,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        SPFROMREG(fd, MIPSInst_FD(ir));
                        rv.s = ieee754sp_msubf(fd, fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case frint_op: {
@@ -1834,7 +1834,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        rv.w = ieee754sp_2008class(fs);
                        rfmt = w_fmt;
-                       break;
+                       goto copcsr;
                }
 
                case fmin_op: {
@@ -1847,7 +1847,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(ft, MIPSInst_FT(ir));
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        rv.s = ieee754sp_fmin(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmina_op: {
@@ -1860,7 +1860,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(ft, MIPSInst_FT(ir));
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        rv.s = ieee754sp_fmina(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmax_op: {
@@ -1873,7 +1873,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(ft, MIPSInst_FT(ir));
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        rv.s = ieee754sp_fmax(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmaxa_op: {
@@ -1886,7 +1886,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
                        SPFROMREG(ft, MIPSInst_FT(ir));
                        SPFROMREG(fs, MIPSInst_FS(ir));
                        rv.s = ieee754sp_fmaxa(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fabs_op:
@@ -2029,9 +2029,10 @@ copcsr:
 
                default:
                        if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
-                               unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
+                               unsigned int cmpop;
                                union ieee754sp fs, ft;
 
+                               cmpop = MIPSInst_FUNC(ir) - fcmp_op;
                                SPFROMREG(fs, MIPSInst_FS(ir));
                                SPFROMREG(ft, MIPSInst_FT(ir));
                                rv.w = ieee754sp_cmp(fs, ft,
@@ -2165,7 +2166,7 @@ copcsr:
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        DPFROMREG(fd, MIPSInst_FD(ir));
                        rv.d = ieee754dp_maddf(fd, fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmsubf_op: {
@@ -2179,7 +2180,7 @@ copcsr:
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        DPFROMREG(fd, MIPSInst_FD(ir));
                        rv.d = ieee754dp_msubf(fd, fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case frint_op: {
@@ -2204,7 +2205,7 @@ copcsr:
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        rv.l = ieee754dp_2008class(fs);
                        rfmt = l_fmt;
-                       break;
+                       goto copcsr;
                }
 
                case fmin_op: {
@@ -2217,7 +2218,7 @@ copcsr:
                        DPFROMREG(ft, MIPSInst_FT(ir));
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        rv.d = ieee754dp_fmin(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmina_op: {
@@ -2230,7 +2231,7 @@ copcsr:
                        DPFROMREG(ft, MIPSInst_FT(ir));
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        rv.d = ieee754dp_fmina(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmax_op: {
@@ -2243,7 +2244,7 @@ copcsr:
                        DPFROMREG(ft, MIPSInst_FT(ir));
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        rv.d = ieee754dp_fmax(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fmaxa_op: {
@@ -2256,7 +2257,7 @@ copcsr:
                        DPFROMREG(ft, MIPSInst_FT(ir));
                        DPFROMREG(fs, MIPSInst_FS(ir));
                        rv.d = ieee754dp_fmaxa(fs, ft);
-                       break;
+                       goto copcsr;
                }
 
                case fabs_op:
@@ -2379,9 +2380,10 @@ dcopuop:
 
                default:
                        if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
-                               unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
+                               unsigned int cmpop;
                                union ieee754dp fs, ft;
 
+                               cmpop = MIPSInst_FUNC(ir) - fcmp_op;
                                DPFROMREG(fs, MIPSInst_FS(ir));
                                DPFROMREG(ft, MIPSInst_FT(ir));
                                rv.w = ieee754dp_cmp(fs, ft,
index e0d9be5..7ad79ed 100644 (file)
@@ -45,10 +45,10 @@ static union ieee754dp _dp_maddf(union ieee754dp z, union ieee754dp x,
 {
        int re;
        int rs;
-       unsigned lxm;
-       unsigned hxm;
-       unsigned lym;
-       unsigned hym;
+       unsigned int lxm;
+       unsigned int hxm;
+       unsigned int lym;
+       unsigned int hym;
        u64 lrm;
        u64 hrm;
        u64 lzm;
index 87d0b44..60c8bfe 100644 (file)
@@ -26,10 +26,10 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
        int re;
        int rs;
        u64 rm;
-       unsigned lxm;
-       unsigned hxm;
-       unsigned lym;
-       unsigned hym;
+       unsigned int lxm;
+       unsigned int hxm;
+       unsigned int lym;
+       unsigned int hym;
        u64 lrm;
        u64 hrm;
        u64 t;
index cd5bc08..cea907b 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "ieee754dp.h"
 
-static const unsigned table[] = {
+static const unsigned int table[] = {
        0, 1204, 3062, 5746, 9193, 13348, 18162, 23592,
        29598, 36145, 43202, 50740, 58733, 67158, 75992,
        85215, 83599, 71378, 60428, 50647, 41945, 34246,
@@ -33,7 +33,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
 {
        struct _ieee754_csr oldcsr;
        union ieee754dp y, z, t;
-       unsigned scalx, yh;
+       unsigned int scalx, yh;
        COMPXDP;
 
        EXPLODEXDP;
index 92dc8fa..e0eb7a9 100644 (file)
@@ -165,11 +165,12 @@ struct _ieee754_csr {
 };
 #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31))
 
-static inline unsigned ieee754_getrm(void)
+static inline unsigned int ieee754_getrm(void)
 {
        return (ieee754_csr.rm);
 }
-static inline unsigned ieee754_setrm(unsigned rm)
+
+static inline unsigned int ieee754_setrm(unsigned int rm)
 {
        return (ieee754_csr.rm = rm);
 }
@@ -177,14 +178,14 @@ static inline unsigned ieee754_setrm(unsigned rm)
 /*
  * get current exceptions
  */
-static inline unsigned ieee754_getcx(void)
+static inline unsigned int ieee754_getcx(void)
 {
        return (ieee754_csr.cx);
 }
 
 /* test for current exception condition
  */
-static inline int ieee754_cxtest(unsigned n)
+static inline int ieee754_cxtest(unsigned int n)
 {
        return (ieee754_csr.cx & n);
 }
@@ -192,21 +193,21 @@ static inline int ieee754_cxtest(unsigned n)
 /*
  * get sticky exceptions
  */
-static inline unsigned ieee754_getsx(void)
+static inline unsigned int ieee754_getsx(void)
 {
        return (ieee754_csr.sx);
 }
 
 /* clear sticky conditions
 */
-static inline unsigned ieee754_clrsx(void)
+static inline unsigned int ieee754_clrsx(void)
 {
        return (ieee754_csr.sx = 0);
 }
 
 /* test for sticky exception condition
  */
-static inline int ieee754_sxtest(unsigned n)
+static inline int ieee754_sxtest(unsigned int n)
 {
        return (ieee754_csr.sx & n);
 }
index dd2071f..06ac0e2 100644 (file)
@@ -54,13 +54,13 @@ static inline int ieee754_class_nan(int xc)
 }
 
 #define COMPXSP \
-       unsigned xm; int xe; int xs __maybe_unused; int xc
+       unsigned int xm; int xe; int xs __maybe_unused; int xc
 
 #define COMPYSP \
-       unsigned ym; int ye; int ys; int yc
+       unsigned int ym; int ye; int ys; int yc
 
 #define COMPZSP \
-       unsigned zm; int ze; int zs; int zc
+       unsigned int zm; int ze; int zs; int zc
 
 #define EXPLODESP(v, vc, vs, ve, vm)                                   \
 {                                                                      \
index 260e689..8423e4c 100644 (file)
@@ -65,7 +65,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r)
        return r;
 }
 
-static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
+static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm)
 {
        /* inexact must round of 3 bits
         */
@@ -96,7 +96,7 @@ static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
  * xe is an unbiased exponent
  * xm is 3bit extended precision value.
  */
-union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
+union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm)
 {
        assert(xm);             /* we don't gen exact zeros (probably should) */
 
index 0f63e42..8c5a638 100644 (file)
@@ -69,7 +69,7 @@ static inline int ieee754sp_finite(union ieee754sp x)
 #define SPDNORMY       SPDNORMx(ym, ye)
 #define SPDNORMZ       SPDNORMx(zm, ze)
 
-static inline union ieee754sp buildsp(int s, int bx, unsigned m)
+static inline union ieee754sp buildsp(int s, int bx, unsigned int m)
 {
        union ieee754sp r;
 
index 27f6db3..23587b3 100644 (file)
@@ -23,9 +23,9 @@
 
 union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
 {
-       unsigned rm;
+       unsigned int rm;
        int re;
-       unsigned bm;
+       unsigned int bm;
 
        COMPXSP;
        COMPYSP;
index d5d8495..1a35d12 100644 (file)
@@ -23,7 +23,7 @@
 
 union ieee754sp ieee754sp_fint(int x)
 {
-       unsigned xm;
+       unsigned int xm;
        int xe;
        int xs;
 
index 7195fe7..f823338 100644 (file)
@@ -20,9 +20,9 @@ static union ieee754sp _sp_maddf(union ieee754sp z, union ieee754sp x,
 {
        int re;
        int rs;
-       unsigned rm;
-       uint64_t rm64;
-       uint64_t zm64;
+       unsigned int rm;
+       u64 rm64;
+       u64 zm64;
        int s;
 
        COMPXSP;
index d910c43..4015101 100644 (file)
@@ -25,15 +25,15 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
 {
        int re;
        int rs;
-       unsigned rm;
+       unsigned int rm;
        unsigned short lxm;
        unsigned short hxm;
        unsigned short lym;
        unsigned short hym;
-       unsigned lrm;
-       unsigned hrm;
-       unsigned t;
-       unsigned at;
+       unsigned int lrm;
+       unsigned int hrm;
+       unsigned int t;
+       unsigned int at;
 
        COMPXSP;
        COMPYSP;
index 2e2514e..e3e94d0 100644 (file)
@@ -179,7 +179,7 @@ static int mips_dma_mmap(struct device *dev, struct vm_area_struct *vma,
        void *cpu_addr, dma_addr_t dma_addr, size_t size,
        unsigned long attrs)
 {
-       unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+       unsigned long user_count = vma_pages(vma);
        unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
        unsigned long addr = (unsigned long)cpu_addr;
        unsigned long off = vma->vm_pgoff;
index 5f6ea7d..84b7b59 100644 (file)
@@ -402,7 +402,6 @@ int page_is_ram(unsigned long pagenr)
 void __init paging_init(void)
 {
        unsigned long max_zone_pfns[MAX_NR_ZONES];
-       unsigned long lastpfn __maybe_unused;
 
        pagetable_init();
 
@@ -416,17 +415,14 @@ void __init paging_init(void)
        max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
 #endif
        max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
-       lastpfn = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
        max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
-       lastpfn = highend_pfn;
 
        if (cpu_has_dc_aliases && max_low_pfn != highend_pfn) {
                printk(KERN_WARNING "This processor doesn't support highmem."
                       " %ldk highmem ignored\n",
                       (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10));
                max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn;
-               lastpfn = max_low_pfn;
        }
 #endif
 
index 90fba9b..407f155 100644 (file)
 #define RALINK_GPIOMODE                        0x60
 
 #define PPLL_CFG1                      0x9c
-#define PDRV_SW_SET                    BIT(23)
 
 #define PPLL_DRV                       0xa0
-#define PDRV_SW_SET                    (1<<31)
-#define LC_CKDRVPD                     (1<<19)
-#define LC_CKDRVOHZ                    (1<<18)
-#define LC_CKDRVHZ                     (1<<17)
-#define LC_CKTEST                      (1<<16)
+#define PDRV_SW_SET                    BIT(31)
+#define LC_CKDRVPD                     BIT(19)
+#define LC_CKDRVOHZ                    BIT(18)
+#define LC_CKDRVHZ                     BIT(17)
+#define LC_CKTEST                      BIT(16)
 
 /* PCI Bridge registers */
 #define RALINK_PCI_PCICFG_ADDR         0x00
@@ -66,7 +65,7 @@
 #define PCIEPHY0_CFG                   0x90
 
 #define RALINK_PCIEPHY_P0_CTL_OFFSET   0x7498
-#define RALINK_PCIE0_CLK_EN            (1 << 26)
+#define RALINK_PCIE0_CLK_EN            BIT(26)
 
 #define BUSY                           0x80000000
 #define WAITRETRY_MAX                  10
@@ -121,7 +120,7 @@ static int wait_pciephy_busy(void)
                else
                        break;
                if (retry++ > WAITRETRY_MAX) {
-                       printk(KERN_WARN "PCIE-PHY retry failed.\n");
+                       pr_warn("PCIE-PHY retry failed.\n");
                        return -1;
                }
        }
index fd28874..87ba86b 100644 (file)
@@ -639,7 +639,7 @@ static int __cvmx_pcie_rc_initialize_link_gen1(int pcie_port)
                        cvmx_dprintf("PCIe: Port %d link timeout\n", pcie_port);
                        return -1;
                }
-               cvmx_wait(10000);
+               __delay(10000);
                pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port));
        } while (pciercx_cfg032.s.dlla == 0);
 
@@ -821,7 +821,7 @@ retry:
         * don't poll PESCX_CTL_STATUS2[PCIERST], but simply wait a
         * fixed number of cycles.
         */
-       cvmx_wait(400000);
+       __delay(400000);
 
        /*
         * PESCX_BIST_STATUS2[PCLK_RUN] was missing on pass 1 of
@@ -1018,7 +1018,7 @@ retry:
                i = in_p_offset;
                while (i--) {
                        cvmx_write64_uint32(write_address, 0);
-                       cvmx_wait(10000);
+                       __delay(10000);
                }
 
                /*
@@ -1034,7 +1034,7 @@ retry:
                        dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA);
                        old_in_fif_p_count = dbg_data.s.data & 0xff;
                        cvmx_write64_uint32(write_address, 0);
-                       cvmx_wait(10000);
+                       __delay(10000);
                        dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA);
                        in_fif_p_count = dbg_data.s.data & 0xff;
                } while (in_fif_p_count != ((old_in_fif_p_count+1) & 0xff));
@@ -1053,7 +1053,7 @@ retry:
                        cvmx_dprintf("PCIe: Port %d aligning TLP counters as workaround to maintain ordering\n", pcie_port);
                        while (in_fif_p_count != 0) {
                                cvmx_write64_uint32(write_address, 0);
-                               cvmx_wait(10000);
+                               __delay(10000);
                                in_fif_p_count = (in_fif_p_count + 1) & 0xff;
                        }
                        /*
@@ -1105,7 +1105,7 @@ static int __cvmx_pcie_rc_initialize_link_gen2(int pcie_port)
        do {
                if (cvmx_get_cycle() - start_cycle >  octeon_get_clock_rate())
                        return -1;
-               cvmx_wait(10000);
+               __delay(10000);
                pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port));
        } while ((pciercx_cfg032.s.dlla == 0) || (pciercx_cfg032.s.lt == 1));
 
index f26736b..1f9cb0e 100644 (file)
@@ -31,7 +31,6 @@ choice
 
        config SOC_RT305X
                bool "RT305x"
-               select USB_ARCH_HAS_HCD
 
        config SOC_RT3883
                bool "RT3883"
index 9be8b08..41b71c4 100644 (file)
@@ -145,8 +145,8 @@ static struct rt2880_pmx_func i2c_grp_mt7628[] = {
        FUNC("i2c", 0, 4, 2),
 };
 
-static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) };
-static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) };
+static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("refclk", 0, 37, 1) };
+static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) };
 static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) };
 static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) };
 
diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
deleted file mode 100644 (file)
index ca7b236..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-choice
-       prompt "Machine type"
-       depends on MACH_XILFPGA
-       default XILFPGA_NEXYS4DDR
-
-config XILFPGA_NEXYS4DDR
-       bool "Nexys4DDR by Digilent"
-
-endchoice
diff --git a/arch/mips/xilfpga/Makefile b/arch/mips/xilfpga/Makefile
deleted file mode 100644 (file)
index a4deec6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the Xilfpga
-#
-
-obj-y +=       init.o
-obj-y +=       intc.o
-obj-y +=       time.o
diff --git a/arch/mips/xilfpga/Platform b/arch/mips/xilfpga/Platform
deleted file mode 100644 (file)
index ed375af..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-platform-$(CONFIG_MACH_XILFPGA) += xilfpga/
-cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga
-load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
diff --git a/arch/mips/xilfpga/init.c b/arch/mips/xilfpga/init.c
deleted file mode 100644 (file)
index 602e384..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Xilfpga platform setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- */
-
-#include <linux/of_fdt.h>
-
-#include <asm/prom.h>
-
-#define XILFPGA_UART_BASE      0xb0401000
-
-const char *get_system_type(void)
-{
-       return "MIPSfpga";
-}
-
-void __init plat_mem_setup(void)
-{
-       __dt_setup_arch(__dtb_start);
-       strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
-}
-
-void __init prom_init(void)
-{
-       setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
-}
-
-void __init prom_free_prom_memory(void)
-{
-}
-
-void __init device_tree_init(void)
-{
-       if (!initial_boot_params)
-               return;
-
-       unflatten_and_copy_device_tree();
-}
diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
deleted file mode 100644 (file)
index a127cca..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Xilfpga interrupt controller setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- */
-
-#include <linux/of.h>
-#include <linux/of_irq.h>
-#include <linux/irqchip.h>
-
-#include <asm/irq_cpu.h>
-
-
-void __init arch_init_irq(void)
-{
-       irqchip_init();
-}
diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
deleted file mode 100644 (file)
index 36f3f18..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Xilfpga clocksource/timer setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/clocksource.h>
-#include <linux/of.h>
-
-#include <asm/time.h>
-
-void __init plat_time_init(void)
-{
-       struct device_node *np;
-       struct clk *clk;
-
-       of_clk_init(NULL);
-       timer_probe();
-
-       np = of_get_cpu_node(0, NULL);
-       if (!np) {
-               pr_err("Failed to get CPU node\n");
-               return;
-       }
-
-       clk = of_clk_get(np, 0);
-       if (IS_ERR(clk)) {
-               pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
-               return;
-       }
-
-       mips_hpt_frequency = clk_get_rate(clk) / 2;
-       clk_put(clk);
-}
index 9d1b7bf..b7adc61 100644 (file)
@@ -843,8 +843,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
        if (!res_irq)
                return -ENODEV;
 
-       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
-                                 clk_get(&pdev->dev, "periph");
+       clk = clk_get(&pdev->dev, "refclk");
+       if (IS_ERR(clk) && pdev->dev.of_node)
+               clk = of_clk_get(pdev->dev.of_node, 0);
+
        if (IS_ERR(clk))
                return -ENODEV;
 
index c722cbf..ca200d1 100644 (file)
@@ -1460,7 +1460,7 @@ config INDYDOG
 
 config JZ4740_WDT
        tristate "Ingenic jz4740 SoC hardware watchdog"
-       depends on MACH_JZ4740
+       depends on MACH_JZ4740 || MACH_JZ4780
        select WATCHDOG_CORE
        help
          Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.