1. 23 Jan, 2015 3 commits
  2. 22 Jan, 2015 2 commits
  3. 21 Jan, 2015 10 commits
  4. 20 Jan, 2015 8 commits
  5. 19 Jan, 2015 6 commits
    • Thomas Petazzoni's avatar
      bus: mvebu-mbus: make sure SDRAM CS for DMA don't overlap the MBus bridge window · 1737cac6
      Thomas Petazzoni authored
      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: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [Andrew Lunn <andrew@lunn.ch>: Fixed merge conflict]
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      1737cac6
    • Michal Mazur's avatar
      bus: mvebu-mbus: fix support of MBus window 13 on Armada XP/375/38x · 7fdf3d8a
      Michal Mazur authored
      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: default avatarMichal Mazur <arg@semihalf.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [Andrew Lunn <andrew@lunn.ch>: Undo the simple fix for stable]
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      7fdf3d8a
    • Thomas Petazzoni's avatar
      ARM: mvebu: use arm_coherent_dma_ops and re-enable hardware I/O coherency · 1bd4d8a6
      Thomas Petazzoni authored
      Now that we have enabled automatic I/O synchronization barriers, we no
      longer need any explicit barriers. We can therefore simplify
      arch/arm/mach-mvebu/coherency.c by using the existing
      arm_coherent_dma_ops instead of our custom mvebu_hwcc_dma_ops, and
      re-enable hardware I/O coherency support.
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [Andrew Lunn <andrew@lunn.ch>: Remove forgotten comment]
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      1bd4d8a6
    • Thomas Petazzoni's avatar
      bus: mvebu-mbus: use automatic I/O synchronization barriers · a0b5cd4a
      Thomas Petazzoni authored
      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: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      a0b5cd4a
    • Andrew Lunn's avatar
      Merge branch 'mvebu/fixes-3' into mvebu/soc · fe6e91e3
      Andrew Lunn authored
      fe6e91e3
    • Andrew Lunn's avatar
      bus: mvebu-mbus: fix support of MBus window 13 · 38bdf45f
      Andrew Lunn authored
      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: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      38bdf45f
  6. 17 Jan, 2015 1 commit
  7. 16 Jan, 2015 10 commits