Re: [PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-12 Thread Sekhar Nori


On 3/6/2013 9:45 PM, Matt Porter wrote:
 Adds support for parsing the TI EDMA DT data into the
 required EDMA private API platform data. Enables runtime
 PM support to initialize the EDMA hwmod. Adds AM33XX EDMA
 crossbar event mux support. Enables build on OMAP.
 
 Signed-off-by: Matt Porter mpor...@ti.com
 Acked-by: Sekhar Nori nsek...@ti.com
 ---
  arch/arm/common/edma.c |  300 
 ++--
  arch/arm/mach-omap2/Kconfig|1 +
  include/linux/platform_data/edma.h |1 +
  3 files changed, 292 insertions(+), 10 deletions(-)
 
 diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
 index a1db6cd..e68ac38 100644
 --- a/arch/arm/common/edma.c
 +++ b/arch/arm/common/edma.c
 @@ -24,6 +24,13 @@
  #include linux/platform_device.h
  #include linux/io.h
  #include linux/slab.h
 +#include linux/edma.h
 +#include linux/err.h
 +#include linux/of_address.h
 +#include linux/of_device.h
 +#include linux/of_dma.h
 +#include linux/of_irq.h
 +#include linux/pm_runtime.h
  
  #include linux/platform_data/edma.h
  
 @@ -1369,31 +1376,278 @@ void edma_clear_event(unsigned channel)
  EXPORT_SYMBOL(edma_clear_event);
  
  /*---*/
 +static int edma_of_read_u32_to_s8_array(const struct device_node *np,
 +  const char *propname, s8 *out_values,
 +  size_t sz)
 +{
 + int ret;
 +
 + ret = of_property_read_u8_array(np, propname, out_values, sz);
 + if (ret)
 + return ret;
 +
 + /* Terminate it */
 + *out_values++ = -1;
 + *out_values++ = -1;
 +
 + return 0;
 +}
 +
 +static int edma_of_read_u32_to_s16_array(const struct device_node *np,
 +  const char *propname, s16 *out_values,
 +  size_t sz)
 +{
 + int ret;
 +
 + ret = of_property_read_u16_array(np, propname, out_values, sz);
 + if (ret)
 + return ret;
 +
 + /* Terminate it */
 + *out_values++ = -1;
 + *out_values++ = -1;
 +
 + return 0;
 +}
 +
 +static int edma_xbar_event_map(struct device *dev,
 +struct device_node *node,
 +struct edma_soc_info *pdata, int len)
 +{

It will be nice to separate the xbar feature from DT'fication of the
existing driver. Right now because of the mix the patch has become
pretty big and its becoming tough to review in isolation.

 + int ret = 0;
 + int i;
 + struct resource res;
 + void *xbar;
 + const s16 (*xbar_chans)[2];
 + u32 shift, offset, mux;
 +
 + xbar_chans = devm_kzalloc(dev,
 +   len/sizeof(s16) + 2*sizeof(s16),
 +   GFP_KERNEL);
 + if (!xbar_chans)
 + return -ENOMEM;
 +
 + ret = of_address_to_resource(node, 1, res);
 + if (ret)
 + return -EIO;
 +
 + xbar = devm_ioremap(dev, res.start, resource_size(res));
 + if (!xbar)
 + return -ENOMEM;
 +
 + ret = edma_of_read_u32_to_s16_array(node,
 + ti,edma-xbar-event-map,
 + (s16 *)xbar_chans,
 + len/sizeof(u32));
 + if (ret)
 + return -EIO;
 +
 + for (i = 0; xbar_chans[i][0] != -1; i++) {
 + shift = (xbar_chans[i][1] % 4) * 8;
 + offset = xbar_chans[i][1]  2;
 + offset = 2;
 + mux = readl((void *)((u32)xbar + offset));
 + mux = ~(0xff  shift);
 + mux |= xbar_chans[i][0]  shift;
 + writel(mux, (void *)((u32)xbar + offset));
 + }
 +
 + pdata-xbar_chans = xbar_chans;
 +
 + return 0;
 +}
 +
 +static int edma_of_parse_dt(struct device *dev,
 + struct device_node *node,
 + struct edma_soc_info *pdata)
 +{
 + int ret = 0;
 + u32 value;
 + struct property *prop;
 + size_t sz;
 + struct edma_rsv_info *rsv_info;
 + const s16 (*rsv_chans)[2], (*rsv_slots)[2];
 + const s8 (*queue_tc_map)[2], (*queue_priority_map)[2];
 +
 + memset(pdata, 0, sizeof(struct edma_soc_info));
 +
 + ret = of_property_read_u32(node, dma-channels, value);
 + if (ret  0)
 + return ret;
 + pdata-n_channel = value;
 +
 + ret = of_property_read_u32(node, ti,edma-regions, value);
 + if (ret  0)
 + return ret;
 + pdata-n_region = value;
 +
 + ret = of_property_read_u32(node, ti,edma-slots, value);
 + if (ret  0)
 + return ret;
 + pdata-n_slot = value;
 +
 + pdata-n_cc = 1;
 + pdata-n_tc = 3;

Will this mean the DT portion of this driver cannot be used on SoCs
where there are two CCs like DA850? If you are hard-coding this, will it
make sense to set to to EDMA_MAX_CC instead? Okay I see a comment down
below saying 

Re: [PATCH] media: davinci: kconfig: fix incorrect selects

2013-03-12 Thread cstsai

Dear Sir,

Please don't send update emails to me

Whenever I need I can check from website

Thanks  Regards,
cstsai



- Original Message - 
From: Prabhakar Lad prabhakar.cse...@gmail.com

To: Sekhar Nori nsek...@ti.com
Cc: Russell King rmk+ker...@arm.linux.org.uk; 
davinci-linux-open-source@linux.davincidsp.com; Mauro Carvalho Chehab 
mche...@redhat.com; linux-me...@vger.kernel.org

Sent: Tuesday, March 12, 2013 1:14 PM
Subject: Re: [PATCH] media: davinci: kconfig: fix incorrect selects


Hi Sekhar,

Thanks for the patch! few nits below

also version number for patch is missing as this should have been v2 :)
BTW this patch still is not  present in media list.

On Mon, Mar 11, 2013 at 5:52 PM, Sekhar Nori nsek...@ti.com wrote:

drivers/media/platform/davinci/Kconfig uses selects where
it should be using 'depends on'. This results in warnings of
the following sort when doing randconfig builds.

warning: (VIDEO_DM6446_CCDC  VIDEO_DM355_CCDC  VIDEO_ISIF  
VIDEO_DAVINCI_VPBE_DISPLAY) selects VIDEO_VPSS_SYSTEM which has unmet 
direct dependencies (MEDIA_SUPPORT  V4L_PLATFORM_DRIVERS  
ARCH_DAVINCI)


The VPIF kconfigs had a strange 'select' and 'depends on' cross
linkage which have been fixed as well by removing unneeded
VIDEO_DAVINCI_VPIF config symbol.

Similarly, remove the unnecessary VIDEO_VPSS_SYSTEM and
VIDEO_VPFE_CAPTURE. They don't select any independent functionality
and were being used to manage code dependencies which can
be handled using makefile.

Selecting video modules is now dependent on all ARCH_DAVINCI
instead of specific EVMs and SoCs earlier. This should help build
coverage. Remove unnecessary 'default y' for some config symbols.

While at it, fix the Kconfig help text to make it more readable
and fix names of modules created.

Rename VIDEO_ISIF to VIDEO_DM365_ISIF as per suggestion from
Prabhakar.

This patch has only been build tested; I have tried to not break
any existing assumptions. I do not have the setup to test video,
so any test reports welcome.

Reported-by: Russell King rmk+ker...@arm.linux.org.uk
Signed-off-by: Sekhar Nori nsek...@ti.com
---
 drivers/media/platform/davinci/Kconfig  |   99 
+++

 drivers/media/platform/davinci/Makefile |   17 ++
 2 files changed, 39 insertions(+), 77 deletions(-)

diff --git a/drivers/media/platform/davinci/Kconfig 
b/drivers/media/platform/davinci/Kconfig

index ccfde4e..86f7f34 100644
--- a/drivers/media/platform/davinci/Kconfig
+++ b/drivers/media/platform/davinci/Kconfig
@@ -1,64 +1,33 @@
 config VIDEO_DAVINCI_VPIF_DISPLAY
-   tristate DM646x/DA850/OMAPL138 EVM Video Display
-   depends on VIDEO_DEV  (MACH_DAVINCI_DM6467_EVM || 
MACH_DAVINCI_DA850_EVM)

+   tristate TI DaVinci VPIF Video Display
+   depends on VIDEO_DEV  ARCH_DAVINCI
select VIDEOBUF2_DMA_CONTIG
-   select VIDEO_DAVINCI_VPIF
select VIDEO_ADV7343 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_THS7303 if MEDIA_SUBDRV_AUTOSELECT
help
  Enables Davinci VPIF module used for display devices.
- This module is common for following DM6467/DA850/OMAPL138
- based display devices.
+ This module is used for display on TI DM6467/DA850/OMAPL138
+ SoCs.

- To compile this driver as a module, choose M here: the
- module will be called vpif_display.
+ To compile this driver as a module, choose M here. There will
+ be two modules called vpif.ko and vpif_display.ko

 config VIDEO_DAVINCI_VPIF_CAPTURE
-   tristate DM646x/DA850/OMAPL138 EVM Video Capture
-   depends on VIDEO_DEV  (MACH_DAVINCI_DM6467_EVM || 
MACH_DAVINCI_DA850_EVM)

+   tristate TI DaVinci VPIF Video Capture
+   depends on VIDEO_DEV  ARCH_DAVINCI
select VIDEOBUF2_DMA_CONTIG
-   select VIDEO_DAVINCI_VPIF
help
- Enables Davinci VPIF module used for captur devices.
- This module is common for following DM6467/DA850/OMAPL138
- based capture devices.
+ Enables Davinci VPIF module used for capture devices.
+ This module is used for capture on TI DM6467/DA850/OMAPL138
+ SoCs.

- To compile this driver as a module, choose M here: the
- module will be called vpif_capture.
-
-config VIDEO_DAVINCI_VPIF
-   tristate DaVinci VPIF Driver
-   depends on VIDEO_DAVINCI_VPIF_DISPLAY || 
VIDEO_DAVINCI_VPIF_CAPTURE

-   help
- Support for DaVinci VPIF Driver.
-
- To compile this driver as a module, choose M here: the
- module will be called vpif.
-
-config VIDEO_VPSS_SYSTEM
-   tristate VPSS System module driver
-   depends on ARCH_DAVINCI
-   help
- Support for vpss system module for video driver
-
-config VIDEO_VPFE_CAPTURE
-   tristate VPFE Video Capture Driver
-   depends on VIDEO_V4L2  (ARCH_DAVINCI || ARCH_OMAP3)
-   depends on I2C
-   select VIDEOBUF_DMA_CONTIG
-   help
- Support for DMx/AMx VPFE based 

Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-12 Thread Sekhar Nori
On 3/6/2013 9:45 PM, Matt Porter wrote:
 The binding definition is based on the generic DMA controller
 binding.
 
 Signed-off-by: Matt Porter mpor...@ti.com

Okay the bindings the documented after they are used leading to some
confusion. This patch should be moved up the series. As I noted in my
other e-mail, some of these bindings are not really hardware description
and need to be re-looked.

Thanks,
Sekhar

 ---
  Documentation/devicetree/bindings/dma/ti-edma.txt |   49 
 +
  1 file changed, 49 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/dma/ti-edma.txt
 
 diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt 
 b/Documentation/devicetree/bindings/dma/ti-edma.txt
 new file mode 100644
 index 000..075a60e3
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
 @@ -0,0 +1,49 @@
 +TI EDMA
 +
 +Required properties:
 +- compatible : ti,edma3
 +- ti,hwmods: Name of the hwmods associated to the EDMA
 +- ti,edma-regions: Number of regions
 +- ti,edma-slots: Number of slots
 +- ti,edma-queue-tc-map: List of transfer control to queue mappings
 +- ti,edma-queue-priority-map: List of queue priority mappings
 +- ti,edma-default-queue: Default queue value
 +
 +Optional properties:
 +- ti,edma-reserved-channels: List of reserved channel regions
 +- ti,edma-reserved-slots: List of reserved slot regions
 +- ti,edma-xbar-event-map: Crossbar event to channel map
 +
 +Example:
 +
 +edma: edma@4900 {
 + reg = 0x4900 0x1;
 + interrupt-parent = intc;
 + interrupts = 12 13 14;
 + compatible = ti,edma3;
 + ti,hwmods = tpcc, tptc0, tptc1, tptc2;
 + #dma-cells = 1;
 + dma-channels = 64;
 + ti,edma-regions = 4;
 + ti,edma-slots = 256;
 + ti,edma-reserved-channels = 0  2
 +  14 2
 +  26 6
 +  48 4
 +  56 8;
 + ti,edma-reserved-slots = 0  2
 +   14 2
 +   26 6
 +   48 4
 +   56 8
 +   64 127;
 + ti,edma-queue-tc-map = 0 0
 + 1 1
 + 2 2;
 + ti,edma-queue-priority-map = 0 0
 +   1 1
 +   2 2;
 + ti,edma-default-queue = 0;
 + ti,edma-xbar-event-map = 1 12
 +   2 13;
 +};
 
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 5/5] ARM: davinci: da850-evm: add SPI flash support

2013-03-12 Thread Manjunathappa, Prakash
Enable m25p64 SPI flash support on da850-EVM. Also
add partition information of SPI flash.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
---
 arch/arm/boot/dts/da850-evm.dts |   40 +++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index c359872..fe2bbe7 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -41,6 +41,46 @@
wdt: wdt@1c21000 {
status = okay;
};
+   spi1: spi@1f0e000 {
+   status = okay;
+   pinctrl-names = default;
+   pinctrl-0 = spi1_pins;
+   flash: m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = m25p64;
+   spi-max-frequency = 3000;
+   reg = 0;
+   partition@0 {
+   label = U-Boot-SPL;
+   reg = 0x 0x0001;
+   read-only;
+   };
+   partition@1 {
+   label = U-Boot;
+   reg = 0x0001 0x0008;
+   read-only;
+   };
+   partition@2 {
+   label = U-Boot-Env;
+   reg = 0x0009 0x0001;
+   read-only;
+   };
+   partition@3 {
+   label = Kernel;
+   reg = 0x000a 0x0028;
+   };
+   partition@4 {
+   label = Filesystem;
+   reg = 0x0032 0x0040;
+   };
+   partition@5 {
+   label = MAC-Address;
+   reg = 0x007f 0x0001;
+   read-only;
+   };
+   };
+   };
};
nand_cs3@6200 {
status = okay;
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 1/5] spi/davinci: no wildcards in DT compatible property

2013-03-12 Thread Manjunathappa, Prakash
Follow DT naming convention for compatible property of the blob.
Use first chip name that introduced the specific version of the
device.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
---
New patch in this series.

 drivers/spi/spi-davinci.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index b30064b..07517c0 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -763,10 +763,10 @@ rx_dma_failed:
 #if defined(CONFIG_OF)
 static const struct of_device_id davinci_spi_of_match[] = {
{
-   .compatible = ti,dm644x-spi,
+   .compatible = ti,dm6441-spi,
},
{
-   .compatible = ti,da8xx-spi,
+   .compatible = ti,da830-spi,
.data = (void *)SPI_VERSION_2,
},
{ },
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 4/5] ARM: davinci: da850: override SPI DT node device name

2013-03-12 Thread Manjunathappa, Prakash
Populate OF_DEV_AUXDATA with desired device name expected by spi-davinci
driver. Without this clk_get of spi-davinci DT driver fails.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
---
 arch/arm/mach-davinci/da8xx-dt.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 5404e92..e049f07 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -40,6 +40,7 @@ static void __init da8xx_init_irq(void)
 struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA(ti,davinci-i2c, 0x01c22000, i2c_davinci.1, NULL),
OF_DEV_AUXDATA(ti,davinci-wdt, 0x01c21000, watchdog, NULL),
+   OF_DEV_AUXDATA(ti,da830-spi, 0x01f0e000, spi_davinci.1, NULL),
{}
 };
 
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 3/5] ARM: davinci: da850: add SPI1 DT node

2013-03-12 Thread Manjunathappa, Prakash
Patch adds SPI1 DT node along with pinmux data.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
---
 arch/arm/boot/dts/da850.dtsi |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 3ec1bda..327fb06 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -62,6 +62,14 @@
0x10 0x2200 0xff00
;
};
+   spi1_pins: pinmux_spi_pins {
+   pinctrl-single,bits = 
+   /* SIMO, SOMI, ENA,
+* CLK, CS[0], CS[1]
+*/
+   0x14 0x0011 0x00ff
+   ;
+   };
};
serial0: serial@1c42000 {
compatible = ns16550a;
@@ -107,6 +115,16 @@
reg = 0x21000 0x1000;
status = disabled;
};
+   spi1: spi@1f0e000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,da830-spi;
+   reg = 0x30e000 0x1000;
+   num-cs = 4;
+   ti,davinci-spi-intr-line = 1;
+   interrupts = 56;
+   status = disabled;
+   };
};
nand_cs3@6200 {
compatible = ti,davinci-nand;
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 0/5] Enable SPI flash support on da850-evm DT kernel

2013-03-12 Thread Manjunathappa, Prakash
Patch enables support for m25p64 SPI flash support on
da850-EVM.

Testing information:
da850-evm comes with partitions specified in DT blob.
Able to mount/umount and create/delete files on filesystem partition.

Depends on below patch in spi-next branch of 
git://git.secretlab.ca/git/linux-2.6.git.
spi/davinci: add OF support for the spi controller

Applies on top of v3.9/dt-2 branch of linux_davinci tree:
git://gitorious.org/linux-davinci/linux-davinci.git

Since v2:
Fix compatible property DT naming convention.

Since v1:
Look for m25p64 instead of m25p80 flash chip and correct partition information.
Dropped below accepted patch:
spi/davinci: fix module build error
Considered below missed out patch:
spi/davinci: add DT binding documentation

Manjunathappa, Prakash (4):
  spi/davinci: no wildcards in DT compatible property
  ARM: davinci: da850: add SPI1 DT node
  ARM: davinci: da850: override SPI DT node device name
  ARM: davinci: da850-evm: add SPI flash support

Murali Karicheri (1):
  spi/davinci: add DT binding documentation

 .../devicetree/bindings/spi/spi-davinci.txt|   51 
 arch/arm/boot/dts/da850-evm.dts|   40 +++
 arch/arm/boot/dts/da850.dtsi   |   18 +++
 arch/arm/mach-davinci/da8xx-dt.c   |1 +
 drivers/spi/spi-davinci.c  |4 +-
 5 files changed, 112 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-davinci.txt

-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3 2/5] spi/davinci: add DT binding documentation

2013-03-12 Thread Manjunathappa, Prakash
From: Murali Karicheri m-kariche...@ti.com

Get back missed out binding documentation submitted along
with below patch:
spi/davinci: add OF support for the spi controller

[prakash...@ti.com: Follow DT naming convention for compatible property]
Signed-off-by: Murali Karicheri m-kariche...@ti.com
Reviewed-by: Grant Likely grant.lik...@secretlab.ca
Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
---
 .../devicetree/bindings/spi/spi-davinci.txt|   51 
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-davinci.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-davinci.txt 
b/Documentation/devicetree/bindings/spi/spi-davinci.txt
new file mode 100644
index 000..75ad9ac
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-davinci.txt
@@ -0,0 +1,51 @@
+Davinci SPI controller device bindings
+
+Required properties:
+- #address-cells: number of cells required to define a chip select
+   address on the SPI bus. Should be set to 1.
+- #size-cells: should be zero.
+- compatible:
+   - ti,dm6441-spi for SPI used similar to that on DM644x SoC family
+   - ti,da830-spi for SPI used similar to that on DA8xx SoC family
+- reg: Offset and length of SPI controller register space
+- num-cs: Number of chip selects
+- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
+   IP to the interrupt controller withn the SoC. Possible values
+   are 0 and 1. Manual says one of the two possible interrupt
+   lines can be tied to the interrupt controller. Set this
+   based on a specifc SoC configuration.
+- interrupts: interrupt number mapped to CPU.
+- clocks: spi clk phandle
+
+Example of a NOR flash slave device (n25q032) connected to DaVinci
+SPI controller device over the SPI bus.
+
+spi0:spi@20BF {
+   #address-cells   = 1;
+   #size-cells  = 0;
+   compatible   = ti,dm6446-spi;
+   reg  = 0x20BF 0x1000;
+   num-cs   = 4;
+   ti,davinci-spi-intr-line= 0;
+   interrupts   = 338;
+   clocks   = clkspi;
+
+   flash: n25q032@0 {
+#address-cells = 1;
+#size-cells = 1;
+compatible = st,m25p32;
+spi-max-frequency = 2500;
+reg = 0;
+
+partition@0 {
+label = u-boot-spl;
+reg = 0x0 0x8;
+read-only;
+};
+
+partition@1 {
+label = test;
+reg = 0x8 0x38;
+};
+   };
+};
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] media: davinci: kconfig: fix incorrect selects

2013-03-12 Thread Sekhar Nori
On 3/12/2013 10:44 AM, Prabhakar Lad wrote:
 Hi Sekhar,
 
 Thanks for the patch! few nits below
 
 also version number for patch is missing as this should have been v2 :)

Missed that, sorry.

 BTW this patch still is not  present in media list.

Not sure what is happening there. Its an open list as far as I can see
and there is no message I am getting back from list. Most probably vger
thinks I am spamming, but I am not sure why.


  config VIDEO_DAVINCI_VPBE_DISPLAY
 tristate DM644X/DM365/DM355 VPBE HW module
 why not change this to 'TI DaVinci VPBE Video Display' as done for vpif ?

Okay, will do. I would like to remind that I have not tested this patch
(not loaded the modules and connected a video device). If you can get
some testing done on this it will be great.

Thanks,
Sekhar
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v4 1/3] dmaengine: add dma_get_slave_sg_limits()

2013-03-12 Thread Lars-Peter Clausen
[...]
   *   struct with auxiliary transfer status information, otherwise the call
   *   will just return a simple status code
   * @device_issue_pending: push pending transactions to hardware
 + * @device_slave_sg_limits: return the slave SG capabilities
   */
  struct dma_device {
  
 @@ -602,6 +615,9 @@ struct dma_device {
   dma_cookie_t cookie,
   struct dma_tx_state *txstate);
   void (*device_issue_pending)(struct dma_chan *chan);
 + struct dma_slave_sg_limits *(*device_slave_sg_limits)(
 + struct dma_chan *chan, enum dma_slave_buswidth addr_width,
 + u32 maxburst);

In my opinion it is better to pass in a pointer to a dma_slave_sg_limits
struct and let the driver fill it. Instead of passing back a pointer to an
internal structure. It is kind of problematic because you never really know
when the user is done using the struct and you don't know when it is safe to
free or reuse it. E.g. in your implementation for the edma driver if the
function is called with different parameters for the same channel, the
previous result will also be overwritten.

- Lars
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v3] media: davinci: kconfig: fix incorrect selects

2013-03-12 Thread Sekhar Nori
drivers/media/platform/davinci/Kconfig uses selects where
it should be using 'depends on'. This results in warnings of
the following sort when doing randconfig builds.

warning: (VIDEO_DM6446_CCDC  VIDEO_DM355_CCDC  VIDEO_ISIF  
VIDEO_DAVINCI_VPBE_DISPLAY) selects VIDEO_VPSS_SYSTEM which has unmet direct 
dependencies (MEDIA_SUPPORT  V4L_PLATFORM_DRIVERS  ARCH_DAVINCI)

The VPIF kconfigs had a strange 'select' and 'depends on' cross
linkage which have been fixed as well by removing unneeded
VIDEO_DAVINCI_VPIF config symbol.

Similarly, remove the unnecessary VIDEO_VPSS_SYSTEM and
VIDEO_VPFE_CAPTURE. They don't select any independent functionality
and were being used to manage code dependencies which can
be handled using makefile.

Selecting video modules is now dependent on all ARCH_DAVINCI
instead of specific EVMs and SoCs earlier. This should help build
coverage. Remove unnecessary 'default y' for some config symbols.

While at it, fix the Kconfig help text to make it more readable
and fix names of modules created during module build.

Rename VIDEO_ISIF to VIDEO_DM365_ISIF as per suggestion from
Prabhakar.

This patch has only been build tested; I have tried to not break
any existing assumptions. I do not have the setup to test video,
so any test reports welcome.

Reported-by: Russell King rmk+ker...@arm.linux.org.uk
Signed-off-by: Sekhar Nori nsek...@ti.com
---
Since v2, revisited config prompt texts and made them
more meaningful/consistent.

 drivers/media/platform/davinci/Kconfig  |  103 +++
 drivers/media/platform/davinci/Makefile |   17 ++---
 2 files changed, 41 insertions(+), 79 deletions(-)

diff --git a/drivers/media/platform/davinci/Kconfig 
b/drivers/media/platform/davinci/Kconfig
index ccfde4e..c50d31d 100644
--- a/drivers/media/platform/davinci/Kconfig
+++ b/drivers/media/platform/davinci/Kconfig
@@ -1,79 +1,47 @@
 config VIDEO_DAVINCI_VPIF_DISPLAY
-   tristate DM646x/DA850/OMAPL138 EVM Video Display
-   depends on VIDEO_DEV  (MACH_DAVINCI_DM6467_EVM || 
MACH_DAVINCI_DA850_EVM)
+   tristate TI DaVinci VPIF V4L2-Display driver
+   depends on VIDEO_DEV  ARCH_DAVINCI
select VIDEOBUF2_DMA_CONTIG
-   select VIDEO_DAVINCI_VPIF
select VIDEO_ADV7343 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_THS7303 if MEDIA_SUBDRV_AUTOSELECT
help
  Enables Davinci VPIF module used for display devices.
- This module is common for following DM6467/DA850/OMAPL138
- based display devices.
+ This module is used for display on TI DM6467/DA850/OMAPL138
+ SoCs.
 
- To compile this driver as a module, choose M here: the
- module will be called vpif_display.
+ To compile this driver as a module, choose M here. There will
+ be two modules called vpif.ko and vpif_display.ko
 
 config VIDEO_DAVINCI_VPIF_CAPTURE
-   tristate DM646x/DA850/OMAPL138 EVM Video Capture
-   depends on VIDEO_DEV  (MACH_DAVINCI_DM6467_EVM || 
MACH_DAVINCI_DA850_EVM)
+   tristate TI DaVinci VPIF video capture driver
+   depends on VIDEO_DEV  ARCH_DAVINCI
select VIDEOBUF2_DMA_CONTIG
-   select VIDEO_DAVINCI_VPIF
help
- Enables Davinci VPIF module used for captur devices.
- This module is common for following DM6467/DA850/OMAPL138
- based capture devices.
+ Enables Davinci VPIF module used for capture devices.
+ This module is used for capture on TI DM6467/DA850/OMAPL138
+ SoCs.
 
- To compile this driver as a module, choose M here: the
- module will be called vpif_capture.
+ To compile this driver as a module, choose M here. There will
+ be two modules called vpif.ko and vpif_capture.ko
 
-config VIDEO_DAVINCI_VPIF
-   tristate DaVinci VPIF Driver
-   depends on VIDEO_DAVINCI_VPIF_DISPLAY || VIDEO_DAVINCI_VPIF_CAPTURE
-   help
- Support for DaVinci VPIF Driver.
-
- To compile this driver as a module, choose M here: the
- module will be called vpif.
-
-config VIDEO_VPSS_SYSTEM
-   tristate VPSS System module driver
-   depends on ARCH_DAVINCI
-   help
- Support for vpss system module for video driver
-
-config VIDEO_VPFE_CAPTURE
-   tristate VPFE Video Capture Driver
+config VIDEO_DM6446_CCDC
+   tristate TI DM6446 CCDC video capture driver
depends on VIDEO_V4L2  (ARCH_DAVINCI || ARCH_OMAP3)
-   depends on I2C
select VIDEOBUF_DMA_CONTIG
help
- Support for DMx/AMx VPFE based frame grabber. This is the
- common V4L2 module for following DMx/AMx SoCs from Texas
- Instruments:- DM6446, DM365, DM355  AM3517/05.
-
- To compile this driver as a module, choose M here: the
- module will be called vpfe-capture.
-
-config VIDEO_DM6446_CCDC
-   tristate DM6446 CCDC HW module
-   depends on VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   

Re: [PATCH v2] arm: davinci: fix edma dmaengine induced null pointer dereference on da830

2013-03-12 Thread Sekhar Nori
On 3/6/2013 10:27 PM, Tomas Novotny wrote:
 On Tue,  5 Mar 2013 10:58:22 -0500
 Matt Porter mpor...@ti.com wrote:
 
 This adds additional error checking to the private edma api implementation
 to catch the case where the edma_alloc_slot() has an invalid controller
 parameter. The edma dmaengine wrapper driver relies on this condition
 being handled in order to avoid setting up a second edma dmaengine
 instance on DA830.

 Verfied using a DA850 with the second EDMA controller platform instance
 removed to simulate a DA830 which only has a single EDMA controller.

 Reported-by: Tomas Novotny to...@novotny.cz
 Signed-off-by: Matt Porter mpor...@ti.com
 Cc: sta...@vger.kernel.org # v3.7.x+
 ---
 v2: Move error check out of conditional to catch all cases

  arch/arm/mach-davinci/dma.c |3 +++
  1 file changed, 3 insertions(+)

 diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
 index a685e97..45b7c71 100644
 --- a/arch/arm/mach-davinci/dma.c
 +++ b/arch/arm/mach-davinci/dma.c
 @@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);
   */
  int edma_alloc_slot(unsigned ctlr, int slot)
  {
 +if (!edma_cc[ctlr])
 +return -EINVAL;
 +
  if (slot = 0)
  slot = EDMA_CHAN_SLOT(slot);
  
 
 On the TI AM1707 based custom board:
 
 Tested-by: Tomas Novotny to...@novotny.cz

I tested it on DA830 EVM. Queuing this for v3.9-rc

Thanks,
Sekhar
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[GIT PULL] DaVinci fixes for v3.9-rc

2013-03-12 Thread Sekhar Nori
Hi Arnd, Olof,

Can you please pull the following fix for v3.9-rc?

Thanks,
Sekhar

The following changes since commit 6dbe51c251a327e012439c4772097a13df43c5b8:

  Linux 3.9-rc1 (2013-03-03 15:11:05 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git 
tags/davinci-for-v3.9-rc/fixes

for you to fetch changes up to 069552777a121eb39da29de4bc0383483dbe1f7e:

  ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830 
(2013-03-12 17:10:46 +0530)


This patch fixes a boot breakage on DA830
that was introduced with EDMA DMA engine
conversion. The bug has been there since
v3.7 and has been marked for stable update.


Matt Porter (1):
  ARM: davinci: edma: fix dmaengine induced null pointer dereference on 
da830

 arch/arm/mach-davinci/dma.c |3 +++
 1 file changed, 3 insertions(+)
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [GIT PULL] DaVinci fixes for v3.9-rc

2013-03-12 Thread Arnd Bergmann
On Tuesday 12 March 2013, Sekhar Nori wrote:
 Hi Arnd, Olof,
 
 Can you please pull the following fix for v3.9-rc?
 

Pulled into the fixes branch, but I only saw it after I sent the pull request 
to Linus,
so it will have to wait for another -rc.

Arnd
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v5 4/4] ARM: davinci: da850: override mmc DT node device name

2013-03-12 Thread Manjunathappa, Prakash
Populate OF_DEV_AUXDATA with desired device name expected by
davinci_mmc driver. Without this clk_get of davinci_mmc DT driver
fails.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
Cc: linux-...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-source@linux.davincidsp.com
Cc: devicetree-disc...@lists.ozlabs.org
Cc: c...@laptop.org
Cc: Sekhar Nori nsek...@ti.com
---
 arch/arm/mach-davinci/da8xx-dt.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index e049f07..516ec7d 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -41,6 +41,8 @@ struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA(ti,davinci-i2c, 0x01c22000, i2c_davinci.1, NULL),
OF_DEV_AUXDATA(ti,davinci-wdt, 0x01c21000, watchdog, NULL),
OF_DEV_AUXDATA(ti,da830-spi, 0x01f0e000, spi_davinci.1, NULL),
+   OF_DEV_AUXDATA(ti,davinci-mmc-da830, 0x01c4,
+   davinci-mmc-da830.0, NULL),
{}
 };
 
-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v5 1/4] ARM: davinci: mmc: derive version information from device name

2013-03-12 Thread Manjunathappa, Prakash
Remove specifying mmc controller IP version information via platform
data, instead specify device name so that driver derives it from
platform_device_id table. Also change the clock node name to match
the changed dev_id.
Tested on da850-evm to make sure driver loads without clk_get failures.

Signed-off-by: Manjunathappa, Prakash prakash...@ti.com
Reviewed-by: Sekhar Nori nsek...@ti.com
---
Since v4:
Minor nit, check on return value for failure of max-frequency property
parsing.
Merged patch ARM: davinci: mmc: derive version information from device name
with this patch

 arch/arm/mach-davinci/board-da830-evm.c |1 -
 arch/arm/mach-davinci/board-da850-evm.c |2 --
 arch/arm/mach-davinci/board-dm355-evm.c |1 -
 arch/arm/mach-davinci/board-dm365-evm.c |1 -
 arch/arm/mach-davinci/board-dm644x-evm.c|1 -
 arch/arm/mach-davinci/board-neuros-osd2.c   |1 -
 arch/arm/mach-davinci/board-omapl138-hawk.c |1 -
 arch/arm/mach-davinci/board-tnetv107x-evm.c |1 -
 arch/arm/mach-davinci/da830.c   |2 +-
 arch/arm/mach-davinci/da850.c   |4 ++--
 arch/arm/mach-davinci/devices-da8xx.c   |4 ++--
 arch/arm/mach-davinci/devices-tnetv107x.c   |4 ++--
 arch/arm/mach-davinci/devices.c |6 --
 arch/arm/mach-davinci/dm355.c   |4 ++--
 arch/arm/mach-davinci/dm365.c   |4 ++--
 arch/arm/mach-davinci/dm644x.c  |2 +-
 arch/arm/mach-davinci/tnetv107x.c   |4 ++--
 drivers/mmc/host/davinci_mmc.c  |   18 +-
 include/linux/platform_data/mmc-davinci.h   |3 ---
 19 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c 
b/arch/arm/mach-davinci/board-da830-evm.c
index 95b5e10..d6a41f0 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -246,7 +246,6 @@ static struct davinci_mmc_config da830_evm_mmc_config = {
.wires  = 8,
.max_freq   = 5000,
.caps   = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-   .version= MMC_CTLR_VERSION_2,
 };
 
 static inline void da830_evm_init_mmc(void)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
b/arch/arm/mach-davinci/board-da850-evm.c
index 0299915..ff0dfd6 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -802,7 +802,6 @@ static struct davinci_mmc_config da850_mmc_config = {
.wires  = 4,
.max_freq   = 5000,
.caps   = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-   .version= MMC_CTLR_VERSION_2,
 };
 
 static const short da850_evm_mmcsd0_pins[] __initconst = {
@@ -1362,7 +1361,6 @@ static struct davinci_mmc_config da850_wl12xx_mmc_config 
= {
.max_freq   = 2500,
.caps   = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
  MMC_CAP_POWER_OFF_CARD,
-   .version= MMC_CTLR_VERSION_2,
 };
 
 static const short da850_wl12xx_pins[] __initconst = {
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c 
b/arch/arm/mach-davinci/board-dm355-evm.c
index cdf8d07..2caa5e9 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -280,7 +280,6 @@ static struct davinci_mmc_config dm355evm_mmc_config = {
.wires  = 4,
.max_freq   = 5000,
.caps   = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-   .version= MMC_CTLR_VERSION_1,
 };
 
 /* Don't connect anything to J10 unless you're only using USB host
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c 
b/arch/arm/mach-davinci/board-dm365-evm.c
index 5d49c75..ba06295 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -253,7 +253,6 @@ static struct davinci_mmc_config dm365evm_mmc_config = {
.wires  = 4,
.max_freq   = 5000,
.caps   = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-   .version= MMC_CTLR_VERSION_2,
 };
 
 static void dm365evm_emac_configure(void)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index f5e018d..4a57280 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -570,7 +570,6 @@ static struct davinci_mmc_config dm6446evm_mmc_config = {
.get_cd = dm6444evm_mmc_get_cd,
.get_ro = dm6444evm_mmc_get_ro,
.wires  = 4,
-   .version= MMC_CTLR_VERSION_1
 };
 
 static struct i2c_board_info __initdata i2c_info[] =  {
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c 
b/arch/arm/mach-davinci/board-neuros-osd2.c
index 3e3e3af..bad8192 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ 

[PATCH v5 0/4] Add DT support for davinci_mmc driver

2013-03-12 Thread Manjunathappa, Prakash
Patch set adds DT support for davinci_mmc driver and is
verified on da850-evm without card_detect/write_protect and
EDMA support. Also takecare to derive controller IP version from
platform_device_id table, remove version specification in pdata.

Applies on top of below patch under community review:
Enable SPI flash support on da850-evm DT kernel
http://www.spinics.net/lists/arm-kernel/msg229328.html

Depends on patch waiting for acceptance:
Patch mmc: davinci: allow driver to work without DMA resource
http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg18771.html

Since v4:
Minor nit, check on return value for failure of max-frequency property
parsing.
Merged patch ARM: davinci: mmc: derive version information from device name
with patch 1/4.

Since v3:
Added support to derive IP version information from platform_device_id table.

Since v2:
Modified the default value for bus-width and skipping the property 
specifications
for highspeed card capabilties for now. Re-ordered patch 2 and 3.

Since v1:
Modified the DT parse function to take default values, updated DT binding
documentation accordingly.

Manjunathappa, Prakash (4):
  ARM: davinci: mmc: derive version information from device name
  mmc: davinci_mmc: add DT support
  ARM: davinci: da850: add mmc DT entries
  ARM: davinci: da850: override mmc DT node device name

 .../devicetree/bindings/mmc/davinci_mmc.txt|   25 ++
 arch/arm/boot/dts/da850-evm.dts|7 ++
 arch/arm/boot/dts/da850.dtsi   |   15 
 arch/arm/mach-davinci/board-da830-evm.c|1 -
 arch/arm/mach-davinci/board-da850-evm.c|2 -
 arch/arm/mach-davinci/board-dm355-evm.c|1 -
 arch/arm/mach-davinci/board-dm365-evm.c|1 -
 arch/arm/mach-davinci/board-dm644x-evm.c   |1 -
 arch/arm/mach-davinci/board-neuros-osd2.c  |1 -
 arch/arm/mach-davinci/board-omapl138-hawk.c|1 -
 arch/arm/mach-davinci/board-tnetv107x-evm.c|1 -
 arch/arm/mach-davinci/da830.c  |2 +-
 arch/arm/mach-davinci/da850.c  |4 +-
 arch/arm/mach-davinci/da8xx-dt.c   |2 +
 arch/arm/mach-davinci/devices-da8xx.c  |4 +-
 arch/arm/mach-davinci/devices-tnetv107x.c  |4 +-
 arch/arm/mach-davinci/devices.c|6 +-
 arch/arm/mach-davinci/dm355.c  |4 +-
 arch/arm/mach-davinci/dm365.c  |4 +-
 arch/arm/mach-davinci/dm644x.c |2 +-
 arch/arm/mach-davinci/tnetv107x.c  |4 +-
 drivers/mmc/host/davinci_mmc.c |   82 +++-
 include/linux/platform_data/mmc-davinci.h  |3 -
 23 files changed, 146 insertions(+), 31 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/davinci_mmc.txt

-- 
1.7.4.1

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-12 Thread Matt Porter
On Thu, Mar 07, 2013 at 08:42:18AM +0200, Andy Shevchenko wrote:
 On Wed, Mar 6, 2013 at 6:15 PM, Matt Porter mpor...@ti.com wrote:
  Adds support for parsing the TI EDMA DT data into the
  required EDMA private API platform data. Enables runtime
  PM support to initialize the EDMA hwmod. Adds AM33XX EDMA
  crossbar event mux support. Enables build on OMAP.
 
  --- a/arch/arm/common/edma.c
  +++ b/arch/arm/common/edma.c
 
  +static int edma_xbar_event_map(struct device *dev,
  +  struct device_node *node,
  +  struct edma_soc_info *pdata, int len)
  +{
  +   int ret = 0;
  +   int i;
  +   struct resource res;
  +   void *xbar;
  +   const s16 (*xbar_chans)[2];
  +   u32 shift, offset, mux;
  +
  +   xbar_chans = devm_kzalloc(dev,
  + len/sizeof(s16) + 2*sizeof(s16),
  + GFP_KERNEL);
  +   if (!xbar_chans)
  +   return -ENOMEM;
  +
  +   ret = of_address_to_resource(node, 1, res);
  +   if (ret)
  +   return -EIO;
  +
  +   xbar = devm_ioremap(dev, res.start, resource_size(res));
  +   if (!xbar)
  +   return -ENOMEM;
  +
  +   ret = edma_of_read_u32_to_s16_array(node,
  +   ti,edma-xbar-event-map,
  +   (s16 *)xbar_chans,
  +   len/sizeof(u32));
  +   if (ret)
  +   return -EIO;
  +
  +   for (i = 0; xbar_chans[i][0] != -1; i++) {
  +   shift = (xbar_chans[i][1] % 4) * 8;
 
 Looks like shift = (xbar_chans[i][1]  0x03)  3;

Yes, will update.

  +   offset = xbar_chans[i][1]  2;
  +   offset = 2;
 
 Is it offset = xbar_chans[i][1]  0xfffc; ?

Yes, will update

  +   mux = readl((void *)((u32)xbar + offset));
  +   mux = ~(0xff  shift);
  +   mux |= xbar_chans[i][0]  shift;
  +   writel(mux, (void *)((u32)xbar + offset));
  +   }
 
 
 -- 
 With Best Regards,
 Andy Shevchenko
 ___
 devicetree-discuss mailing list
 devicetree-disc...@lists.ozlabs.org
 https://lists.ozlabs.org/listinfo/devicetree-discuss
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-12 Thread Matt Porter
On Tue, Mar 12, 2013 at 06:53:03AM +, Sekhar Nori wrote:
 On 3/6/2013 9:45 PM, Matt Porter wrote:
  The binding definition is based on the generic DMA controller
  binding.
  
  Signed-off-by: Matt Porter mpor...@ti.com
 
 Okay the bindings the documented after they are used leading to some
 confusion. This patch should be moved up the series. As I noted in my
 other e-mail, some of these bindings are not really hardware description
 and need to be re-looked.

Sure, I'll reorder it.

-Matt

  ---
   Documentation/devicetree/bindings/dma/ti-edma.txt |   49 
  +
   1 file changed, 49 insertions(+)
   create mode 100644 Documentation/devicetree/bindings/dma/ti-edma.txt
  
  diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt 
  b/Documentation/devicetree/bindings/dma/ti-edma.txt
  new file mode 100644
  index 000..075a60e3
  --- /dev/null
  +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
  @@ -0,0 +1,49 @@
  +TI EDMA
  +
  +Required properties:
  +- compatible : ti,edma3
  +- ti,hwmods: Name of the hwmods associated to the EDMA
  +- ti,edma-regions: Number of regions
  +- ti,edma-slots: Number of slots
  +- ti,edma-queue-tc-map: List of transfer control to queue mappings
  +- ti,edma-queue-priority-map: List of queue priority mappings
  +- ti,edma-default-queue: Default queue value
  +
  +Optional properties:
  +- ti,edma-reserved-channels: List of reserved channel regions
  +- ti,edma-reserved-slots: List of reserved slot regions
  +- ti,edma-xbar-event-map: Crossbar event to channel map
  +
  +Example:
  +
  +edma: edma@4900 {
  +   reg = 0x4900 0x1;
  +   interrupt-parent = intc;
  +   interrupts = 12 13 14;
  +   compatible = ti,edma3;
  +   ti,hwmods = tpcc, tptc0, tptc1, tptc2;
  +   #dma-cells = 1;
  +   dma-channels = 64;
  +   ti,edma-regions = 4;
  +   ti,edma-slots = 256;
  +   ti,edma-reserved-channels = 0  2
  +14 2
  +26 6
  +48 4
  +56 8;
  +   ti,edma-reserved-slots = 0  2
  + 14 2
  + 26 6
  + 48 4
  + 56 8
  + 64 127;
  +   ti,edma-queue-tc-map = 0 0
  +   1 1
  +   2 2;
  +   ti,edma-queue-priority-map = 0 0
  + 1 1
  + 2 2;
  +   ti,edma-default-queue = 0;
  +   ti,edma-xbar-event-map = 1 12
  + 2 13;
  +};
  
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-12 Thread Matt Porter
On Tue, Mar 12, 2013 at 06:45:46AM +, Sekhar Nori wrote:
 
 
 On 3/6/2013 9:45 PM, Matt Porter wrote:
  Adds support for parsing the TI EDMA DT data into the
  required EDMA private API platform data. Enables runtime
  PM support to initialize the EDMA hwmod. Adds AM33XX EDMA
  crossbar event mux support. Enables build on OMAP.
  
  Signed-off-by: Matt Porter mpor...@ti.com
  Acked-by: Sekhar Nori nsek...@ti.com
  ---
   arch/arm/common/edma.c |  300 
  ++--
   arch/arm/mach-omap2/Kconfig|1 +
   include/linux/platform_data/edma.h |1 +
   3 files changed, 292 insertions(+), 10 deletions(-)
  
  diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
  index a1db6cd..e68ac38 100644
  --- a/arch/arm/common/edma.c
  +++ b/arch/arm/common/edma.c
  @@ -24,6 +24,13 @@
   #include linux/platform_device.h
   #include linux/io.h
   #include linux/slab.h
  +#include linux/edma.h
  +#include linux/err.h
  +#include linux/of_address.h
  +#include linux/of_device.h
  +#include linux/of_dma.h
  +#include linux/of_irq.h
  +#include linux/pm_runtime.h
   
   #include linux/platform_data/edma.h
   
  @@ -1369,31 +1376,278 @@ void edma_clear_event(unsigned channel)
   EXPORT_SYMBOL(edma_clear_event);
   
   /*---*/
  +static int edma_of_read_u32_to_s8_array(const struct device_node *np,
  +const char *propname, s8 *out_values,
  +size_t sz)
  +{
  +   int ret;
  +
  +   ret = of_property_read_u8_array(np, propname, out_values, sz);
  +   if (ret)
  +   return ret;
  +
  +   /* Terminate it */
  +   *out_values++ = -1;
  +   *out_values++ = -1;
  +
  +   return 0;
  +}
  +
  +static int edma_of_read_u32_to_s16_array(const struct device_node *np,
  +const char *propname, s16 *out_values,
  +size_t sz)
  +{
  +   int ret;
  +
  +   ret = of_property_read_u16_array(np, propname, out_values, sz);
  +   if (ret)
  +   return ret;
  +
  +   /* Terminate it */
  +   *out_values++ = -1;
  +   *out_values++ = -1;
  +
  +   return 0;
  +}
  +
  +static int edma_xbar_event_map(struct device *dev,
  +  struct device_node *node,
  +  struct edma_soc_info *pdata, int len)
  +{
 
 It will be nice to separate the xbar feature from DT'fication of the
 existing driver. Right now because of the mix the patch has become
 pretty big and its becoming tough to review in isolation.

Sure, I'll do that on v10.

  +   int ret = 0;
  +   int i;
  +   struct resource res;
  +   void *xbar;
  +   const s16 (*xbar_chans)[2];
  +   u32 shift, offset, mux;
  +
  +   xbar_chans = devm_kzalloc(dev,
  + len/sizeof(s16) + 2*sizeof(s16),
  + GFP_KERNEL);
  +   if (!xbar_chans)
  +   return -ENOMEM;
  +
  +   ret = of_address_to_resource(node, 1, res);
  +   if (ret)
  +   return -EIO;
  +
  +   xbar = devm_ioremap(dev, res.start, resource_size(res));
  +   if (!xbar)
  +   return -ENOMEM;
  +
  +   ret = edma_of_read_u32_to_s16_array(node,
  +   ti,edma-xbar-event-map,
  +   (s16 *)xbar_chans,
  +   len/sizeof(u32));
  +   if (ret)
  +   return -EIO;
  +
  +   for (i = 0; xbar_chans[i][0] != -1; i++) {
  +   shift = (xbar_chans[i][1] % 4) * 8;
  +   offset = xbar_chans[i][1]  2;
  +   offset = 2;
  +   mux = readl((void *)((u32)xbar + offset));
  +   mux = ~(0xff  shift);
  +   mux |= xbar_chans[i][0]  shift;
  +   writel(mux, (void *)((u32)xbar + offset));
  +   }
  +
  +   pdata-xbar_chans = xbar_chans;
  +
  +   return 0;
  +}
  +
  +static int edma_of_parse_dt(struct device *dev,
  +   struct device_node *node,
  +   struct edma_soc_info *pdata)
  +{
  +   int ret = 0;
  +   u32 value;
  +   struct property *prop;
  +   size_t sz;
  +   struct edma_rsv_info *rsv_info;
  +   const s16 (*rsv_chans)[2], (*rsv_slots)[2];
  +   const s8 (*queue_tc_map)[2], (*queue_priority_map)[2];
  +
  +   memset(pdata, 0, sizeof(struct edma_soc_info));
  +
  +   ret = of_property_read_u32(node, dma-channels, value);
  +   if (ret  0)
  +   return ret;
  +   pdata-n_channel = value;
  +
  +   ret = of_property_read_u32(node, ti,edma-regions, value);
  +   if (ret  0)
  +   return ret;
  +   pdata-n_region = value;
  +
  +   ret = of_property_read_u32(node, ti,edma-slots, value);
  +   if (ret  0)
  +   return ret;
  +   pdata-n_slot = value;
  +
  +   pdata-n_cc = 1;
  +   pdata-n_tc = 3;
 
 Will this mean the DT portion of this driver cannot be used on SoCs
 where there are two CCs like DA850? If you are hard-coding this, will 

Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-12 Thread Peter Korsgaard
 Matt == Matt Porter mpor...@ti.com writes:

Hi,

 Matt +edma: edma@4900 {
 Matt +reg = 0x4900 0x1;
 Matt +interrupt-parent = intc;
 Matt +interrupts = 12 13 14;
  
  Probably interrupt-parent should be removed from the example as well to
  match am33xx.dtsi

 Matt On second thought, I'm not sure we're going to get any direction
 Matt on this one so let's just do what feels right and make it reflect
 Matt common usage like you suggested.

Sounds good to me!

-- 
Bye, Peter Korsgaard
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source