Re: [PATCH 00/13] uio_pruss: add support for devicetree and am33xx

2014-07-09 Thread Hans J. Koch
On Mon, Jul 07, 2014 at 05:50:09PM +, Paul Walmsley wrote:
 On Mon, 7 Jul 2014, Andre Heider wrote:
 
  On Sun, Jun 29, 2014 at 06:21:34PM +0200, Andre Heider wrote:
   
   this series adds PRUv2 support to uio_pruss through devicetree, makes the
   device usable on am33xx and enables it on beaglebone black.
   Inspired by old patches from Matt Porter found in a downstream tree.
   
   To archieve that this series:
   * adds a flag to omap_hwmod.c to get PRUSS out of hardreset (patch 5 and 
   6)
 
 ...
 
   * is the hardreset thing I did there the right thing to do? I think the
 proper way would be a reset controller (which apparently doesn't yet 
   exist
 for this SoC?) and let the driver deassert/assert on probe/remove?
   * the platform device path has a clk_enable() / clk_put() calls. Are those
 now redundant with the introduced pm_runtime_enable() 
   pm_runtime_disable()
 calls?
 
 Probably you only need pm_runtime_{get,put}_*() calls, unless you're 
 changing clock parents or rates in your driver code.
 
  @OMAP guys: any comments? The series depends on patch 5 and 6; both touch
  common hwmod code.
 
 I'd suggest splitting the series into three independent pieces if 
 possible:
 
 1. UIO code, for the UIO maintainer(s)
 2. DT pieces for Tony
 3. hwmod pieces for me
 
 That way they can be cleanly merged by the respective maintainers.

I second that. At first sight, the UIO parts look OK to me, but please
make it a new patch series.

Thanks,
Hans
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 1/3] uio: uio_pruss: port to AM33xx

2012-09-26 Thread Hans J. Koch
On Wed, Sep 26, 2012 at 09:44:29AM -0400, Matt Porter wrote:
 Add ifdefery hacks to only use SRAM on Davinci. This
 needs to be cleaned up with a sane generic SRAM allocator
 (like the DT based driver available that can't be used on
 Davinci which is just starting DT conversion) before it
 can go upstream.

I agree with that ;-)
Needing lots of ifdefs in *.c files is usually a bad sign...

Thanks anyway for posting, it's good to have things like that in the archives.

And please make driver code and documentation updates separate patches in the
future.

Hans

 
 Adds DT, pinctrl, and runtime PM support for use on
 AM33xx.
 
 Signed-off-by: Matt Porter mpor...@ti.com
 ---
  Documentation/devicetree/bindings/uio/pruss.txt|   17 ++
  .../devicetree/bindings/uio/uio_pruss.txt  |   17 ++
  drivers/uio/Kconfig|4 +-
  drivers/uio/uio_pruss.c|   63 
 +++-
  4 files changed, 98 insertions(+), 3 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/uio/pruss.txt
  create mode 100644 Documentation/devicetree/bindings/uio/uio_pruss.txt
 
 diff --git a/Documentation/devicetree/bindings/uio/pruss.txt 
 b/Documentation/devicetree/bindings/uio/pruss.txt
 new file mode 100644
 index 000..2ac45c5
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/uio/pruss.txt
 @@ -0,0 +1,17 @@
 +TI PRUSS device
 +
 +Required properties:
 +- compatible :
 +  - ti,pruss-v1 for AM18xx/OMAP-L138/DA850
 +  - ti,pruss-v2 for AM33xx.
 +- ti,pintc-offset : Offset of the PINTC from the PRUSS address base
 +- ti,hwmods: Name of the hwmod associated to the PRUSS
 +
 +Example:
 +
 +pruss: pruss@4a30 {
 + compatible = ti,pruss-v2;
 + ti,hwmods = pruss;
 + reg = 0x4a30 0x08;
 + ti,pintc-offset = 0x2;
 +};
 diff --git a/Documentation/devicetree/bindings/uio/uio_pruss.txt 
 b/Documentation/devicetree/bindings/uio/uio_pruss.txt
 new file mode 100644
 index 000..2ac45c5
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/uio/uio_pruss.txt
 @@ -0,0 +1,17 @@
 +TI PRUSS device
 +
 +Required properties:
 +- compatible :
 +  - ti,pruss-v1 for AM18xx/OMAP-L138/DA850
 +  - ti,pruss-v2 for AM33xx.
 +- ti,pintc-offset : Offset of the PINTC from the PRUSS address base
 +- ti,hwmods: Name of the hwmod associated to the PRUSS
 +
 +Example:
 +
 +pruss: pruss@4a30 {
 + compatible = ti,pruss-v2;
 + ti,hwmods = pruss;
 + reg = 0x4a30 0x08;
 + ti,pintc-offset = 0x2;
 +};
 diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
 index 6f3ea9b..8da7d9b 100644
 --- a/drivers/uio/Kconfig
 +++ b/drivers/uio/Kconfig
 @@ -96,9 +96,9 @@ config UIO_NETX
  
  config UIO_PRUSS
   tristate Texas Instruments PRUSS driver
 - depends on ARCH_DAVINCI_DA850
 + depends on ARCH_DAVINCI_DA850 || SOC_AM33XX
   help
 -   PRUSS driver for OMAPL138/DA850/AM18XX devices
 +   PRUSS driver for OMAPL138/DA850/AM18XX and AM33XX devices
 PRUSS driver requires user space components, examples and user space
 driver is available from below SVN repo - you may use anonymous login
  
 diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
 index 33a7a27..326ce40 100644
 --- a/drivers/uio/uio_pruss.c
 +++ b/drivers/uio/uio_pruss.c
 @@ -25,7 +25,15 @@
  #include linux/clk.h
  #include linux/dma-mapping.h
  #include linux/slab.h
 +#include linux/of_address.h
 +#include linux/of_device.h
 +#include linux/pinctrl/consumer.h
 +#include linux/err.h
 +#include linux/pm_runtime.h
 +
 +#ifdef CONFIG_ARCH_DAVINCI_DA850
  #include mach/sram.h
 +#endif
  
  #define DRV_NAME pruss_uio
  #define DRV_VERSION 1.0
 @@ -105,8 +113,10 @@ static void pruss_cleanup(struct platform_device *dev,
   dma_free_coherent(dev-dev, extram_pool_sz, gdev-ddr_vaddr,
   gdev-ddr_paddr);
   }
 +#ifdef CONFIG_ARCH_DAVINCI_DA850
   if (gdev-sram_vaddr)
   sram_free(gdev-sram_vaddr, sram_pool_sz);
 +#endif
   kfree(gdev-info);
   clk_put(gdev-pruss_clk);
   kfree(gdev);
 @@ -117,8 +127,10 @@ static int __devinit pruss_probe(struct platform_device 
 *dev)
   struct uio_info *p;
   struct uio_pruss_dev *gdev;
   struct resource *regs_prussio;
 + struct resource res;
   int ret = -ENODEV, cnt = 0, len;
   struct uio_pruss_pdata *pdata = dev-dev.platform_data;
 + struct pinctrl *pinctrl;
  
   gdev = kzalloc(sizeof(struct uio_pruss_dev), GFP_KERNEL);
   if (!gdev)
 @@ -129,6 +141,7 @@ static int __devinit pruss_probe(struct platform_device 
 *dev)
   kfree(gdev);
   return -ENOMEM;
   }
 +#ifdef CONFIG_ARCH_DAVINCI_DA850
   /* Power on PRU in case its not done as part of boot-loader */
   gdev-pruss_clk = clk_get(dev-dev, pruss);
   if (IS_ERR(gdev-pruss_clk)) {
 @@ -140,6 +153,28 @@ static int __devinit pruss_probe(struct platform_device 
 *dev)
   } else {
  

Re: [PATCH 01/19] Make clocksource name const

2011-05-18 Thread Hans J. Koch
On Mon, May 16, 2011 at 06:25:54PM +0100, Russell King - ARM Linux wrote:
 As nothing should be writing to the clocksource name string, make the
 clocksource name pointer const.  Build-tested on ARM Versatile Express.
 
 Cc: Alessandro Rubini rub...@unipv.it
 Cc: Colin Cross ccr...@android.com
 Cc: Eric Miao eric.y.m...@gmail.com
 Cc: Erik Gilling konk...@android.com
 Cc: Hans J. Koch h...@hansjkoch.de
 Cc: Imre Kaloz ka...@openwrt.org
 Cc: Krzysztof Halasa k...@pm.waw.pl
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Lennert Buytenhek ker...@wantstofly.org
 Cc: Linus Walleij linus.wall...@stericsson.com
 Cc: linux-omap@vger.kernel.org
 Cc: Nicolas Pitre n...@fluxnic.net
 Cc: Olof Johansson o...@lixom.net
 Cc: Sascha Hauer ker...@pengutronix.de
 Cc: Tony Lindgren t...@atomide.com
 Cc: Viresh Kumar viresh.ku...@st.com
 Cc: Wan ZongShun mcuos@gmail.com
 Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk

Acked-by: Hans J. Koch h...@hansjkoch.de

 ---
  include/linux/clocksource.h |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
 index c37b21a..94c1f38 100644
 --- a/include/linux/clocksource.h
 +++ b/include/linux/clocksource.h
 @@ -161,7 +161,7 @@ struct clocksource {
   /*
* First part of structure is read mostly
*/
 - char *name;
 + const char *name;
   struct list_head list;
   int rating;
   cycle_t (*read)(struct clocksource *cs);
 -- 
 1.7.4.4
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html