1. 01 4月, 2015 24 次提交
  2. 31 3月, 2015 16 次提交
    • M
      MIPS: Malta: malta-time: Ensure GIC counter is running · be37a990
      Markos Chandras 提交于
      Start the GIC counter before we try to determine its frequency.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9596/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      be37a990
    • M
      CLOCKSOURCE: mips-gic-timer: Ensure GIC counter is running · 7d9cd1f5
      Markos Chandras 提交于
      Start the GIC counter after configuring the clocksource since there
      are no guarantees the counter will be running after a CPU reset.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      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/9595/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7d9cd1f5
    • M
      IRQCHIP: irq-mips-gic: Add new functions to start/stop the GIC counter · 8fa4b930
      Markos Chandras 提交于
      We add new functions to start and stop the GIC counter since there are no
      guarantees the counter will be running after a CPU reset. The GIC counter
      is stopped by setting the 29th bit on the GIC Config register and it is
      started by clearing that bit.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9594/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8fa4b930
    • J
      ttyFDC: Implement KGDB IO operations. · c2d7ef51
      James Hogan 提交于
      Implement KGDB IO operations for MIPS Fast Debug Channel (FDC). This can
      be enabled via Kconfig, which also allows the channel number to be
      chosen.
      
      The magic sysrq hack is implemented in the TTY driver, detecting just ^C
      for the KGDB channel, and ^O followed by a letter for the FDC console
      channel.
      
      The KGDB operations are reasonably efficient thanks to the flush
      callback, with a 4 byte buffer being used in both directions to allow up
      to 4 bytes to be encoded per FDC word. Reading of data for KGDB will
      discard any data received on other channels, which clearly isn't ideal,
      but given that there is a single FIFO shared between channels we can't
      do much better.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: linux-mips@linux-mips.org
      Cc: kgdb-bugreport@lists.sourceforge.net
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9147/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c2d7ef51
    • J
      MIPS, ttyFDC: Add early FDC console support · e934945d
      James Hogan 提交于
      Add support for early console of MIPS Fast Debug Channel (FDC) on
      channel 1 with a call very early from the MIPS setup_arch().
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9145/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e934945d
    • J
      TTY: Add MIPS EJTAG Fast Debug Channel TTY driver · 4cebec60
      James Hogan 提交于
      Add TTY driver and consoles for the MIPS EJTAG Fast Debug Channel (FDC),
      which is found on the per-CPU MIPS Common Device Mapped Memory (CDMM)
      bus.
      
      The FDC is a per-CPU device which is used to communicate with an EJTAG
      probe. RX and TX FIFOs exist, containing 32-bits of data and 4-bit
      channel numbers. 16 general data streams are implemented on this for TTY
      and console use by encoding up to 4 bytes on each 32-bit FDC word.
      
      The TTY devices are named e.g. /dev/ttyFDC3c2 for channel 2 of the FDC
      attached to logical CPU 3.
      
      These can be used for getting the kernel log, a login prompt, or as a
      GDB remote transport, all over EJTAG and without needing a serial port.
      
      It can have an interrupt to notify of when incoming data is available in
      the RX FIFO or when the TX FIFO is no longer full. The detection of this
      interrupt occurs in architecture / platform code, but it may be shared
      with the timer and/or performance counter interrupt.
      
      Due to the per-CPU nature of the hardware, all outgoing TTY data is
      written out from a kthread which is pinned to the appropriate CPU.
      
      The console is not bound to a specific CPU, so output will appear on the
      chosen channel on whichever CPU the code is executing on. Enable with
      e.g. console=fdc1 in kernel arguments. /dev/console is bound to the same
      channel on the boot CPU's FDC if it exists.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9146/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4cebec60
    • J
      MIPS: idle: Workaround wait + FDC problems · e38df288
      James Hogan 提交于
      On certain cores (namely proAptiv and P5600) incoming data via a Fast
      Debug Channel (FDC) while the core is blocked on a wait instruction will
      cause the wait not to wake up even when another interrupt is received.
      This makes an idle target stop as soon as you send FDC data to it, until
      the debug probe interrupts it and restarts the wait instruction.
      
      This is worked around by avoiding using r4k_wait on these cores if
      CONFIG_MIPS_EJTAG_FDC_TTY is enabled (which would imply the user intends
      to use the FDC).
      
      [ralf@linux-mips.org: Fix conflict.]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9144/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e38df288
    • J
      MIPS: Malta: Implement get_c0_fdc_int() · 602e8a34
      James Hogan 提交于
      Implement the weak get_c0_fdc_int() function for Malta. The Fast Debug
      Channel (FDC) interrupt is obtained mainly depending on whether a GIC is
      present. Vectored external interrupt mode isn't yet supported.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9143/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      602e8a34
    • J
      IRQCHIP: mips-gic: Add function for retrieving FDC IRQ · 6429e2b6
      James Hogan 提交于
      Add a function to the MIPS GIC driver for retrieving the Fast Debug
      Channel (FDC) interrupt number, similar to the existing ones for the
      timer and perf counter interrupts. This will be used by platform
      implementations of get_c0_fdc_int() if a GIC is present.
      
      A workaround exists for interAptiv and proAptiv which claim to be able
      to route the FDC interrupt but don't seem to be able to in practice (at
      least on Malta).
      
      [ralf@linux-mips.org: Fix conflict.]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9142/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6429e2b6
    • J
      irqchip: mips-gic: Don't treat FDC IRQ as percpu devid · b720fd8b
      James Hogan 提交于
      Treat the Fast Debug Channel (FDC) interrupt the same as the timer and
      performance counter interrupts. Like them, the FDC IRQ is also per-VPE,
      and also doesn't use a per-CPU device ID yet. Per-CPU device IDs don't
      seem to work with IRQF_SHARED which is needed for compatibility with
      cores which don't route the FDC IRQ through the GIC. For hardware which
      routes FDC IRQs through the GIC this is something that could be added
      later.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9141/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b720fd8b
    • J
      MIPS: Read CPU IRQ line that FDC to routed to · 8f7ff027
      James Hogan 提交于
      Read the CPU IRQ line reportedly used for the Fast Debug Channel (FDC)
      interrupt from the IntCtl register and store it in cp0_fdc_irq where
      platform implementations of the new weak platform function
      get_c0_fdc_int() can refer to it.
      
      [ralf@linux-mips.org: Fixed conflict.]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/9140/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8f7ff027
    • J
      MIPS: Add architectural FDC IRQ fields · 9323f84f
      James Hogan 提交于
      Add architectural field definitions relating to the Fast Debug Channel
      (FDC) interrupt, namely the pending bit in Cause and the field in
      IntCtl to specify which CPU IRQ line the FDC interrupt is routed to.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/9139/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9323f84f
    • J
      MIPS: Malta: Implement mips_cdmm_phys_base() · 296b7c68
      James Hogan 提交于
      Implement mips_cdmm_phys_base() for Malta, returning the physical base
      address 0x1fc10000 which is "typically unused".
      
      This allows the Common Device Memory Map (CDMM) region to be mapped, and
      devices in that region (such as the Fast Debug Channel (FDC) hardware
      for communication over EJTAG) to be discovered.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9177/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      296b7c68
    • J
      MIPS: Add CDMM bus support · 8286ae03
      James Hogan 提交于
      Add MIPS Common Device Memory Map (CDMM) support in the form of a bus in
      the standard Linux device model. Each device attached via CDMM is
      discoverable via an 8-bit type identifier and may contain a number of
      blocks of memory mapped registers in the CDMM region. IRQs are expected
      to be handled separately.
      
      Due to the per-cpu (per-VPE for MT cores) nature of the CDMM devices,
      all the driver callbacks take place from workqueues which are run on the
      right CPU for the device in question, so that the driver doesn't need to
      be as concerned about which CPU it is running on. Callbacks also exist
      for when CPUs are taken offline, so that any per-CPU resources used by
      the driver can be disabled so they don't get forcefully migrated. CDMM
      devices are created as children of the CPU device they are attached to.
      
      Any existing CDMM configuration by the bootloader will be inherited,
      however platforms wishing to enable CDMM should implement the weak
      mips_cdmm_phys_base() function (see asm/cdmm.h) so that the bus driver
      knows where it should put the CDMM region in the physical address space
      if the bootloader hasn't already enabled it.
      
      A mips_cdmm_early_probe() function is also provided to allow early boot
      or particularly low level code to set up the CDMM region and probe for a
      specific device type, for example early console or KGDB IO drivers for
      the EJTAG Fast Debug Channel (FDC) CDMM device.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9599/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8286ae03
    • J
      MIPS: Add arch CDMM definitions and probing · 9b3274bd
      James Hogan 提交于
      Add architectural definitions and probing for the MIPS Common Device
      Memory Map (CDMM) region. When supported and enabled at a particular
      physical address, this region allows some number of per-CPU devices to
      be discovered and controlled via MMIO.
      
      A bit exists in Config3 to determine whether the feature is present, and
      a CDMMBase CP0 register allows the region to be enabled at a particular
      physical address.
      
      [ralf@linux-mips.org: Sort conflict with other patches.]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9178/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9b3274bd
    • J
      MIPS: Allow shared IRQ for timer & perf counter · 4a91d8fb
      James Hogan 提交于
      Before release 2 of the architecture there weren't separate interrupt
      pending bits for the local CPU interrupts (timer & perf counter
      overflow), so when they were connected to the same interrupt line the
      timer handler had to call the performance counter handler before knowing
      whether a timer interrupt was actually pending.
      
      Now another CPU local interrupt, for the Fast Debug Channel (FDC), can
      also be routed to an arbitrary interrupt line. It isn't scalable to keep
      adding cross-calls between handlers for these cases of shared interrupt
      lines, especially since the FDC could in theory share its interrupt line
      with the performance counter, timer, or both.
      
      Fortunately since release 2 of the architecture separate interrupt
      pending bits do exist in the Cause register. This allows local
      interrupts which share an interrupt line to have separate handlers using
      IRQF_SHARED. Unfortunately they can't easily have their own irqchip as
      there is no generic way to individually mask them.
      
      Enable this sharing to happen by removing the special case for when the
      perf count shares an IRQ with the timer. cp0_perfcount_irq and
      cp0_compare_irq can then be set to the same value with shared interrupt
      handlers registered for both of them.
      
      Pre-R2 code should be unaffected. cp0_perfcount_irq will always be -1
      and the timer handler will contnue to call into the perf counter
      handler.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9131/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4a91d8fb