Skip to contentSkip to conversation

dmaengine: mv_xor: Add support for IO (PCIe) src/dst areas

PATCH Superseded Stefan Roese 2 participants 2 messages Aug 26, 2016 – Aug 28, 2016 dmaengine

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dmaengine: mv_xor: Add support for IO (PCIe) src/dst areas

To enable the access to a specific area, the MVEBU XOR controllers needs to have this area enabled / mapped via an address window. Right now, only the DRAM memory area is enabled via such memory windows. So using this driver to DMA to / from a e.g. PCIe memory region is currently not supported.

This patch now adds support for such PCIe / IO regions by checking if the src / dst address is located in an IO memory area in contrast to being located in DRAM. This is done by using the newly introduced MBus function mvebu_mbus_get_io_win_info(). If the src / dst address is located in such an IO area, a new address window is created in the XOR DMA controller. Enabling the controller to access this area.

Cc Gregory CLEMENT <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Marcin Wojtas <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Vinod Koul <[email protected]>

---
v1 -> v2:
- Removed COMPILE_TEST from Kconfig entry as this results in compilation errors on non-Marvell platforms because of references to MBus driver functions. Since this driver will never be used on non-Marvell platforms this should be okay.

RFC -> v1:
- Use a cache for the already mapped areas for performance reasons, as the MMIO registers don't need to get queried any more if the area is already mapped now

 drivers/dma/Kconfig  |  2 +-
 drivers/dma/mv_xor.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 drivers/dma/mv_xor.h |  7 ++++
 3 files changed, 98 insertions(+), 2 deletions(-)
drivers/dma/Kconfig +1 -1
index 8c98779..b878da1 100644
@@ -332,7 +332,7 @@ config MPC512X_DMA
 
 config MV_XOR
 	bool "Marvell XOR engine support"
-	depends on PLAT_ORION || ARCH_MVEBU || COMPILE_TEST
+	depends on PLAT_ORION || ARCH_MVEBU
 	select DMA_ENGINE
 	select DMA_ENGINE_RAID
 	select ASYNC_TX_ENABLE_CHANNEL_SWITCH
drivers/dma/mv_xor.c +90 -1

128 lines not on this page · raw message

drivers/dma/mv_xor.h +7 -0
index bf56e08..88eeab2 100644
@@ -80,12 +80,17 @@
 #define WINDOW_BAR_ENABLE(chan)	(0x40 + ((chan) << 2))
 #define WINDOW_OVERRIDE_CTRL(chan)	(0xA0 + ((chan) << 2))
 
+#define WINDOW_COUNT		8
+
 struct mv_xor_device {
 	void __iomem	     *xor_base;
 	void __iomem	     *xor_high_base;
 	struct clk	     *clk;
 	struct mv_xor_chan   *channels[MV_XOR_MAX_CHANNELS];
 	int		     xor_type;
+
+	u32                  win_start[WINDOW_COUNT];
+	u32                  win_end[WINDOW_COUNT];
 };
 
 /**
@@ -127,6 +132,8 @@ struct mv_xor_chan {
 	char			dummy_dst[MV_XOR_MIN_BYTE_COUNT];
 	dma_addr_t		dummy_src_addr, dummy_dst_addr;
 	u32                     saved_config_reg, saved_int_mask_reg;
+
+	struct mv_xor_device	*xordev;
 };
 
 /**
Signature · 1 line
2.9.3
#1 lore raw
url: https://github.com/0day-ci/linux/commits/Stefan-Roese/dmaengine-mv_xor-Add-support-for-IO-PCIe-src-dst-areas/20160826-134151 config: arm64-allyesconfig (attached as .config) compiler…

Hi Stefan,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information]

url: https://github.com/0day-ci/linux/commits/Stefan-Roese/dmaengine-mv_xor-Add-support-for-IO-PCIe-src-dst-areas/20160826-134151
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64

All errors (new ones prefixed by >>):

drivers/built-in.o: In function `mv_xor_add_io_win.isra.13':

>> zynq-fpga.c:(.text+0x31dadc): undefined reference to `mvebu_mbus_get_io_win_info'

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 51379 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160828/7a3d8f10/attachment-0001.obj>