Merge branch 'mips-for-linux-next' of git://git.linux-mips.org/pub/scm/ralf/upstream-sfr
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 20:40:50 +0000 (13:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 20:40:50 +0000 (13:40 -0700)
Pull MIPS updates from Ralf Baechle:
 - Support for Imgtec's Aptiv family of MIPS cores.
 - Improved detection of BCM47xx configurations.
 - Fix hiberation for certain configurations.
 - Add support for the Chinese Loongson 3 CPU, a MIPS64 R2 core and
   systems.
 - Detection and support for the MIPS P5600 core.
 - A few more random fixes that didn't make 3.14.
 - Support for the EVA Extended Virtual Addressing
 - Switch Alchemy to the platform PATA driver
 - Complete unification of Alchemy support
 - Allow availability of I/O cache coherency to be runtime detected
 - Improvments to multiprocessing support for Imgtec platforms
 - A few microoptimizations
 - Cleanups of FPU support
 - Paul Gortmaker's fixes for the init stuff
 - Support for seccomp

* 'mips-for-linux-next' of git://git.linux-mips.org/pub/scm/ralf/upstream-sfr: (165 commits)
  MIPS: CPC: Use __raw_ memory access functions
  MIPS: CM: use __raw_ memory access functions
  MIPS: Fix warning when including smp-ops.h with CONFIG_SMP=n
  MIPS: Malta: GIC IPIs may be used without MT
  MIPS: smp-mt: Use common GIC IPI implementation
  MIPS: smp-cmp: Remove incorrect core number probe
  MIPS: Fix gigaton of warning building with microMIPS.
  MIPS: Fix core number detection for MT cores
  MIPS: MT: core_nvpes function to retrieve VPE count
  MIPS: Provide empty mips_mt_set_cpuoptions when CONFIG_MIPS_MT=n
  MIPS: Lasat: Replace del_timer by del_timer_sync
  MIPS: Malta: Setup PM I/O region on boot
  MIPS: Loongson: Add a Loongson-3 default config file
  MIPS: Loongson 3: Add CPU hotplug support
  MIPS: Loongson 3: Add Loongson-3 SMP support
  MIPS: Loongson: Add Loongson-3 Kconfig options
  MIPS: Loongson: Add swiotlb to support All-Memory DMA
  MIPS: Loongson 3: Add serial port support
  MIPS: Loongson 3: Add IRQ init and dispatch support
  MIPS: Loongson 3: Add HT-linked PCI support
  ...

1  2 
arch/mips/Kconfig
drivers/spi/spi-au1550.c

diff --combined arch/mips/Kconfig
index cb1da372346c5da1c57fb445b0da597665cd5879,fc9be7c8c5aaf6d2baf57ff1b2ff37afec811f38..16d5ab1615b1b1ee39b2148c01aa4b0b2df74d6a
@@@ -10,6 -10,7 +10,7 @@@ config MIP
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
        select HAVE_ARCH_KGDB
+       select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select ARCH_HAVE_CUSTOM_GPIO_H
        select HAVE_FUNCTION_TRACER
@@@ -62,11 -63,14 +63,12 @@@ config MIPS_ALCHEM
        select CEVT_R4K
        select CSRC_R4K
        select IRQ_CPU
+       select DMA_MAYBE_COHERENT       # Au1000,1500,1100 aren't, rest is
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_APM_EMULATION
        select ARCH_REQUIRE_GPIOLIB
        select SYS_SUPPORTS_ZBOOT
 -      select USB_ARCH_HAS_OHCI
 -      select USB_ARCH_HAS_EHCI
  
  config AR7
        bool "Texas Instruments AR7"
@@@ -121,7 -125,7 +123,7 @@@ config BCM47X
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_HAS_EARLY_PRINTK
-       select EARLY_PRINTK_8250 if EARLY_PRINTK
+       select USE_GENERIC_EARLY_PRINTK_8250
        help
         Support for BCM47XX based boards
  
@@@ -148,7 -152,6 +150,6 @@@ config MIPS_COBAL
        select CSRC_R4K
        select CEVT_GT641XX
        select DMA_NONCOHERENT
-       select EARLY_PRINTK_8250 if EARLY_PRINTK
        select HW_HAS_PCI
        select I8253
        select I8259
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
+       select USE_GENERIC_EARLY_PRINTK_8250
  
  config MACH_DECSTATION
        bool "DECstations"
@@@ -233,7 -237,6 +235,6 @@@ config MACH_JZ474
        select IRQ_CPU
        select ARCH_REQUIRE_GPIOLIB
        select SYS_HAS_EARLY_PRINTK
-       select HAVE_PWM
        select HAVE_CLK
        select GENERIC_IRQ_CHIP
  
@@@ -318,6 -321,7 +319,7 @@@ config MIPS_MALT
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_HAS_CPU_MIPS32_R2
+       select SYS_HAS_CPU_MIPS32_R3_5
        select SYS_HAS_CPU_MIPS64_R1
        select SYS_HAS_CPU_MIPS64_R2
        select SYS_HAS_CPU_NEVADA
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_MIPS_CMP
+       select SYS_SUPPORTS_MIPS_CPS
        select SYS_SUPPORTS_MULTITHREADING
        select SYS_SUPPORTS_SMARTMIPS
        select SYS_SUPPORTS_ZBOOT
@@@ -358,6 -363,7 +361,6 @@@ config MIPS_SEAD
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_SMARTMIPS
        select SYS_SUPPORTS_MICROMIPS
 -      select USB_ARCH_HAS_EHCI
        select USB_EHCI_BIG_ENDIAN_DESC
        select USB_EHCI_BIG_ENDIAN_MMIO
        select USE_OF
@@@ -671,6 -677,7 +674,7 @@@ config SNI_R
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
        select SYS_SUPPORTS_LITTLE_ENDIAN
+       select USE_GENERIC_EARLY_PRINTK_8250
        help
          The SNI RM200/300/400 are MIPS-based machines manufactured by
          Siemens Nixdorf Informationssysteme (SNI), parent company of Pyramid
@@@ -715,6 -722,8 +719,6 @@@ config CAVIUM_OCTEON_SO
        select SWAP_IO_SPACE
        select HW_HAS_PCI
        select ZONE_DMA32
 -      select USB_ARCH_HAS_OHCI
 -      select USB_ARCH_HAS_EHCI
        select HOLES_IN_ZONE
        select ARCH_REQUIRE_GPIOLIB
        help
@@@ -751,6 -760,8 +755,6 @@@ config NLM_XLR_BOAR
        select ZONE_DMA32 if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
 -      select USB_ARCH_HAS_OHCI if USB_SUPPORT
 -      select USB_ARCH_HAS_EHCI if USB_SUPPORT
        select SYS_SUPPORTS_ZBOOT
        select SYS_SUPPORTS_ZBOOT_UART16550
        help
@@@ -775,7 -786,6 +779,6 @@@ config NLM_XLP_BOAR
        select CEVT_R4K
        select CSRC_R4K
        select IRQ_CPU
-       select ARCH_SUPPORTS_MSI
        select ZONE_DMA32 if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
@@@ -861,6 -871,7 +864,7 @@@ config CEVT_R4
        bool
  
  config CEVT_GIC
+       select MIPS_CM
        bool
  
  config CEVT_SB1250
@@@ -879,6 -890,7 +883,7 @@@ config CSRC_R4
        bool
  
  config CSRC_GIC
+       select MIPS_CM
        bool
  
  config CSRC_SB1250
@@@ -1023,6 -1035,7 +1028,7 @@@ config IRQ_GT641X
        bool
  
  config IRQ_GIC
+       select MIPS_CM
        bool
  
  config PCI_GT64XXX_PCI0
@@@ -1141,6 -1154,18 +1147,18 @@@ choic
        prompt "CPU type"
        default CPU_R4X00
  
+ config CPU_LOONGSON3
+       bool "Loongson 3 CPU"
+       depends on SYS_HAS_CPU_LOONGSON3
+       select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
+       select CPU_SUPPORTS_HUGEPAGES
+       select WEAK_ORDERING
+       select WEAK_REORDERING_BEYOND_LLSC
+       help
+               The Loongson 3 processor implements the MIPS64R2 instruction
+               set with many extensions.
  config CPU_LOONGSON2E
        bool "Loongson 2E"
        depends on SYS_HAS_CPU_LOONGSON2E
@@@ -1196,6 -1221,7 +1214,7 @@@ config CPU_MIPS32_R
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
+       select CPU_SUPPORTS_MSA
        select HAVE_KVM
        help
          Choose this option to build a kernel for release 2 or later of the
@@@ -1231,6 -1257,7 +1250,7 @@@ config CPU_MIPS64_R
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
        select CPU_SUPPORTS_HUGEPAGES
+       select CPU_SUPPORTS_MSA
        help
          Choose this option to build a kernel for release 2 or later of the
          MIPS64 architecture.  Many modern embedded systems with a 64-bit
@@@ -1389,7 -1416,6 +1409,6 @@@ config CPU_CAVIUM_OCTEO
        select LIBFDT
        select USE_OF
        select USB_EHCI_BIG_ENDIAN_MMIO
-       select SYS_HAS_DMA_OPS
        select MIPS_L1_CACHE_SHIFT_7
        help
          The Cavium Octeon processor is a highly integrated chip containing
@@@ -1441,6 -1467,26 +1460,26 @@@ config CPU_XL
          Netlogic Microsystems XLP processors.
  endchoice
  
+ config CPU_MIPS32_3_5_FEATURES
+       bool "MIPS32 Release 3.5 Features"
+       depends on SYS_HAS_CPU_MIPS32_R3_5
+       depends on CPU_MIPS32_R2
+       help
+         Choose this option to build a kernel for release 2 or later of the
+         MIPS32 architecture including features from the 3.5 release such as
+         support for Enhanced Virtual Addressing (EVA).
+ config CPU_MIPS32_3_5_EVA
+       bool "Enhanced Virtual Addressing (EVA)"
+       depends on CPU_MIPS32_3_5_FEATURES
+       select EVA
+       default y
+       help
+         Choose this option if you want to enable the Enhanced Virtual
+         Addressing (EVA) on your MIPS32 core (such as proAptiv).
+         One of its primary benefits is an increase in the maximum size
+         of lowmem (up to 3GB). If unsure, say 'N' here.
  if CPU_LOONGSON2F
  config CPU_NOP_WORKAROUNDS
        bool
@@@ -1516,6 -1562,10 +1555,10 @@@ config CPU_BMIPS500
        select SYS_SUPPORTS_SMP
        select SYS_SUPPORTS_HOTPLUG_CPU
  
+ config SYS_HAS_CPU_LOONGSON3
+       bool
+       select CPU_SUPPORTS_CPUFREQ
  config SYS_HAS_CPU_LOONGSON2E
        bool
  
@@@ -1534,6 -1584,9 +1577,9 @@@ config SYS_HAS_CPU_MIPS32_R
  config SYS_HAS_CPU_MIPS32_R2
        bool
  
+ config SYS_HAS_CPU_MIPS32_R3_5
+       bool
  config SYS_HAS_CPU_MIPS64_R1
        bool
  
@@@ -1650,6 -1703,9 +1696,9 @@@ config CPU_MIPSR
        bool
        default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON
  
+ config EVA
+       bool
  config SYS_SUPPORTS_32BIT_KERNEL
        bool
  config SYS_SUPPORTS_64BIT_KERNEL
@@@ -1722,7 -1778,7 +1771,7 @@@ choic
  
  config PAGE_SIZE_4KB
        bool "4kB"
-       depends on !CPU_LOONGSON2
+       depends on !CPU_LOONGSON2 && !CPU_LOONGSON3
        help
         This option select the standard 4kB Linux page size.  On some
         R3000-family processors this is the only available page size.  Using
@@@ -1863,6 -1919,7 +1912,7 @@@ config MIPS_MT_SM
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
        select SYNC_R4K
+       select MIPS_GIC_IPI
        select MIPS_MT
        select SMP
        select SMP_UP
@@@ -1880,6 -1937,7 +1930,7 @@@ config MIPS_MT_SMT
        bool "Use all TCs on all VPEs for SMP (DEPRECATED)"
        depends on CPU_MIPS32_R2
        depends on SYS_SUPPORTS_MULTITHREADING
+       depends on !MIPS_CPS
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_IRQ_EI
        select MIPS_MT
@@@ -1987,13 -2045,45 +2038,45 @@@ config MIPS_VPE_APSP_API_M
        depends on MIPS_VPE_APSP_API && !MIPS_CMP
  
  config MIPS_CMP
-       bool "MIPS CMP support"
-       depends on SYS_SUPPORTS_MIPS_CMP && MIPS_MT_SMP
+       bool "MIPS CMP framework support (DEPRECATED)"
+       depends on SYS_SUPPORTS_MIPS_CMP && !MIPS_MT_SMTC
+       select MIPS_GIC_IPI
        select SYNC_R4K
        select WEAK_ORDERING
        default n
        help
-         Enable Coherency Manager processor (CMP) support.
+         Select this if you are using a bootloader which implements the "CMP
+         framework" protocol (ie. YAMON) and want your kernel to make use of
+         its ability to start secondary CPUs.
+         Unless you have a specific need, you should use CONFIG_MIPS_CPS
+         instead of this.
+ config MIPS_CPS
+       bool "MIPS Coherent Processing System support"
+       depends on SYS_SUPPORTS_MIPS_CPS
+       select MIPS_CM
+       select MIPS_CPC
+       select MIPS_GIC_IPI
+       select SMP
+       select SYNC_R4K if (CEVT_R4K || CSRC_R4K)
+       select SYS_SUPPORTS_SMP
+       select WEAK_ORDERING
+       help
+         Select this if you wish to run an SMP kernel across multiple cores
+         within a MIPS Coherent Processing System. When this option is
+         enabled the kernel will probe for other cores and boot them with
+         no external assistance. It is safe to enable this when hardware
+         support is unavailable.
+ config MIPS_GIC_IPI
+       bool
+ config MIPS_CM
+       bool
+ config MIPS_CPC
+       bool
  
  config SB1_PASS_1_WORKAROUNDS
        bool
@@@ -2036,6 -2126,21 +2119,21 @@@ config CPU_MICROMIP
          When this option is enabled the kernel will be built using the
          microMIPS ISA
  
+ config CPU_HAS_MSA
+       bool "Support for the MIPS SIMD Architecture"
+       depends on CPU_SUPPORTS_MSA
+       default y
+       help
+         MIPS SIMD Architecture (MSA) introduces 128 bit wide vector registers
+         and a set of SIMD instructions to operate on them. When this option
+         is enabled the kernel will support allocating & switching MSA
+         vector register contexts. If you know that your kernel will only be
+         running on CPUs which do not support MSA or that your userland will
+         not be making use of it then you may wish to say N here to reduce
+         the size & complexity of your kernel.
+         If unsure, say Y.
  config CPU_HAS_WB
        bool
  
@@@ -2087,7 -2192,7 +2185,7 @@@ config CPU_R4400_WORKAROUND
  #
  config HIGHMEM
        bool "High Memory Support"
-       depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM
+       depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA
  
  config CPU_SUPPORTS_HIGHMEM
        bool
@@@ -2101,6 -2206,9 +2199,9 @@@ config SYS_SUPPORTS_SMARTMIP
  config SYS_SUPPORTS_MICROMIPS
        bool
  
+ config CPU_SUPPORTS_MSA
+       bool
  config ARCH_FLATMEM_ENABLE
        def_bool y
        depends on !NUMA && !CPU_LOONGSON2
@@@ -2174,6 -2282,9 +2275,9 @@@ config SMP_U
  config SYS_SUPPORTS_MIPS_CMP
        bool
  
+ config SYS_SUPPORTS_MIPS_CPS
+       bool
  config SYS_SUPPORTS_SMP
        bool
  
@@@ -2406,6 -2517,17 +2510,17 @@@ config PC
          your box. Other bus systems are ISA, EISA, or VESA. If you have PCI,
          say Y, otherwise N.
  
+ config HT_PCI
+       bool "Support for HT-linked PCI"
+       default y
+       depends on CPU_LOONGSON3
+       select PCI
+       select PCI_DOMAINS
+       help
+         Loongson family machines use Hyper-Transport bus for inter-core
+         connection and device connection. The PCI bus is a subordinate
+         linked at HT. Choose Y for Loongson-3 based machines.
  config PCI_DOMAINS
        bool
  
diff --combined drivers/spi/spi-au1550.c
index aafb812d7ea605b9b2b3fab468029d6fea022a5a,2ca4ee24755b180bad801d991a63302f3fd73093..67375a11d4bdc1f25b117005c06b2f0917a236d4
@@@ -55,6 -55,8 +55,6 @@@ struct au1550_spi 
  
        volatile psc_spi_t __iomem *regs;
        int irq;
 -      unsigned freq_max;
 -      unsigned freq_min;
  
        unsigned len;
        unsigned tx_count;
@@@ -246,8 -248,11 +246,8 @@@ static int au1550_spi_setupxfer(struct 
                        hz = t->speed_hz;
        }
  
 -      if (hz > spi->max_speed_hz || hz > hw->freq_max || hz < hw->freq_min) {
 -              dev_err(&spi->dev, "setupxfer: clock rate=%d out of range\n",
 -                      hz);
 +      if (!hz)
                return -EINVAL;
 -      }
  
        au1550_spi_bits_handlers_set(hw, spi->bits_per_word);
  
        return 0;
  }
  
 -static int au1550_spi_setup(struct spi_device *spi)
 -{
 -      struct au1550_spi *hw = spi_master_get_devdata(spi->master);
 -
 -      if (spi->max_speed_hz == 0)
 -              spi->max_speed_hz = hw->freq_max;
 -      if (spi->max_speed_hz > hw->freq_max
 -                      || spi->max_speed_hz < hw->freq_min)
 -              return -EINVAL;
 -      /*
 -       * NOTE: cannot change speed and other hw settings immediately,
 -       *       otherwise sharing of spi bus is not possible,
 -       *       so do not call setupxfer(spi, NULL) here
 -       */
 -      return 0;
 -}
 -
  /*
   * for dma spi transfers, we have to setup rx channel, otherwise there is
   * no reliable way how to recognize that spi transfer is done
@@@ -816,6 -838,7 +816,6 @@@ static int au1550_spi_probe(struct plat
        hw->bitbang.master = hw->master;
        hw->bitbang.setup_transfer = au1550_spi_setupxfer;
        hw->bitbang.chipselect = au1550_spi_chipsel;
 -      hw->bitbang.master->setup = au1550_spi_setup;
        hw->bitbang.txrx_bufs = au1550_spi_txrx_bufs;
  
        if (hw->usedma) {
        {
                int min_div = (2 << 0) * (2 * (4 + 1));
                int max_div = (2 << 3) * (2 * (63 + 1));
 -              hw->freq_max = hw->pdata->mainclk_hz / min_div;
 -              hw->freq_min = hw->pdata->mainclk_hz / (max_div + 1) + 1;
 +              master->max_speed_hz = hw->pdata->mainclk_hz / min_div;
 +              master->min_speed_hz =
 +                              hw->pdata->mainclk_hz / (max_div + 1) + 1;
        }
  
        au1550_spi_setup_psc_as_spi(hw);
@@@ -977,6 -999,15 +977,15 @@@ static int __init au1550_spi_init(void
         * create memory device with 8 bits dev_devwidth
         * needed for proper byte ordering to spi fifo
         */
+       switch (alchemy_get_cputype()) {
+       case ALCHEMY_CPU_AU1550:
+       case ALCHEMY_CPU_AU1200:
+       case ALCHEMY_CPU_AU1300:
+               break;
+       default:
+               return -ENODEV;
+       }
        if (usedma) {
                ddma_memid = au1xxx_ddma_add_device(&au1550_spi_mem_dbdev);
                if (!ddma_memid)