1. 04 9月, 2017 5 次提交
  2. 02 9月, 2017 1 次提交
  3. 30 8月, 2017 27 次提交
  4. 29 8月, 2017 7 次提交
    • 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
    • P
      MIPS: CM: Specify register size when generating accessors · b025d518
      Paul Burton 提交于
      Some CM registers are always 32 bits, or at least only use bits in the
      lower 32 bits of the register. For these registers it is wasteful for us
      to generate accessors which bother to check mips_cm_is64 & perform 64
      bit accesses.
      
      This patch modifies the accessor generation to take into account the
      size of the register, and for 32 bit registers we generate accessors
      which only ever perform 32 bit accesses. For 64 bit registers we either
      perform a 64 bit access or two 32 bit accesses, depending upon the value
      of mips_cm_is64. Doing this saves us ~1.5KiB of code in a generic 64r6el
      kernel, and perhaps more importantly simplifies various code paths.
      
      This removes the read64_gcr_* accessors, so mips_cm_error_report() is
      modified to stop using them & instead use the regular read_gcr_*
      accessors which will return 64 bit values from the 64 bit registers.
      
      The new accessor macros are placed in asm/mips-cps.h such that they can
      be shared by CPC & GIC code in later patches.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17000/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b025d518
    • P
      MIPS: CM: Rename mips_cm_base to mips_gcr_base · abe852ea
      Paul Burton 提交于
      We currently have a mips_cm_base variable which holds the base address
      of the Coherence Manager (CM) Global Configuration Registers (GCRs), and
      accessor functions which use the GCR in their names. This works fine,
      but gets in the way of sharing the code to generate the accessor
      functions with other blocks (ie. CPC & GIC) because that code would then
      need to separately handle the name of the base address variable & the
      name used in the accessor functions.
      
      In order to prepare for sharing the accessor generation code between CM,
      CPC & GIC code this patch renames mips_cm_base to mips_gcr_base such
      that the "gcr" portion is common to both the base address variable & the
      accessor function names.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16999/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      abe852ea
    • A
      MIPS: math-emu: Add FP emu debugfs stats for individual instructions · 454854ac
      Aleksandar Markovic 提交于
      Add FP emulation debugfs statistics for individual instructions. The
      debugfs files that contain counter values are placed in a separate
      directory called "instructions". This means that the default path for
      these new stat is "/sys/kernel/debug/mips/fpuemustats/instructions".
      
      Each instruction counter is mapped to the debugfs file that has the
      same name as instruction name. The lowercase is choosen as more
      commonly used case for instruction names.
      
      One example of usage:
      
      mips_host::/sys/kernel/debug/mips/fpuemustats/instructions # grep "" *
      
      The shortened output of this command is:
      
      abs.d:34
      abs.s:5711
      add.d:10401
      add.s:399307
      bc1eqz:3199
      ...
      ...
      ...
      sub.s:167211
      trunc.l.d:375
      trunc.l.s:8054
      trunc.w.d:421
      trunc.w.s:27032
      
      The limitation of this patch is that it handles R6 FP emulation
      instructions only. There are altogether 114 handled instructions.
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: Douglas Leung <douglas.leung@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Maciej W. Rozycki <macro@imgtec.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
      Cc: Raghu Gandham <raghu.gandham@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/17145/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      454854ac
    • A
      MIPS: math-emu: Add FP emu debugfs clear functionality · 25ad8db6
      Aleksandar Markovic 提交于
      Add capability for the user to clear all FP emu debugfs counters.
      
      This is achieved by having a special debugfs file "fpuemustats_clear"
      (under default location "/sys/kernel/debug/mips"). Each access to the
      file results in setting all counters to zero (it is enough, let's say,
      to issue a "cat /sys/kernel/debug/mips/fpuemustats_clear").
      
      This functionality already exists for R2 emulation statistics,
      but was missing for FP emulation statistics. The implementation in
      this patch is consistent with its R2 emulation counterpart.
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: Douglas Leung <douglas.leung@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
      Cc: Raghu Gandham <raghu.gandham@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/17144/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      25ad8db6
    • A
      MIPS: math-emu: Add FP emu debugfs statistics for branches · ae5f3f5b
      Aleksandar Markovic 提交于
      Add FP emu debugfs counter for branches.
      
      The new counter is displayed the same way as existing counter, and
      its default path is /sys/kernel/debug/mips/fpuemustats/.
      
      The limitation of this counter is that it counts only R6 branch
      instructions BC1NEZ and BC1EQZ.
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: Douglas Leung <douglas.leung@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Maciej W. Rozycki <macro@imgtec.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
      Cc: Raghu Gandham <raghu.gandham@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/17143/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ae5f3f5b
    • A
      MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result · e1231dd6
      Aleksandar Markovic 提交于
      Fix content of CLASS.D output bits 32-63 to match hardware behavior.
      
      Prior to this patch, bits 32-63 of CLASS.D output were not
      initialized, causing different 32-63 bits content of CLASS.D, based on
      circumstances. However, the hardware consistently returns all these
      bits zeroed. The documentation is not clear whether these bits should
      be zero or unpredictable. Since technically "all zero" case still can
      be viewed as belonging to "unpredictable" class of results, it is
      better to zero bits 32-63.
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: Douglas Leung <douglas.leung@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Maciej W. Rozycki <macro@imgtec.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
      Cc: Raghu Gandham <raghu.gandham@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/17142/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e1231dd6