* [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
@ 2014-08-19 17:29 Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
` (15 more replies)
0 siblings, 16 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
The patchset is targeting two things:
- removal of slave_id which is deprecated (suggested by Arnd Bergmann)
- support BayTrail and Braswell SoCs in PCI case
They are tight with each other, thus comes in one series.
The patch set was BAT tested on Braswell and BayTrail machines.
We would like to push this through slave-dma tree, so, Mark, Greg,
Hans-Christian, and Haavard, please, Ack them if you have no objections.
Vinod, we would like them to be pushed during this cycle since we have more
coming. And it would be nice to have Braswell support in v3.18-rc1.
Alan Cox (1):
serial: 8250_pci: Add PCI IDs for Intel Braswell
Andy Shevchenko (9):
dmaengine: dw: move dw_dmac.h to where it belongs to
avr32: at32ap700x: don't rely on default DMA masters
dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
dmaengine: dw: apply both HS interfaces and remove slave_id usage
dmaengine: dw: introduce generic filter function
dmaengine: dw: move clock operations to platform.c
dmaengine: dw: add PCI IDs for Braswell DMAs
spi/pxa2xx-pci: remove unnecessary assignment
serial: 8250: don't use slave_id of dma_slave_config
Mika Westerberg (2):
spi/pxa2xx: Don't use slave_id of dma_slave_config
spi/pxa2xx-pci: Add support for Intel Braswell
MAINTAINERS | 2 +-
arch/avr32/mach-at32ap/at32ap700x.c | 19 ++--
arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
drivers/dma/dw/core.c | 72 +++++----------
drivers/dma/dw/internal.h | 28 +-----
drivers/dma/dw/pci.c | 4 +
drivers/dma/dw/platform.c | 86 +++++++++---------
drivers/dma/dw/regs.h | 14 +--
drivers/spi/spi-pxa2xx-dma.c | 15 +---
drivers/spi/spi-pxa2xx-pci.c | 102 ++++++++++++++++++----
drivers/spi/spi-pxa2xx.c | 2 -
drivers/tty/serial/8250/8250.h | 6 +-
drivers/tty/serial/8250/8250_dw.c | 7 +-
drivers/tty/serial/8250/8250_pci.c | 78 ++++++++++++++---
include/linux/dw_dmac.h | 111 ------------------------
include/linux/platform_data/dma-dw.h | 109 +++++++++++++++++++++++
include/linux/spi/pxa2xx_spi.h | 9 +-
include/sound/atmel-abdac.h | 2 +-
include/sound/atmel-ac97c.h | 2 +-
sound/atmel/abdac.c | 2 +-
sound/atmel/ac97c.c | 2 +-
21 files changed, 365 insertions(+), 309 deletions(-)
delete mode 100644 include/linux/dw_dmac.h
create mode 100644 include/linux/platform_data/dma-dw.h
--
2.1.0
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-20 6:01 ` Hans-Christian Egtvedt
2014-08-20 8:55 ` Viresh Kumar
2014-08-19 17:29 ` [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters Andy Shevchenko
` (14 subsequent siblings)
15 siblings, 2 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
There is a common storage for platform data related structures and definitions
inside kernel source tree. The patch moves file from include/linux to
include/linux/platform_data and renames it acoordingly. The users are also
updated.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
MAINTAINERS | 2 +-
arch/avr32/mach-at32ap/at32ap700x.c | 2 +-
arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
drivers/dma/dw/internal.h | 2 +-
drivers/dma/dw/regs.h | 6 +-
include/linux/dw_dmac.h | 111 ------------------------
include/linux/platform_data/dma-dw.h | 111 ++++++++++++++++++++++++
include/sound/atmel-abdac.h | 2 +-
include/sound/atmel-ac97c.h | 2 +-
sound/atmel/abdac.c | 2 +-
sound/atmel/ac97c.c | 2 +-
11 files changed, 122 insertions(+), 122 deletions(-)
delete mode 100644 include/linux/dw_dmac.h
create mode 100644 include/linux/platform_data/dma-dw.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 04bf956..cd4a118 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7888,7 +7888,7 @@ SYNOPSYS DESIGNWARE DMAC DRIVER
M: Viresh Kumar <viresh.linux@gmail.com>
M: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
S: Maintained
-F: include/linux/dw_dmac.h
+F: include/linux/platform_data/dma-dw.h
F: drivers/dma/dw/
SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index db85b5e..2a1aa71 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -7,7 +7,7 @@
*/
#include <linux/clk.h>
#include <linux/delay.h>
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/platform_device.h>
diff --git a/arch/avr32/mach-at32ap/include/mach/atmel-mci.h b/arch/avr32/mach-at32ap/include/mach/atmel-mci.h
index 4bba585..11d7f4b 100644
--- a/arch/avr32/mach-at32ap/include/mach/atmel-mci.h
+++ b/arch/avr32/mach-at32ap/include/mach/atmel-mci.h
@@ -1,7 +1,7 @@
#ifndef __MACH_ATMEL_MCI_H
#define __MACH_ATMEL_MCI_H
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
/**
* struct mci_dma_data - DMA data for MCI interface
diff --git a/drivers/dma/dw/internal.h b/drivers/dma/dw/internal.h
index 32667f9..43cc1df 100644
--- a/drivers/dma/dw/internal.h
+++ b/drivers/dma/dw/internal.h
@@ -12,7 +12,7 @@
#define _DW_DMAC_INTERNAL_H
#include <linux/device.h>
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#include "regs.h"
diff --git a/drivers/dma/dw/regs.h b/drivers/dma/dw/regs.h
index bb98d3e..af02439 100644
--- a/drivers/dma/dw/regs.h
+++ b/drivers/dma/dw/regs.h
@@ -11,7 +11,7 @@
#include <linux/interrupt.h>
#include <linux/dmaengine.h>
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#define DW_DMA_MAX_NR_CHANNELS 8
#define DW_DMA_MAX_NR_REQUESTS 16
@@ -161,7 +161,7 @@ struct dw_dma_regs {
#define DWC_CTLH_DONE 0x00001000
#define DWC_CTLH_BLOCK_TS_MASK 0x00000fff
-/* Bitfields in CFG_LO. Platform-configurable bits are in <linux/dw_dmac.h> */
+/* Bitfields in CFG_LO. Platform-configurable bits are in <linux/platform_data/dma-dw.h> */
#define DWC_CFGL_CH_PRIOR_MASK (0x7 << 5) /* priority mask */
#define DWC_CFGL_CH_PRIOR(x) ((x) << 5) /* priority */
#define DWC_CFGL_CH_SUSP (1 << 8) /* pause xfer */
@@ -172,7 +172,7 @@ struct dw_dma_regs {
#define DWC_CFGL_RELOAD_SAR (1 << 30)
#define DWC_CFGL_RELOAD_DAR (1 << 31)
-/* Bitfields in CFG_HI. Platform-configurable bits are in <linux/dw_dmac.h> */
+/* Bitfields in CFG_HI. Platform-configurable bits are in <linux/platform_data/dma-dw.h> */
#define DWC_CFGH_DS_UPD_EN (1 << 5)
#define DWC_CFGH_SS_UPD_EN (1 << 6)
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
deleted file mode 100644
index 68b4024..0000000
--- a/include/linux/dw_dmac.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Driver for the Synopsys DesignWare DMA Controller
- *
- * Copyright (C) 2007 Atmel Corporation
- * Copyright (C) 2010-2011 ST Microelectronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef DW_DMAC_H
-#define DW_DMAC_H
-
-#include <linux/dmaengine.h>
-
-/**
- * struct dw_dma_slave - Controller-specific information about a slave
- *
- * @dma_dev: required DMA master device. Depricated.
- * @bus_id: name of this device channel, not just a device name since
- * devices may have more than one channel e.g. "foo_tx"
- * @cfg_hi: Platform-specific initializer for the CFG_HI register
- * @cfg_lo: Platform-specific initializer for the CFG_LO register
- * @src_master: src master for transfers on allocated channel.
- * @dst_master: dest master for transfers on allocated channel.
- */
-struct dw_dma_slave {
- struct device *dma_dev;
- u32 cfg_hi;
- u32 cfg_lo;
- u8 src_master;
- u8 dst_master;
-};
-
-/**
- * struct dw_dma_platform_data - Controller configuration parameters
- * @nr_channels: Number of channels supported by hardware (max 8)
- * @is_private: The device channels should be marked as private and not for
- * by the general purpose DMA channel allocator.
- * @chan_allocation_order: Allocate channels starting from 0 or 7
- * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0.
- * @block_size: Maximum block size supported by the controller
- * @nr_masters: Number of AHB masters supported by the controller
- * @data_width: Maximum data width supported by hardware per AHB master
- * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits)
- */
-struct dw_dma_platform_data {
- unsigned int nr_channels;
- bool is_private;
-#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
-#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
- unsigned char chan_allocation_order;
-#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
-#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
- unsigned char chan_priority;
- unsigned short block_size;
- unsigned char nr_masters;
- unsigned char data_width[4];
-};
-
-/* bursts size */
-enum dw_dma_msize {
- DW_DMA_MSIZE_1,
- DW_DMA_MSIZE_4,
- DW_DMA_MSIZE_8,
- DW_DMA_MSIZE_16,
- DW_DMA_MSIZE_32,
- DW_DMA_MSIZE_64,
- DW_DMA_MSIZE_128,
- DW_DMA_MSIZE_256,
-};
-
-/* Platform-configurable bits in CFG_HI */
-#define DWC_CFGH_FCMODE (1 << 0)
-#define DWC_CFGH_FIFO_MODE (1 << 1)
-#define DWC_CFGH_PROTCTL(x) ((x) << 2)
-#define DWC_CFGH_SRC_PER(x) ((x) << 7)
-#define DWC_CFGH_DST_PER(x) ((x) << 11)
-
-/* Platform-configurable bits in CFG_LO */
-#define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */
-#define DWC_CFGL_LOCK_CH_BLOCK (1 << 12)
-#define DWC_CFGL_LOCK_CH_XACT (2 << 12)
-#define DWC_CFGL_LOCK_BUS_XFER (0 << 14) /* scope of LOCK_BUS */
-#define DWC_CFGL_LOCK_BUS_BLOCK (1 << 14)
-#define DWC_CFGL_LOCK_BUS_XACT (2 << 14)
-#define DWC_CFGL_LOCK_CH (1 << 15) /* channel lockout */
-#define DWC_CFGL_LOCK_BUS (1 << 16) /* busmaster lockout */
-#define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */
-#define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */
-
-/* DMA API extensions */
-struct dw_cyclic_desc {
- struct dw_desc **desc;
- unsigned long periods;
- void (*period_callback)(void *param);
- void *period_callback_param;
-};
-
-struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
- dma_addr_t buf_addr, size_t buf_len, size_t period_len,
- enum dma_transfer_direction direction);
-void dw_dma_cyclic_free(struct dma_chan *chan);
-int dw_dma_cyclic_start(struct dma_chan *chan);
-void dw_dma_cyclic_stop(struct dma_chan *chan);
-
-dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan);
-
-dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan);
-
-#endif /* DW_DMAC_H */
diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h
new file mode 100644
index 0000000..68b4024
--- /dev/null
+++ b/include/linux/platform_data/dma-dw.h
@@ -0,0 +1,111 @@
+/*
+ * Driver for the Synopsys DesignWare DMA Controller
+ *
+ * Copyright (C) 2007 Atmel Corporation
+ * Copyright (C) 2010-2011 ST Microelectronics
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef DW_DMAC_H
+#define DW_DMAC_H
+
+#include <linux/dmaengine.h>
+
+/**
+ * struct dw_dma_slave - Controller-specific information about a slave
+ *
+ * @dma_dev: required DMA master device. Depricated.
+ * @bus_id: name of this device channel, not just a device name since
+ * devices may have more than one channel e.g. "foo_tx"
+ * @cfg_hi: Platform-specific initializer for the CFG_HI register
+ * @cfg_lo: Platform-specific initializer for the CFG_LO register
+ * @src_master: src master for transfers on allocated channel.
+ * @dst_master: dest master for transfers on allocated channel.
+ */
+struct dw_dma_slave {
+ struct device *dma_dev;
+ u32 cfg_hi;
+ u32 cfg_lo;
+ u8 src_master;
+ u8 dst_master;
+};
+
+/**
+ * struct dw_dma_platform_data - Controller configuration parameters
+ * @nr_channels: Number of channels supported by hardware (max 8)
+ * @is_private: The device channels should be marked as private and not for
+ * by the general purpose DMA channel allocator.
+ * @chan_allocation_order: Allocate channels starting from 0 or 7
+ * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0.
+ * @block_size: Maximum block size supported by the controller
+ * @nr_masters: Number of AHB masters supported by the controller
+ * @data_width: Maximum data width supported by hardware per AHB master
+ * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits)
+ */
+struct dw_dma_platform_data {
+ unsigned int nr_channels;
+ bool is_private;
+#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
+#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
+ unsigned char chan_allocation_order;
+#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
+#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
+ unsigned char chan_priority;
+ unsigned short block_size;
+ unsigned char nr_masters;
+ unsigned char data_width[4];
+};
+
+/* bursts size */
+enum dw_dma_msize {
+ DW_DMA_MSIZE_1,
+ DW_DMA_MSIZE_4,
+ DW_DMA_MSIZE_8,
+ DW_DMA_MSIZE_16,
+ DW_DMA_MSIZE_32,
+ DW_DMA_MSIZE_64,
+ DW_DMA_MSIZE_128,
+ DW_DMA_MSIZE_256,
+};
+
+/* Platform-configurable bits in CFG_HI */
+#define DWC_CFGH_FCMODE (1 << 0)
+#define DWC_CFGH_FIFO_MODE (1 << 1)
+#define DWC_CFGH_PROTCTL(x) ((x) << 2)
+#define DWC_CFGH_SRC_PER(x) ((x) << 7)
+#define DWC_CFGH_DST_PER(x) ((x) << 11)
+
+/* Platform-configurable bits in CFG_LO */
+#define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */
+#define DWC_CFGL_LOCK_CH_BLOCK (1 << 12)
+#define DWC_CFGL_LOCK_CH_XACT (2 << 12)
+#define DWC_CFGL_LOCK_BUS_XFER (0 << 14) /* scope of LOCK_BUS */
+#define DWC_CFGL_LOCK_BUS_BLOCK (1 << 14)
+#define DWC_CFGL_LOCK_BUS_XACT (2 << 14)
+#define DWC_CFGL_LOCK_CH (1 << 15) /* channel lockout */
+#define DWC_CFGL_LOCK_BUS (1 << 16) /* busmaster lockout */
+#define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */
+#define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */
+
+/* DMA API extensions */
+struct dw_cyclic_desc {
+ struct dw_desc **desc;
+ unsigned long periods;
+ void (*period_callback)(void *param);
+ void *period_callback_param;
+};
+
+struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
+ dma_addr_t buf_addr, size_t buf_len, size_t period_len,
+ enum dma_transfer_direction direction);
+void dw_dma_cyclic_free(struct dma_chan *chan);
+int dw_dma_cyclic_start(struct dma_chan *chan);
+void dw_dma_cyclic_stop(struct dma_chan *chan);
+
+dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan);
+
+dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan);
+
+#endif /* DW_DMAC_H */
diff --git a/include/sound/atmel-abdac.h b/include/sound/atmel-abdac.h
index edff6a8..a8f735d 100644
--- a/include/sound/atmel-abdac.h
+++ b/include/sound/atmel-abdac.h
@@ -10,7 +10,7 @@
#ifndef __INCLUDE_SOUND_ATMEL_ABDAC_H
#define __INCLUDE_SOUND_ATMEL_ABDAC_H
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
/**
* struct atmel_abdac_pdata - board specific ABDAC configuration
diff --git a/include/sound/atmel-ac97c.h b/include/sound/atmel-ac97c.h
index 00e6c289..f2a1cdc 100644
--- a/include/sound/atmel-ac97c.h
+++ b/include/sound/atmel-ac97c.h
@@ -10,7 +10,7 @@
#ifndef __INCLUDE_SOUND_ATMEL_AC97C_H
#define __INCLUDE_SOUND_ATMEL_AC97C_H
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#define AC97C_CAPTURE 0x01
#define AC97C_PLAYBACK 0x02
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index edf2ca7..154a7c4 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -9,7 +9,7 @@
*/
#include <linux/clk.h>
#include <linux/bitmap.h>
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index a04d2317..1dfb35a 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -31,7 +31,7 @@
#include <sound/atmel-ac97c.h>
#include <sound/memalloc.h>
-#include <linux/dw_dmac.h>
+#include <linux/platform_data/dma-dw.h>
#include <mach/cpu.h>
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-20 6:03 ` Hans-Christian Egtvedt
2014-08-19 17:29 ` [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces Andy Shevchenko
` (13 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
In future we are going to remove the defaults of AHB masters from dw_dmac
driver. It means each user have to supply proper source and destination masters
by itself explicitly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/avr32/mach-at32ap/at32ap700x.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 2a1aa71..ec7be28 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1360,6 +1360,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
| DWC_CFGH_DST_PER(1));
slave->sdata.cfg_lo &= ~(DWC_CFGL_HS_DST_POL
| DWC_CFGL_HS_SRC_POL);
+ slave->sdata.src_master = 1;
+ slave->sdata.dst_master = 0;
data->dma_slave = slave;
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-20 6:15 ` Hans-Christian Egtvedt
2014-08-19 17:29 ` [PATCH v1 04/12] dmaengine: dw: apply both HS interfaces and remove slave_id usage Andy Shevchenko
` (12 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
Instead of exposing the possibility to set DMA registers CFG_HI and CFG_LO
strict user to provide handshake interfaces explicitly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/avr32/mach-at32ap/at32ap700x.c | 15 +++++----------
drivers/dma/dw/core.c | 4 ++--
include/linux/platform_data/dma-dw.h | 10 ++++------
3 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index ec7be28..37b7560 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1356,10 +1356,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
goto fail;
slave->sdata.dma_dev = &dw_dmac0_device.dev;
- slave->sdata.cfg_hi = (DWC_CFGH_SRC_PER(0)
- | DWC_CFGH_DST_PER(1));
- slave->sdata.cfg_lo &= ~(DWC_CFGL_HS_DST_POL
- | DWC_CFGL_HS_SRC_POL);
+ slave->sdata.src_id = 0;
+ slave->sdata.dst_id = 1;
slave->sdata.src_master = 1;
slave->sdata.dst_master = 0;
@@ -2054,8 +2052,7 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data,
/* Check if DMA slave interface for capture should be configured. */
if (flags & AC97C_CAPTURE) {
rx_dws->dma_dev = &dw_dmac0_device.dev;
- rx_dws->cfg_hi = DWC_CFGH_SRC_PER(3);
- rx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
+ rx_dws->src_id = 3;
rx_dws->src_master = 0;
rx_dws->dst_master = 1;
}
@@ -2063,8 +2060,7 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data,
/* Check if DMA slave interface for playback should be configured. */
if (flags & AC97C_PLAYBACK) {
tx_dws->dma_dev = &dw_dmac0_device.dev;
- tx_dws->cfg_hi = DWC_CFGH_DST_PER(4);
- tx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
+ tx_dws->dst_id = 4;
tx_dws->src_master = 0;
tx_dws->dst_master = 1;
}
@@ -2136,8 +2132,7 @@ at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data)
dws = &data->dws;
dws->dma_dev = &dw_dmac0_device.dev;
- dws->cfg_hi = DWC_CFGH_DST_PER(2);
- dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
+ dws->dst_id = 2;
dws->src_master = 0;
dws->dst_master = 1;
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 1af731b..0a9c052 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -155,8 +155,8 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
*/
BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev);
- cfghi = dws->cfg_hi;
- cfglo |= dws->cfg_lo & ~DWC_CFGL_CH_PRIOR_MASK;
+ cfghi |= DWC_CFGH_DST_PER(dws->dst_id);
+ cfghi |= DWC_CFGH_SRC_PER(dws->src_id);
} else {
if (dwc->direction == DMA_MEM_TO_DEV)
cfghi = DWC_CFGH_DST_PER(dwc->request_line);
diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h
index 68b4024..bc411a1 100644
--- a/include/linux/platform_data/dma-dw.h
+++ b/include/linux/platform_data/dma-dw.h
@@ -17,17 +17,15 @@
* struct dw_dma_slave - Controller-specific information about a slave
*
* @dma_dev: required DMA master device. Depricated.
- * @bus_id: name of this device channel, not just a device name since
- * devices may have more than one channel e.g. "foo_tx"
- * @cfg_hi: Platform-specific initializer for the CFG_HI register
- * @cfg_lo: Platform-specific initializer for the CFG_LO register
+ * @src_id: src request line
+ * @dst_id: dst request line
* @src_master: src master for transfers on allocated channel.
* @dst_master: dest master for transfers on allocated channel.
*/
struct dw_dma_slave {
struct device *dma_dev;
- u32 cfg_hi;
- u32 cfg_lo;
+ u8 src_id;
+ u8 dst_id;
u8 src_master;
u8 dst_master;
};
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 04/12] dmaengine: dw: apply both HS interfaces and remove slave_id usage
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (2 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 05/12] dmaengine: dw: introduce generic filter function Andy Shevchenko
` (11 subsequent siblings)
15 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
Instead of one request line member let's use both source and destination ones.
Usually we have no such hardware except Atmel MMC controller found on AVR32
platform (see arch/avr32/mach-at32ap/at32ap700x.c and
drivers/mmc/host/atmel-mci.c).
This patch removes slave_id usage since it'll be removed from the generic
structure in later. This breaks the non-ACPI / non-DT cases for the users of
the driver, i.e. SPI and HSUART. However, these cases mean only PCI enumerated
devices for now, which is anyway broken (considering more than one DMA
controller in the system) and this patch series is intended to fix that
eventually.
The ACPI and DT cases shall be aware of the channel direction when setting
request lines, but this is a minor problem that would be addressed in future.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dw/core.c | 32 ++------------------------------
drivers/dma/dw/platform.c | 6 ++++--
drivers/dma/dw/regs.h | 7 ++++---
3 files changed, 10 insertions(+), 35 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 0a9c052..1c45212 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -37,24 +37,6 @@
* support descriptor writeback.
*/
-static inline bool is_request_line_unset(struct dw_dma_chan *dwc)
-{
- return dwc->request_line == (typeof(dwc->request_line))~0;
-}
-
-static inline void dwc_set_masters(struct dw_dma_chan *dwc)
-{
- struct dw_dma *dw = to_dw_dma(dwc->chan.device);
- struct dw_dma_slave *dws = dwc->chan.private;
- unsigned char mmax = dw->nr_masters - 1;
-
- if (!is_request_line_unset(dwc))
- return;
-
- dwc->src_master = min_t(unsigned char, mmax, dwc_get_sms(dws));
- dwc->dst_master = min_t(unsigned char, mmax, dwc_get_dms(dws));
-}
-
#define DWC_DEFAULT_CTLLO(_chan) ({ \
struct dw_dma_chan *_dwc = to_dw_dma_chan(_chan); \
struct dma_slave_config *_sconfig = &_dwc->dma_sconfig; \
@@ -158,10 +140,8 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
cfghi |= DWC_CFGH_DST_PER(dws->dst_id);
cfghi |= DWC_CFGH_SRC_PER(dws->src_id);
} else {
- if (dwc->direction == DMA_MEM_TO_DEV)
- cfghi = DWC_CFGH_DST_PER(dwc->request_line);
- else if (dwc->direction == DMA_DEV_TO_MEM)
- cfghi = DWC_CFGH_SRC_PER(dwc->request_line);
+ cfghi |= DWC_CFGH_DST_PER(dwc->dst_id);
+ cfghi |= DWC_CFGH_SRC_PER(dwc->src_id);
}
channel_writel(dwc, CFG_LO, cfglo);
@@ -967,10 +947,6 @@ set_runtime_config(struct dma_chan *chan, struct dma_slave_config *sconfig)
memcpy(&dwc->dma_sconfig, sconfig, sizeof(*sconfig));
dwc->direction = sconfig->direction;
- /* Take the request line from slave_id member */
- if (is_request_line_unset(dwc))
- dwc->request_line = sconfig->slave_id;
-
convert_burst(&dwc->dma_sconfig.src_maxburst);
convert_burst(&dwc->dma_sconfig.dst_maxburst);
@@ -1123,8 +1099,6 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan)
* doesn't mean what you think it means), and status writeback.
*/
- dwc_set_masters(dwc);
-
spin_lock_irqsave(&dwc->lock, flags);
i = dwc->descs_allocated;
while (dwc->descs_allocated < NR_DESCS_PER_CHANNEL) {
@@ -1182,7 +1156,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
list_splice_init(&dwc->free_list, &list);
dwc->descs_allocated = 0;
dwc->initialized = false;
- dwc->request_line = ~0;
/* Disable interrupts */
channel_clear_bit(dw, MASK.XFER, dwc->mask);
@@ -1604,7 +1577,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
channel_clear_bit(dw, CH_EN, dwc->mask);
dwc->direction = DMA_TRANS_NONE;
- dwc->request_line = ~0;
/* Hardware configuration */
if (autocfg) {
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index c5b339a..7aa3cd3 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -41,7 +41,8 @@ static bool dw_dma_of_filter(struct dma_chan *chan, void *param)
if (chan->device != &fargs->dw->dma)
return false;
- dwc->request_line = fargs->req;
+ dwc->src_id = fargs->req;
+ dwc->dst_id = fargs->req;
dwc->src_master = fargs->src;
dwc->dst_master = fargs->dst;
@@ -86,7 +87,8 @@ static bool dw_dma_acpi_filter(struct dma_chan *chan, void *param)
chan->chan_id != dma_spec->chan_id)
return false;
- dwc->request_line = dma_spec->slave_id;
+ dwc->src_id = dma_spec->slave_id;
+ dwc->dst_id = dma_spec->slave_id;
dwc->src_master = dwc_get_sms(NULL);
dwc->dst_master = dwc_get_dms(NULL);
diff --git a/drivers/dma/dw/regs.h b/drivers/dma/dw/regs.h
index af02439..0e82d99 100644
--- a/drivers/dma/dw/regs.h
+++ b/drivers/dma/dw/regs.h
@@ -221,9 +221,10 @@ struct dw_dma_chan {
bool nollp;
/* custom slave configuration */
- unsigned int request_line;
- unsigned char src_master;
- unsigned char dst_master;
+ u8 src_id;
+ u8 dst_id;
+ u8 src_master;
+ u8 dst_master;
/* configuration passed via DMA_SLAVE_CONFIG */
struct dma_slave_config dma_sconfig;
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 05/12] dmaengine: dw: introduce generic filter function
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (3 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 04/12] dmaengine: dw: apply both HS interfaces and remove slave_id usage Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 06/12] dmaengine: dw: move clock operations to platform.c Andy Shevchenko
` (10 subsequent siblings)
15 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
The introduced filter function would be reused in the ACPI and DT cases since
in those cases we have to apply mandatory data to the requested channel. Thus,
patch moves platform driver to use it in that case.
The function unlikely can't be used by users of the driver due to an implicit
dependency to the dw_dmac_core module.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dw/core.c | 20 +++++++++++++++
drivers/dma/dw/internal.h | 24 +-----------------
drivers/dma/dw/platform.c | 63 ++++++++++++++---------------------------------
3 files changed, 40 insertions(+), 67 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 1c45212..10e43ea 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -919,6 +919,26 @@ err_desc_get:
return NULL;
}
+bool dw_dma_filter(struct dma_chan *chan, void *param)
+{
+ struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
+ struct dw_dma_slave *dws = param;
+
+ if (!dws || dws->dma_dev != chan->device->dev)
+ return false;
+
+ /* We have to copy data since dws can be temporary storage */
+
+ dwc->src_id = dws->src_id;
+ dwc->dst_id = dws->dst_id;
+
+ dwc->src_master = dws->src_master;
+ dwc->dst_master = dws->dst_master;
+
+ return true;
+}
+EXPORT_SYMBOL_GPL(dw_dma_filter);
+
/*
* Fix sconfig's burst size according to dw_dmac. We need to convert them as:
* 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3.
diff --git a/drivers/dma/dw/internal.h b/drivers/dma/dw/internal.h
index 43cc1df..2c8d02f 100644
--- a/drivers/dma/dw/internal.h
+++ b/drivers/dma/dw/internal.h
@@ -43,28 +43,6 @@ int dw_dma_resume(struct dw_dma_chip *chip);
#endif /* CONFIG_PM_SLEEP */
-/**
- * dwc_get_dms - get destination master
- * @slave: pointer to the custom slave configuration
- *
- * Returns destination master in the custom slave configuration if defined, or
- * default value otherwise.
- */
-static inline unsigned int dwc_get_dms(struct dw_dma_slave *slave)
-{
- return slave ? slave->dst_master : 0;
-}
-
-/**
- * dwc_get_sms - get source master
- * @slave: pointer to the custom slave configuration
- *
- * Returns source master in the custom slave configuration if defined, or
- * default value otherwise.
- */
-static inline unsigned int dwc_get_sms(struct dw_dma_slave *slave)
-{
- return slave ? slave->src_master : 1;
-}
+extern bool dw_dma_filter(struct dma_chan *chan, void *param);
#endif /* _DW_DMAC_INTERNAL_H */
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 7aa3cd3..860c9ac 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -25,74 +25,49 @@
#include "internal.h"
-struct dw_dma_of_filter_args {
- struct dw_dma *dw;
- unsigned int req;
- unsigned int src;
- unsigned int dst;
-};
-
-static bool dw_dma_of_filter(struct dma_chan *chan, void *param)
-{
- struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
- struct dw_dma_of_filter_args *fargs = param;
-
- /* Ensure the device matches our channel */
- if (chan->device != &fargs->dw->dma)
- return false;
-
- dwc->src_id = fargs->req;
- dwc->dst_id = fargs->req;
- dwc->src_master = fargs->src;
- dwc->dst_master = fargs->dst;
-
- return true;
-}
-
static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
struct dw_dma *dw = ofdma->of_dma_data;
- struct dw_dma_of_filter_args fargs = {
- .dw = dw,
+ struct dw_dma_slave slave = {
+ .dma_dev = dw->dma.dev,
};
dma_cap_mask_t cap;
if (dma_spec->args_count != 3)
return NULL;
- fargs.req = dma_spec->args[0];
- fargs.src = dma_spec->args[1];
- fargs.dst = dma_spec->args[2];
+ slave.src_id = dma_spec->args[0];
+ slave.dst_id = dma_spec->args[0];
+ slave.src_master = dma_spec->args[1];
+ slave.dst_master = dma_spec->args[2];
- if (WARN_ON(fargs.req >= DW_DMA_MAX_NR_REQUESTS ||
- fargs.src >= dw->nr_masters ||
- fargs.dst >= dw->nr_masters))
+ if (WARN_ON(slave.src_id >= DW_DMA_MAX_NR_REQUESTS ||
+ slave.dst_id >= DW_DMA_MAX_NR_REQUESTS ||
+ slave.src_master >= dw->nr_masters ||
+ slave.dst_master >= dw->nr_masters))
return NULL;
dma_cap_zero(cap);
dma_cap_set(DMA_SLAVE, cap);
/* TODO: there should be a simpler way to do this */
- return dma_request_channel(cap, dw_dma_of_filter, &fargs);
+ return dma_request_channel(cap, dw_dma_filter, &slave);
}
#ifdef CONFIG_ACPI
static bool dw_dma_acpi_filter(struct dma_chan *chan, void *param)
{
- struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
struct acpi_dma_spec *dma_spec = param;
+ struct dw_dma_slave slave = {
+ .dma_dev = dma_spec->dev,
+ .src_id = dma_spec->slave_id,
+ .dst_id = dma_spec->slave_id,
+ .src_master = 1,
+ .dst_master = 0,
+ };
- if (chan->device->dev != dma_spec->dev ||
- chan->chan_id != dma_spec->chan_id)
- return false;
-
- dwc->src_id = dma_spec->slave_id;
- dwc->dst_id = dma_spec->slave_id;
- dwc->src_master = dwc_get_sms(NULL);
- dwc->dst_master = dwc_get_dms(NULL);
-
- return true;
+ return dw_dma_filter(chan, &slave);
}
static void dw_dma_acpi_controller_register(struct dw_dma *dw)
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 06/12] dmaengine: dw: move clock operations to platform.c
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (4 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 05/12] dmaengine: dw: introduce generic filter function Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 07/12] dmaengine: dw: add PCI IDs for Braswell DMAs Andy Shevchenko
` (9 subsequent siblings)
15 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
On BayTrail platform DMA is not functional in the PCI mode, whereby it always
failed and exit at the point when it tries to get a clock. It causes the PCI
mode probe to exit with the error message:
dw_dmac_pci: probe of 0000:00:1e.0 failed with error -2
This patch moves clock operations to where it belongs to. Thus, the clock is
provided only in ACPI / non-PCI cases.
Reported-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dw/core.c | 16 ----------------
drivers/dma/dw/internal.h | 2 ++
drivers/dma/dw/platform.c | 25 ++++++++++++++++++++++---
drivers/dma/dw/regs.h | 1 -
4 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 10e43ea..9546b1f 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -11,7 +11,6 @@
*/
#include <linux/bitops.h>
-#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
@@ -1488,13 +1487,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
dw->regs = chip->regs;
chip->dw = dw;
- dw->clk = devm_clk_get(chip->dev, "hclk");
- if (IS_ERR(dw->clk))
- return PTR_ERR(dw->clk);
- err = clk_prepare_enable(dw->clk);
- if (err)
- return err;
-
dw_params = dma_read_byaddr(chip->regs, DW_PARAMS);
autocfg = dw_params >> DW_PARAMS_EN & 0x1;
@@ -1665,7 +1657,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
err_dma_register:
free_irq(chip->irq, dw);
err_pdata:
- clk_disable_unprepare(dw->clk);
return err;
}
EXPORT_SYMBOL_GPL(dw_dma_probe);
@@ -1687,8 +1678,6 @@ int dw_dma_remove(struct dw_dma_chip *chip)
channel_clear_bit(dw, CH_EN, dwc->mask);
}
- clk_disable_unprepare(dw->clk);
-
return 0;
}
EXPORT_SYMBOL_GPL(dw_dma_remove);
@@ -1698,7 +1687,6 @@ void dw_dma_shutdown(struct dw_dma_chip *chip)
struct dw_dma *dw = chip->dw;
dw_dma_off(dw);
- clk_disable_unprepare(dw->clk);
}
EXPORT_SYMBOL_GPL(dw_dma_shutdown);
@@ -1709,8 +1697,6 @@ int dw_dma_suspend(struct dw_dma_chip *chip)
struct dw_dma *dw = chip->dw;
dw_dma_off(dw);
- clk_disable_unprepare(dw->clk);
-
return 0;
}
EXPORT_SYMBOL_GPL(dw_dma_suspend);
@@ -1719,9 +1705,7 @@ int dw_dma_resume(struct dw_dma_chip *chip)
{
struct dw_dma *dw = chip->dw;
- clk_prepare_enable(dw->clk);
dma_writel(dw, CFG, DW_CFG_DMA_EN);
-
return 0;
}
EXPORT_SYMBOL_GPL(dw_dma_resume);
diff --git a/drivers/dma/dw/internal.h b/drivers/dma/dw/internal.h
index 2c8d02f..82258a1 100644
--- a/drivers/dma/dw/internal.h
+++ b/drivers/dma/dw/internal.h
@@ -21,12 +21,14 @@
* @dev: struct device of the DMA controller
* @irq: irq line
* @regs: memory mapped I/O space
+ * @clk: hclk clock
* @dw: struct dw_dma that is filed by dw_dma_probe()
*/
struct dw_dma_chip {
struct device *dev;
int irq;
void __iomem *regs;
+ struct clk *clk;
struct dw_dma *dw;
};
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 860c9ac..d50077e 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -178,10 +178,17 @@ static int dw_probe(struct platform_device *pdev)
chip->dev = dev;
- err = dw_dma_probe(chip, pdata);
+ chip->clk = devm_clk_get(chip->dev, "hclk");
+ if (IS_ERR(chip->clk))
+ return PTR_ERR(chip->clk);
+ err = clk_prepare_enable(chip->clk);
if (err)
return err;
+ err = dw_dma_probe(chip, pdata);
+ if (err)
+ goto err_dw_dma_probe;
+
platform_set_drvdata(pdev, chip);
if (pdev->dev.of_node) {
@@ -196,6 +203,10 @@ static int dw_probe(struct platform_device *pdev)
dw_dma_acpi_controller_register(chip->dw);
return 0;
+
+err_dw_dma_probe:
+ clk_disable_unprepare(chip->clk);
+ return err;
}
static int dw_remove(struct platform_device *pdev)
@@ -205,7 +216,10 @@ static int dw_remove(struct platform_device *pdev)
if (pdev->dev.of_node)
of_dma_controller_free(pdev->dev.of_node);
- return dw_dma_remove(chip);
+ dw_dma_remove(chip);
+ clk_disable_unprepare(chip->clk);
+
+ return 0;
}
static void dw_shutdown(struct platform_device *pdev)
@@ -213,6 +227,7 @@ static void dw_shutdown(struct platform_device *pdev)
struct dw_dma_chip *chip = platform_get_drvdata(pdev);
dw_dma_shutdown(chip);
+ clk_disable_unprepare(chip->clk);
}
#ifdef CONFIG_OF
@@ -238,7 +253,10 @@ static int dw_suspend_late(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct dw_dma_chip *chip = platform_get_drvdata(pdev);
- return dw_dma_suspend(chip);
+ dw_dma_suspend(chip);
+ clk_disable_unprepare(chip->clk);
+
+ return 0;
}
static int dw_resume_early(struct device *dev)
@@ -246,6 +264,7 @@ static int dw_resume_early(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct dw_dma_chip *chip = platform_get_drvdata(pdev);
+ clk_prepare_enable(chip->clk);
return dw_dma_resume(chip);
}
diff --git a/drivers/dma/dw/regs.h b/drivers/dma/dw/regs.h
index 0e82d99..00d27a9 100644
--- a/drivers/dma/dw/regs.h
+++ b/drivers/dma/dw/regs.h
@@ -251,7 +251,6 @@ struct dw_dma {
void __iomem *regs;
struct dma_pool *desc_pool;
struct tasklet_struct tasklet;
- struct clk *clk;
/* channels */
struct dw_dma_chan *chan;
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 07/12] dmaengine: dw: add PCI IDs for Braswell DMAs
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (5 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 06/12] dmaengine: dw: move clock operations to platform.c Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config Andy Shevchenko
` (8 subsequent siblings)
15 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
Braswell SoC has two DMA controllers for LPSS. This patch adds them to
supported list in the PCI driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dw/pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
index 39e30c3..9c88828 100644
--- a/drivers/dma/dw/pci.c
+++ b/drivers/dma/dw/pci.c
@@ -108,6 +108,10 @@ static const struct pci_device_id dw_pci_id_table[] = {
{ PCI_VDEVICE(INTEL, 0x0f06), (kernel_ulong_t)&dw_pci_pdata },
{ PCI_VDEVICE(INTEL, 0x0f40), (kernel_ulong_t)&dw_pci_pdata },
+ /* Braswell */
+ { PCI_VDEVICE(INTEL, 0x2286), (kernel_ulong_t)&dw_pci_pdata },
+ { PCI_VDEVICE(INTEL, 0x22c0), (kernel_ulong_t)&dw_pci_pdata },
+
/* Haswell */
{ PCI_VDEVICE(INTEL, 0x9c60), (kernel_ulong_t)&dw_pci_pdata },
{ }
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (6 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 07/12] dmaengine: dw: add PCI IDs for Braswell DMAs Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 21:13 ` Mark Brown
2014-09-11 6:20 ` Vinod Koul
2014-08-19 17:29 ` [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment Andy Shevchenko
` (7 subsequent siblings)
15 siblings, 2 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
From: Mika Westerberg <mika.westerberg@linux.intel.com>
That field has been deprecated in favour of getting the necessary
information from ACPI/DT.
However, we still need to deal systems that are PCI only (no ACPI to back
up). In order to support such systems, we allow the DMA filter function and
its corresponding parameter via pxa2xx_spi_master platform data. Then when
the pxa2xx_spi_dma_setup() doesn't find the channel via ACPI, it falls back
to use the given filter function.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/spi/spi-pxa2xx-dma.c | 15 ++--------
drivers/spi/spi-pxa2xx-pci.c | 64 +++++++++++++++++++++++++++++++-----------
drivers/spi/spi-pxa2xx.c | 2 --
include/linux/spi/pxa2xx_spi.h | 9 +++---
4 files changed, 54 insertions(+), 36 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c
index c41ff14..62a9297 100644
--- a/drivers/spi/spi-pxa2xx-dma.c
+++ b/drivers/spi/spi-pxa2xx-dma.c
@@ -157,7 +157,6 @@ static struct dma_async_tx_descriptor *
pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
enum dma_transfer_direction dir)
{
- struct pxa2xx_spi_master *pdata = drv_data->master_info;
struct chip_data *chip = drv_data->cur_chip;
enum dma_slave_buswidth width;
struct dma_slave_config cfg;
@@ -184,7 +183,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
cfg.dst_addr = drv_data->ssdr_physical;
cfg.dst_addr_width = width;
cfg.dst_maxburst = chip->dma_burst_size;
- cfg.slave_id = pdata->tx_slave_id;
sgt = &drv_data->tx_sgt;
nents = drv_data->tx_nents;
@@ -193,7 +191,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
cfg.src_addr = drv_data->ssdr_physical;
cfg.src_addr_width = width;
cfg.src_maxburst = chip->dma_burst_size;
- cfg.slave_id = pdata->rx_slave_id;
sgt = &drv_data->rx_sgt;
nents = drv_data->rx_nents;
@@ -210,14 +207,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
}
-static bool pxa2xx_spi_dma_filter(struct dma_chan *chan, void *param)
-{
- const struct pxa2xx_spi_master *pdata = param;
-
- return chan->chan_id == pdata->tx_chan_id ||
- chan->chan_id == pdata->rx_chan_id;
-}
-
bool pxa2xx_spi_dma_is_possible(size_t len)
{
return len <= MAX_DMA_LEN;
@@ -321,12 +310,12 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data)
return -ENOMEM;
drv_data->tx_chan = dma_request_slave_channel_compat(mask,
- pxa2xx_spi_dma_filter, pdata, dev, "tx");
+ pdata->dma_filter, pdata->tx_param, dev, "tx");
if (!drv_data->tx_chan)
return -ENODEV;
drv_data->rx_chan = dma_request_slave_channel_compat(mask,
- pxa2xx_spi_dma_filter, pdata, dev, "rx");
+ pdata->dma_filter, pdata->rx_param, dev, "rx");
if (!drv_data->rx_chan) {
dma_release_channel(drv_data->tx_chan);
drv_data->tx_chan = NULL;
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 20ebbc7..0424b67 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -10,6 +10,9 @@
#include <linux/clk.h>
#include <linux/clk-provider.h>
+#include <linux/dmaengine.h>
+#include <linux/platform_data/dma-dw.h>
+
enum {
PORT_CE4100,
PORT_BYT,
@@ -19,33 +22,41 @@ struct pxa_spi_info {
enum pxa_ssp_type type;
int port_id;
int num_chipselect;
- int tx_slave_id;
- int tx_chan_id;
- int rx_slave_id;
- int rx_chan_id;
unsigned long max_clk_rate;
+
+ /* DMA channel request parameters */
+ void *tx_param;
+ void *rx_param;
};
+static struct dw_dma_slave byt_tx_param = { .dst_id = 0 };
+static struct dw_dma_slave byt_rx_param = { .src_id = 1 };
+
+static bool lpss_dma_filter(struct dma_chan *chan, void *param)
+{
+ struct dw_dma_slave *dws = param;
+
+ if (dws->dma_dev != chan->device->dev)
+ return false;
+
+ chan->private = dws;
+ return true;
+}
+
static struct pxa_spi_info spi_info_configs[] = {
[PORT_CE4100] = {
.type = PXA25x_SSP,
.port_id = -1,
.num_chipselect = -1,
- .tx_slave_id = -1,
- .tx_chan_id = -1,
- .rx_slave_id = -1,
- .rx_chan_id = -1,
.max_clk_rate = 3686400,
},
[PORT_BYT] = {
.type = LPSS_SSP,
.port_id = 0,
.num_chipselect = 1,
- .tx_slave_id = 0,
- .tx_chan_id = 0,
- .rx_slave_id = 1,
- .rx_chan_id = 1,
.max_clk_rate = 50000000,
+ .tx_param = &byt_tx_param,
+ .rx_param = &byt_rx_param,
},
};
@@ -59,6 +70,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
struct ssp_device *ssp;
struct pxa_spi_info *c;
char buf[40];
+ struct pci_dev *dma_dev;
ret = pcim_enable_device(dev);
if (ret)
@@ -73,11 +85,29 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
memset(&spi_pdata, 0, sizeof(spi_pdata));
spi_pdata.num_chipselect = (c->num_chipselect > 0) ?
c->num_chipselect : dev->devfn;
- spi_pdata.tx_slave_id = c->tx_slave_id;
- spi_pdata.tx_chan_id = c->tx_chan_id;
- spi_pdata.rx_slave_id = c->rx_slave_id;
- spi_pdata.rx_chan_id = c->rx_chan_id;
- spi_pdata.enable_dma = c->rx_slave_id >= 0 && c->tx_slave_id >= 0;
+
+ dma_dev = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+
+ if (c->tx_param) {
+ struct dw_dma_slave *slave = c->tx_param;
+
+ slave->dma_dev = &dma_dev->dev;
+ slave->src_master = 1;
+ slave->dst_master = 0;
+ }
+
+ if (c->rx_param) {
+ struct dw_dma_slave *slave = c->rx_param;
+
+ slave->dma_dev = &dma_dev->dev;
+ slave->src_master = 1;
+ slave->dst_master = 0;
+ }
+
+ spi_pdata.dma_filter = lpss_dma_filter;
+ spi_pdata.tx_param = c->tx_param;
+ spi_pdata.rx_param = c->rx_param;
+ spi_pdata.enable_dma = c->rx_param && c->tx_param;
ssp = &spi_pdata.ssp;
ssp->phys_base = pci_resource_start(dev, 0);
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index fe79210..256c0ab 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1062,8 +1062,6 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
pdata->num_chipselect = 1;
pdata->enable_dma = true;
- pdata->tx_chan_id = -1;
- pdata->rx_chan_id = -1;
return pdata;
}
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index 82d5111..d5a3165 100644
--- a/include/linux/spi/pxa2xx_spi.h
+++ b/include/linux/spi/pxa2xx_spi.h
@@ -23,6 +23,8 @@
#define PXA2XX_CS_ASSERT (0x01)
#define PXA2XX_CS_DEASSERT (0x02)
+struct dma_chan;
+
/* device.platform_data for SSP controller devices */
struct pxa2xx_spi_master {
u32 clock_enable;
@@ -30,10 +32,9 @@ struct pxa2xx_spi_master {
u8 enable_dma;
/* DMA engine specific config */
- int rx_chan_id;
- int tx_chan_id;
- int rx_slave_id;
- int tx_slave_id;
+ bool (*dma_filter)(struct dma_chan *chan, void *param);
+ void *tx_param;
+ void *rx_param;
/* For non-PXA arches */
struct ssp_device ssp;
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (7 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 21:12 ` Mark Brown
2014-08-19 17:29 ` [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell Andy Shevchenko
` (6 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
There is no need to unset driver data pointer at removal stage.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/spi/spi-pxa2xx-pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 0424b67..c950ee2 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -153,7 +153,6 @@ static void pxa2xx_spi_pci_remove(struct pci_dev *dev)
platform_device_unregister(pdev);
clk_unregister(spi_pdata->ssp.clk);
- pci_set_drvdata(dev, NULL);
}
static const struct pci_device_id pxa2xx_spi_pci_devices[] = {
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (8 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-19 21:14 ` Mark Brown
2014-08-19 17:29 ` [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config Andy Shevchenko
` (5 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Instead of one port we have 3 ports and all of them can take advantage of
the shared DMA controller.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/spi/spi-pxa2xx-pci.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index c950ee2..6beee8c 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -16,6 +16,9 @@
enum {
PORT_CE4100,
PORT_BYT,
+ PORT_BSW0,
+ PORT_BSW1,
+ PORT_BSW2,
};
struct pxa_spi_info {
@@ -32,6 +35,13 @@ struct pxa_spi_info {
static struct dw_dma_slave byt_tx_param = { .dst_id = 0 };
static struct dw_dma_slave byt_rx_param = { .src_id = 1 };
+static struct dw_dma_slave bsw0_tx_param = { .dst_id = 0 };
+static struct dw_dma_slave bsw0_rx_param = { .src_id = 1 };
+static struct dw_dma_slave bsw1_tx_param = { .dst_id = 6 };
+static struct dw_dma_slave bsw1_rx_param = { .src_id = 7 };
+static struct dw_dma_slave bsw2_tx_param = { .dst_id = 8 };
+static struct dw_dma_slave bsw2_rx_param = { .src_id = 9 };
+
static bool lpss_dma_filter(struct dma_chan *chan, void *param)
{
struct dw_dma_slave *dws = param;
@@ -58,6 +68,30 @@ static struct pxa_spi_info spi_info_configs[] = {
.tx_param = &byt_tx_param,
.rx_param = &byt_rx_param,
},
+ [PORT_BSW0] = {
+ .type = LPSS_SSP,
+ .port_id = 0,
+ .num_chipselect = 1,
+ .max_clk_rate = 50000000,
+ .tx_param = &bsw0_tx_param,
+ .rx_param = &bsw0_rx_param,
+ },
+ [PORT_BSW1] = {
+ .type = LPSS_SSP,
+ .port_id = 1,
+ .num_chipselect = 1,
+ .max_clk_rate = 50000000,
+ .tx_param = &bsw1_tx_param,
+ .rx_param = &bsw1_rx_param,
+ },
+ [PORT_BSW2] = {
+ .type = LPSS_SSP,
+ .port_id = 2,
+ .num_chipselect = 1,
+ .max_clk_rate = 50000000,
+ .tx_param = &bsw2_tx_param,
+ .rx_param = &bsw2_rx_param,
+ },
};
static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
@@ -158,6 +192,9 @@ static void pxa2xx_spi_pci_remove(struct pci_dev *dev)
static const struct pci_device_id pxa2xx_spi_pci_devices[] = {
{ PCI_VDEVICE(INTEL, 0x2e6a), PORT_CE4100 },
{ PCI_VDEVICE(INTEL, 0x0f0e), PORT_BYT },
+ { PCI_VDEVICE(INTEL, 0x228e), PORT_BSW0 },
+ { PCI_VDEVICE(INTEL, 0x2290), PORT_BSW1 },
+ { PCI_VDEVICE(INTEL, 0x22ac), PORT_BSW2 },
{ },
};
MODULE_DEVICE_TABLE(pci, pxa2xx_spi_pci_devices);
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (9 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-26 22:38 ` Greg Kroah-Hartman
2014-08-19 17:29 ` [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell Andy Shevchenko
` (4 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
That field has been deprecated in favour of getting the necessary information
from ACPI or DT.
However, we still need to deal systems that are PCI only (no ACPI to back up)
like Intel Bay Trail. In order to support such systems, we explicitly bind
setup() to the appropriate DMA filter function and its corresponding parameter.
Then when serial8250_request_dma() doesn't find the channel via ACPI or DT, it
falls back to use the given filter function.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250.h | 6 ++---
drivers/tty/serial/8250/8250_dw.c | 7 +-----
drivers/tty/serial/8250/8250_pci.c | 51 ++++++++++++++++++++++++++++++--------
3 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index 1b08c91..c3c7091 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -16,13 +16,13 @@
#include <linux/dmaengine.h>
struct uart_8250_dma {
+ /* Filter function */
dma_filter_fn fn;
+
+ /* Parameter to the filter function */
void *rx_param;
void *tx_param;
- int rx_chan_id;
- int tx_chan_id;
-
struct dma_slave_config rxconf;
struct dma_slave_config txconf;
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 4db7987..6664de2 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -216,10 +216,7 @@ out:
static bool dw8250_dma_filter(struct dma_chan *chan, void *param)
{
- struct dw8250_data *data = param;
-
- return chan->chan_id == data->dma.tx_chan_id ||
- chan->chan_id == data->dma.rx_chan_id;
+ return false;
}
static void dw8250_setup_port(struct uart_8250_port *up)
@@ -399,8 +396,6 @@ static int dw8250_probe(struct platform_device *pdev)
if (!IS_ERR(data->rst))
reset_control_deassert(data->rst);
- data->dma.rx_chan_id = -1;
- data->dma.tx_chan_id = -1;
data->dma.rx_param = data;
data->dma.tx_param = data;
data->dma.fn = dw8250_dma_filter;
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 61830b1..a00c9de 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -25,6 +25,9 @@
#include <asm/byteorder.h>
#include <asm/io.h>
+#include <linux/dmaengine.h>
+#include <linux/platform_data/dma-dw.h>
+
#include "8250.h"
/*
@@ -1427,7 +1430,13 @@ byt_set_termios(struct uart_port *p, struct ktermios *termios,
static bool byt_dma_filter(struct dma_chan *chan, void *param)
{
- return chan->chan_id == *(int *)param;
+ struct dw_dma_slave *dws = param;
+
+ if (dws->dma_dev != chan->device->dev)
+ return false;
+
+ chan->private = dws;
+ return true;
}
static int
@@ -1435,35 +1444,55 @@ byt_serial_setup(struct serial_private *priv,
const struct pciserial_board *board,
struct uart_8250_port *port, int idx)
{
+ struct pci_dev *pdev = priv->dev;
+ struct device *dev = port->port.dev;
struct uart_8250_dma *dma;
+ struct dw_dma_slave *tx_param, *rx_param;
+ struct pci_dev *dma_dev;
int ret;
- dma = devm_kzalloc(port->port.dev, sizeof(*dma), GFP_KERNEL);
+ dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
if (!dma)
return -ENOMEM;
- switch (priv->dev->device) {
+ tx_param = devm_kzalloc(dev, sizeof(*tx_param), GFP_KERNEL);
+ if (!tx_param)
+ return -ENOMEM;
+
+ rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL);
+ if (!rx_param)
+ return -ENOMEM;
+
+ switch (pdev->device) {
case PCI_DEVICE_ID_INTEL_BYT_UART1:
- dma->rx_chan_id = 3;
- dma->tx_chan_id = 2;
+ rx_param->src_id = 3;
+ tx_param->dst_id = 2;
break;
case PCI_DEVICE_ID_INTEL_BYT_UART2:
- dma->rx_chan_id = 5;
- dma->tx_chan_id = 4;
+ rx_param->src_id = 5;
+ tx_param->dst_id = 4;
break;
default:
return -EINVAL;
}
- dma->rxconf.slave_id = dma->rx_chan_id;
+ rx_param->src_master = 1;
+ rx_param->dst_master = 0;
+
dma->rxconf.src_maxburst = 16;
- dma->txconf.slave_id = dma->tx_chan_id;
+ tx_param->src_master = 1;
+ tx_param->dst_master = 0;
+
dma->txconf.dst_maxburst = 16;
+ dma_dev = pci_get_slot(pdev->bus, PCI_DEVFN(PCI_SLOT(pdev->devfn), 0));
+ rx_param->dma_dev = &dma_dev->dev;
+ tx_param->dma_dev = &dma_dev->dev;
+
dma->fn = byt_dma_filter;
- dma->rx_param = &dma->rx_chan_id;
- dma->tx_param = &dma->tx_chan_id;
+ dma->rx_param = rx_param;
+ dma->tx_param = tx_param;
ret = pci_default_setup(priv, board, port, idx);
port->port.iotype = UPIO_MEM;
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (10 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config Andy Shevchenko
@ 2014-08-19 17:29 ` Andy Shevchenko
2014-08-26 22:38 ` Greg Kroah-Hartman
2014-08-20 6:17 ` [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Hans-Christian Egtvedt
` (3 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-19 17:29 UTC (permalink / raw)
To: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel
Cc: Andy Shevchenko
From: Alan Cox <alan@linux.intel.com>
Add new PCI IDs to cover newer Intel SoCs such as Braswell.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250_pci.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index a00c9de..85a2eb9 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1352,6 +1352,9 @@ ce4100_serial_setup(struct serial_private *priv,
#define PCI_DEVICE_ID_INTEL_BYT_UART1 0x0f0a
#define PCI_DEVICE_ID_INTEL_BYT_UART2 0x0f0c
+#define PCI_DEVICE_ID_INTEL_BSW_UART1 0x228a
+#define PCI_DEVICE_ID_INTEL_BSW_UART2 0x228c
+
#define BYT_PRV_CLK 0x800
#define BYT_PRV_CLK_EN (1 << 0)
#define BYT_PRV_CLK_M_VAL_SHIFT 1
@@ -1465,10 +1468,12 @@ byt_serial_setup(struct serial_private *priv,
switch (pdev->device) {
case PCI_DEVICE_ID_INTEL_BYT_UART1:
+ case PCI_DEVICE_ID_INTEL_BSW_UART1:
rx_param->src_id = 3;
tx_param->dst_id = 2;
break;
case PCI_DEVICE_ID_INTEL_BYT_UART2:
+ case PCI_DEVICE_ID_INTEL_BSW_UART2:
rx_param->src_id = 5;
tx_param->dst_id = 4;
break;
@@ -1927,6 +1932,20 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.subdevice = PCI_ANY_ID,
.setup = byt_serial_setup,
},
+ {
+ .vendor = PCI_VENDOR_ID_INTEL,
+ .device = PCI_DEVICE_ID_INTEL_BSW_UART1,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = byt_serial_setup,
+ },
+ {
+ .vendor = PCI_VENDOR_ID_INTEL,
+ .device = PCI_DEVICE_ID_INTEL_BSW_UART2,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = byt_serial_setup,
+ },
/*
* ITE
*/
@@ -5219,6 +5238,14 @@ static struct pci_device_id serial_pci_tbl[] = {
PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
pbn_byt },
+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW_UART1,
+ PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+ pbn_byt },
+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW_UART2,
+ PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+ pbn_byt },
/*
* Cronyx Omega PCI
--
2.1.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment
2014-08-19 17:29 ` [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment Andy Shevchenko
@ 2014-08-19 21:12 ` Mark Brown
0 siblings, 0 replies; 33+ messages in thread
From: Mark Brown @ 2014-08-19 21:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Hein Tibosch, Russell King, Greg Kroah-Hartman, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 149 bytes --]
On Tue, Aug 19, 2014 at 08:29:20PM +0300, Andy Shevchenko wrote:
> There is no need to unset driver data pointer at removal stage.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config
2014-08-19 17:29 ` [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config Andy Shevchenko
@ 2014-08-19 21:13 ` Mark Brown
2014-09-11 6:20 ` Vinod Koul
1 sibling, 0 replies; 33+ messages in thread
From: Mark Brown @ 2014-08-19 21:13 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Hein Tibosch, Russell King, Greg Kroah-Hartman, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
On Tue, Aug 19, 2014 at 08:29:19PM +0300, Andy Shevchenko wrote:
> From: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> That field has been deprecated in favour of getting the necessary
> information from ACPI/DT.
Acked-by: Mark Brown <broonie@linaro.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell
2014-08-19 17:29 ` [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell Andy Shevchenko
@ 2014-08-19 21:14 ` Mark Brown
0 siblings, 0 replies; 33+ messages in thread
From: Mark Brown @ 2014-08-19 21:14 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Hein Tibosch, Russell King, Greg Kroah-Hartman, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
On Tue, Aug 19, 2014 at 08:29:21PM +0300, Andy Shevchenko wrote:
> From: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> Instead of one port we have 3 ports and all of them can take advantage of
> the shared DMA controller.
Acked-by: Mark Brown <broonie@linaro.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
@ 2014-08-20 6:01 ` Hans-Christian Egtvedt
2014-08-20 8:55 ` Viresh Kumar
1 sibling, 0 replies; 33+ messages in thread
From: Hans-Christian Egtvedt @ 2014-08-20 6:01 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Haavard Skinnemoen, Vinod Koul, Mark Brown, Hein Tibosch,
Russell King, Greg Kroah-Hartman, Takashi Iwai, Kweh Hock Leong,
Mika Westerberg, Alan Cox, dmaengine, linux-kernel
Around Tue 19 Aug 2014 20:29:12 +0300 or thereabout, Andy Shevchenko wrote:
> There is a common storage for platform data related structures and definitions
> inside kernel source tree. The patch moves file from include/linux to
> include/linux/platform_data and renames it acoordingly. The users are also
> updated.
Nice cleanup, thanks.
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
For the arch/avr32/.* and .*sound/atmel.* related changes
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> ---
> MAINTAINERS | 2 +-
> arch/avr32/mach-at32ap/at32ap700x.c | 2 +-
> arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
> drivers/dma/dw/internal.h | 2 +-
> drivers/dma/dw/regs.h | 6 +-
> include/linux/dw_dmac.h | 111 ------------------------
> include/linux/platform_data/dma-dw.h | 111 ++++++++++++++++++++++++
> include/sound/atmel-abdac.h | 2 +-
> include/sound/atmel-ac97c.h | 2 +-
> sound/atmel/abdac.c | 2 +-
> sound/atmel/ac97c.c | 2 +-
> 11 files changed, 122 insertions(+), 122 deletions(-)
> delete mode 100644 include/linux/dw_dmac.h
> create mode 100644 include/linux/platform_data/dma-dw.h
<snipp diff>
--
BR, HcE
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters
2014-08-19 17:29 ` [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters Andy Shevchenko
@ 2014-08-20 6:03 ` Hans-Christian Egtvedt
0 siblings, 0 replies; 33+ messages in thread
From: Hans-Christian Egtvedt @ 2014-08-20 6:03 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Haavard Skinnemoen, Vinod Koul, Mark Brown, Hein Tibosch,
Russell King, Greg Kroah-Hartman, Takashi Iwai, Kweh Hock Leong,
Mika Westerberg, Alan Cox, dmaengine, linux-kernel
Around Tue 19 Aug 2014 20:29:13 +0300 or thereabout, Andy Shevchenko wrote:
> In future we are going to remove the defaults of AHB masters from dw_dmac
> driver. It means each user have to supply proper source and destination masters
> by itself explicitly.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> ---
> arch/avr32/mach-at32ap/at32ap700x.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> index 2a1aa71..ec7be28 100644
> --- a/arch/avr32/mach-at32ap/at32ap700x.c
> +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> @@ -1360,6 +1360,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
> | DWC_CFGH_DST_PER(1));
> slave->sdata.cfg_lo &= ~(DWC_CFGL_HS_DST_POL
> | DWC_CFGL_HS_SRC_POL);
> + slave->sdata.src_master = 1;
> + slave->sdata.dst_master = 0;
>
> data->dma_slave = slave;
--
Hans-Christian Egtvedt
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
2014-08-19 17:29 ` [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces Andy Shevchenko
@ 2014-08-20 6:15 ` Hans-Christian Egtvedt
0 siblings, 0 replies; 33+ messages in thread
From: Hans-Christian Egtvedt @ 2014-08-20 6:15 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Haavard Skinnemoen, Vinod Koul, Mark Brown, Hein Tibosch,
Russell King, Greg Kroah-Hartman, Takashi Iwai, Kweh Hock Leong,
Mika Westerberg, Alan Cox, dmaengine, linux-kernel
Around Tue 19 Aug 2014 20:29:14 +0300 or thereabout, Andy Shevchenko wrote:
> Instead of exposing the possibility to set DMA registers CFG_HI and CFG_LO
> strict user to provide handshake interfaces explicitly.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> ---
> arch/avr32/mach-at32ap/at32ap700x.c | 15 +++++----------
> drivers/dma/dw/core.c | 4 ++--
> include/linux/platform_data/dma-dw.h | 10 ++++------
> 3 files changed, 11 insertions(+), 18 deletions(-)
<snipp diff>
--
mvh
Hans-Christian Egtvedt
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (11 preceding siblings ...)
2014-08-19 17:29 ` [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell Andy Shevchenko
@ 2014-08-20 6:17 ` Hans-Christian Egtvedt
2014-08-27 6:33 ` Andy Shevchenko
2014-08-26 15:27 ` Andy Shevchenko
` (2 subsequent siblings)
15 siblings, 1 reply; 33+ messages in thread
From: Hans-Christian Egtvedt @ 2014-08-20 6:17 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Haavard Skinnemoen, Vinod Koul, Mark Brown, Hein Tibosch,
Russell King, Greg Kroah-Hartman, Takashi Iwai, Kweh Hock Leong,
Mika Westerberg, Alan Cox, dmaengine, linux-kernel
Around Tue 19 Aug 2014 20:29:11 +0300 or thereabout, Andy Shevchenko wrote:
> The patchset is targeting two things:
> - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> - support BayTrail and Braswell SoCs in PCI case
>
> They are tight with each other, thus comes in one series.
>
> The patch set was BAT tested on Braswell and BayTrail machines.
>
> We would like to push this through slave-dma tree, so, Mark, Greg,
> Hans-Christian, and Haavard, please, Ack them if you have no objections.
I had a look through the patches touching Atmel and AVR32 related files,
mostly things I originally wrote or maintain. They seem all good, feel free
to push the changes through the slave-dma tree.
> Vinod, we would like them to be pushed during this cycle since we have more
> coming. And it would be nice to have Braswell support in v3.18-rc1.
>
> Alan Cox (1):
> serial: 8250_pci: Add PCI IDs for Intel Braswell
>
> Andy Shevchenko (9):
> dmaengine: dw: move dw_dmac.h to where it belongs to
> avr32: at32ap700x: don't rely on default DMA masters
> dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
> dmaengine: dw: apply both HS interfaces and remove slave_id usage
> dmaengine: dw: introduce generic filter function
> dmaengine: dw: move clock operations to platform.c
> dmaengine: dw: add PCI IDs for Braswell DMAs
> spi/pxa2xx-pci: remove unnecessary assignment
> serial: 8250: don't use slave_id of dma_slave_config
>
> Mika Westerberg (2):
> spi/pxa2xx: Don't use slave_id of dma_slave_config
> spi/pxa2xx-pci: Add support for Intel Braswell
>
> MAINTAINERS | 2 +-
> arch/avr32/mach-at32ap/at32ap700x.c | 19 ++--
> arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
> drivers/dma/dw/core.c | 72 +++++----------
> drivers/dma/dw/internal.h | 28 +-----
> drivers/dma/dw/pci.c | 4 +
> drivers/dma/dw/platform.c | 86 +++++++++---------
> drivers/dma/dw/regs.h | 14 +--
> drivers/spi/spi-pxa2xx-dma.c | 15 +---
> drivers/spi/spi-pxa2xx-pci.c | 102 ++++++++++++++++++----
> drivers/spi/spi-pxa2xx.c | 2 -
> drivers/tty/serial/8250/8250.h | 6 +-
> drivers/tty/serial/8250/8250_dw.c | 7 +-
> drivers/tty/serial/8250/8250_pci.c | 78 ++++++++++++++---
> include/linux/dw_dmac.h | 111 ------------------------
> include/linux/platform_data/dma-dw.h | 109 +++++++++++++++++++++++
> include/linux/spi/pxa2xx_spi.h | 9 +-
> include/sound/atmel-abdac.h | 2 +-
> include/sound/atmel-ac97c.h | 2 +-
> sound/atmel/abdac.c | 2 +-
> sound/atmel/ac97c.c | 2 +-
> 21 files changed, 365 insertions(+), 309 deletions(-)
> delete mode 100644 include/linux/dw_dmac.h
> create mode 100644 include/linux/platform_data/dma-dw.h
--
mvh
Hans-Christian Egtvedt
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
2014-08-20 6:01 ` Hans-Christian Egtvedt
@ 2014-08-20 8:55 ` Viresh Kumar
2014-08-20 8:56 ` Viresh Kumar
2014-08-20 9:28 ` Andy Shevchenko
1 sibling, 2 replies; 33+ messages in thread
From: Viresh Kumar @ 2014-08-20 8:55 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel@vger.kernel.org
On Tue, Aug 19, 2014 at 10:59 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There is a common storage for platform data related structures and definitions
> inside kernel source tree. The patch moves file from include/linux to
> include/linux/platform_data and renames it acoordingly. The users are also
> updated.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> include/linux/dw_dmac.h | 111 ------------------------
> include/linux/platform_data/dma-dw.h | 111 ++++++++++++++++++++++++
Nice work but wrong git commands to produce this patch..
Always run format-patch with these options Atleast:
git format-patch -C -M --thread=shallow
With the -C -M option you would have got something like:
include/linux/{dw_dmac.h => platform_data/dma-dw.h} | 0
Which would have made review so so easy :)
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to
2014-08-20 8:55 ` Viresh Kumar
@ 2014-08-20 8:56 ` Viresh Kumar
2014-08-20 9:28 ` Andy Shevchenko
1 sibling, 0 replies; 33+ messages in thread
From: Viresh Kumar @ 2014-08-20 8:56 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel@vger.kernel.org
On Wed, Aug 20, 2014 at 2:25 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On Tue, Aug 19, 2014 at 10:59 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> There is a common storage for platform data related structures and definitions
>> inside kernel source tree. The patch moves file from include/linux to
>> include/linux/platform_data and renames it acoordingly. The users are also
>> updated.
>>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>
>> include/linux/dw_dmac.h | 111 ------------------------
>> include/linux/platform_data/dma-dw.h | 111 ++++++++++++++++++++++++
>
> Nice work but wrong git commands to produce this patch..
> Always run format-patch with these options Atleast:
>
> git format-patch -C -M --thread=shallow
>
> With the -C -M option you would have got something like:
>
> include/linux/{dw_dmac.h => platform_data/dma-dw.h} | 0
>
> Which would have made review so so easy :)
Otherwise: Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to
2014-08-20 8:55 ` Viresh Kumar
2014-08-20 8:56 ` Viresh Kumar
@ 2014-08-20 9:28 ` Andy Shevchenko
1 sibling, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-20 9:28 UTC (permalink / raw)
To: Viresh Kumar
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Greg Kroah-Hartman,
Takashi Iwai, Kweh Hock Leong, Mika Westerberg, Alan Cox,
dmaengine, linux-kernel@vger.kernel.org
On Wed, 2014-08-20 at 14:25 +0530, Viresh Kumar wrote:
> On Tue, Aug 19, 2014 at 10:59 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > There is a common storage for platform data related structures and definitions
> > inside kernel source tree. The patch moves file from include/linux to
> > include/linux/platform_data and renames it acoordingly. The users are also
> > updated.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
>
> > include/linux/dw_dmac.h | 111 ------------------------
> > include/linux/platform_data/dma-dw.h | 111 ++++++++++++++++++++++++
>
> Nice work but wrong git commands to produce this patch..
> Always run format-patch with these options Atleast:
>
> git format-patch -C -M --thread=shallow
>
> With the -C -M option you would have got something like:
>
> include/linux/{dw_dmac.h => platform_data/dma-dw.h} | 0
>
> Which would have made review so so easy :)
Thanks for reminding me this, though I thought I would do that way and
*forgot* while rebasing series.
And thanks for Ack!
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (12 preceding siblings ...)
2014-08-20 6:17 ` [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Hans-Christian Egtvedt
@ 2014-08-26 15:27 ` Andy Shevchenko
2014-08-26 22:39 ` Greg Kroah-Hartman
2014-08-29 10:00 ` Andy Shevchenko
2014-09-11 6:42 ` Vinod Koul
15 siblings, 1 reply; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-26 15:27 UTC (permalink / raw)
To: dmaengine
Cc: Vinod Koul, Greg Kroah-Hartman, Kweh Hock Leong, Mika Westerberg,
Alan Cox, linux-kernel
On Tue, 2014-08-19 at 20:29 +0300, Andy Shevchenko wrote:
> The patchset is targeting two things:
> - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> - support BayTrail and Braswell SoCs in PCI case
>
> They are tight with each other, thus comes in one series.
>
> The patch set was BAT tested on Braswell and BayTrail machines.
>
> We would like to push this through slave-dma tree, so, Mark, Greg,
> Hans-Christian, and Haavard, please, Ack them if you have no objections.
Greg, gently ping you to get your Ack (or comments) on patches 11/12 and
12/12.
>
> Vinod, we would like them to be pushed during this cycle since we have more
> coming. And it would be nice to have Braswell support in v3.18-rc1.
>
> Alan Cox (1):
> serial: 8250_pci: Add PCI IDs for Intel Braswell
>
> Andy Shevchenko (9):
> dmaengine: dw: move dw_dmac.h to where it belongs to
> avr32: at32ap700x: don't rely on default DMA masters
> dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
> dmaengine: dw: apply both HS interfaces and remove slave_id usage
> dmaengine: dw: introduce generic filter function
> dmaengine: dw: move clock operations to platform.c
> dmaengine: dw: add PCI IDs for Braswell DMAs
> spi/pxa2xx-pci: remove unnecessary assignment
> serial: 8250: don't use slave_id of dma_slave_config
>
> Mika Westerberg (2):
> spi/pxa2xx: Don't use slave_id of dma_slave_config
> spi/pxa2xx-pci: Add support for Intel Braswell
>
> MAINTAINERS | 2 +-
> arch/avr32/mach-at32ap/at32ap700x.c | 19 ++--
> arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
> drivers/dma/dw/core.c | 72 +++++----------
> drivers/dma/dw/internal.h | 28 +-----
> drivers/dma/dw/pci.c | 4 +
> drivers/dma/dw/platform.c | 86 +++++++++---------
> drivers/dma/dw/regs.h | 14 +--
> drivers/spi/spi-pxa2xx-dma.c | 15 +---
> drivers/spi/spi-pxa2xx-pci.c | 102 ++++++++++++++++++----
> drivers/spi/spi-pxa2xx.c | 2 -
> drivers/tty/serial/8250/8250.h | 6 +-
> drivers/tty/serial/8250/8250_dw.c | 7 +-
> drivers/tty/serial/8250/8250_pci.c | 78 ++++++++++++++---
> include/linux/dw_dmac.h | 111 ------------------------
> include/linux/platform_data/dma-dw.h | 109 +++++++++++++++++++++++
> include/linux/spi/pxa2xx_spi.h | 9 +-
> include/sound/atmel-abdac.h | 2 +-
> include/sound/atmel-ac97c.h | 2 +-
> sound/atmel/abdac.c | 2 +-
> sound/atmel/ac97c.c | 2 +-
> 21 files changed, 365 insertions(+), 309 deletions(-)
> delete mode 100644 include/linux/dw_dmac.h
> create mode 100644 include/linux/platform_data/dma-dw.h
>
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell
2014-08-19 17:29 ` [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell Andy Shevchenko
@ 2014-08-26 22:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 33+ messages in thread
From: Greg Kroah-Hartman @ 2014-08-26 22:38 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
On Tue, Aug 19, 2014 at 08:29:23PM +0300, Andy Shevchenko wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> Add new PCI IDs to cover newer Intel SoCs such as Braswell.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/tty/serial/8250/8250_pci.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config
2014-08-19 17:29 ` [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config Andy Shevchenko
@ 2014-08-26 22:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 33+ messages in thread
From: Greg Kroah-Hartman @ 2014-08-26 22:38 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Vinod Koul,
Mark Brown, Hein Tibosch, Russell King, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
On Tue, Aug 19, 2014 at 08:29:22PM +0300, Andy Shevchenko wrote:
> That field has been deprecated in favour of getting the necessary information
> from ACPI or DT.
>
> However, we still need to deal systems that are PCI only (no ACPI to back up)
> like Intel Bay Trail. In order to support such systems, we explicitly bind
> setup() to the appropriate DMA filter function and its corresponding parameter.
> Then when serial8250_request_dma() doesn't find the channel via ACPI or DT, it
> falls back to use the given filter function.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-26 15:27 ` Andy Shevchenko
@ 2014-08-26 22:39 ` Greg Kroah-Hartman
2014-08-27 6:32 ` Andy Shevchenko
0 siblings, 1 reply; 33+ messages in thread
From: Greg Kroah-Hartman @ 2014-08-26 22:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: dmaengine, Vinod Koul, Kweh Hock Leong, Mika Westerberg, Alan Cox,
linux-kernel
On Tue, Aug 26, 2014 at 06:27:25PM +0300, Andy Shevchenko wrote:
> On Tue, 2014-08-19 at 20:29 +0300, Andy Shevchenko wrote:
> > The patchset is targeting two things:
> > - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> > - support BayTrail and Braswell SoCs in PCI case
> >
> > They are tight with each other, thus comes in one series.
> >
> > The patch set was BAT tested on Braswell and BayTrail machines.
> >
> > We would like to push this through slave-dma tree, so, Mark, Greg,
> > Hans-Christian, and Haavard, please, Ack them if you have no objections.
>
> Greg, gently ping you to get your Ack (or comments) on patches 11/12 and
> 12/12.
Oops, sorry about that, you should now have my acks for both of these.
greg k-h
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-26 22:39 ` Greg Kroah-Hartman
@ 2014-08-27 6:32 ` Andy Shevchenko
0 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-27 6:32 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Andy Shevchenko, dmaengine, Vinod Koul, Kweh Hock Leong,
Mika Westerberg, Alan Cox, linux-kernel@vger.kernel.org
On Wed, Aug 27, 2014 at 1:39 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Tue, Aug 26, 2014 at 06:27:25PM +0300, Andy Shevchenko wrote:
>> On Tue, 2014-08-19 at 20:29 +0300, Andy Shevchenko wrote:
>> Greg, gently ping you to get your Ack (or comments) on patches 11/12 and
>> 12/12.
>
> Oops, sorry about that, you should now have my acks for both of these.
No problem and thank you!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-20 6:17 ` [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Hans-Christian Egtvedt
@ 2014-08-27 6:33 ` Andy Shevchenko
0 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-27 6:33 UTC (permalink / raw)
To: Hans-Christian Egtvedt
Cc: Andy Shevchenko, dmaengine, linux-kernel@vger.kernel.org
On Wed, Aug 20, 2014 at 9:17 AM, Hans-Christian Egtvedt
<egtvedt@samfundet.no> wrote:
> Around Tue 19 Aug 2014 20:29:11 +0300 or thereabout, Andy Shevchenko wrote:
>> The patchset is targeting two things:
>> - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
>> - support BayTrail and Braswell SoCs in PCI case
>>
>> They are tight with each other, thus comes in one series.
>>
>> The patch set was BAT tested on Braswell and BayTrail machines.
>>
>> We would like to push this through slave-dma tree, so, Mark, Greg,
>> Hans-Christian, and Haavard, please, Ack them if you have no objections.
>
> I had a look through the patches touching Atmel and AVR32 related files,
> mostly things I originally wrote or maintain. They seem all good, feel free
> to push the changes through the slave-dma tree.
Thank you!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (13 preceding siblings ...)
2014-08-26 15:27 ` Andy Shevchenko
@ 2014-08-29 10:00 ` Andy Shevchenko
2014-09-11 6:42 ` Vinod Koul
15 siblings, 0 replies; 33+ messages in thread
From: Andy Shevchenko @ 2014-08-29 10:00 UTC (permalink / raw)
To: Koul, Vinod; +Cc: dmaengine, linux-kernel
On Tue, 2014-08-19 at 20:29 +0300, Andy Shevchenko wrote:
> The patchset is targeting two things:
> - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> - support BayTrail and Braswell SoCs in PCI case
>
> They are tight with each other, thus comes in one series.
>
> The patch set was BAT tested on Braswell and BayTrail machines.
>
> We would like to push this through slave-dma tree, so, Mark, Greg,
> Hans-Christian, and Haavard, please, Ack them if you have no objections.
>
> Vinod, we would like them to be pushed during this cycle since we have more
> coming. And it would be nice to have Braswell support in v3.18-rc1.
Vinod, so far so good, we got all Acks needed to proceed. What is your
opinion?
>
> Alan Cox (1):
> serial: 8250_pci: Add PCI IDs for Intel Braswell
>
> Andy Shevchenko (9):
> dmaengine: dw: move dw_dmac.h to where it belongs to
> avr32: at32ap700x: don't rely on default DMA masters
> dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
> dmaengine: dw: apply both HS interfaces and remove slave_id usage
> dmaengine: dw: introduce generic filter function
> dmaengine: dw: move clock operations to platform.c
> dmaengine: dw: add PCI IDs for Braswell DMAs
> spi/pxa2xx-pci: remove unnecessary assignment
> serial: 8250: don't use slave_id of dma_slave_config
>
> Mika Westerberg (2):
> spi/pxa2xx: Don't use slave_id of dma_slave_config
> spi/pxa2xx-pci: Add support for Intel Braswell
>
> MAINTAINERS | 2 +-
> arch/avr32/mach-at32ap/at32ap700x.c | 19 ++--
> arch/avr32/mach-at32ap/include/mach/atmel-mci.h | 2 +-
> drivers/dma/dw/core.c | 72 +++++----------
> drivers/dma/dw/internal.h | 28 +-----
> drivers/dma/dw/pci.c | 4 +
> drivers/dma/dw/platform.c | 86 +++++++++---------
> drivers/dma/dw/regs.h | 14 +--
> drivers/spi/spi-pxa2xx-dma.c | 15 +---
> drivers/spi/spi-pxa2xx-pci.c | 102 ++++++++++++++++++----
> drivers/spi/spi-pxa2xx.c | 2 -
> drivers/tty/serial/8250/8250.h | 6 +-
> drivers/tty/serial/8250/8250_dw.c | 7 +-
> drivers/tty/serial/8250/8250_pci.c | 78 ++++++++++++++---
> include/linux/dw_dmac.h | 111 ------------------------
> include/linux/platform_data/dma-dw.h | 109 +++++++++++++++++++++++
> include/linux/spi/pxa2xx_spi.h | 9 +-
> include/sound/atmel-abdac.h | 2 +-
> include/sound/atmel-ac97c.h | 2 +-
> sound/atmel/abdac.c | 2 +-
> sound/atmel/ac97c.c | 2 +-
> 21 files changed, 365 insertions(+), 309 deletions(-)
> delete mode 100644 include/linux/dw_dmac.h
> create mode 100644 include/linux/platform_data/dma-dw.h
>
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config
2014-08-19 17:29 ` [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config Andy Shevchenko
2014-08-19 21:13 ` Mark Brown
@ 2014-09-11 6:20 ` Vinod Koul
1 sibling, 0 replies; 33+ messages in thread
From: Vinod Koul @ 2014-09-11 6:20 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Mark Brown,
Hein Tibosch, Russell King, Greg Kroah-Hartman, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
On Tue, Aug 19, 2014 at 08:29:19PM +0300, Andy Shevchenko wrote:
> From: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> That field has been deprecated in favour of getting the necessary
> information from ACPI/DT.
>
> However, we still need to deal systems that are PCI only (no ACPI to back
> up). In order to support such systems, we allow the DMA filter function and
> its corresponding parameter via pxa2xx_spi_master platform data. Then when
> the pxa2xx_spi_dma_setup() doesn't find the channel via ACPI, it falls back
> to use the given filter function.
This fails to apply for me, was it based on dmaengine tree or spi?
--
~Vinod
>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/spi/spi-pxa2xx-dma.c | 15 ++--------
> drivers/spi/spi-pxa2xx-pci.c | 64 +++++++++++++++++++++++++++++++-----------
> drivers/spi/spi-pxa2xx.c | 2 --
> include/linux/spi/pxa2xx_spi.h | 9 +++---
> 4 files changed, 54 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c
> index c41ff14..62a9297 100644
> --- a/drivers/spi/spi-pxa2xx-dma.c
> +++ b/drivers/spi/spi-pxa2xx-dma.c
> @@ -157,7 +157,6 @@ static struct dma_async_tx_descriptor *
> pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
> enum dma_transfer_direction dir)
> {
> - struct pxa2xx_spi_master *pdata = drv_data->master_info;
> struct chip_data *chip = drv_data->cur_chip;
> enum dma_slave_buswidth width;
> struct dma_slave_config cfg;
> @@ -184,7 +183,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
> cfg.dst_addr = drv_data->ssdr_physical;
> cfg.dst_addr_width = width;
> cfg.dst_maxburst = chip->dma_burst_size;
> - cfg.slave_id = pdata->tx_slave_id;
>
> sgt = &drv_data->tx_sgt;
> nents = drv_data->tx_nents;
> @@ -193,7 +191,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
> cfg.src_addr = drv_data->ssdr_physical;
> cfg.src_addr_width = width;
> cfg.src_maxburst = chip->dma_burst_size;
> - cfg.slave_id = pdata->rx_slave_id;
>
> sgt = &drv_data->rx_sgt;
> nents = drv_data->rx_nents;
> @@ -210,14 +207,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> }
>
> -static bool pxa2xx_spi_dma_filter(struct dma_chan *chan, void *param)
> -{
> - const struct pxa2xx_spi_master *pdata = param;
> -
> - return chan->chan_id == pdata->tx_chan_id ||
> - chan->chan_id == pdata->rx_chan_id;
> -}
> -
> bool pxa2xx_spi_dma_is_possible(size_t len)
> {
> return len <= MAX_DMA_LEN;
> @@ -321,12 +310,12 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data)
> return -ENOMEM;
>
> drv_data->tx_chan = dma_request_slave_channel_compat(mask,
> - pxa2xx_spi_dma_filter, pdata, dev, "tx");
> + pdata->dma_filter, pdata->tx_param, dev, "tx");
> if (!drv_data->tx_chan)
> return -ENODEV;
>
> drv_data->rx_chan = dma_request_slave_channel_compat(mask,
> - pxa2xx_spi_dma_filter, pdata, dev, "rx");
> + pdata->dma_filter, pdata->rx_param, dev, "rx");
> if (!drv_data->rx_chan) {
> dma_release_channel(drv_data->tx_chan);
> drv_data->tx_chan = NULL;
> diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
> index 20ebbc7..0424b67 100644
> --- a/drivers/spi/spi-pxa2xx-pci.c
> +++ b/drivers/spi/spi-pxa2xx-pci.c
> @@ -10,6 +10,9 @@
> #include <linux/clk.h>
> #include <linux/clk-provider.h>
>
> +#include <linux/dmaengine.h>
> +#include <linux/platform_data/dma-dw.h>
> +
> enum {
> PORT_CE4100,
> PORT_BYT,
> @@ -19,33 +22,41 @@ struct pxa_spi_info {
> enum pxa_ssp_type type;
> int port_id;
> int num_chipselect;
> - int tx_slave_id;
> - int tx_chan_id;
> - int rx_slave_id;
> - int rx_chan_id;
> unsigned long max_clk_rate;
> +
> + /* DMA channel request parameters */
> + void *tx_param;
> + void *rx_param;
> };
>
> +static struct dw_dma_slave byt_tx_param = { .dst_id = 0 };
> +static struct dw_dma_slave byt_rx_param = { .src_id = 1 };
> +
> +static bool lpss_dma_filter(struct dma_chan *chan, void *param)
> +{
> + struct dw_dma_slave *dws = param;
> +
> + if (dws->dma_dev != chan->device->dev)
> + return false;
> +
> + chan->private = dws;
> + return true;
> +}
> +
> static struct pxa_spi_info spi_info_configs[] = {
> [PORT_CE4100] = {
> .type = PXA25x_SSP,
> .port_id = -1,
> .num_chipselect = -1,
> - .tx_slave_id = -1,
> - .tx_chan_id = -1,
> - .rx_slave_id = -1,
> - .rx_chan_id = -1,
> .max_clk_rate = 3686400,
> },
> [PORT_BYT] = {
> .type = LPSS_SSP,
> .port_id = 0,
> .num_chipselect = 1,
> - .tx_slave_id = 0,
> - .tx_chan_id = 0,
> - .rx_slave_id = 1,
> - .rx_chan_id = 1,
> .max_clk_rate = 50000000,
> + .tx_param = &byt_tx_param,
> + .rx_param = &byt_rx_param,
> },
> };
>
> @@ -59,6 +70,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
> struct ssp_device *ssp;
> struct pxa_spi_info *c;
> char buf[40];
> + struct pci_dev *dma_dev;
>
> ret = pcim_enable_device(dev);
> if (ret)
> @@ -73,11 +85,29 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
> memset(&spi_pdata, 0, sizeof(spi_pdata));
> spi_pdata.num_chipselect = (c->num_chipselect > 0) ?
> c->num_chipselect : dev->devfn;
> - spi_pdata.tx_slave_id = c->tx_slave_id;
> - spi_pdata.tx_chan_id = c->tx_chan_id;
> - spi_pdata.rx_slave_id = c->rx_slave_id;
> - spi_pdata.rx_chan_id = c->rx_chan_id;
> - spi_pdata.enable_dma = c->rx_slave_id >= 0 && c->tx_slave_id >= 0;
> +
> + dma_dev = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
> +
> + if (c->tx_param) {
> + struct dw_dma_slave *slave = c->tx_param;
> +
> + slave->dma_dev = &dma_dev->dev;
> + slave->src_master = 1;
> + slave->dst_master = 0;
> + }
> +
> + if (c->rx_param) {
> + struct dw_dma_slave *slave = c->rx_param;
> +
> + slave->dma_dev = &dma_dev->dev;
> + slave->src_master = 1;
> + slave->dst_master = 0;
> + }
> +
> + spi_pdata.dma_filter = lpss_dma_filter;
> + spi_pdata.tx_param = c->tx_param;
> + spi_pdata.rx_param = c->rx_param;
> + spi_pdata.enable_dma = c->rx_param && c->tx_param;
>
> ssp = &spi_pdata.ssp;
> ssp->phys_base = pci_resource_start(dev, 0);
> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> index fe79210..256c0ab 100644
> --- a/drivers/spi/spi-pxa2xx.c
> +++ b/drivers/spi/spi-pxa2xx.c
> @@ -1062,8 +1062,6 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
>
> pdata->num_chipselect = 1;
> pdata->enable_dma = true;
> - pdata->tx_chan_id = -1;
> - pdata->rx_chan_id = -1;
>
> return pdata;
> }
> diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
> index 82d5111..d5a3165 100644
> --- a/include/linux/spi/pxa2xx_spi.h
> +++ b/include/linux/spi/pxa2xx_spi.h
> @@ -23,6 +23,8 @@
> #define PXA2XX_CS_ASSERT (0x01)
> #define PXA2XX_CS_DEASSERT (0x02)
>
> +struct dma_chan;
> +
> /* device.platform_data for SSP controller devices */
> struct pxa2xx_spi_master {
> u32 clock_enable;
> @@ -30,10 +32,9 @@ struct pxa2xx_spi_master {
> u8 enable_dma;
>
> /* DMA engine specific config */
> - int rx_chan_id;
> - int tx_chan_id;
> - int rx_slave_id;
> - int tx_slave_id;
> + bool (*dma_filter)(struct dma_chan *chan, void *param);
> + void *tx_param;
> + void *rx_param;
>
> /* For non-PXA arches */
> struct ssp_device ssp;
> --
> 2.1.0
>
--
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
` (14 preceding siblings ...)
2014-08-29 10:00 ` Andy Shevchenko
@ 2014-09-11 6:42 ` Vinod Koul
2014-09-11 7:53 ` Shevchenko, Andriy
15 siblings, 1 reply; 33+ messages in thread
From: Vinod Koul @ 2014-09-11 6:42 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans-Christian Egtvedt, Haavard Skinnemoen, Mark Brown,
Hein Tibosch, Russell King, Greg Kroah-Hartman, Takashi Iwai,
Kweh Hock Leong, Mika Westerberg, Alan Cox, dmaengine,
linux-kernel
On Tue, Aug 19, 2014 at 08:29:11PM +0300, Andy Shevchenko wrote:
> The patchset is targeting two things:
> - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> - support BayTrail and Braswell SoCs in PCI case
>
> They are tight with each other, thus comes in one series.
>
> The patch set was BAT tested on Braswell and BayTrail machines.
>
> We would like to push this through slave-dma tree, so, Mark, Greg,
> Hans-Christian, and Haavard, please, Ack them if you have no objections.
>
> Vinod, we would like them to be pushed during this cycle since we have more
> coming. And it would be nice to have Braswell support in v3.18-rc1.
Applied all except the three SPI patches. One of them Mark has applied, rest
dont apply for me, so pls resend with acks.
--
~Vinod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support
2014-09-11 6:42 ` Vinod Koul
@ 2014-09-11 7:53 ` Shevchenko, Andriy
0 siblings, 0 replies; 33+ messages in thread
From: Shevchenko, Andriy @ 2014-09-11 7:53 UTC (permalink / raw)
To: Koul, Vinod
Cc: linux-kernel@vger.kernel.org, Kweh, Hock Leong,
hskinnemoen@gmail.com, tiwai@suse.de, broonie@kernel.org,
dmaengine@vger.kernel.org, alan@linux.jf.intel.com,
andriy.shevchenko@linux.jf.intel.com, gregkh@linuxfoundation.org,
hein_tibosch@yahoo.es, mika.westerberg@linux.jf.intel.com,
egtvedt@samfundet.no, linux@arm.linux.org.uk
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1572 bytes --]
On Thu, 2014-09-11 at 12:12 +0530, Vinod Koul wrote:
> On Tue, Aug 19, 2014 at 08:29:11PM +0300, Andy Shevchenko wrote:
> > The patchset is targeting two things:
> > - removal of slave_id which is deprecated (suggested by Arnd Bergmann)
> > - support BayTrail and Braswell SoCs in PCI case
> >
> > They are tight with each other, thus comes in one series.
> >
> > The patch set was BAT tested on Braswell and BayTrail machines.
> >
> > We would like to push this through slave-dma tree, so, Mark, Greg,
> > Hans-Christian, and Haavard, please, Ack them if you have no objections.
> >
> > Vinod, we would like them to be pushed during this cycle since we have more
> > coming. And it would be nice to have Braswell support in v3.18-rc1.
>
> Applied all
Thanks!
> except the three SPI patches. One of them Mark has applied, rest
> dont apply for me, so pls resend with acks.
Done!
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2014-09-11 7:54 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19 17:29 [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 01/12] dmaengine: dw: move dw_dmac.h to where it belongs to Andy Shevchenko
2014-08-20 6:01 ` Hans-Christian Egtvedt
2014-08-20 8:55 ` Viresh Kumar
2014-08-20 8:56 ` Viresh Kumar
2014-08-20 9:28 ` Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 02/12] avr32: at32ap700x: don't rely on default DMA masters Andy Shevchenko
2014-08-20 6:03 ` Hans-Christian Egtvedt
2014-08-19 17:29 ` [PATCH v1 03/12] dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces Andy Shevchenko
2014-08-20 6:15 ` Hans-Christian Egtvedt
2014-08-19 17:29 ` [PATCH v1 04/12] dmaengine: dw: apply both HS interfaces and remove slave_id usage Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 05/12] dmaengine: dw: introduce generic filter function Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 06/12] dmaengine: dw: move clock operations to platform.c Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 07/12] dmaengine: dw: add PCI IDs for Braswell DMAs Andy Shevchenko
2014-08-19 17:29 ` [PATCH v1 08/12] spi/pxa2xx: Don't use slave_id of dma_slave_config Andy Shevchenko
2014-08-19 21:13 ` Mark Brown
2014-09-11 6:20 ` Vinod Koul
2014-08-19 17:29 ` [PATCH v1 09/12] spi/pxa2xx-pci: remove unnecessary assignment Andy Shevchenko
2014-08-19 21:12 ` Mark Brown
2014-08-19 17:29 ` [PATCH v1 10/12] spi/pxa2xx-pci: Add support for Intel Braswell Andy Shevchenko
2014-08-19 21:14 ` Mark Brown
2014-08-19 17:29 ` [PATCH v1 11/12] serial: 8250: don't use slave_id of dma_slave_config Andy Shevchenko
2014-08-26 22:38 ` Greg Kroah-Hartman
2014-08-19 17:29 ` [PATCH v1 12/12] serial: 8250_pci: Add PCI IDs for Intel Braswell Andy Shevchenko
2014-08-26 22:38 ` Greg Kroah-Hartman
2014-08-20 6:17 ` [PATCH v1 00/12] dmaengine: dw: remove slave_id, add PCI support Hans-Christian Egtvedt
2014-08-27 6:33 ` Andy Shevchenko
2014-08-26 15:27 ` Andy Shevchenko
2014-08-26 22:39 ` Greg Kroah-Hartman
2014-08-27 6:32 ` Andy Shevchenko
2014-08-29 10:00 ` Andy Shevchenko
2014-09-11 6:42 ` Vinod Koul
2014-09-11 7:53 ` Shevchenko, Andriy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).