1. 05 9月, 2017 4 次提交
  2. 04 9月, 2017 28 次提交
  3. 30 8月, 2017 6 次提交
    • P
      clocksource: mips-gic-timer: Use new GIC accessor functions · e07127a0
      Paul Burton 提交于
      Switch from calling functions exported by the GIC interrupt controller
      to using new accessors provided by asm/mips-gic.h. This will allow the
      counter-handling functionality to be removed from the interrupt
      controller driver, where it doesn't really belong, and also allow for
      inlining of the accesses to the GIC.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17021/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e07127a0
    • P
      MIPS: GIC: Introduce asm/mips-gic.h with accessor functions · 582e2b4a
      Paul Burton 提交于
      This patch introduces a new header providing accessor functions for the
      MIPS Global Interrupt Controller (GIC) mirroring those provided for the
      other 2 components of the MIPS Coherent Processing System (CPS) - the
      Coherence Manager (CM) & Cluster Power Controller (CPC).
      
      This header makes use of the new standardised CPS accessor macros where
      possible, but does require some custom accessors for cases where we have
      either a bit or a register per interrupt.
      
      A major advantage of this over the existing
      include/linux/irqchip/mips-gic.h definitions is that code performing
      accesses can become much simpler, for example this:
      
        gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_TRIGGER) +
                        GIC_INTR_OFS(intr), 1ul << GIC_INTR_BIT(intr),
                        (unsigned long)trig << GIC_INTR_BIT(intr));
      
      ...can become simply:
      
        change_gic_trig(intr, trig);
      
      The accessors handle 32 vs 64 bit in the same way as for CM & CPC code,
      which means that GIC code will also not need to worry about the access
      size in most cases. They are also accessible outside of
      drivers/irqchip/irq-mips-gic.c which will allow for simplification in
      the use of the non-interrupt portions of the GIC (eg. counters) which
      currently require the interrupt controller driver to expose helper
      functions for access.
      
      This patch doesn't change any existing code over to use the new
      accessors yet, since a wholesale change would be invasive & difficult to
      review. Instead follow-on patches will convert code piecemeal to use
      this new header. The one change to existing code is to rename gic_base
      to mips_gic_base & make it global, in order to fit in with the naming
      expected by the standardised CPS accessor macros.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17020/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      582e2b4a
    • J
      irqchip: mips-gic: SYNC after enabling GIC region · a0ffec3d
      James Hogan 提交于
      A SYNC is required between enabling the GIC region and actually trying
      to use it, even if the first access is a read, otherwise its possible
      depending on the timing (and in my case depending on the precise
      alignment of certain kernel code) to hit CM bus errors on that first
      access.
      
      Add the SYNC straight after setting the GIC base.
      
      [paul.burton@imgtec.com:
        Changes later in this series increase our likelihood of hitting this
        by reducing the amount of code that runs between enabling the GIC &
        accessing it.]
      
      Fixes: a7057270 ("irqchip: mips-gic: Add device-tree support")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17019/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a0ffec3d
    • P
      MIPS: CPS: Have asm/mips-cps.h include CM & CPC headers · e83f7e02
      Paul Burton 提交于
      With Coherence Manager (CM) 3.5 information about the topology of the
      system, which has previously only been available through & accessed from
      the CM, is now also provided by the Cluster Power Controller (CPC). This
      includes a new CPC_CONFIG register mirroring GCR_CONFIG, and similarly a
      new CPC_Cx_CONFIG register mirroring GCR_Cx_CONFIG.
      
      In preparation for adjusting functions such as mips_cm_numcores(), which
      have previously only needed to access the CM, to also access the CPC
      this patch modifies the way we use the various CPS headers. Rather than
      having users include asm/mips-cm.h or asm/mips-cpc.h individually we
      instead have users include asm/mips-cps.h which in turn includes
      asm/mips-cm.h & asm/mips-cpc.h. This means that users will gain access
      to both CM & CPC registers by including one header, and most importantly
      it makes asm/mips-cps.h an ideal location for helper functions which
      need to access the various components of the CPS.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17015/
      Patchwork: https://patchwork.linux-mips.org/patch/17217/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e83f7e02
    • P
      MIPS: Unify checks for sibling CPUs · fe7a38c6
      Paul Burton 提交于
      Up until now we have open-coded checks for whether CPUs are siblings,
      with slight variations on whether we consider the package ID or not.
      
      This will only get more complex when we introduce cluster support, so in
      preparation for that this patch introduces a cpus_are_siblings()
      function which can be used to check whether or not 2 CPUs are siblings
      in a consistent manner.
      
      By checking globalnumber with the VP ID masked out this also has the
      neat side effect of being ready for multi-cluster systems already.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17011/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fe7a38c6
    • P
      MIPS: Abstract CPU core & VP(E) ID access through accessor functions · f875a832
      Paul Burton 提交于
      We currently have fields in struct cpuinfo_mips for the core & VP(E) ID
      of a particular CPU, and various pieces of code directly access those
      fields. This patch abstracts such access by introducing accessor
      functions cpu_core(), cpu_set_core(), cpu_vpe_id() & cpu_set_vpe_id()
      and having code that needs to access these values call those functions
      rather than directly accessing the struct cpuinfo_mips fields. This
      prepares us for changes to the way in which those values are stored in
      later patches.
      
      The cpu_vpe_id() function is introduced even though we already had a
      cpu_vpe_id() macro for a couple of reasons:
      
        1) It's more consistent with the core, and future cluster, accessors.
      
        2) It ensures a sensible return type without explicit casts.
      
        3) It's generally preferable to use functions rather than macros.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17009/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f875a832
  4. 29 8月, 2017 2 次提交
    • P
      MIPS: CM: Use BIT/GENMASK for register fields, order & drop shifts · 93c5bba5
      Paul Burton 提交于
      There's no reason for us not to use BIT() & GENMASK() in asm/mips-cm.h
      when declaring macros corresponding to register fields. This patch
      modifies our definitions to do so.
      
      The *_SHF definitions are removed entirely - they duplicate information
      found in the masks, are infrequently used & can be replaced with use of
      __ffs() where needed.
      
      The *_MSK definitions then lose their _MSK suffix which is now somewhat
      redundant, and users are modified to match.
      
      The field definitions are moved to follow the appropriate register's
      accessor functions, which helps to keep the field definitions in order &
      to find the appropriate fields for a given register. Whilst here a
      comment is added describing each register & including its name, which is
      helpful both for linking the register back to hardware documentation &
      for grepping purposes.
      
      This also cleans up a couple of issues that became obvious as a result
      of making the changes described above:
      
        - We previously had definitions for GCR_Cx_RESET_EXT_BASE & a phony
          copy of that named GCR_RESET_EXT_BASE - a register which does not
          exist. The bad definitions were added by commit 497e803e ("MIPS:
          smp-cps: Ensure secondary cores start with EVA disabled") and made
          use of from boot_core(), which is now modified to use the
          GCR_Cx_RESET_EXT_BASE definitions.
      
        - We had a typo in CM_GCR_ERROR_CAUSE_ERRINGO_MSK - we now correctly
          define this as inFo rather than inGo.
      
      Now that we don't duplicate field information between _SHF & _MSK
      definitions, and keep the fields next to the register accessors, it will
      be much easier to spot & prevent any similar oddities being introduced
      in the future.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: Thomas Gleixner <tglx@linutronix.de
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17001/
      Patchwork: https://patchwork.linux-mips.org/patch/17216/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      93c5bba5
    • M
      MIPS: Alchemy: Threaded carddetect irqs for devboards · cc10815e
      Manuel Lauss 提交于
      This introduces threaded carddetect irqs for the db1200/db1300 boards.
      Main benefit is that the broken insertion/ejection interrupt pairs
      can now be better supported and debounced in software.
      Signed-off-by: NManuel Lauss <manuel.lauss@gmail.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15287/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cc10815e