1. 23 Aug, 2019 7 commits
  2. 19 Aug, 2019 2 commits
  3. 12 Aug, 2019 3 commits
    • Nathan Chancellor's avatar
      MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean · c59ae0a1
      Nathan Chancellor authored
      clang warns:
      
      arch/mips/mm/tlbex.c:634:19: error: use of logical '&&' with constant
      operand [-Werror,-Wconstant-logical-operand]
              if (cpu_has_rixi && _PAGE_NO_EXEC) {
                               ^  ~~~~~~~~~~~~~
      arch/mips/mm/tlbex.c:634:19: note: use '&' for a bitwise operation
              if (cpu_has_rixi && _PAGE_NO_EXEC) {
                               ^~
                               &
      arch/mips/mm/tlbex.c:634:19: note: remove constant to silence this
      warning
              if (cpu_has_rixi && _PAGE_NO_EXEC) {
                              ~^~~~~~~~~~~~~~~~
      1 error generated.
      
      Explicitly cast this value to a boolean so that clang understands we
      intend for this to be a non-zero value.
      
      Fixes: 00bf1c69 ("MIPS: tlbex: Avoid placing software PTE bits in Entry* PFN fields")
      Link: https://github.com/ClangBuiltLinux/linux/issues/609Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: clang-built-linux@googlegroups.com
      c59ae0a1
    • Nathan Chancellor's avatar
      MIPS/ptrace: Update mips_get_syscall_arg's return type · 077ff3be
      Nathan Chancellor authored
      clang warns:
      
      arch/mips/include/asm/syscall.h:136:3: error: variable 'ret' is
      uninitialized when used here [-Werror,-Wuninitialized]
                      ret |= mips_get_syscall_arg(args++, task, regs, i++);
                      ^~~
      arch/mips/include/asm/syscall.h:129:9: note: initialize the variable
      'ret' to silence this warning
              int ret;
                     ^
                      = 0
      1 error generated.
      
      It's not wrong; however, it's not an issue in practice because ret is
      only assigned to, not read from. ret could just be initialized to zero
      but looking into it further, ret has been unused since it was first
      added in 2012 so just get rid of it and update mips_get_syscall_arg's
      return type since none of the return values are ever checked. If it is
      ever needed again, this commit can be reverted and ret can be properly
      initialized.
      
      Fixes: c0ff3c53 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.")
      Link: https://github.com/ClangBuiltLinux/linux/issues/604Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: clang-built-linux@googlegroups.com
      077ff3be
    • Nathan Chancellor's avatar
      MIPS: Don't use bc_false uninitialized in __mm_isBranchInstr · c2869aaf
      Nathan Chancellor authored
      clang warns:
      
      arch/mips/kernel/branch.c:148:8: error: variable 'bc_false' is used
      uninitialized whenever switch case is taken
      [-Werror,-Wsometimes-uninitialized]
                      case mm_bc2t_op:
                           ^~~~~~~~~~
      arch/mips/kernel/branch.c:157:8: note: uninitialized use occurs here
                              if (bc_false)
                                  ^~~~~~~~
      arch/mips/kernel/branch.c:149:8: error: variable 'bc_false' is used
      uninitialized whenever switch case is taken
      [-Werror,-Wsometimes-uninitialized]
                      case mm_bc1t_op:
                           ^~~~~~~~~~
      arch/mips/kernel/branch.c:157:8: note: uninitialized use occurs here
                              if (bc_false)
                                  ^~~~~~~~
      arch/mips/kernel/branch.c:142:4: note: variable 'bc_false' is declared
      here
                              int bc_false = 0;
                              ^
      2 errors generated.
      
      When mm_bc1t_op and mm_bc2t_op are taken, the bc_false initialization
      does not happen, which leads to a garbage value upon use, as illustrated
      below with a small sample program.
      
      $ mipsel-linux-gnu-gcc --version | head -n1
      mipsel-linux-gnu-gcc (Debian 8.3.0-2) 8.3.0
      
      $ clang --version | head -n1
      ClangBuiltLinux clang version 9.0.0 (git://github.com/llvm/llvm-project
      544315b4197034a3be8acd12cba56a75fb1f08dc) (based on LLVM 9.0.0svn)
      
      $ cat test.c
       #include <stdio.h>
      
       static void switch_scoped(int opcode)
       {
      	 switch (opcode) {
      	 case 1:
      	 case 2: {
      		 int bc_false = 0;
      
      		 bc_false = 4;
      	 case 3:
      	 case 4:
      		 printf("\t* switch scoped bc_false = %d\n", bc_false);
      	 }
      	 }
       }
      
       static void function_scoped(int opcode)
       {
      	 int bc_false = 0;
      
      	 switch (opcode) {
      	 case 1:
      	 case 2: {
      		 bc_false = 4;
      	 case 3:
      	 case 4:
      		 printf("\t* function scoped bc_false = %d\n", bc_false);
      	 }
      	 }
       }
      
       int main(void)
       {
      	 int opcode;
      
      	 for (opcode = 1; opcode < 5; opcode++) {
      		 printf("opcode = %d:\n", opcode);
      		 switch_scoped(opcode);
      		 function_scoped(opcode);
      		 printf("\n");
      	 }
      
      	 return 0;
       }
      
      $ mipsel-linux-gnu-gcc -std=gnu89 -static test.c && \
        qemu-mipsel a.out
      opcode = 1:
              * switch scoped bc_false = 4
              * function scoped bc_false = 4
      
      opcode = 2:
              * switch scoped bc_false = 4
              * function scoped bc_false = 4
      
      opcode = 3:
              * switch scoped bc_false = 2147483004
              * function scoped bc_false = 0
      
      opcode = 4:
              * switch scoped bc_false = 2147483004
              * function scoped bc_false = 0
      
      $ clang -std=gnu89 --target=mipsel-linux-gnu -m32 -static test.c && \
        qemu-mipsel a.out
      opcode = 1:
              * switch scoped bc_false = 4
              * function scoped bc_false = 4
      
      opcode = 2:
              * switch scoped bc_false = 4
              * function scoped bc_false = 4
      
      opcode = 3:
              * switch scoped bc_false = 2147483004
              * function scoped bc_false = 0
      
      opcode = 4:
              * switch scoped bc_false = 2147483004
              * function scoped bc_false = 0
      
      Move the definition up so that we get the right behavior and mark it
      __maybe_unused as it will not be used when CONFIG_MIPS_FP_SUPPORT
      isn't enabled.
      
      Fixes: 6a1cc218 ("MIPS: branch: Remove FP branch handling when CONFIG_MIPS_FP_SUPPORT=n")
      Link: https://github.com/ClangBuiltLinux/linux/issues/603Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: clang-built-linux@googlegroups.com
      c2869aaf
  4. 08 Aug, 2019 14 commits
    • Paul Burton's avatar
      Merge branch 'ingenic-tcu-v5.4' into mips-next · 75b7329a
      Paul Burton authored
      Merge the Ingenic TCU patchset from the ingenic-tcu-v5.4 branch which
      was created to enable follow-on changes in other subsystems.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      75b7329a
    • Paul Cercueil's avatar
      MIPS: jz4740: Drop obsolete code · abc55228
      Paul Cercueil authored
      The old clocksource/timer platform code is now obsoleted by the newly
      introduced TCU drivers.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      abc55228
    • Paul Cercueil's avatar
      MIPS: GCW0: Reduce system timer and clocksource to 750 kHz · 967a7100
      Paul Cercueil authored
      The default clock (12 MHz) is too fast for the system timer.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      967a7100
    • Paul Cercueil's avatar
      MIPS: CI20: Reduce system timer and clocksource to 3 MHz · 157c887a
      Paul Cercueil authored
      The default clock (48 MHz) is too fast for the system timer.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      157c887a
    • Paul Cercueil's avatar
      MIPS: qi_lb60: Reduce system timer and clocksource to 750 kHz · a68d3b05
      Paul Cercueil authored
      The default clock (12 MHz) is too fast for the system timer, which fails
      to report time accurately.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      a68d3b05
    • Paul Cercueil's avatar
      MIPS: jz4740: Add DTS nodes for the TCU drivers · 36aafdbd
      Paul Cercueil authored
      Add DTS nodes for the JZ4780, JZ4770 and JZ4740 devicetree files.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      36aafdbd
    • Paul Cercueil's avatar
      clk: jz4740: Add TCU clock · 73dd11dc
      Paul Cercueil authored
      Add the missing TCU clock to the list of clocks supplied by the CGU for
      the JZ4740 SoC.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Acked-by: default avatarStephen Boyd <sboyd@kernel.org>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      73dd11dc
    • Paul Cercueil's avatar
      clocksource: Add a new timer-ingenic driver · 34e93683
      Paul Cercueil authored
      This driver handles the TCU (Timer Counter Unit) present on the Ingenic
      JZ47xx SoCs, and provides the kernel with a system timer, a clocksource
      and a sched_clock.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      34e93683
    • Paul Cercueil's avatar
      irqchip: Add irq-ingenic-tcu driver · 9536eba0
      Paul Cercueil authored
      This driver handles the interrupt controller built in the Timer/Counter
      Unit (TCU) of the JZ47xx SoCs from Ingenic.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      9536eba0
    • Paul Cercueil's avatar
      clk: ingenic: Add driver for the TCU clocks · 4f89e4b8
      Paul Cercueil authored
      Add driver to support the clocks provided by the Timer/Counter Unit
      (TCU) of the JZ47xx SoCs from Ingenic.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Acked-by: default avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      4f89e4b8
    • Paul Cercueil's avatar
      mfd/syscon: Add device_node_to_regmap() · 39233b7c
      Paul Cercueil authored
      device_node_to_regmap() is exactly like syscon_node_to_regmap(), but it
      does not check that the node is compatible with "syscon", and won't
      attach the first clock it finds to the regmap.
      
      The rationale behind this, is that one device node with a standard
      compatible string "foo,bar" can be covered by multiple drivers sharing a
      regmap, or by a single driver doing all the job without a regmap, but
      these are implementation details which shouldn't reflect on the
      devicetree.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      Cc: Mathieu Malaterre <malat@debian.org>
      39233b7c
    • Paul Cercueil's avatar
      dt-bindings: Add doc for the Ingenic TCU drivers · 2e8722a5
      Paul Cercueil authored
      Add documentation about how to properly use the Ingenic TCU
      (Timer/Counter Unit) drivers from devicetree.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      2e8722a5
    • Paul Cercueil's avatar
      doc: Add doc for the Ingenic TCU hardware · 97689a1a
      Paul Cercueil authored
      Add documentation about the Timer/Counter Unit (TCU) present in the
      Ingenic JZ47xx SoCs.
      
      The Timer/Counter Unit (TCU) in Ingenic JZ47xx SoCs is a multi-function
      hardware block. It features up to to eight channels, that can be used as
      counters, timers, or PWM.
      
      - JZ4725B, JZ4750, JZ4755 only have six TCU channels. The other SoCs all
        have eight channels.
      
      - JZ4725B introduced a separate channel, called Operating System Timer
        (OST). It is a 32-bit programmable timer. On JZ4770 and above, it is
        64-bit.
      
      - Each one of the TCU channels has its own clock, which can be reparented
        to three different clocks (pclk, ext, rtc), gated, and reclocked, through
        their TCSR register.
        * The watchdog and OST hardware blocks also feature a TCSR register with
          the same format in their register space.
        * The TCU registers used to gate/ungate can also gate/ungate the watchdog
          and OST clocks.
      
      - Each TCU channel works in one of two modes:
        * mode TCU1: channels cannot work in sleep mode, but are easier to
          operate.
        * mode TCU2: channels can work in sleep mode, but the operation is a bit
          more complicated than with TCU1 channels.
      
      - The mode of each TCU channel depends on the SoC used:
        * On the oldest SoCs (up to JZ4740), all of the eight channels operate in
          TCU1 mode.
        * On JZ4725B, channel 5 operates as TCU2, the others operate as TCU1.
        * On newest SoCs (JZ4750 and above), channels 1-2 operate as TCU2, the
          others operate as TCU1.
      
      - Each channel can generate an interrupt. Some channels share an interrupt
        line, some don't, and this changes between SoC versions:
        * on older SoCs (JZ4740 and below), channel 0 and channel 1 have their
          own interrupt line; channels 2-7 share the last interrupt line.
        * On JZ4725B, channel 0 has its own interrupt; channels 1-5 share one
          interrupt line; the OST uses the last interrupt line.
        * on newer SoCs (JZ4750 and above), channel 5 has its own interrupt;
          channels 0-4 and (if eight channels) 6-7 all share one interrupt line;
          the OST uses the last interrupt line.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      97689a1a
    • Paul Cercueil's avatar
      dt-bindings: ingenic: Add DT bindings for TCU clocks · 4bc3c420
      Paul Cercueil authored
      This header provides clock numbers for the ingenic,tcu
      DT binding.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Tested-by: default avatarMathieu Malaterre <malat@debian.org>
      Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: od@zcrc.me
      4bc3c420
  5. 06 Aug, 2019 5 commits
    • Arnd Bergmann's avatar
      mips: fix vdso32 build, again · 6393e606
      Arnd Bergmann authored
      The generic vdso support adds the same #if hack in two places,
      asm/vdso/vdso.h and config-n32-o32-env.c, but only the second
      is actually used. The result lacks the BUILD_VDSO32_64 macro,
      and that triggers a build error:
      
      ./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
      
      Move the macro into the other place, and remove the duplicated
      bits.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: ee38d94a ("page flags: prioritize kasan bits over last-cpuid")
      Fixes: 24640f23 ("mips: Add support for generic vDSO")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andrey Konovalov <andreyknvl@google.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      6393e606
    • Paul Burton's avatar
      MIPS: octeon: Remove ARCH_HAS_IRQ_PER_CPU · 905421ee
      Paul Burton authored
      ARCH_HAS_IRQ_PER_CPU is unused anywhere in the kernel - remove the
      definition.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      905421ee
    • Paul Burton's avatar
      MIPS: octeon: Remove cpu_has_saa · ece51529
      Paul Burton authored
      The cpu_has_saa feature macro was added along with Cavium Octeon CPU
      support back in commit 5b3b1688 ("MIPS: Add Cavium OCTEON processor
      support files to arch/mips/cavium-octeon.") but has never been used.
      
      Remove the dead code.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      ece51529
    • Zhou Yanjie's avatar
      MIPS: Ingenic: Disable broken BTB lookup optimization. · 053951dd
      Zhou Yanjie authored
      In order to further reduce power consumption, the XBurst core
      by default attempts to avoid branch target buffer lookups by
      detecting & special casing loops. This feature will cause
      BogoMIPS and lpj calculate in error. Set cp0 config7 bit 4 to
      disable this feature.
      Signed-off-by: default avatarZhou Yanjie <zhouyanjie@zoho.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: ralf@linux-mips.org
      Cc: paul@crapouillou.net
      Cc: jhogan@kernel.org
      Cc: malat@debian.org
      Cc: gregkh@linuxfoundation.org
      Cc: tglx@linutronix.de
      Cc: allison@lohutok.net
      Cc: syq@debian.org
      Cc: chenhc@lemote.com
      Cc: jiaxun.yang@flygoat.com
      053951dd
    • Zhou Yanjie's avatar
      MIPS: Ingenic: Fix bugs when detecting X1000's L2 cache. · 579de8f8
      Zhou Yanjie authored
      1.fix bugs when detecting L2 cache sets value.
      2.fix bugs when detecting L2 cache ways value.
      Signed-off-by: default avatarZhou Yanjie <zhouyanjie@zoho.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: ralf@linux-mips.org
      Cc: paul@crapouillou.net
      Cc: jhogan@kernel.org
      Cc: malat@debian.org
      Cc: gregkh@linuxfoundation.org
      Cc: tglx@linutronix.de
      Cc: allison@lohutok.net
      Cc: syq@debian.org
      Cc: chenhc@lemote.com
      Cc: jiaxun.yang@flygoat.com
      579de8f8
  6. 30 Jul, 2019 9 commits