Skip to contentSkip to conversation

ppc440spe-adma: adds updated ppc440spe adma driver

PATCH Superseded Anatolij Gustschin 2 participants 2 messages Dec 3, 2009 – Dec 11, 2009

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ppc440spe-adma: adds updated ppc440spe adma driver

This patch adds new version of the PPC440SPe ADMA driver.

---

Changes since v2:
- Correct Sign-offs order.
- Place the driver in 'drivers/dma/ppc4xx' directory as there are wishes to extend the driver to support other CPUs (PPC460EX) later.
- Don't duplicate directory name in the driver file names.
- Perform checks for 'len' > PAGE_SIZE cases while looking for suitable channel for async operations so that there will be a fallback to synchronous path if a user of the api should ever submit pq_val requests with 'len' > PAGE_SIZE.

 .../powerpc/dts-bindings/4xx/ppc440spe-adma.txt    |   93 +
 arch/powerpc/boot/dts/katmai.dts                   |   52 +-
 arch/powerpc/include/asm/async_tx.h                |   47 +
 arch/powerpc/include/asm/dcr-regs.h                |   23 +
 drivers/dma/Kconfig                                |   11 +
 drivers/dma/Makefile                               |    1 +
 drivers/dma/ppc4xx/Makefile                        |    1 +
 drivers/dma/ppc4xx/adma.c                          | 5027 ++++++++++++++++++++
 drivers/dma/ppc4xx/adma.h                          |  195 +
 drivers/dma/ppc4xx/dma.h                           |  223 +
 drivers/dma/ppc4xx/xor.h                           |  110 +
 11 files changed, 5782 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt
 create mode 100644 arch/powerpc/include/asm/async_tx.h
 create mode 100644 drivers/dma/ppc4xx/Makefile
 create mode 100644 drivers/dma/ppc4xx/adma.c
 create mode 100644 drivers/dma/ppc4xx/adma.h
 create mode 100644 drivers/dma/ppc4xx/dma.h
 create mode 100644 drivers/dma/ppc4xx/xor.h
Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt new file +93 -0
new file mode 100644
index 0000000..515ebcf
@@ -0,0 +1,93 @@
+PPC440SPe DMA/XOR (DMA Controller and XOR Accelerator)
+
+Device nodes needed for operation of the ppc440spe-adma driver
+are specified hereby. These are I2O/DMA, DMA and XOR nodes
+for DMA engines and Memory Queue Module node. The latter is used
+by ADMA driver for configuration of RAID-6 H/W capabilities of
+the PPC440SPe. In addition to the nodes and properties described
+below, the ranges property of PLB node must specify ranges for
+DMA devices.
+
+ i) The I2O node
+
+ Required properties:
+
+ - compatible		: "ibm,i2o-440spe";
+ - reg			: <registers mapping>
+ - dcr-reg		: <DCR registers range>
+
+ Example:
+
+	I2O: i2o@400100000 {
+		compatible = "ibm,i2o-440spe";
+		reg = <0x00000004 0x00100000 0x100>;
+		dcr-reg = <0x060 0x020>;
+	};
+
+
+ ii) The DMA node
+
+ Required properties:
+
+ - compatible		: "ibm,dma-440spe";
+ - cell-index		: 1 cell, hardware index of the DMA engine
+			  (typically 0x0 and 0x1 for DMA0 and DMA1)
+ - reg			: <registers mapping>
+ - dcr-reg		: <DCR registers range>
+ - interrupts		: <interrupt mapping for DMA0/1 interrupts sources:
+			   2 sources: DMAx CS FIFO Needs Service IRQ (on UIC0)
+			   and DMA Error IRQ (on UIC1). The latter is common
+			   for both DMA engines>.
+ - interrupt-parent	: needed for interrupt mapping
+
+ Example:
+
+	DMA0: dma0@400100100 {
+		compatible = "ibm,dma-440spe";
+		cell-index = <0>;
+		reg = <0x00000004 0x00100100 0x100>;
+		dcr-reg = <0x060 0x020>;
+		interrupt-parent = <&DMA0>;
+		interrupts = <0 1>;
+		#interrupt-cells = <1>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		interrupt-map = <
+			0 &UIC0 0x14 4
+			1 &UIC1 0x16 4>;
+	};
+
+
+ iii) XOR Accelerator node
+
+ Required properties:
+
+ - compatible		: "amcc,xor-accelerator";
+ - reg			: <registers mapping>
+ - interrupts		: <interrupt mapping for XOR interrupt source>
+ - interrupt-parent	: for interrupt mapping
+
+ Example:
+
+	xor-accel@400200000 {
+		compatible = "amcc,xor-accelerator";
+		reg = <0x00000004 0x00200000 0x400>;
+		interrupt-parent = <&UIC1>;
+		interrupts = <0x1f 4>;
+	};
+
+
+ iv) Memory Queue Module node
+
+ Required properties:
+
+ - compatible		: "ibm,mq-440spe";
+ - dcr-reg		: <DCR registers range>
+
+ Example:
+
+	MQ0: mq {
+		compatible = "ibm,mq-440spe";
+		dcr-reg = <0x040 0x020>;
+	};
+
arch/powerpc/boot/dts/katmai.dts +51 -1

69 lines not on this page · raw message

arch/powerpc/include/asm/async_tx.h new file +47 -0

47 lines not on this page · raw message

arch/powerpc/include/asm/dcr-regs.h +23 -0
index 828e3aa..380274d 100644
@@ -157,4 +157,27 @@
 #define  L2C_SNP_SSR_32G	0x0000f000
 #define  L2C_SNP_ESR		0x00000800
 
+/*
+ * DCR register offsets for 440SP/440SPe I2O/DMA controller.
+ * The base address is configured in the device tree.
+ */
+#define DCRN_I2O0_IBAL		0x006
+#define DCRN_I2O0_IBAH		0x007
+#define I2O_REG_ENABLE		0x00000001	/* Enable I2O/DMA access */
+
+/* 440SP/440SPe Software Reset DCR */
+#define DCRN_SDR0_SRST		0x0200
+#define DCRN_SDR0_SRST_I2ODMA	(0x80000000 >> 15)	/* Reset I2O/DMA */
+
+/* 440SP/440SPe Memory Queue DCR offsets */
+#define DCRN_MQ0_XORBA		0x04
+#define DCRN_MQ0_CF2H		0x06
+#define DCRN_MQ0_CFBHL		0x0f
+#define DCRN_MQ0_BAUH		0x10
+
+/* HB/LL Paths Configuration Register */
+#define MQ0_CFBHL_TPLM		28
+#define MQ0_CFBHL_HBCL		23
+#define MQ0_CFBHL_POLY		15
+
 #endif /* __DCR_REGS_H__ */
drivers/dma/Kconfig +11 -0
index b401dad..af43aca 100644
@@ -111,6 +111,17 @@ config SH_DMAE
 	help
 	  Enable support for the Renesas SuperH DMA controllers.
 
+config AMCC_PPC440SPE_ADMA
+	tristate "AMCC PPC440SPe ADMA support"
+	depends on 440SPe || 440SP
+	select DMA_ENGINE
+	select ARCH_HAS_ASYNC_TX_FIND_CHANNEL
+	help
+	  Enable support for the AMCC PPC440SPe RAID engines.
+
+config ARCH_HAS_ASYNC_TX_FIND_CHANNEL
+	bool
+
 config DMA_ENGINE
 	bool
 
drivers/dma/Makefile +1 -0
index eca71ba..ab697ae 100644
@@ -10,3 +10,4 @@ obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
 obj-$(CONFIG_MX3_IPU) += ipu/
 obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
 obj-$(CONFIG_SH_DMAE) += shdma.o
+obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/
drivers/dma/ppc4xx/Makefile new file +1 -0
new file mode 100644
index 0000000..b3d259b
@@ -0,0 +1 @@
+obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += adma.o
drivers/dma/ppc4xx/adma.c new file +5027 -0

2,742 lines not on this page · raw message

drivers/dma/ppc4xx/adma.h new file +195 -0

195 lines not on this page · raw message

drivers/dma/ppc4xx/dma.h new file +223 -0

223 lines not on this page · raw message

drivers/dma/ppc4xx/xor.h new file +110 -0

110 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.5

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 6 lines · Anatolij Gustschin

This patch adds new version of the PPC440SPe ADMA driver.

---

Quoted 12 lines

Changes since v2:
- Correct Sign-offs order.
- Place the driver in 'drivers/dma/ppc4xx' directory as there are wishes to extend the driver to support other CPUs (PPC460EX) later.
- Don't duplicate directory name in the driver file names.
- Perform checks for 'len' > PAGE_SIZE cases while looking for suitable channel for async operations so that there will be a fallback to synchronous path if a user of the api should ever submit pq_val requests with 'len' > PAGE_SIZE.

Ok, please split the katmai.dts fixups to a separate patch to send to Josh as this patch has picked up new conflicts with his tree. It also appears that this is not based on my next branch [1] because the Makefile and Kconfig updates collide with the coh driver. Fix that up and I'll apply this for my pull request for 2.6.33.

Thanks,
Dan

[1] git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git next