* [PATCH V2 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data
@ 2012-10-12 14:31 Viresh Kumar
2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar
2012-10-12 14:31 ` [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar
0 siblings, 2 replies; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 14:31 UTC (permalink / raw)
To: vinod.koul
Cc: linux-kernel, spear-devel, andriy.shevchenko, linux-arm-kernel,
devicetree-discuss, Viresh Kumar
Documentation style comments were missing for few fields in struct
dw_dma_platform_data. Add these.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
include/linux/dw_dmac.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index e1c8c9e..62a6190 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -19,6 +19,8 @@
* @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
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:31 [PATCH V2 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar
@ 2012-10-12 14:31 ` Viresh Kumar
2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 14:58 ` Andy Shevchenko
2012-10-12 14:31 ` [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar
1 sibling, 2 replies; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 14:31 UTC (permalink / raw)
To: vinod.koul
Cc: linux-kernel, spear-devel, andriy.shevchenko, linux-arm-kernel,
devicetree-discuss, Viresh Kumar
dw_dmac driver already supports device tree but it used to have its platform
data passed the non-DT way.
This patch does following changes:
- pass platform data via DT, non-DT way still takes precedence if both are used.
- create generic filter routine
- Earlier slave information was made available by slave specific filter routines
in chan->private field. Now, this information would be passed from within dmac
DT node. Slave drivers would now be required to pass bus_id (a string) as
parameter to this generic filter(), which would be compared against the slave
data passed from DT, by the generic filter routine.
- Update binding document
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
------
- Optimized filter & DT parsing routine
- Removed unnecessary casts from changes
- renamed filter function
- Fixed function prototype and return value of DT parsing routine for !CONFIG_OF
case
- use of_get_child_count()
Documentation/devicetree/bindings/dma/snps-dma.txt | 44 +++++++
drivers/dma/dw_dmac.c | 137 +++++++++++++++++++++
drivers/dma/dw_dmac_regs.h | 4 +
include/linux/dw_dmac.h | 43 ++++---
4 files changed, 211 insertions(+), 17 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/snps-dma.txt b/Documentation/devicetree/bindings/dma/snps-dma.txt
index c0d85db..5bb3dfb 100644
--- a/Documentation/devicetree/bindings/dma/snps-dma.txt
+++ b/Documentation/devicetree/bindings/dma/snps-dma.txt
@@ -6,6 +6,26 @@ Required properties:
- interrupt-parent: Should be the phandle for the interrupt controller
that services interrupts for this device
- interrupt: Should contain the DMAC interrupt number
+- nr_channels: Number of channels supported by hardware
+- is_private: The device channels should be marked as private and not for by the
+ general purpose DMA channel allocator. False if not passed.
+- chan_allocation_order: order of allocation of channel, 0 (default): ascending,
+ 1: descending
+- chan_priority: priority of channels. 0 (default): increase from chan 0->n, 1:
+ increase from chan n->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)
+- slave_info:
+ - bus_id: name of this device channel, not just a device name since
+ devices may have more than one channel e.g. "foo_tx". For using the
+ dw_generic_filter(), slave drivers must pass exactly this string as
+ param to filter function.
+ - 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.
Example:
@@ -14,4 +34,28 @@ Example:
reg = <0xfc000000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <12>;
+
+ nr_channels = <8>;
+ chan_allocation_order = <1>;
+ chan_priority = <1>;
+ block_size = <0xfff>;
+ nr_masters = <2>;
+ data_width = <3 3 0 0>;
+
+ slave_info {
+ uart0-tx {
+ bus_id = "uart0-tx";
+ cfg_hi = <0x4000>; /* 0x8 << 11 */
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <1>;
+ };
+ spi0-tx {
+ bus_id = "spi0-tx";
+ cfg_hi = <0x2000>; /* 0x4 << 11 */
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <0>;
+ };
+ };
};
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index c4b0eb3..d72c26f 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1179,6 +1179,53 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
}
+bool dw_dma_generic_filter(struct dma_chan *chan, void *param)
+{
+ struct dw_dma *dw = to_dw_dma(chan->device);
+ static struct dw_dma *last_dw;
+ static char *last_bus_id;
+ int i = -1;
+
+ /*
+ * dmaengine framework calls this routine for all channels of all dma
+ * controller, until true is returned. If 'param' bus_id is not
+ * registered with a dma controller (dw), then there is no need of
+ * running below function for all channels of dw.
+ *
+ * This block of code does this by saving the parameters of last
+ * failure. If dw and param are same, i.e. trying on same dw with
+ * different channel, return false.
+ */
+ if (last_dw) {
+ if ((last_bus_id == param) && (last_dw == dw))
+ return false;
+ }
+
+ /*
+ * Return true:
+ * - If dw_dma's platform data is not filled with slave info, then all
+ * dma controllers are fine for transfer.
+ * - Or if param is NULL
+ */
+ if (!dw->sd || !param)
+ return true;
+
+ while (++i < dw->sd_count) {
+ if (!strcmp(dw->sd[i].bus_id, param)) {
+ chan->private = &dw->sd[i];
+ last_dw = NULL;
+ last_bus_id = NULL;
+
+ return true;
+ }
+ }
+
+ last_dw = dw;
+ last_bus_id = param;
+ return false;
+}
+EXPORT_SYMBOL(dw_dma_generic_filter);
+
/* --------------------- Cyclic DMA API extensions -------------------- */
/**
@@ -1462,6 +1509,91 @@ static void dw_dma_off(struct dw_dma *dw)
dw->chan[i].initialized = false;
}
+#ifdef CONFIG_OF
+static struct dw_dma_platform_data *
+__devinit dw_dma_parse_dt(struct platform_device *pdev)
+{
+ struct device_node *sn, *cn, *np = pdev->dev.of_node;
+ struct dw_dma_platform_data *pdata;
+ struct dw_dma_slave *sd;
+ u32 val, arr[4];
+
+ if (!np) {
+ dev_err(&pdev->dev, "Missing DT data\n");
+ return NULL;
+ }
+
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata)
+ return NULL;
+
+ if (of_property_read_u32(np, "nr_channels", &pdata->nr_channels))
+ return NULL;
+
+ if (of_property_read_bool(np, "is_private"))
+ pdata->is_private = true;
+
+ if (!of_property_read_u32(np, "chan_allocation_order", &val))
+ pdata->chan_allocation_order = (unsigned char)val;
+
+ if (!of_property_read_u32(np, "chan_priority", &val))
+ pdata->chan_priority = val;
+
+ if (!of_property_read_u32(np, "block_size", &val))
+ pdata->block_size = val;
+
+ if (!of_property_read_u32(np, "nr_masters", &val)) {
+ if (val > 4)
+ return NULL;
+
+ pdata->nr_masters = val;
+ }
+
+ if (!of_property_read_u32_array(np, "data_width", arr,
+ pdata->nr_masters))
+ for (val = 0; val < pdata->nr_masters; val++)
+ pdata->data_width[val] = arr[val];
+
+ /* parse slave data */
+ sn = of_find_node_by_name(np, "slave_info");
+ if (!sn)
+ return pdata;
+
+ /* calculate number of slaves */
+ val = of_get_child_count(sn);
+ if (!val)
+ return NULL;
+
+ sd = devm_kzalloc(&pdev->dev, sizeof(*sd) * val, GFP_KERNEL);
+ if (!sd)
+ return NULL;
+
+ pdata->sd = sd;
+ pdata->sd_count = val;
+
+ for_each_child_of_node(sn, cn) {
+ sd->dma_dev = &pdev->dev;
+ of_property_read_string(cn, "bus_id", &sd->bus_id);
+ of_property_read_u32(cn, "cfg_hi", &sd->cfg_hi);
+ of_property_read_u32(cn, "cfg_lo", &sd->cfg_lo);
+ if (!of_property_read_u32(cn, "src_master", &val))
+ sd->src_master = val;
+
+ if (!of_property_read_u32(cn, "dst_master", &val))
+ sd->dst_master = val;
+ sd++;
+ }
+
+ return pdata;
+}
+#else
+static inline struct dw_dma_platform_data *
+dw_dma_parse_dt(struct platform_device *pdev)
+{
+ return NULL;
+}
+#endif
+
static int __devinit dw_probe(struct platform_device *pdev)
{
struct dw_dma_platform_data *pdata;
@@ -1478,6 +1610,9 @@ static int __devinit dw_probe(struct platform_device *pdev)
int i;
pdata = dev_get_platdata(&pdev->dev);
+ if (!pdata)
+ pdata = dw_dma_parse_dt(pdev);
+
if (!pdata || pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS)
return -EINVAL;
@@ -1512,6 +1647,8 @@ static int __devinit dw_probe(struct platform_device *pdev)
clk_prepare_enable(dw->clk);
dw->regs = regs;
+ dw->sd = pdata->sd;
+ dw->sd_count = pdata->sd_count;
/* get hardware configuration parameters */
if (autocfg) {
diff --git a/drivers/dma/dw_dmac_regs.h b/drivers/dma/dw_dmac_regs.h
index ff39fa6..5cc61ba 100644
--- a/drivers/dma/dw_dmac_regs.h
+++ b/drivers/dma/dw_dmac_regs.h
@@ -231,6 +231,10 @@ struct dw_dma {
struct tasklet_struct tasklet;
struct clk *clk;
+ /* slave information */
+ struct dw_dma_slave *sd;
+ unsigned int sd_count;
+
u8 all_chan_mask;
/* hardware configuration */
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index 62a6190..41766de 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -15,6 +15,26 @@
#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;
+ const char *bus_id;
+ 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
@@ -25,6 +45,8 @@
* @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)
+ * @sd: slave specific data. Used for configuring channels
+ * @sd_count: count of slave data structures passed.
*/
struct dw_dma_platform_data {
unsigned int nr_channels;
@@ -38,6 +60,9 @@ struct dw_dma_platform_data {
unsigned short block_size;
unsigned char nr_masters;
unsigned char data_width[4];
+
+ struct dw_dma_slave *sd;
+ unsigned int sd_count;
};
/* bursts size */
@@ -52,23 +77,6 @@ enum dw_dma_msize {
DW_DMA_MSIZE_256,
};
-/**
- * struct dw_dma_slave - Controller-specific information about a slave
- *
- * @dma_dev: required DMA master device
- * @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;
-};
-
/* Platform-configurable bits in CFG_HI */
#define DWC_CFGH_FCMODE (1 << 0)
#define DWC_CFGH_FIFO_MODE (1 << 1)
@@ -106,5 +114,6 @@ 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);
+bool dw_dma_generic_filter(struct dma_chan *chan, void *param);
#endif /* DW_DMAC_H */
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-12 14:31 [PATCH V2 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar
2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar
@ 2012-10-12 14:31 ` Viresh Kumar
[not found] ` <2039bc164224b0068bc078b6cd8df6218e754fce.1350051925.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
1 sibling, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 14:31 UTC (permalink / raw)
To: vinod.koul
Cc: linux-kernel, spear-devel, andriy.shevchenko, linux-arm-kernel,
devicetree-discuss, Viresh Kumar
This patch adds dw_dmac's platform data to DT node. It also creates slave info
node for SPEAr13xx, for the devices which were using dw_dmac.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
------
- renamed filter function
arch/arm/boot/dts/spear1340.dtsi | 19 ++++++++++
arch/arm/boot/dts/spear13xx.dtsi | 38 ++++++++++++++++++++
arch/arm/mach-spear13xx/include/mach/spear.h | 2 --
arch/arm/mach-spear13xx/spear1310.c | 4 +--
arch/arm/mach-spear13xx/spear1340.c | 27 +++-----------
arch/arm/mach-spear13xx/spear13xx.c | 54 ++--------------------------
6 files changed, 65 insertions(+), 79 deletions(-)
diff --git a/arch/arm/boot/dts/spear1340.dtsi b/arch/arm/boot/dts/spear1340.dtsi
index d71fe2a..8ea3f66 100644
--- a/arch/arm/boot/dts/spear1340.dtsi
+++ b/arch/arm/boot/dts/spear1340.dtsi
@@ -24,6 +24,25 @@
status = "disabled";
};
+ dma@ea800000 {
+ slave_info {
+ uart1_tx {
+ bus_id = "uart1_tx";
+ cfg_hi = <0x6000>; /* 0xC << 11 */
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <1>;
+ };
+ uart1_tx {
+ bus_id = "uart1_tx";
+ cfg_hi = <0x680>; /* 0xD << 7 */
+ cfg_lo = <0>;
+ src_master = <1>;
+ dst_master = <0>;
+ };
+ };
+ };
+
spi1: spi@5d400000 {
compatible = "arm,pl022", "arm,primecell";
reg = <0x5d400000 0x1000>;
diff --git a/arch/arm/boot/dts/spear13xx.dtsi b/arch/arm/boot/dts/spear13xx.dtsi
index f7b84ac..f06bb50 100644
--- a/arch/arm/boot/dts/spear13xx.dtsi
+++ b/arch/arm/boot/dts/spear13xx.dtsi
@@ -91,6 +91,37 @@
reg = <0xea800000 0x1000>;
interrupts = <0 19 0x4>;
status = "disabled";
+
+ nr_channels = <8>;
+ chan_allocation_order = <1>;
+ chan_priority = <1>;
+ block_size = <0xfff>;
+ nr_masters = <2>;
+ data_width = <3 3 0 0>;
+
+ slave_info {
+ ssp0_tx {
+ bus_id = "ssp0_tx";
+ cfg_hi = <0x2000>; /* 0x4 << 11 */
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <0>;
+ };
+ ssp0_rx {
+ bus_id = "ssp0_rx";
+ cfg_hi = <0x280>; /* 0x5 << 7 */
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <0>;
+ };
+ cf {
+ bus_id = "cf";
+ cfg_hi = <0>;
+ cfg_lo = <0>;
+ src_master = <0>;
+ dst_master = <0>;
+ };
+ };
};
dma@eb000000 {
@@ -98,6 +129,13 @@
reg = <0xeb000000 0x1000>;
interrupts = <0 59 0x4>;
status = "disabled";
+
+ nr_channels = <8>;
+ chan_allocation_order = <1>;
+ chan_priority = <1>;
+ block_size = <0xfff>;
+ nr_masters = <2>;
+ data_width = <3 3 0 0>;
};
fsmc: flash@b0000000 {
diff --git a/arch/arm/mach-spear13xx/include/mach/spear.h b/arch/arm/mach-spear13xx/include/mach/spear.h
index 07d90ac..71bf5b6 100644
--- a/arch/arm/mach-spear13xx/include/mach/spear.h
+++ b/arch/arm/mach-spear13xx/include/mach/spear.h
@@ -43,8 +43,6 @@
#define VA_L2CC_BASE IOMEM(UL(0xFB000000))
/* others */
-#define DMAC0_BASE UL(0xEA800000)
-#define DMAC1_BASE UL(0xEB000000)
#define MCIF_CF_BASE UL(0xB2800000)
/* Devices present in SPEAr1310 */
diff --git a/arch/arm/mach-spear13xx/spear1310.c b/arch/arm/mach-spear13xx/spear1310.c
index 9fbbfc5..0e60195 100644
--- a/arch/arm/mach-spear13xx/spear1310.c
+++ b/arch/arm/mach-spear13xx/spear1310.c
@@ -36,9 +36,7 @@ static struct pl022_ssp_controller ssp1_plat_data = {
/* Add SPEAr1310 auxdata to pass platform data */
static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
- OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
- OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
- OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
+ OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
diff --git a/arch/arm/mach-spear13xx/spear1340.c b/arch/arm/mach-spear13xx/spear1340.c
index 081014f..7301f14 100644
--- a/arch/arm/mach-spear13xx/spear1340.c
+++ b/arch/arm/mach-spear13xx/spear1340.c
@@ -20,7 +20,6 @@
#include <linux/of_platform.h>
#include <asm/hardware/gic.h>
#include <asm/mach/arch.h>
-#include <mach/dma.h>
#include <mach/generic.h>
#include <mach/spear.h>
@@ -78,26 +77,10 @@
(SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
SPEAR1340_MIPHY_PLL_RATIO_TOP(25))
-static struct dw_dma_slave uart1_dma_param[] = {
- {
- /* Tx */
- .cfg_hi = DWC_CFGH_DST_PER(SPEAR1340_DMA_REQ_UART1_TX),
- .cfg_lo = 0,
- .src_master = DMA_MASTER_MEMORY,
- .dst_master = SPEAR1340_DMA_MASTER_UART1,
- }, {
- /* Rx */
- .cfg_hi = DWC_CFGH_SRC_PER(SPEAR1340_DMA_REQ_UART1_RX),
- .cfg_lo = 0,
- .src_master = SPEAR1340_DMA_MASTER_UART1,
- .dst_master = DMA_MASTER_MEMORY,
- }
-};
-
static struct amba_pl011_data uart1_data = {
- .dma_filter = dw_dma_filter,
- .dma_tx_param = &uart1_dma_param[0],
- .dma_rx_param = &uart1_dma_param[1],
+ .dma_filter = dw_dma_generic_filter,
+ .dma_tx_param = "uart1_tx",
+ .dma_rx_param = "uart1_rx",
};
/* SATA device registration */
@@ -158,9 +141,7 @@ static struct ahci_platform_data sata_pdata = {
/* Add SPEAr1340 auxdata to pass platform data */
static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = {
- OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
- OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
- OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
+ OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL,
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c
index 5633d69..0e166fa 100644
--- a/arch/arm/mach-spear13xx/spear13xx.c
+++ b/arch/arm/mach-spear13xx/spear13xx.c
@@ -22,67 +22,19 @@
#include <asm/hardware/gic.h>
#include <asm/mach/map.h>
#include <asm/smp_twd.h>
-#include <mach/dma.h>
#include <mach/generic.h>
#include <mach/spear.h>
-/* common dw_dma filter routine to be used by peripherals */
-bool dw_dma_filter(struct dma_chan *chan, void *slave)
-{
- struct dw_dma_slave *dws = (struct dw_dma_slave *)slave;
-
- if (chan->device->dev == dws->dma_dev) {
- chan->private = slave;
- return true;
- } else {
- return false;
- }
-}
-
/* ssp device registration */
-static struct dw_dma_slave ssp_dma_param[] = {
- {
- /* Tx */
- .cfg_hi = DWC_CFGH_DST_PER(DMA_REQ_SSP0_TX),
- .cfg_lo = 0,
- .src_master = DMA_MASTER_MEMORY,
- .dst_master = DMA_MASTER_SSP0,
- }, {
- /* Rx */
- .cfg_hi = DWC_CFGH_SRC_PER(DMA_REQ_SSP0_RX),
- .cfg_lo = 0,
- .src_master = DMA_MASTER_SSP0,
- .dst_master = DMA_MASTER_MEMORY,
- }
-};
-
struct pl022_ssp_controller pl022_plat_data = {
.bus_id = 0,
.enable_dma = 1,
- .dma_filter = dw_dma_filter,
- .dma_rx_param = &ssp_dma_param[1],
- .dma_tx_param = &ssp_dma_param[0],
+ .dma_filter = dw_dma_generic_filter,
+ .dma_rx_param = "ssp0_rx",
+ .dma_tx_param = "ssp0_tx",
.num_chipselect = 3,
};
-/* CF device registration */
-struct dw_dma_slave cf_dma_priv = {
- .cfg_hi = 0,
- .cfg_lo = 0,
- .src_master = 0,
- .dst_master = 0,
-};
-
-/* dmac device registeration */
-struct dw_dma_platform_data dmac_plat_data = {
- .nr_channels = 8,
- .chan_allocation_order = CHAN_ALLOCATION_DESCENDING,
- .chan_priority = CHAN_PRIORITY_DESCENDING,
- .block_size = 4095U,
- .nr_masters = 2,
- .data_width = { 3, 3, 0, 0 },
-};
-
void __init spear13xx_l2x0_init(void)
{
/*
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
[not found] ` <2039bc164224b0068bc078b6cd8df6218e754fce.1350051925.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 14:52 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 14:48 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
spear-devel-nkJGhpqTU55BDgjK7y7TUQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
>
> /* others */
> -#define DMAC0_BASE UL(0xEA800000)
> -#define DMAC1_BASE UL(0xEB000000)
> #define MCIF_CF_BASE UL(0xB2800000)
>
> /* Devices present in SPEAr1310 */
> diff --git a/arch/arm/mach-spear13xx/spear1310.c b/arch/arm/mach-spear13xx/spear1310.c
> index 9fbbfc5..0e60195 100644
> --- a/arch/arm/mach-spear13xx/spear1310.c
> +++ b/arch/arm/mach-spear13xx/spear1310.c
> @@ -36,9 +36,7 @@ static struct pl022_ssp_controller ssp1_plat_data = {
>
> /* Add SPEAr1310 auxdata to pass platform data */
> static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
> - OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
?/
> OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
>
> OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
> diff --git a/arch/arm/mach-spear13xx/spear1340.c b/arch/arm/mach-spear13xx/spear1340.c
> index 081014f..7301f14 100644
> --- a/arch/arm/mach-spear13xx/spear1340.c
> +++ b/arch/arm/mach-spear13xx/spear1340.c
> @@ -20,7 +20,6 @@
> #include <linux/of_platform.h>
> #include <asm/hardware/gic.h>
> #include <asm/mach/arch.h>
> -#include <mach/dma.h>
> #include <mach/generic.h>
> #include <mach/spear.h>
>
> @@ -78,26 +77,10 @@
> (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
> SPEAR1340_MIPHY_PLL_RATIO_TOP(25))
>
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar
@ 2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 14:55 ` Viresh Kumar
2012-10-12 14:58 ` Andy Shevchenko
1 sibling, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 14:50 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 20:01 Fri 12 Oct , Viresh Kumar wrote:
> dw_dmac driver already supports device tree but it used to have its platform
> data passed the non-DT way.
>
> This patch does following changes:
> - pass platform data via DT, non-DT way still takes precedence if both are used.
why keep it all platform are DT
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 14:52 ` Viresh Kumar
2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 14:52 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 12 October 2012 20:18, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
>> static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
>> - OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
>> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
>> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
>> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
> ?/
Sorry. can't get it :(
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 14:55 ` Viresh Kumar
2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 14:55 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 12 October 2012 20:20, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 20:01 Fri 12 Oct , Viresh Kumar wrote:
>> dw_dmac driver already supports device tree but it used to have its platform
>> data passed the non-DT way.
>>
>> This patch does following changes:
>> - pass platform data via DT, non-DT way still takes precedence if both are used.
> why keep it all platform are DT
I would love to remove that, but not sure if somebody want's the non-DT
way too.
I didn't wanted to get into fixing user SoCs of this driver.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar
2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 14:58 ` Andy Shevchenko
2012-10-12 15:18 ` Viresh Kumar
2012-10-15 3:29 ` Viresh Kumar
1 sibling, 2 replies; 24+ messages in thread
From: Andy Shevchenko @ 2012-10-12 14:58 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, linux-kernel, spear-devel, linux-arm-kernel,
devicetree-discuss
On Fri, 2012-10-12 at 20:01 +0530, Viresh Kumar wrote:
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> @@ -1179,6 +1179,53 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
> dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
> }
>
> +bool dw_dma_generic_filter(struct dma_chan *chan, void *param)
> +{
> + struct dw_dma *dw = to_dw_dma(chan->device);
> + static struct dw_dma *last_dw;
> + static char *last_bus_id;
> + int i = -1;
> +
> + /*
> + * dmaengine framework calls this routine for all channels of all dma
> + * controller, until true is returned. If 'param' bus_id is not
> + * registered with a dma controller (dw), then there is no need of
> + * running below function for all channels of dw.
> + *
> + * This block of code does this by saving the parameters of last
> + * failure. If dw and param are same, i.e. trying on same dw with
> + * different channel, return false.
> + */
> + if (last_dw) {
> + if ((last_bus_id == param) && (last_dw == dw))
> + return false;
> + }
Just came to my mind.
dw can't be NULL, can't it?
Then
if (last_dw) {
...
}
is unneeded.
Please, check twice my thought because it's a Friday evening.
> @@ -1462,6 +1509,91 @@ static void dw_dma_off(struct dw_dma *dw)
> dw->chan[i].initialized = false;
> }
>
> +#ifdef CONFIG_OF
> +static struct dw_dma_platform_data *
> +__devinit dw_dma_parse_dt(struct platform_device *pdev)
> +{
> + struct device_node *sn, *cn, *np = pdev->dev.of_node;
> + struct dw_dma_platform_data *pdata;
> + struct dw_dma_slave *sd;
> + u32 val, arr[4];
Let me weekend to think about naming. I really can't offer anything else
right now.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:58 ` Andy Shevchenko
@ 2012-10-12 15:18 ` Viresh Kumar
2012-10-12 15:53 ` Andy Shevchenko
2012-10-15 3:29 ` Viresh Kumar
1 sibling, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 15:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: vinod.koul, linux-kernel, spear-devel, linux-arm-kernel,
devicetree-discuss
On 12 October 2012 20:28, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Fri, 2012-10-12 at 20:01 +0530, Viresh Kumar wrote:
>> + if (last_dw) {
>> + if ((last_bus_id == param) && (last_dw == dw))
>> + return false;
>> + }
> Just came to my mind.
> dw can't be NULL, can't it?
> Then
> if (last_dw) {
> ...
> }
> is unneeded.
dw can't be but last_dw can be, which we are making NULL when
we find a channel :)
You are already drunk.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 15:18 ` Viresh Kumar
@ 2012-10-12 15:53 ` Andy Shevchenko
2012-10-12 15:55 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Andy Shevchenko @ 2012-10-12 15:53 UTC (permalink / raw)
To: Viresh Kumar
Cc: Andy Shevchenko, vinod.koul, linux-kernel, spear-devel,
linux-arm-kernel, devicetree-discuss
On Fri, Oct 12, 2012 at 6:18 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 12 October 2012 20:28, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> On Fri, 2012-10-12 at 20:01 +0530, Viresh Kumar wrote:
>
>>> + if (last_dw) {
>>> + if ((last_bus_id == param) && (last_dw == dw))
>>> + return false;
>>> + }
1. This is an equivalent of
if (last_dw && (last_bus_id == ... ) && (last_dw == dw))
return false;
2. In case dw is always non-NULL the last_dw == dw is false if last_dw is NULL.
Where am I wrong?
> You are already drunk.
Not yet, but tired.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 15:53 ` Andy Shevchenko
@ 2012-10-12 15:55 ` Viresh Kumar
0 siblings, 0 replies; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 15:55 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, vinod.koul, linux-kernel, spear-devel,
linux-arm-kernel, devicetree-discuss
On 12 October 2012 21:23, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> 1. This is an equivalent of
> if (last_dw && (last_bus_id == ... ) && (last_dw == dw))
> return false;
> 2. In case dw is always non-NULL the last_dw == dw is false if last_dw is NULL.
>
> Where am I wrong?
Nowhere, I am drunk ;)
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:55 ` Viresh Kumar
@ 2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:14 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 16:20 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 20:25 Fri 12 Oct , Viresh Kumar wrote:
> On 12 October 2012 20:20, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 20:01 Fri 12 Oct , Viresh Kumar wrote:
> >> dw_dmac driver already supports device tree but it used to have its platform
> >> data passed the non-DT way.
> >>
> >> This patch does following changes:
> >> - pass platform data via DT, non-DT way still takes precedence if both are used.
> > why keep it all platform are DT
>
> I would love to remove that, but not sure if somebody want's the non-DT
> way too.
>
> I didn't wanted to get into fixing user SoCs of this driver.
no drop it at the mailine if do not need it
Best Regads,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-12 14:52 ` Viresh Kumar
@ 2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:12 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-12 16:21 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 20:22 Fri 12 Oct , Viresh Kumar wrote:
> On 12 October 2012 20:18, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> >> static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
> >> - OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
> >> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
> >> - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
> > ?/
>
> Sorry. can't get it :(
what is the "cf" as paltfrom data
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 17:12 ` Viresh Kumar
2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 17:12 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
>> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
>> > ?/
>>
>> Sorry. can't get it :(
> what is the "cf" as paltfrom data
This is dma bus_id string, which matches with what is passed from dtb.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-12 17:14 ` Viresh Kumar
0 siblings, 0 replies; 24+ messages in thread
From: Viresh Kumar @ 2012-10-12 17:14 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 12 October 2012 21:50, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
>> >> - pass platform data via DT, non-DT way still takes precedence if both are used.
>> > why keep it all platform are DT
>>
>> I would love to remove that, but not sure if somebody want's the non-DT
>> way too.
>>
>> I didn't wanted to get into fixing user SoCs of this driver.
> no drop it at the mailine if do not need it
But what's the harm in keeping it until we are sure, all users of it have
moved into DT? It is not adding any overhead for DT case. And this
is what most of the drivers today are doing, because not every platform
is DT compatible.
This driver is used in multiple architectures, not only ARM.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-12 17:12 ` Viresh Kumar
@ 2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 8:48 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-13 6:44 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 22:42 Fri 12 Oct , Viresh Kumar wrote:
> On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, "cf"),
> >> > ?/
> >>
> >> Sorry. can't get it :(
> > what is the "cf" as paltfrom data
>
> This is dma bus_id string, which matches with what is passed from dtb.
so pass if via dtb too
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-13 8:48 ` Viresh Kumar
[not found] ` <CAKohpokfei_ryGKMh4wE9D=wyRZCkddc+Da1cq+3facTHradKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-13 8:48 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 550 bytes --]
On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD" <
plagnioj@jcrosoft.com> wrote:
>
> On 22:42 Fri 12 Oct , Viresh Kumar wrote:
> > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
> > <plagnioj@jcrosoft.com> wrote:
> > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
"cf"),
> > >> > ?/
> > >>
> > >> Sorry. can't get it :(
> > > what is the "cf" as paltfrom data
> >
> > This is dma bus_id string, which matches with what is passed from dtb.
> so pass if via dtb too
Yes. Already passed in 13xx.dtsi.
[-- Attachment #1.2: Type: text/html, Size: 871 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
[not found] ` <CAKohpokfei_ryGKMh4wE9D=wyRZCkddc+Da1cq+3facTHradKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 14:08 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-13 12:22 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
spear-devel-nkJGhpqTU55BDgjK7y7TUQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On 14:18 Sat 13 Oct , Viresh Kumar wrote:
> On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD"
> <plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org> wrote:
> >
> > On 22:42 Fri 12 Oct , Viresh Kumar wrote:
> > > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
> > > <plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org> wrote:
> > > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
> "cf"),
> > > >> > ?/
> > > >>
> > > >> Sorry. can't get it :(
> > > > what is the "cf" as paltfrom data
> > >
> > > This is dma bus_id string, which matches with what is passed from dtb.
> > so pass if via dtb too
>
> Yes. Already passed in 13xx.dtsi.
so why do you keep the AUXDATA
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-13 14:08 ` Viresh Kumar
2012-10-13 14:10 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-13 14:08 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: andriy.shevchenko, vinod.koul, spear-devel, linux-kernel,
linux-arm-kernel, devicetree-discuss
On 13 October 2012 17:52, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 14:18 Sat 13 Oct , Viresh Kumar wrote:
>> On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD"
>> <plagnioj@jcrosoft.com> wrote:
>> >
>> > On 22:42 Fri 12 Oct , Viresh Kumar wrote:
>> > > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
>> > > <plagnioj@jcrosoft.com> wrote:
>> > > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
>> "cf"),
>> > > >> > ?/
>> > > >>
>> > > >> Sorry. can't get it :(
>> > > > what is the "cf" as paltfrom data
>> > >
>> > > This is dma bus_id string, which matches with what is passed from dtb.
>> > so pass if via dtb too
>>
>> Yes. Already passed in 13xx.dtsi.
> so why do you keep the AUXDATA
Because the compact flash driver expects it via platform data and not
via DT. yes, it
can be changed, but that wasn't the target of this patchset. If it has
to be done, then
it has to be done separately by ST guys.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-13 14:08 ` Viresh Kumar
@ 2012-10-13 14:10 ` Viresh Kumar
2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-13 14:10 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: andriy.shevchenko, vinod.koul, spear-devel, linux-kernel,
linux-arm-kernel, devicetree-discuss
On 13 October 2012 19:38, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 13 October 2012 17:52, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
>> On 14:18 Sat 13 Oct , Viresh Kumar wrote:
>>> On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD"
>>> <plagnioj@jcrosoft.com> wrote:
>>> >
>>> > On 22:42 Fri 12 Oct , Viresh Kumar wrote:
>>> > > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
>>> > > <plagnioj@jcrosoft.com> wrote:
>>> > > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
>>> "cf"),
>>> > > >> > ?/
>>> > > >>
>>> > > >> Sorry. can't get it :(
>>> > > > what is the "cf" as paltfrom data
>>> > >
>>> > > This is dma bus_id string, which matches with what is passed from dtb.
>>> > so pass if via dtb too
>>>
>>> Yes. Already passed in 13xx.dtsi.
Probably some confusion here. What i meant to say here is, dmac's
DT slave info has a node for cf and cf driver expects this string to come
via platform data currently.
>> so why do you keep the AUXDATA
>
> Because the compact flash driver expects it via platform data and not
> via DT. yes, it
> can be changed, but that wasn't the target of this patchset. If it has
> to be done, then
> it has to be done separately by ST guys.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-13 14:10 ` Viresh Kumar
@ 2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15 3:21 ` Viresh Kumar
0 siblings, 1 reply; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-14 10:01 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, devicetree-discuss, spear-devel, linux-kernel,
andriy.shevchenko, linux-arm-kernel
On 19:40 Sat 13 Oct , Viresh Kumar wrote:
> On 13 October 2012 19:38, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > On 13 October 2012 17:52, Jean-Christophe PLAGNIOL-VILLARD
> > <plagnioj@jcrosoft.com> wrote:
> >> On 14:18 Sat 13 Oct , Viresh Kumar wrote:
> >>> On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD"
> >>> <plagnioj@jcrosoft.com> wrote:
> >>> >
> >>> > On 22:42 Fri 12 Oct , Viresh Kumar wrote:
> >>> > > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
> >>> > > <plagnioj@jcrosoft.com> wrote:
> >>> > > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
> >>> "cf"),
> >>> > > >> > ?/
> >>> > > >>
> >>> > > >> Sorry. can't get it :(
> >>> > > > what is the "cf" as paltfrom data
> >>> > >
> >>> > > This is dma bus_id string, which matches with what is passed from dtb.
> >>> > so pass if via dtb too
> >>>
> >>> Yes. Already passed in 13xx.dtsi.
>
> Probably some confusion here. What i meant to say here is, dmac's
> DT slave info has a node for cf and cf driver expects this string to come
> via platform data currently.
so use a phandle to connect them
Best Regards,
J.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT
2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-15 3:21 ` Viresh Kumar
0 siblings, 0 replies; 24+ messages in thread
From: Viresh Kumar @ 2012-10-15 3:21 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: andriy.shevchenko, vinod.koul, spear-devel, linux-kernel,
linux-arm-kernel, devicetree-discuss
On 14 October 2012 15:31, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 19:40 Sat 13 Oct , Viresh Kumar wrote:
>> On 13 October 2012 19:38, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> > On 13 October 2012 17:52, Jean-Christophe PLAGNIOL-VILLARD
>> > <plagnioj@jcrosoft.com> wrote:
>> >> On 14:18 Sat 13 Oct , Viresh Kumar wrote:
>> >>> On Oct 13, 2012 12:16 PM, "Jean-Christophe PLAGNIOL-VILLARD"
>> >>> <plagnioj@jcrosoft.com> wrote:
>> >>> >
>> >>> > On 22:42 Fri 12 Oct , Viresh Kumar wrote:
>> >>> > > On 12 October 2012 21:51, Jean-Christophe PLAGNIOL-VILLARD
>> >>> > > <plagnioj@jcrosoft.com> wrote:
>> >>> > > >> >> + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL,
>> >>> "cf"),
>> >>> > > >> > ?/
>> >>> > > >>
>> >>> > > >> Sorry. can't get it :(
>> >>> > > > what is the "cf" as paltfrom data
>> >>> > >
>> >>> > > This is dma bus_id string, which matches with what is passed from dtb.
>> >>> > so pass if via dtb too
>> >>>
>> >>> Yes. Already passed in 13xx.dtsi.
>>
>> Probably some confusion here. What i meant to say here is, dmac's
>> DT slave info has a node for cf and cf driver expects this string to come
>> via platform data currently.
>
> so use a phandle to connect them
The purpose of this patchset wasn't to fix how CF driver sends its filter
routine and its parameter. CF driver would be fixed later by ST guys.
--
viresh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-12 14:58 ` Andy Shevchenko
2012-10-12 15:18 ` Viresh Kumar
@ 2012-10-15 3:29 ` Viresh Kumar
2012-10-15 7:35 ` Andy Shevchenko
1 sibling, 1 reply; 24+ messages in thread
From: Viresh Kumar @ 2012-10-15 3:29 UTC (permalink / raw)
To: Andy Shevchenko
Cc: vinod.koul, linux-kernel, spear-devel, linux-arm-kernel,
devicetree-discuss
On 12 October 2012 20:28, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>> + if (last_dw) {
>> + if ((last_bus_id == param) && (last_dw == dw))
>> + return false;
>> + }
> Just came to my mind.
> dw can't be NULL, can't it?
> Then
> if (last_dw) {
> ...
> }
> is unneeded.
Fixup for this:
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index d72c26f..764c159 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1196,11 +1196,8 @@ bool dw_dma_generic_filter(struct dma_chan
*chan, void *param)
* failure. If dw and param are same, i.e. trying on same dw with
* different channel, return false.
*/
- if (last_dw) {
- if ((last_bus_id == param) && (last_dw == dw))
- return false;
- }
-
+ if ((last_dw == dw) && (last_bus_id == param))
+ return false;
/*
* Return true:
* - If dw_dma's platform data is not filled with slave info, then all
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support
2012-10-15 3:29 ` Viresh Kumar
@ 2012-10-15 7:35 ` Andy Shevchenko
0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2012-10-15 7:35 UTC (permalink / raw)
To: Viresh Kumar
Cc: vinod.koul, linux-kernel, spear-devel, linux-arm-kernel,
devicetree-discuss
On Mon, 2012-10-15 at 08:59 +0530, Viresh Kumar wrote:
> On 12 October 2012 20:28, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >> + if (last_dw) {
> >> + if ((last_bus_id == param) && (last_dw == dw))
> >> + return false;
> >> + }
> > Just came to my mind.
> > dw can't be NULL, can't it?
> > Then
> > if (last_dw) {
> > ...
> > }
> > is unneeded.
>
> Fixup for this:
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index d72c26f..764c159 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1196,11 +1196,8 @@ bool dw_dma_generic_filter(struct dma_chan
> *chan, void *param)
> * failure. If dw and param are same, i.e. trying on same dw with
> * different channel, return false.
> */
> - if (last_dw) {
> - if ((last_bus_id == param) && (last_dw == dw))
> - return false;
> - }
> -
> + if ((last_dw == dw) && (last_bus_id == param))
> + return false;
> /*
> * Return true:
> * - If dw_dma's platform data is not filled with slave info, then all
Good.
So, have my
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
for this patch.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2012-10-15 7:35 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 14:31 [PATCH V2 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar
2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar
2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 14:55 ` Viresh Kumar
2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:14 ` Viresh Kumar
2012-10-12 14:58 ` Andy Shevchenko
2012-10-12 15:18 ` Viresh Kumar
2012-10-12 15:53 ` Andy Shevchenko
2012-10-12 15:55 ` Viresh Kumar
2012-10-15 3:29 ` Viresh Kumar
2012-10-15 7:35 ` Andy Shevchenko
2012-10-12 14:31 ` [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar
[not found] ` <2039bc164224b0068bc078b6cd8df6218e754fce.1350051925.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 14:52 ` Viresh Kumar
2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-12 17:12 ` Viresh Kumar
2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 8:48 ` Viresh Kumar
[not found] ` <CAKohpokfei_ryGKMh4wE9D=wyRZCkddc+Da1cq+3facTHradKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-13 14:08 ` Viresh Kumar
2012-10-13 14:10 ` Viresh Kumar
2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15 3:21 ` Viresh Kumar
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).