1. 14 2月, 2015 1 次提交
  2. 20 1月, 2015 4 次提交
    • T
      bus: mvebu-mbus: make sure SDRAM CS for DMA don't overlap the MBus bridge window · 1737cac6
      Thomas Petazzoni 提交于
      The mvebu-mbus driver reads the SDRAM window registers, and make the
      information about the DRAM CS configuration available to device
      drivers using the mv_mbus_dram_info() API. This information is used by
      the DMA-capable device drivers to program their address decoding
      windows.
      
      Until now, we were basically providing the SDRAM window register
      details as is. However, it turns out that the DMA capability of the
      CESA cryptographic engine consists in doing DMA being the DRAM and the
      crypto SRAM mapped as a MBus window. For this case, it is very
      important that the SDRAM CS information does not overlap with the MBus
      bridge window.
      
      Therefore, this commit improves the mvebu-mbus driver to make sure we
      adjust the SDRAM CS information so that it doesn't overlap with the
      MBus bridge window. This problem was reported by Boris Brezillon,
      while working on the mv_cesa driver for Armada 37x/38x/XP. We use the
      memblock memory information to know where the usable RAM is located,
      as this information is guaranteed to be correct on all SoC variants.
      
      We could have used the MBus bridge window registers on Armada 370/XP,
      but they are not really used on Armada 375/38x (Cortex-A9 based),
      since the PL310 L2 filtering is used instead to discriminate between
      RAM accesses and I/O accesses. Therefore, using the memblock
      information is more generic and works accross the different platforms.
      Reported-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [Andrew Lunn <andrew@lunn.ch>: Fixed merge conflict]
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      1737cac6
    • M
      bus: mvebu-mbus: fix support of MBus window 13 on Armada XP/375/38x · 7fdf3d8a
      Michal Mazur 提交于
      On Armada XP, 375 and 38x the MBus window 13 has the remap capability,
      like windows 0 to 7. However, the mvebu-mbus driver isn't currently
      taking into account this special case, which means that when window 13
      is actually used, the remap registers are left to 0, making the device
      using this MBus window unavailable.
      
      To make things even more fun, the hardware designers have chosen to
      put the window 13 remap registers in a completely custom location,
      using a logic that differs from the one used for all other remappable
      windows.
      
      To solve this problem, this commit:
      
       * Adds a SoC specific function to calculate offset of remap registers
         to the mvebu_mbus_soc_data structure. This function,
         ->win_remap_offset(), returns the offset of the remap registers, or
         MVEBU_MBUS_NO_REMAP if the window does not have the remap
         capability. This new function replaces the previous integer field
         num_remappable_wins, which was insufficient to encode the special
         case of window 13.
      
       * Adds an implementation of the ->win_remap_offset() function for the
         various SoC families. Some have 2 first windows that are remapable,
         some the 4 first, some the 8 first, and then the Armada XP/375/38x
         case where the 8 first are remapable plus the special window
         13. This is implemented in functions
         generic_mbus_win_remap_2_offset(),
         generic_mbus_win_remap_4_offset(),
         generic_mbus_win_remap_8_offset() and
         armada_xp_mbus_win_remap_offset() respectively.
      
       * Change the code to use the ->win_remap_offset() function when
         accessing the remap registers, and also to use a newly introduced
         mvebu_mbus_window_is_remappable() helper function that tells
         whether a given window is remapable or not.
      
       * Separate Armada 370 from XP/375/38X because the window 13 of Armada
         370 does not support the remap capability.
      
      [Thomas: adapted for the mainline kernel, minor clarifications in the
      code, reword the commit log.]
      Signed-off-by: NMichal Mazur <arg@semihalf.com>
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [Andrew Lunn <andrew@lunn.ch>: Undo the simple fix for stable]
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      7fdf3d8a
    • T
      bus: mvebu-mbus: use automatic I/O synchronization barriers · a0b5cd4a
      Thomas Petazzoni 提交于
      Instead of using explicit I/O synchronization barriers shoehorned
      inside the streaming DMA mappings API (in
      arch/arm/mach-mvebu/coherency.c), we are switching to use automatic
      I/O synchronization barrier.
      
      The primary motivation for this change is that explicit I/O
      synchronization barriers are not only needed for streaming DMA
      mappings (which can easily be done by overriding the dma_map_ops), but
      also for coherent DMA mappings (which is a lot less easy to do, since
      the kernel assumes such mappings are coherent and don't require any
      sort of cache maintenance operation to ensure the consistency of the
      buffers).
      
      Switching to automatic I/O synchronization barriers will also allow us
      to use the existing arm_coherent_dma_ops instead of our custom
      arm_dma_ops.
      
      In order to use automatic I/O synchronization barriers, this commit
      changes mvebu-mbus in two ways:
      
       - It enables automatic I/O synchronization barriers in the 0x84
         register of the MBus bridge, by enabling such barriers for all MBus
         units. This enables automatic barriers for the on-SoC peripherals
         that are doing DMA.
      
       - It enables the SyncEnable bit in the MBus windows, so that PCIe
         devices also use automatic I/O synchronization barrier.
      
      This automatic synchronization barrier relies on the assumption that
      at least one register of a given hardware unit is read before the
      driver accesses the DMA mappings modified by this unit. This
      assumption is guaranteed for PCI devices by vertue of the PCI
      standard, and we can reasonably verify that this assumption is also
      true for the limited number of platform drivers doing DMA used on
      Marvell EBU platforms.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      a0b5cd4a
    • A
      bus: mvebu-mbus: fix support of MBus window 13 · 38bdf45f
      Andrew Lunn 提交于
      On Armada XP, 375 and 38x the MBus window 13 has the remap capability,
      like windows 0 to 7. However, the mvebu-mbus driver isn't currently
      taking into account this special case, which means that when window 13
      is actually used, the remap registers are left to 0, making the device
      using this MBus window unavailable.
      
      As a minimal fix for stable, don't use window 13. A full fix will
      follow later.
      
      Fixes: fddddb52 ("bus: introduce an Marvell EBU MBus driver")
      Cc: <stable@vger.kernel.org> # v3.10+
      Reviewed-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      38bdf45f
  3. 17 1月, 2015 1 次提交
  4. 01 12月, 2014 2 次提交
    • T
      bus: mvebu-mbus: provide a mechanism to save SDRAM window configuration · 4749c02b
      Thomas Petazzoni 提交于
      On Marvell EBU platforms, when doing suspend/resume, the SDRAM window
      configuration must be saved on suspend, and restored on
      resume. However, it needs to be restored on resume *before*
      re-entering the kernel, because the SDRAM window configuration defines
      the layout of the memory. For this reason, it cannot simply be done in
      the ->suspend() and ->resume() hooks of the mvebu-mbus driver.
      
      Instead, it needs to be restored by the bootloader "boot info"
      mechanism used when resuming. This mechanism allows the kernel to
      define a list of (address, value) pairs when suspending, that the
      bootloader will restore on resume before jumping back into the kernel.
      
      This commit therefore adds a new function to the mvebu-mbus driver,
      called mvebu_mbus_save_cpu_target(), which will be called by the
      platform code to make the mvebu-mbus driver save the SDRAM window
      configuration in a way that can be understood by the bootloader "boot
      info" mechanism.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Link: https://lkml.kernel.org/r/1416585613-2113-8-git-send-email-thomas.petazzoni@free-electrons.comSigned-off-by: NJason Cooper <jason@lakedaemon.net>
      4749c02b
    • T
      bus: mvebu-mbus: suspend/resume support · a0e89c02
      Thomas Petazzoni 提交于
      This commit extends the mvebu-mbus driver to provide suspend/resume
      support. Since mvebu-mbus is not a platform_driver, the syscore_ops
      mechanism is used to get ->suspend() and ->resume() hooks called into
      the driver.
      
      In those hooks, we save and restore the MBus windows state, to make
      sure after resume all Mbus windows are properly restored. Note that
      while the state of some windows could be gathered by looking again at
      the Device Tree (for statically described windows), it is not the case
      of dynamically described windows such as the PCIe memory and I/O
      windows. Therefore, we take the simple approach of saving and
      restoring the registers for all MBus windows.
      
      In addition, the commit extends the Device Tree binding of the MBus
      controller, to control the MBus bridge registers (which define which
      parts of the physical address space is routed to MBus windows
      vs. normal RAM memory). Those registers must be saved and restored
      during suspend/resume. The Device Tree binding extension is made is a
      backward compatible fashion, but of course, suspend/resume will not
      work without the Device Tree update.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Link: https://lkml.kernel.org/r/1416585613-2113-7-git-send-email-thomas.petazzoni@free-electrons.comSigned-off-by: NJason Cooper <jason@lakedaemon.net>
      a0e89c02
  5. 29 11月, 2014 4 次提交
  6. 21 11月, 2014 1 次提交
    • F
      bus: brcmstb_gisb: resolve section mismatch · 2e8a29a1
      Florian Fainelli 提交于
      Commit f1bee783 moved the call to hook_fault_code in
      brcmstb_gisb_arb_probe() which now calls a function annotated with __init, so
      this one must also be annotated with __init.
      
      In order to avoid introducing another section mismatch, call
      platform_driver_probe() manually and remove the .probe assignment from
      brcmstb_gisb_arb_driver, this is very similar to what
      drivers/pci/host/pci-imx6.c does since we basically have the same constraints
      here.
      
      Fixes: f1bee783 ("bus: brcmstb_gisb: register the fault code hook")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      2e8a29a1
  7. 12 11月, 2014 2 次提交
  8. 06 11月, 2014 1 次提交
  9. 30 10月, 2014 1 次提交
    • M
      bus: cci: move away from arm_pmu framework · c6f85cb4
      Mark Rutland 提交于
      The ARM CPU PMUs and the ARM CCI PMU are using the same framework
      despite being substantially different in programming model, which makes
      it difficult to handle either particularly well.
      
      This patch migrates the ARM CCI PMU driver away from the arm_pmu
      framework, matching the style of the CCN PMU driver and other 'uncore'
      PMU drivers. This will enable refactoring of the arm_pmu framework to
      better support CPU PMUs. Event context migration on hotplug is not yet
      added due to a race on event->ctx in the core perf code.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NPunit Agrawal <punit.agrawal@arm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      [will: fix whitespace issues]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c6f85cb4
  10. 21 10月, 2014 2 次提交
  11. 20 10月, 2014 1 次提交
  12. 09 10月, 2014 1 次提交
  13. 12 9月, 2014 1 次提交
    • N
      bus: omap_l3_noc: Fix connID for OMAP4 · 41fc619d
      Nishanth Menon 提交于
      Commit d4d8819e ("bus: omap_l3_noc: fix masterid detection")
      did the right thing in dropping the LSB 2 bits which is not part
      of the ConnID for NTTP master address. However, as part of that
      change, we should also have ensured that existing list of OMAP4 connID
      codes are also shifted by 2 bits to ensure that connIDs map to "Table
      13-18. ConnID Values" as provided in Technical Reference Manuals for
      OMAP4430(Rev AP, April 2014, SWPU220AP) and OMAP4460(Rev AB, April
      2014, SWPU234AB)
      
      Fixes: d4d8819e ("bus: omap_l3_noc: fix masterid detection")
      Reported-by: NKristian Otnes <kotnes@cisco.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      41fc619d
  14. 06 9月, 2014 1 次提交
  15. 25 8月, 2014 1 次提交
  16. 01 8月, 2014 1 次提交
  17. 31 7月, 2014 1 次提交
  18. 24 7月, 2014 2 次提交
  19. 18 7月, 2014 1 次提交
    • L
      bus: imx-weim: populate devices on a simple bus · 26651c43
      Liu Ying 提交于
      There could be some memory map devices located in
      a certain chip select region of the i.MX WEIM.
      The devices could be attached to a simple bus(for
      example, a AXI bus) whose root node is one child
      device tree node of the i.MX WEIM device tree node.
      There should be a bridge(very likely, software
      transparent) bewteen the i.MX WEIM and the simple bus.
      This patch makes the i.MX WEIM driver possible to
      populate devices on a simple bus.  In this way, people
      may try various IPs(in a FPGA, maybe) outside of i.MX
      chips with the i.MX WEIM embedded.
      Signed-off-by: NLiu Ying <Ying.Liu@freescale.com>
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      26651c43
  20. 20 6月, 2014 1 次提交
  21. 17 6月, 2014 1 次提交
    • A
      bus/arm-cci: add dependency on OF && CPU_V7 · 30b6f37d
      Arnd Bergmann 提交于
      The arm-cci code uses device tree helpers for initialization
      that don't work on kernels built without CONFIG_OF. Further,
      it contains an inline assembly in cci_enable_port_for_self()
      that uses ARMv7 instructions and fails to build when targetting
      other ARM instruction set versions.
      
      This works around both issues by limiting the scope of the
      Kconfig symbol to platforms that can actually build this driver
      cleanly.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      30b6f37d
  22. 27 5月, 2014 1 次提交
    • A
      ARM: vexpress: refine dependencies for new code · b33cdd28
      Arnd Bergmann 提交于
      The versatile express changes for 3.16 introduced a number of
      build regressions for randconfig kernels by not tracking dependencies
      between the components right.
      
      This patch tries to rectify that:
      
      * the mach-vexpress code cannot link without the syscfg driver,
        which in turn needs MFD_VEXPRESS_SYSREG
      * various drivers call devm_regmap_init_vexpress_config(), which
        has to be exported so it can be used by loadable modules
      * the configuration bus uses OF DT helper functions that are not
        available to platforms disable CONFIG_OF
      * The sysreg driver exports GPIOs through gpiolib, which can
        be disabled on some platforms.
      * The clocksource code cannot be built on platforms that don't
        use modern timekeeping but rely on gettimeoffset.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      b33cdd28
  23. 24 5月, 2014 1 次提交
    • F
      bus: add Broadcom GISB bus arbiter timeout/error handler · 44127b77
      Florian Fainelli 提交于
      This patch adds support for the Broadcom GISB arbiter bus timeout/error
      handler. GISB is a proprietary bus used by Broadcom Set Top Box
      System-on-a-chip devices (BCM7xxx) which allows multiple masters and
      clients to be interfaced with each other.
      
      The bus arbiter offers support for generating two interrupts towards the
      host CPU, thus allowing us to "catch" clock gated masters, or masters
      being volontarily blocked for powersaving purposes, or do general system
      troubleshooting.
      
      We also register a hook with the ARM fault exception handling to allow
      printing a more informative message than "imprecise external abort at
      0x00000000" for instance.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      44127b77
  24. 16 5月, 2014 1 次提交
    • P
      mfd: vexpress: Convert custom func API to regmap · 3b9334ac
      Pawel Moll 提交于
      Components of the Versatile Express platform (configuration
      microcontrollers on motherboard and daughterboards in particular)
      talk to each other over a custom configuration bus. They
      provide miscellaneous functions (from clock generator control
      to energy sensors) which are represented as platform devices
      (and Device Tree nodes). The transactions on the bus can
      be generated by different "bridges" in the system, some
      of which are universal for the whole platform (for the price
      of high transfer latencies), others restricted to a subsystem
      (but much faster).
      
      Until now drivers for such functions were using custom "func"
      API, which is being replaced in this patch by regmap calls.
      This required:
      
      * a rework (and move to drivers/bus directory, as suggested
        by Samuel and Arnd) of the config bus core, which is much
        simpler now and uses device model infrastructure (class)
        to keep track of the bridges; non-DT case (soon to be
        retired anyway) is simply covered by a special device
        registration function
      
      * the new config-bus driver also takes over device population,
        so there is no need for special matching table for
        of_platform_populate nor "simple-bus" hack in the arm64
        model dtsi file (relevant bindings documentation has
        been updated); this allows all the vexpress devices
        fit into normal device model, making it possible
        to remove plenty of early inits and other hacks in
        the near future
      
      * adaptation of the syscfg bridge implementation in the
        sysreg driver, again making it much simpler; there is
        a special case of the "energy" function spanning two
        registers, where they should be both defined in the tree
        now, but backward compatibility is maintained in the code
      
      * modification of the relevant drivers:
      
        * hwmon - just a straight-forward API change
        * power/reset driver - API change
        * regulator - API change plus error handling
          simplification
        * osc clock driver - this one required larger rework
          in order to turn in into a standard platform driver
      Signed-off-by: NPawel Moll <pawel.moll@arm.com>
      Acked-by: NMark Brown <broonie@linaro.org>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Acked-by: NMike Turquette <mturquette@linaro.org>
      3b9334ac
  25. 06 5月, 2014 6 次提交