1. 11 Nov, 2015 40 commits
    • Hauke Mehrtens's avatar
      MIPS: Lantiq: Add support for setting PMU register on AR10 and GRX390 · 758d2443
      Hauke Mehrtens authored
      This adds support for setting the PMU register on the AR10 and GRX390.
      Signed-off-by: default avatarHauke Mehrtens <hauke.mehrtens@lantiq.com>
      Acked-by: default avatarJohn Crispin <blogic@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11382/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      758d2443
    • Hauke Mehrtens's avatar
      MIPS: Lantiq: Add locking for PMU register and check status afterwards · cab7b836
      Hauke Mehrtens authored
      The PMU register are accessed in a non atomic way and they could be
      accessed by different threads simultaneously, which could cause
      problems this patch adds locking around the PMU registers. In
      addition we now also wait till the PMU is actually deactivated.
      
      [ralf@linux-mips.org: Fix spelling mistake in commit message as noticed
      by Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>.]
      Signed-off-by: default avatarHauke Mehrtens <hauke.mehrtens@lantiq.com>
      Acked-by: default avatarJohn Crispin <blogic@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11381/
      Patchwork: https://patchwork.linux-mips.org/patch/11396/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      cab7b836
    • Rafał Miłecki's avatar
      MIPS: BCM47xx: Fetch board info directly in callback function · d8cfb503
      Rafał Miłecki authored
      This drops another symbol dependency between setup.c and sprom.c which
      will allow us to make SPROM code a separated module (and share it with
      ARM).
      Patch tested on Linksys WRT300N V1.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11360/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      d8cfb503
    • Rafał Miłecki's avatar
      MIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by checkpatch.pl · 2f94acde
      Rafał Miłecki authored
      There are still few left:
      1) Most of them about lines over 80 chars (increased readability exception)
      2) Wrong parsing of preprocessor macros
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/11356/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      2f94acde
    • Rafał Miłecki's avatar
      MIPS: BCM47xx: Support on-SoC bus in SPROM reading function · daa7ce02
      Rafał Miłecki authored
      To support (extract) SPROM on Broadcom ARM devices we should separate
      SPROM code and make it a separated module. We won't want to export
      bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard
      fallback function and then modify ssb to use it.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11355/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      daa7ce02
    • Hauke Mehrtens's avatar
      MIPS: lantiq: add clk_round_rate() · 500fab97
      Hauke Mehrtens authored
      This adds a basic implementation of clk_round_rate()
      The clk_round_rate() function is called by multiple drivers and
      subsystems now and the lantiq clk driver is supposed to export this,
      but doesn't do so, this causes linking problems like this one:
      ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Acked-by: default avatarJohn Crispin <blogic@openwrt.org>
      Cc: <stable@vger.kernel.org> # 4.1+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11358/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      500fab97
    • Aaro Koskinen's avatar
      MIPS: Add LATENCYTOP support · e1e16115
      Aaro Koskinen authored
      Add LATENCYTOP support for MIPS. Tested on OCTEON.
      Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@nokia.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11353/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      e1e16115
    • Julia Lawall's avatar
      MIPS: pci-rt3883: drop unneeded of_node_get · 972cfd55
      Julia Lawall authored
      for_each_child_of_node performs an of_node_get on each iteration, so no
      of_node_get is needed on breaking out of the loop when the device_node
      structure is saved in another variable.
      
      A simplified semantic match that finds this problem is as follows
      (http://coccinelle.lip6.fr):
      
      // <smpl>
      @@
      expression root;
      local idexpression child;
      @@
      
       for_each_child_of_node(root, child) {
         ...
      *  of_node_get(child)
         ...
         break;
       }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Cc: kernel-janitors@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Patchwork: https://patchwork.linux-mips.org/patch/11357/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      972cfd55
    • Alex Smith's avatar
      MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() · a7f4df4e
      Alex Smith authored
      Add user-mode implementations of gettimeofday() and clock_gettime() to
      the VDSO. This is currently usable with 2 clocksources: the CP0 count
      register, which is accessible to user-mode via RDHWR on R2 and later
      cores, or the MIPS Global Interrupt Controller (GIC) timer, which
      provides a "user-mode visible" section containing a mirror of its
      counter registers. This section must be mapped into user memory, which
      is done below the VDSO data page.
      
      When a supported clocksource is not in use, the VDSO functions will
      return -ENOSYS, which causes libc to fall back on the standard syscall
      path.
      
      When support for neither of these clocksources is compiled into the
      kernel at all, the VDSO still provides clock_gettime(), as the coarse
      realtime/monotonic clocks can still be implemented. However,
      gettimeofday() is not provided in this case as nothing can be done
      without a suitable clocksource. This causes the symbol lookup to fail
      in libc and it will then always use the standard syscall path.
      
      This patch includes a workaround for a bug in QEMU which results in
      RDHWR on the CP0 count register always returning a constant (incorrect)
      value. A fix for this has been submitted, and the workaround can be
      removed after the fix has been in stable releases for a reasonable
      amount of time.
      
      A simple performance test which calls gettimeofday() 1000 times in a
      loop and calculates the average execution time gives the following
      results on a Malta + I6400 (running at 20MHz):
      
       - Syscall:    ~31000 ns
       - VDSO (GIC): ~15000 ns
       - VDSO (CP0): ~9500 ns
      
      [markos.chandras@imgtec.com:
      - Minor code re-arrangements in order for mappings to be made
      in the order they appear to the process' address space.
      - Move do_{monotonic, realtime} outside of the MIPS_CLOCK_VSYSCALL ifdef
      - Use gic_get_usm_range so we can do the GIC mapping in the
      arch/mips/kernel/vdso instead of the GIC irqchip driver]
      Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11338/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      a7f4df4e
    • Alex Smith's avatar
      irqchip: irq-mips-gic: Provide function to map GIC user section · c0a9f72c
      Alex Smith authored
      The GIC provides a "user-mode visible" section containing a mirror of
      the counter registers which can be mapped into user memory. This will
      be used by the VDSO time function implementations, so provide a
      function to map it in.
      
      When the GIC is not enabled in Kconfig a dummy inline version of this
      function is provided, along with "#define gic_present 0", so that we
      don't have to litter the VDSO code with ifdefs.
      
      [markos.chandras@imgtec.com:
        - Move mapping code to arch/mips/kernel/vdso.c and use a resource
          type to get the GIC usermode information
        - Avoid renaming function arguments and use __gic_base_addr to hold
          the base GIC address prior to ioremap.]
      [ralf@linux-mips.org: Fix up gic_get_usm_range() to compile and make inline
      again.]
      Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alex Smith <alex.smith@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/11281/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      c0a9f72c
    • Alex Smith's avatar
      MIPS: Initial implementation of a VDSO · ebb5e78c
      Alex Smith authored
      Add an initial implementation of a proper (i.e. an ELF shared library)
      VDSO. With this commit it does not export any symbols, it only replaces
      the current signal return trampoline page. A later commit will add user
      implementations of gettimeofday()/clock_gettime().
      
      To support both new toolchains and old ones which don't generate ABI
      flags section, we define its content manually and then use a tool
      (genvdso) to patch up the section to have the correct name and type.
      genvdso also extracts symbol offsets ({,rt_}sigreturn) needed by the
      kernel, and generates a C file containing a "struct mips_vdso_image"
      containing both the VDSO data and these offsets. This C file is
      compiled into the kernel.
      
      On 64-bit kernels we require a different VDSO for each supported ABI,
      so we may build up to 3 different VDSOs. The VDSO to use is selected by
      the mips_abi structure.
      
      A kernel/user shared data page is created and mapped below the VDSO
      image. This is currently empty, but will be used by the user time
      function implementations which are added later.
      
      [markos.chandras@imgtec.com:
      - Add more comments
      - Move abi detection in genvdso.h since it's the get_symbol function
      that needs it.
      - Add an R6 specific way to calculate the base address of VDSO in order
      to avoid the branch instruction which affects performance.
      - Do not patch .gnu.attributes since it's not needed for dynamic linking.
      - Simplify Makefile a little bit.
      - checkpatch fixes
      - Restrict VDSO support for binutils < 2.25 for pre-R6
      - Include atomic64.h for O32 variant on MIPS64]
      Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11337/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ebb5e78c
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: mpc30x_defconfig: Convert to use libata PATA drivers · 22773aa9
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts mpc30x_defconfig to use libata PATA
      drivers.
      
      PS This platform still uses "ide0=base[,ctl[,irq]]" hack in
      its defconfig.  The hack itself has been removed in 2008 and
      this platform should be converted to using PATA platform host
      driver (pata_platform) instead.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11141/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      22773aa9
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: maltaup_xpa_defconfig: Convert to use libata PATA drivers · 1b7d8012
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts maltaup_xpa_defconfig to use libata PATA
      drivers (tc86c001 IDE host driver has no corresponding libata
      driver yet so it is not converted).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11140/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      1b7d8012
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: maltaup_defconfig: Convert to use libata PATA drivers · 93c7e664
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts maltaup_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11142/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      93c7e664
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: maltasmvp_eva_defconfig: Convert to use libata PATA drivers · b0b98ad9
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts maltasmvp_eva_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11139/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      b0b98ad9
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: maltaaprp_defconfig: Convert to use libata PATA drivers · 255faa84
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts maltaaprp_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: b.zolnierkie@samsung.com
      Patchwork: https://patchwork.linux-mips.org/patch/11137/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      255faa84
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: malta_qemu_32r6_defconfig: Convert to use libata PATA drivers · 077b649a
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts malta_qemu_32r6_defconfig to use libata
      PATA drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: b.zolnierkie@samsung.com
      Patchwork: https://patchwork.linux-mips.org/patch/11138/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      077b649a
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: malta_kvm_guest_defconfig: Convert to use libata PATA drivers · 5f6df05b
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts malta_kvm_guest_defconfig to use libata
      PATA drivers (tc86c001 IDE host driver has no corresponding
      libata driver yet so it is not converted).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11136/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5f6df05b
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: malta_kvm_defconfig: Convert to use libata PATA drivers · 91c6fbab
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts malta_kvm_defconfig to use libata PATA
      drivers (tc86c001 IDE host driver has no corresponding libata
      driver yet so it is not converted).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11135/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      91c6fbab
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: malta_defconfig: Convert to use libata PATA drivers · d17e4655
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts malta_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11134/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      d17e4655
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: lemote2f_defconfig: Convert to use libata PATA drivers · 7ff7a5b1
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts lemote2f_defconfig to use libata PATA
      drivers.
      
      PS This platform uses CS5536 chipset which (due to historical
      reasons) has basic support in AMD/nVidia PATA host driver and
      full support in a newer CS5536 PATA one (pata_cs5536).  Thus
      most likely this platform should switch to using the latter
      host driver.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11133/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      7ff7a5b1
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: lasat_defconfig: Convert to use libata PATA drivers · 973852fc
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts lasat_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Brian Murphy <brian@murphy.dk>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11132/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      973852fc
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: fuloong2e_defconfig: Convert to use libata PATA drivers · 1485ddcc
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts fuloong2e_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11131/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      1485ddcc
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: e55_defconfig: Convert to use libata PATA drivers · 5c2a53a1
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts e55_defconfig to use libata PATA drivers.
      
      PS This platform still uses "ide0=base[,ctl[,irq]]" hack in
      its defconfig.  The hack itself has been removed in 2008 and
      this platform should be converted to using PATA platform host
      driver (pata_platform) instead.
      
      Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5c2a53a1
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: capcella_defconfig: Convert to use libata PATA drivers · 5081f4fc
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts capcella_defconfig to use libata PATA
      drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11129/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5081f4fc
    • Bartlomiej Zolnierkiewicz's avatar
      MIPS: bigsur_defconfig: Convert to use libata PATA drivers · adcdd428
      Bartlomiej Zolnierkiewicz authored
      IDE subsystem has been deprecated since 2009 and the majority
      (if not all) of Linux distributions have switched to use
      libata for ATA support exclusively.  However there are still
      some users (mostly old or/and embedded non-x86 systems) that
      have not converted from using IDE subsystem to libata PATA
      drivers.  This doesn't seem to be good thing in the long-term
      for Linux as while there is less and less PATA systems left
      in use:
      
      * testing efforts are divided between two subsystems
      
      * having duplicate drivers for same hardware confuses users
      
      This patch converts bigsur_defconfig to use libata PATA
      drivers (tc86c001 IDE host driver has no corresponding libata
      driver yet so it is not converted).
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11128/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      adcdd428
    • Paul Burton's avatar
      MIPS: Extend hardware table walking support to MIPS64 · cab25bc7
      Paul Burton authored
      Extend the existing support for Hardware Table Walking (HTW) to MIPS64
      systems by supporting PMDs & setting the pointer size bit in PWSize,
      then ceasing to blacklist HTW on MIPS64 systems.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Joshua Kinard <kumba@gentoo.org>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11224/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      cab25bc7
    • Paul Burton's avatar
      MIPS: Malta: Register UP SMP ops if all else fails · ecafe3e9
      Paul Burton authored
      If we fail to register any real SMP implementations, fall back to
      registering the dummy UP implementation. Otherwise when we build an SMP
      kernel & run it on a system where the SMP implementations fail to probe
      (eg. QEMU) the kernel will perform a NULL dereference attempting to call
      mp_ops->smp_setup() from plat_smp_setup().
      
      Notably this fixes booting kernels with CPS SMP enabled on QEMU, which
      doesn't currently implement the CM, CPC or GIC.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11223/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ecafe3e9
    • Paul Burton's avatar
      MIPS: Malta: Setup RAM regions via DT · e81a8c7d
      Paul Burton authored
      Move memory configuration to be performed via device tree for the Malta
      board. This moves more Malta specific code to malta-dtshim.c, leaving
      the rest of the mti-malta code a little more board-agnostic. This will
      be useful to share more code between boards, with the device tree
      providing the board specifics as intended.
      
      Since we can't rely upon Malta boards running a bootloader capable of
      handling devictrees & filling in the required information, a piece of
      shim code (malta_dt_shim) is added to consume the (e)memsize variables
      provided as part of the bootloader environment (or on the kernel command
      line) then generate the DT memory node using the provided values.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: Kumar Gala <galak@codeaurora.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11222/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      e81a8c7d
    • Paul Burton's avatar
      MIPS: Malta: Remove fw_memblock_t abstraction · ea050714
      Paul Burton authored
      The fw_getmdesc function & fw_memblock_t abstraction is only used by
      Malta, and so far as I can tell serves no purpose beyond making the code
      less clear than it could be. Remove the useless level of abstraction.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11221/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ea050714
    • Paul Burton's avatar
      MIPS: Malta: Split obj-y entries across lines · e1137e1d
      Paul Burton authored
      Split the obj-y entries to their own lines such that it's easier to see
      what's going on when adding or removing entries.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11220/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      e1137e1d
    • Paul Burton's avatar
      MIPS: Allow RIXI for 32-bit kernels on MIPS64 · 033549c6
      Paul Burton authored
      Commit a68d09a1 ("MIPS: Don't use RI/XI with 32-bit kernels on
      64-bit CPUs") prevented use of RIXI on MIPS64 systems, stating that the
      "TLB handlers cannot handle this case". What they actually couldn't
      handle was cases where there were less fill bits in the Entry{Lo,Hi}
      registers than bits used by software in PTEs. The handlers can now deal
      with this case, so enable RIXI for MIPS32 kernels on MIPS64 systems.
      
      Note that beyond the obvious benefits provided by having RIXI on such
      systems, this is required for systems implementing MIPSr6 where RIXI
      cannot be disabled.
      
      This reverts commit a68d09a1 ("MIPS: Don't use RI/XI with 32-bit
      kernels on 64-bit CPUs").
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Joshua Kinard <kumba@gentoo.org>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11219/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      033549c6
    • Paul Burton's avatar
      MIPS: tlbex: Avoid placing software PTE bits in Entry* PFN fields · 00bf1c69
      Paul Burton authored
      Commit 748e787e ("MIPS: Optimize TLB refill for RI/XI
      configurations.") stopped explicitly clearing the bits used by software
      in PTEs by making use of a rotate instruction that rotates them into the
      fill bits of the Entry{Lo,Hi} register. This can only work if there are
      actually enough fill bits in the register to cover the software
      maintained bits, otherwise we end up writing those bits into the upper
      bits of the PFN or PFNX field of the Entry{Lo,Hi} register.
      
      Fix this by detecting the number of fill bits present in the
      Entry{Lo,Hi} registers & explicitly clearing the software bits where
      necessary.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11218/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      00bf1c69
    • Paul Burton's avatar
      MIPS: Tidy EntryLo bit definitions, add PFN · c6956728
      Paul Burton authored
      Tidy up the definition of the EntryLo RI & XI bits using BITS_PER_LONG
      rather than #ifdef'ing on CONFIG_64BIT, and add a definition for the
      offset to the PFN field for use by a later patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11217/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      c6956728
    • Paul Burton's avatar
      MIPS: tlbex: Share MIPS32 32 bit phys & MIPS64 64 bit phys code · c676589b
      Paul Burton authored
      The code in build_update_entries for 64 bit physical addresses on a
      MIPS64 CPU and 32 bit physical addresses on a MIPS32 CPU is now
      identical, with the exception of r4k bug workaround in the latter which
      would simply not apply to the former. Remove the duplication and some
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11216/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      c676589b
    • Paul Burton's avatar
      MIPS: tlbex: Remove some RIXI redundancy · 974a0b6a
      Paul Burton authored
      The cpu_has_rixi cases in build_update_entries are now identical to the
      non-RIXI cases with the one exception of the r45k_bvahwbug case which is
      hardcoded as never happening anyway & presumably was either missed from
      the RIXI path or would never happen on a CPU with RIXI support. Remove
      the redundant checks & duplication.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11215/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      974a0b6a
    • Paul Burton's avatar
      MIPS: tlbex: Stop open-coding build_convert_pte_to_entrylo · dbfd657a
      Paul Burton authored
      Make use of build_convert_pte_to_entrylo in the RIXI cases within
      build_update_entries rather than open-coding it 4 times.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11214/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      dbfd657a
    • Paul Burton's avatar
      MIPS: Always use r4k_wait_irqoff for MIPSr6 · 5b10a0e8
      Paul Burton authored
      Prior to release 6 of the MIPS architecture it has been implementation
      dependent whether masked interrupts cause a wait instruction to return,
      so the kernel has effectively had to maintain a whitelist of cores upon
      which it is safe to use the r4k_wait_irqoff cpu_wait implementation.
      With MIPSr6 this is no longer implementation dependent and
      r4k_wait_irqoff can always be used.
      
      Remove the existing I6400 case which will no longer ever be hit, and was
      incorrect anyway since I6400 & r6 in general doesn't have the WII bit.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11210/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5b10a0e8
    • Paul Burton's avatar
      MIPS: CM, CPC: Ensure core-other GCRs reflect the correct core · 78a54c4d
      Paul Burton authored
      Ensure the update to which core the core-other GCR regions reflect has
      taken place before any core-other GCRs are accessed by placing a memory
      barrier (sync instruction) between the write to the core-other registers
      and any such GCR accesses.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11209/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      78a54c4d
    • Paul Burton's avatar
      MIPS: CM: make use of mips_cm_{lock,unlock}_other · 4ede3161
      Paul Burton authored
      Document that CPC core-other accesses must take place within the bounds
      of the CM lock, and begin using the CM lock functions where we access
      the GCRs of other cores. This is required because with CM3 the CPC began
      using GCR_CL_OTHER instead of CPC_CL_OTHER.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Niklas Cassel <niklas.cassel@axis.com>
      Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11208/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      4ede3161