* [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq
2017-10-09 22:46 [PATCH v3 0/5] using uio_pdrv_genirq without module param Chris Packham
@ 2017-10-09 22:46 ` Chris Packham
2017-10-13 20:24 ` Rob Herring
2017-10-09 22:46 ` [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100" Chris Packham
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh; +Cc: devicetree, linux-kernel, Chris Packham
Document the device tree bindings for the uio-prv-genirq driver. Provide
some examples on how it can be used.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v3:
- New. Document existing binding first.
.../devicetree/bindings/uio/uio-pdrv-genirq.txt | 27 ++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
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 000000000000..5a92b1f8825f
--- /dev/null
+++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
@@ -0,0 +1,27 @@
+*Generic UIO platform driver with interrupts
+
+Required properties:
+- compatible: Should be a value set with the of_id module parameter.
+
+Optional properties:
+- interrupts: Should contain the interrupt to be associated with this device
+ (only a single interrupt is supported per device).
+- interrupt-parent: Specifies the phandle to the parent interrupt controller.
+- reg: Should specify the physical address spaces used by this device.
+
+Example:
+
+/* Device with MM IO and interrupt assuming of_id="me,my-device" */
+my-device@10000 {
+ compatible = "me,my-device";
+ reg = <0x10000 0x40>;
+ interrupts = <4 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-parent = <&gic>;
+};
+
+/* Device with interrupt only assuming of_id="me,my-device" */
+my-int {
+ compatible = "me,my-device";
+ interrupts = <6 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-parent = <&gic>;
+};
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq
2017-10-09 22:46 ` [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq Chris Packham
@ 2017-10-13 20:24 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-10-13 20:24 UTC (permalink / raw)
To: Chris Packham; +Cc: mark.rutland, gregkh, devicetree, linux-kernel
On Tue, Oct 10, 2017 at 11:46:51AM +1300, Chris Packham wrote:
> Document the device tree bindings for the uio-prv-genirq driver. Provide
> some examples on how it can be used.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> Changes in v3:
> - New. Document existing binding first.
>
> .../devicetree/bindings/uio/uio-pdrv-genirq.txt | 27 ++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
>
> 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 000000000000..5a92b1f8825f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
> @@ -0,0 +1,27 @@
> +*Generic UIO platform driver with interrupts
This document is a how to use the UIO driver, not a DT binding. Using
UIO versus a proper kernel driver is purely a kernel decision that has
nothing to do with DT.
> +
> +Required properties:
> +- compatible: Should be a value set with the of_id module parameter.
> +
> +Optional properties:
> +- interrupts: Should contain the interrupt to be associated with this device
> + (only a single interrupt is supported per device).
> +- interrupt-parent: Specifies the phandle to the parent interrupt controller.
> +- reg: Should specify the physical address spaces used by this device.
> +
> +Example:
> +
> +/* Device with MM IO and interrupt assuming of_id="me,my-device" */
> +my-device@10000 {
> + compatible = "me,my-device";
> + reg = <0x10000 0x40>;
> + interrupts = <4 IRQ_TYPE_EDGE_BOTH>;
> + interrupt-parent = <&gic>;
> +};
> +
> +/* Device with interrupt only assuming of_id="me,my-device" */
> +my-int {
> + compatible = "me,my-device";
> + interrupts = <6 IRQ_TYPE_EDGE_BOTH>;
> + interrupt-parent = <&gic>;
> +};
> --
> 2.14.2
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100"
2017-10-09 22:46 [PATCH v3 0/5] using uio_pdrv_genirq without module param Chris Packham
2017-10-09 22:46 ` [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq Chris Packham
@ 2017-10-09 22:46 ` Chris Packham
2017-10-13 20:33 ` Rob Herring
2017-10-09 22:46 ` [PATCH v3 3/5] uio: dt-bindings: Add binding for "marvell,88e2040" Chris Packham
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh; +Cc: devicetree, linux-kernel, Chris Packham
The stm32f100 is a general purpose micro controller. Document a binding
that allows a user-space driver to be implemented for these devices.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v3:
- (replaces "uio: dt-bindings: document binding for uio-pdrv-genirq")
- split the bindings up into the devices I'm actually wanting to support. The
first is a stm32f100 micro controller.
Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
index 5a92b1f8825f..fb4c1b5059f2 100644
--- a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
+++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
@@ -1,7 +1,8 @@
*Generic UIO platform driver with interrupts
Required properties:
-- compatible: Should be a value set with the of_id module parameter.
+- compatible: Should be a value set with the of_id module parameter or the
+ built in value "st,stm32f100".
Optional properties:
- interrupts: Should contain the interrupt to be associated with this device
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100"
2017-10-09 22:46 ` [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100" Chris Packham
@ 2017-10-13 20:33 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-10-13 20:33 UTC (permalink / raw)
To: Chris Packham; +Cc: mark.rutland, gregkh, devicetree, linux-kernel
On Tue, Oct 10, 2017 at 11:46:52AM +1300, Chris Packham wrote:
> The stm32f100 is a general purpose micro controller. Document a binding
> that allows a user-space driver to be implemented for these devices.
It may be general purpose, but how it is hooked up to the host is not
and probably could be done in a variety of ways. I'd expect that to be
described in a binding doc (that's not a suggestion to add it to this
doc as I'm fundamentally against any binding with "UIO" in it).
Also, while the processor itself is general purpose, typically its
function on a given board would not be except maybe on dev boards. It's
that function (a combination of the uC and its firmware) which we want
to describe to the host OS. There's already examples of uC used as PMICs
or system controllers.
Rob
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 3/5] uio: dt-bindings: Add binding for "marvell,88e2040"
2017-10-09 22:46 [PATCH v3 0/5] using uio_pdrv_genirq without module param Chris Packham
2017-10-09 22:46 ` [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq Chris Packham
2017-10-09 22:46 ` [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100" Chris Packham
@ 2017-10-09 22:46 ` Chris Packham
2017-10-09 22:46 ` [PATCH v3 4/5] uio: uio_pdrv_genirq: Add st,stm32f100 to dt compatible list Chris Packham
2017-10-09 22:46 ` [PATCH v3 5/5] uio: uio_pdrv_genirq: Add "marvell,88e2040" " Chris Packham
4 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh; +Cc: devicetree, linux-kernel, Chris Packham
The marvell,88e2040 is a N-BaseT Ethernet PHY which requires a userspace
driver. The only kernel presence is an interrupt handler which
uio_pdrv_genirq can provide.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v3:
- (replaces "uio: dt-bindings: document binding for uio-pdrv-genirq")
- split the bindings up into the devices I'm actually wanting to support. The
second is a marvell N-BaseT Ethernet PHY
Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
index fb4c1b5059f2..7b28bead4016 100644
--- a/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
+++ b/Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
@@ -1,8 +1,8 @@
*Generic UIO platform driver with interrupts
Required properties:
-- compatible: Should be a value set with the of_id module parameter or the
- built in value "st,stm32f100".
+- compatible: Should be a value set with the of_id module parameter or one of
+ the built in values "st,stm32f100", "marvell,88e2040".
Optional properties:
- interrupts: Should contain the interrupt to be associated with this device
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 4/5] uio: uio_pdrv_genirq: Add st,stm32f100 to dt compatible list
2017-10-09 22:46 [PATCH v3 0/5] using uio_pdrv_genirq without module param Chris Packham
` (2 preceding siblings ...)
2017-10-09 22:46 ` [PATCH v3 3/5] uio: dt-bindings: Add binding for "marvell,88e2040" Chris Packham
@ 2017-10-09 22:46 ` Chris Packham
2017-10-09 22:46 ` [PATCH v3 5/5] uio: uio_pdrv_genirq: Add "marvell,88e2040" " Chris Packham
4 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh; +Cc: devicetree, linux-kernel, Chris Packham
The stm32f100 is a general purpose micro controller. Allow users to
interact with one as a uio device.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v3:
- (replaces "uio: add default compatible string to uio_pdrv_genirq")
- remove superfluous change suggested by checkpatch.pl
- As suggested by Rob, add specific dt bindings for the hardware I'm
supporting. uio_pdrv_genirq is one potential implementor of a compatible
driver.
drivers/uio/uio_pdrv_genirq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index f598ecddc8a7..532de98034c2 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -253,11 +253,12 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
#ifdef CONFIG_OF
static struct of_device_id uio_of_genirq_match[] = {
+ { .compatible = "st,stm32f100" },
{ /* This is filled with module_parm */ },
{ /* Sentinel */ },
};
MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
-module_param_string(of_id, uio_of_genirq_match[0].compatible, 128, 0);
+module_param_string(of_id, uio_of_genirq_match[1].compatible, 128, 0);
MODULE_PARM_DESC(of_id, "Openfirmware id of the device to be handled by uio");
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v3 5/5] uio: uio_pdrv_genirq: Add "marvell,88e2040" to dt compatible list
2017-10-09 22:46 [PATCH v3 0/5] using uio_pdrv_genirq without module param Chris Packham
` (3 preceding siblings ...)
2017-10-09 22:46 ` [PATCH v3 4/5] uio: uio_pdrv_genirq: Add st,stm32f100 to dt compatible list Chris Packham
@ 2017-10-09 22:46 ` Chris Packham
4 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt, mark.rutland, gregkh; +Cc: devicetree, linux-kernel, Chris Packham
The marvell,88e2040 is a N-BaseT Ethernet PHY which requires a userspace
driver. uio_pdrv_genirq can be used to provide interrupts to such a
userspace driver.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v3:
- (replaces "uio: add default compatible string to uio_pdrv_genirq")
- As suggested by Rob, add specific dt bindings for the hardware I'm
supporting. uio_pdrv_genirq is one potential implementor of a compatible
driver.
drivers/uio/uio_pdrv_genirq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 532de98034c2..4bcab82b899e 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -254,11 +254,12 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
#ifdef CONFIG_OF
static struct of_device_id uio_of_genirq_match[] = {
{ .compatible = "st,stm32f100" },
+ { .compatible = "marvell,88e2040" },
{ /* This is filled with module_parm */ },
{ /* Sentinel */ },
};
MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
-module_param_string(of_id, uio_of_genirq_match[1].compatible, 128, 0);
+module_param_string(of_id, uio_of_genirq_match[2].compatible, 128, 0);
MODULE_PARM_DESC(of_id, "Openfirmware id of the device to be handled by uio");
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread