1. 31 5月, 2014 3 次提交
    • P
      MIPS: Malta: add suspend state entry code · b6911bba
      Paul Burton 提交于
      This patch introduces code which will enter a suspend state via the
      PIIX4. This can only be done when PCI support is enabled since it
      requires access to PCI I/O space and the generation of a special cycle
      on the PCI bus. In cases where PCI is disabled the mips_pm_suspend
      function will simply always return an error.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6905/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b6911bba
    • P
      MIPS: Define some more PIIX4 registers & values · 643c5705
      Paul Burton 提交于
      This patch simply adds definitions for some I/O registers in the PIIX4
      PM device, and the magic data for a special cycle which must occur on
      the PCI bus in order for the PIIX4 to enter a suspend state.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6903/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      643c5705
    • M
      MIPS: Implement random_get_entropy with CP0 Random · 06947aaa
      Maciej W. Rozycki 提交于
      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: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMaciej 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: NRalf Baechle <ralf@linux-mips.org>
      06947aaa
  2. 30 5月, 2014 20 次提交
  3. 28 5月, 2014 11 次提交
    • P
      MIPS: cpuidle wait instruction state · da9f970f
      Paul Burton 提交于
      Defines a macro intended to allow trivial use of the regular MIPS wait
      instruction from cpuidle drivers, which may simply invoke the macro
      within their array of states.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      da9f970f
    • P
      MIPS: pm-cps: add PM state entry code for CPS systems · 3179d37e
      Paul Burton 提交于
      This patch adds code to generate entry & exit code for various low power
      states available on systems based around the MIPS Coherent Processing
      System architecture (ie. those with a Coherence Manager, Global
      Interrupt Controller & for >=CM2 a Cluster Power Controller). States
      supported are:
      
        - Non-coherent wait. This state first leaves the coherent domain and
          then executes a regular MIPS wait instruction. Power savings are
          found from the elimination of coherency interventions between the
          core and any other coherent requestors in the system.
      
        - Clock gated. This state leaves the coherent domain and then gates
          the clock input to the core. This removes all dynamic power from the
          core but leaves the core at the mercy of another to restart its
          clock. Register state is preserved, but the core can not service
          interrupts whilst its clock is gated.
      
        - Power gated. This deepest state removes all power input to the core.
          All register state is lost and the core will restart execution from
          its BEV when another core powers it back up. Because register state
          is lost this state requires cooperation with the CONFIG_MIPS_CPS SMP
          implementation in order for the core to exit the state successfully.
      
      The code will detect which states are available on the current system
      during boot & generate the entry/exit code for those states. This will
      be used by cpuidle & hotplug implementations.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      3179d37e
    • P
      MIPS: smp-cps: function to determine whether CPS SMP is in use · 68c1232f
      Paul Burton 提交于
      The core power down state for cpuidle will require that the CPS SMP
      implementation is in use. This patch provides a mips_cps_smp_in_use
      function which determines whether or not the CPS SMP implementation is
      currently in use.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      68c1232f
    • P
      MIPS: smp-cps: rework core/VPE initialisation · 245a7868
      Paul Burton 提交于
      When hotplug and/or a powered down idle state are supported cases will
      arise where a non-zero VPE must be brought online without VPE 0, and it
      where multiple VPEs must be onlined simultaneously. This patch prepares
      for that by:
      
        - Splitting struct boot_config into core & VPE boot config structures,
          allocated one per core or VPE respectively. This allows for multiple
          VPEs to be onlined simultaneously without clobbering each others
          configuration.
      
        - Indicating which VPEs should be online within a core at any given
          time using a bitmap. This allows multiple VPEs to be brought online
          simultaneously and also indicates to VPE 0 whether it should halt
          after starting any non-zero VPEs that should be online within the
          core. For example if all VPEs within a core are offlined via hotplug
          and the user onlines the second VPE within that core:
      
            1) The core will be powered up.
      
            2) VPE 0 will run from the BEV (ie. mips_cps_core_entry) to
               initialise the core.
      
            3) VPE 0 will start VPE 1 because its bit is set in the cores
               bitmap.
      
            4) VPE 0 will halt itself because its bit is clear in the cores
               bitmap.
      
        - Moving the core & VPE initialisation to assembly code which does not
          make any use of the stack. This is because if a non-zero VPE is to
          be brought online in a powered down core then when VPE 0 of that
          core runs it may not have a valid stack, and even if it did then
          it's messy to run through parts of generic kernel code on VPE 0
          before starting the correct VPE.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      245a7868
    • P
      MIPS: uasm: add MT ASE yield instruction · d674dd14
      Paul Burton 提交于
      This patch allows use of the MT ASE yield instruction from uasm. It will
      be used by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      d674dd14
    • P
      MIPS: uasm: add wait instruction · 53ed1389
      Paul Burton 提交于
      This patch allows use of the wait instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      53ed1389
    • P
      MIPS: uasm: add sync instruction · 729ff561
      Paul Burton 提交于
      This patch allows use of the sync instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      729ff561
    • P
      MIPS: uasm: add jalr instruction · 49e9529b
      Paul Burton 提交于
      This patch allows use of the jalr instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      49e9529b
    • P
      MIPS: uasm: add a label variant of beq · 8dee5901
      Paul Burton 提交于
      This patch allows for use of the beq instruction with labels from uasm,
      much as bne & others already do. It will be used by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      8dee5901
    • P
      MIPS: MT: define write_c0_tchalt macro · 27476f3b
      Paul Burton 提交于
      Define a macro to write to the current TCs TCHalt register. This will be
      used by a subsequent patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      27476f3b
    • P
      MIPS: add kmap_noncoherent to wire a cached non-coherent TLB entry · e2a9e5ad
      Paul Burton 提交于
      This is identical to kmap_coherent apart from the cache coherency
      attribute used for the TLB entry, so kmap_coherent is abstracted to
      kmap_prot which is then called for both kmap_coherent &
      kmap_noncoherent. This will be used by a subsequent patch.
      Suggested-by: NLeonid Yegoshin <leonid.yegoshin@imgtec.com>
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      e2a9e5ad
  4. 27 5月, 2014 1 次提交
  5. 24 5月, 2014 1 次提交
    • R
      MIPS: MT: Remove SMTC support · b633648c
      Ralf Baechle 提交于
      Nobody is maintaining SMTC anymore and there also seems to be no userbase.
      Which is a pity - the SMTC technology primarily developed by Kevin D.
      Kissell <kevink@paralogos.com> is an ingenious demonstration for the MT
      ASE's power and elegance.
      
      Based on Markos Chandras <Markos.Chandras@imgtec.com> patch
      https://patchwork.linux-mips.org/patch/6719/ which while very similar did
      no longer apply cleanly when I tried to merge it plus some additional
      post-SMTC cleanup - SMTC was a feature as tricky to remove as it was to
      merge once upon a time.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b633648c
  6. 23 5月, 2014 4 次提交