* [PATCH v3 0/5] using uio_pdrv_genirq without module param
@ 2017-10-09 22:46 Chris Packham
2017-10-09 22:46 ` [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq Chris Packham
` (4 more replies)
0 siblings, 5 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
I found myself about to add a driver that was a sub-optimal clone of
uio_pdrv_genirq the only difference was that I didn't want to modify the args
passed to the kernel by my bootloader. If uio_pdrv_genirq had a default
of_match entry I could simply use that. This series attempts to implement this.
I wonder if it is worth having a catch-all compat string for this driver
"generic-dev" or something. People seem to be ok with spidev not having any
such fallback so perhaps there is no-need (other than the 2 devices I want to
support with userspace drivers).
Changes in v2:
- added a better commit message to 1/2
- remove bogus checkpatch fix in 2/2
Changes in v3:
- As suggested by Rob document the bindings for the hardware and treat
uio_pdrv_genirq.c as one potential implementer of a compatible driver.
Following the model used by spidev.c
- Patches 1-3 replace patch 1 from v2 of this series
- Patches 4-5 replace patch 2 from v2
Chris Packham (5):
uio: dt-bindings: document existing binding for uio-pdrv-genirq
uio: dt-bindings: Add binding for "st,stm32f100"
uio: dt-bindings: Add binding for "marvell,88e2040"
uio: uio_pdrv_genirq: Add st,stm32f100 to dt compatible list
uio: uio_pdrv_genirq: Add "marvell,88e2040" to dt compatible list
.../devicetree/bindings/uio/uio-pdrv-genirq.txt | 28 ++++++++++++++++++++++
drivers/uio/uio_pdrv_genirq.c | 4 +++-
2 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/uio/uio-pdrv-genirq.txt
--
2.14.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [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
[not found] ` <20171009224655.6173-2-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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 related [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
[not found] ` <20171009224655.6173-3-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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 related [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
[not found] ` <20171009224655.6173-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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 related [flat|nested] 8+ messages in thread
* [PATCH v3 4/5] uio: uio_pdrv_genirq: Add st,stm32f100 to dt compatible list
[not found] ` <20171009224655.6173-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 2017-10-09 22:46 ` Chris Packham
0 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2017-10-09 22:46 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, 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-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
---
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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [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 ...)
[not found] ` <20171009224655.6173-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 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 related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/5] uio: dt-bindings: document existing binding for uio-pdrv-genirq
[not found] ` <20171009224655.6173-2-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 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-5wv7dgnIgG8, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
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-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
> ---
> 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
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/5] uio: dt-bindings: Add binding for "st,stm32f100"
[not found] ` <20171009224655.6173-3-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
@ 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-5wv7dgnIgG8, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-13 20:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
[not found] ` <20171009224655.6173-2-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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
[not found] ` <20171009224655.6173-3-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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
[not found] ` <20171009224655.6173-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
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
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).