diff mbox series

[v2,2/2] uio: Introduce UIO driver dt-binding documentation

Message ID 1512658019-30279-3-git-send-email-andrey.z@gmail.com
State Rejected, archived
Headers show
Series uio: Allow to take irq bottom-half into irq_handler with additional dt-binding | expand

Commit Message

Andrey Zhizhikin Dec. 7, 2017, 2:46 p.m. UTC
Create Documentation portion of UIO driver with Generic Interrupt Handler.

This patch creates a dt-binding documentation portion of the UIO Driver.

In addition to definition of standard required properties, new optional
property defined:
- no-threaded-irq: when present, request_irq() is called with
  IRQF_NO_THREAD flag set, effectively skipping threaded interrupt
  handler and taking bottom-half into irq_handler

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>

Comments

Rob Herring (Arm) Dec. 7, 2017, 11:42 p.m. UTC | #1
On Thu, Dec 07, 2017 at 03:46:59PM +0100, Andrey Zhizhikin wrote:
> Create Documentation portion of UIO driver with Generic Interrupt Handler.
> 
> This patch creates a dt-binding documentation portion of the UIO Driver.
> 
> In addition to definition of standard required properties, new optional
> property defined:
> - no-threaded-irq: when present, request_irq() is called with
>   IRQF_NO_THREAD flag set, effectively skipping threaded interrupt
>   handler and taking bottom-half into irq_handler
> 
> Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
> 
> diff --git a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
> new file mode 100644
> index 0000000..dfcc362
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
> @@ -0,0 +1,46 @@
> +* Userspace I/O platform driver with generic IRQ handling code.

No. See prior discussions:

https://lkml.org/lkml/2016/5/18/457
https://lkml.org/lkml/2017/10/8/238
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrey Zhizhikin Dec. 8, 2017, 12:52 p.m. UTC | #2
Hello Rob,

Thanks for your reply here!

>
> No. See prior discussions:
>
> https://lkml.org/lkml/2016/5/18/457
> https://lkml.org/lkml/2017/10/8/238

Just for my clarify; to understand how to move on with the patch:
Since UIO is not considered as a real HW and rather a aggregate, which
could be used for to wrap virtually any HW block - does that mean no
new dt-bindings would be accepted to it?

I agree it is really hard (and practically impossible) to create
compatible strings for all HW units potentially using UIO as a
container, therefore I can see clearly arguments here.

But if considered from a driver perspective: there is already DT
awareness in the UIO driver (specifically the pdrv-genirq), and we
have a "HW-like" functionality (irq handler, iomem and ioreg regions)
which could be covered by the DT bindings. What if those "generic"
properties that covers only those pieces of the UIO driver code could
be assigned corresponding dt-bindings? I believe it is not the best
and rather contradictory approach to not have any "compatible" string,
but as long as those driver parameters are covered by DT properties,
isn't it OK to have them?

I can assume a lot of people are using UIO in exactly this way:
defining a node in their DTS, assigning "compatible" via kernel
command line and having devnode instantiated. Why can't a possibility
be provided to them to have a generic description of how they can
configure, tweak and use their UIO drivers in the correct and
efficient way? This is especially true for people that are using FPGAs
and enveloping their Soft-IPs with UIO to have a generic
status/control capabilities. I cannot imagine how this tremendous
amount of variations could be easily accommodated inside UIO
compatible names...

Or am I completely missing a point here?
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
new file mode 100644
index 0000000..dfcc362
--- /dev/null
+++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
@@ -0,0 +1,46 @@ 
+* Userspace I/O platform driver with generic IRQ handling code.
+
+Platform driver for User-space IO handling with generic IRQ code.
+This driver is very similar to the regular UIO platform driver, but is
+only suitable for devices that are connected to the interrupt
+controller using unique interrupt lines.
+
+Required properties:
+- compatible: Driver compatible string. For UIO device with generic IRQ
+  handling code this property is defined in device tree to any desired
+  name, and then set via module parameters passed to Kernel command line
+  in a form:
+  uio_pdrv_genirq.of_id=<your name>
+
+- reg: Physical base address and size for memory mapped region to be accessed
+  via UIO driver.
+
+- interrupts: Platform IRQ standard definition. For details on defining this
+  property, see interrupt-controller/interrupts.txt
+
+- interrupt-parent: Parent interrupt controller node.
+  For details, see interrupt-controller/interrupts.txt
+
+Optional properties:
+- no-threaded-irq: when present, request_irq() is called with IRQF_NO_THREAD
+  flag set, effectively skipping threaded interrupt handler and taking
+  bottom-half into irq_handler
+
+
+Examples:
+
+base-uio {
+	compatible = "platform-uio";
+	reg = < 0xC0000000 0x00020000 >;
+	interrupts = < 0 10 1 >;
+	interrupt-parent = <&intc>;
+};
+
+nothreaded-uio {
+	compatible = "platform-uio";
+	reg = < 0xC0040000 0x00020000 >;
+	interrupts = < 0 27 1 >;
+	interrupt-parent = <&intc>;
+	no-threaded-irq;
+};
+