Skip to content
  1. May 31, 2014
    • Maciej W. Rozycki's avatar
      MIPS: __delay ABI-dependent subtraction simplification · e496453d
      Maciej W. Rozycki authored
      
      
      This small update to the previous fix to __delay removes a conditional
      around the ABI-dependent subtraction operation within an inline asm in
      favor to the standard <asm/asm.h> LONG_SUBU macro.  No change in code
      produced.
      
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6703/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      e496453d
    • Maciej W. Rozycki's avatar
      MIPS: Implement random_get_entropy with CP0 Random · 06947aaa
      Maciej W. Rozycki authored
      Update to commit 9c9b415c
      
       [MIPS:
      Reimplement get_cycles().]
      
      On systems were for whatever reasons we can't use the cycle counter, fall
      back to the c0_random register as an entropy source.  It has however a
      very small range that makes it suitable for random_get_entropy only and
      not get_cycles.
      
      This optimised version compiles to 8 instructions in the fast path even in
      the worst case of all the conditions to check being variable (including a
      MFC0 move delay slot that is only required for very old processors):
      
           828:	8cf90000 	lw	t9,0(a3)
      			828: R_MIPS_LO16	jiffies
           82c:	40057800 	mfc0	a1,c0_prid
           830:	3c0200ff 	lui	v0,0xff
           834:	00a21024 	and	v0,a1,v0
           838:	1040007d 	beqz	v0,a30 <add_interrupt_randomness+0x22c>
           83c:	3c030000 	lui	v1,0x0
      			83c: R_MIPS_HI16	cpu_data
           840:	40024800 	mfc0	v0,c0_count
           844:	00000000 	nop
           848:	00409021 	move	s2,v0
           84c:	8ce20000 	lw	v0,0(a3)
      			84c: R_MIPS_LO16	jiffies
      
      On most targets the sequence will be shorter and on some it will reduce to
      a single `MFC0 <reg>,c0_count', as all MIPS architecture (i.e. non-legacy
      MIPS) processors require the CP0 Count register to be present.
      
      The only known exception that reports MIPS architecture compliance, but
      contrary to that lacks CP0 Count is the Ingenic JZ4740 thingy.  For broken
      platforms like that this code requires cpu_has_counter to be hardcoded to
      0 (i.e. no variable setting is permitted) so as not to penalise all the
      other good platforms out there.
      
      The asm barrier is required so that the compiler does not pull any
      potentially costly (cold cache!) `cpu_data' variable access into the fast
      path.
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Andrew McGregor <andrewmcgr@gmail.com>
      Cc: Dave Taht <dave.taht@bufferbloat.net>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Simon Kelley <simon@thekelleys.org.uk>
      Cc: Jim Gettys <jg@freedesktop.org>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6702/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      06947aaa
  2. May 30, 2014
  3. May 29, 2014
  4. May 28, 2014
    • Paul Burton's avatar
      MIPS: Malta: CPS SMP by default · 32201453
      Paul Burton authored
      
      
      The CONFIG_MIPS_CPS SMP implementation should be able to handle all
      cases the CONFIG_MIPS_CMP implementation does, but without requiring
      bootloader assistance. It is also required in order to make use of
      features such as hotplug & cpuidle core power gating. Enable it by
      default for Malta configs that previously enabled the now deprecated
      CONFIG_MIPS_CMP, and disable the latter. The local version suffix "cmp"
      is removed rather than replaced with "cps" since there are other ways to
      tell that the CPS SMP implementation is in use (the "VPE topology" line
      in the boot log being one).
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      32201453
    • Paul Burton's avatar
      cpuidle: cpuidle-cps: add MIPS CPS cpuidle driver · d0508944
      Paul Burton authored
      
      
      This patch adds a cpuidle driver for systems based around the MIPS
      Coherent Processing System (CPS) architecture. It supports four idle
      states:
      
        - The standard MIPS wait instruction.
      
        - The non-coherent wait, clock gated & power gated states exposed by
          the recently added pm-cps layer.
      
      The pm-cps layer is used to enter all the deep idle states. Since cores
      in the clock or power gated states cannot service interrupts, the
      gic_send_ipi_single function is modified to send a power up command for
      the appropriate core to the CPC in cases where the target CPU has marked
      itself potentially incoherent.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      d0508944