All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] serial: pl011: Add xilinx uart
@ 2022-08-26 12:05 Shubhrajyoti Datta
  2022-08-26 12:05 ` [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter Shubhrajyoti Datta
  2022-08-26 12:05 ` [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters Shubhrajyoti Datta
  0 siblings, 2 replies; 5+ messages in thread
From: Shubhrajyoti Datta @ 2022-08-26 12:05 UTC (permalink / raw)
  To: linux-serial
  Cc: git, devicetree, jirislaby, linux, krzysztof.kozlowski+dt,
	robh+dt, gregkh

-Support uart peripheral in Xilinx Versal SOC.
Add parameter reg-io-width.
Add the dt-binding for the same

v2: 
Update the commit message to reflect the AXI limitation.

v3:
Add reg-io-width.

v4:
Fix the binding comments

Shubhrajyoti Datta (2):
  dt-bindings: serial: pl011: Add a reg-io-width parameter
  serial: pl011: Add reg-io-width parameters

 .../devicetree/bindings/serial/pl011.yaml        |  6 ++++++
 drivers/tty/serial/amba-pl011.c                  | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter
  2022-08-26 12:05 [PATCH v4 0/2] serial: pl011: Add xilinx uart Shubhrajyoti Datta
@ 2022-08-26 12:05 ` Shubhrajyoti Datta
  2022-08-26 17:38   ` Krzysztof Kozlowski
  2022-08-26 12:05 ` [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters Shubhrajyoti Datta
  1 sibling, 1 reply; 5+ messages in thread
From: Shubhrajyoti Datta @ 2022-08-26 12:05 UTC (permalink / raw)
  To: linux-serial
  Cc: git, devicetree, jirislaby, linux, krzysztof.kozlowski+dt,
	robh+dt, gregkh

Some of the implementations support only 32-bit accesses.
Add a parameter reg-io-width for such platforms.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
---
v4
Fix the bindings

 Documentation/devicetree/bindings/serial/pl011.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/pl011.yaml b/Documentation/devicetree/bindings/serial/pl011.yaml
index d8aed84abcd3..80af72859876 100644
--- a/Documentation/devicetree/bindings/serial/pl011.yaml
+++ b/Documentation/devicetree/bindings/serial/pl011.yaml
@@ -94,6 +94,12 @@ properties:
   resets:
     maxItems: 1
 
+  reg-io-width:
+    description:
+      The size (in bytes) of the IO accesses that should be performed
+      on the device.
+    enum: [1, 4]
+
 required:
   - compatible
   - reg
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters
  2022-08-26 12:05 [PATCH v4 0/2] serial: pl011: Add xilinx uart Shubhrajyoti Datta
  2022-08-26 12:05 ` [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter Shubhrajyoti Datta
@ 2022-08-26 12:05 ` Shubhrajyoti Datta
  2022-08-26 14:52   ` Ilpo Järvinen
  1 sibling, 1 reply; 5+ messages in thread
From: Shubhrajyoti Datta @ 2022-08-26 12:05 UTC (permalink / raw)
  To: linux-serial
  Cc: git, devicetree, jirislaby, linux, krzysztof.kozlowski+dt,
	robh+dt, gregkh

Some of the implementations can read only 32 bits because of
the interface limitations of the port they are connected to.
Add a parameter reg-io-width for supporting such platforms.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
---
v4:
No change

 drivers/tty/serial/amba-pl011.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 15f0e4d88c5a..033bf8699540 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2777,6 +2777,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 	struct uart_amba_port *uap;
 	struct vendor_data *vendor = id->data;
 	int portnr, ret;
+	u32 val;
 
 	portnr = pl011_find_free_port();
 	if (portnr < 0)
@@ -2801,6 +2802,21 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 	uap->port.rs485_supported = pl011_rs485_supported;
 	snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
 
+	if (device_property_read_u32(&dev->dev, "reg-io-width", &val) == 0) {
+		switch (val) {
+		case 1:
+			uap->port.iotype = UPIO_MEM;
+			break;
+		case 4:
+			uap->port.iotype = UPIO_MEM32;
+			break;
+		default:
+			dev_warn(&dev->dev, "unsupported reg-io-width (%d)\n",
+				 val);
+			return -EINVAL;
+		}
+	}
+
 	ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr);
 	if (ret)
 		return ret;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters
  2022-08-26 12:05 ` [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters Shubhrajyoti Datta
@ 2022-08-26 14:52   ` Ilpo Järvinen
  0 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2022-08-26 14:52 UTC (permalink / raw)
  To: Shubhrajyoti Datta
  Cc: linux-serial, git, devicetree, Jiri Slaby, linux,
	krzysztof.kozlowski+dt, robh+dt, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

On Fri, 26 Aug 2022, Shubhrajyoti Datta wrote:

> Some of the implementations can read only 32 bits because of
> the interface limitations of the port they are connected to.
> Add a parameter reg-io-width for supporting such platforms.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.


> ---
> v4:
> No change
> 
>  drivers/tty/serial/amba-pl011.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 15f0e4d88c5a..033bf8699540 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -2777,6 +2777,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
>  	struct uart_amba_port *uap;
>  	struct vendor_data *vendor = id->data;
>  	int portnr, ret;
> +	u32 val;
>  
>  	portnr = pl011_find_free_port();
>  	if (portnr < 0)
> @@ -2801,6 +2802,21 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
>  	uap->port.rs485_supported = pl011_rs485_supported;
>  	snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
>  
> +	if (device_property_read_u32(&dev->dev, "reg-io-width", &val) == 0) {
> +		switch (val) {
> +		case 1:
> +			uap->port.iotype = UPIO_MEM;
> +			break;
> +		case 4:
> +			uap->port.iotype = UPIO_MEM32;
> +			break;
> +		default:
> +			dev_warn(&dev->dev, "unsupported reg-io-width (%d)\n",
> +				 val);
> +			return -EINVAL;
> +		}
> +	}
> +
>  	ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr);
>  	if (ret)
>  		return ret;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter
  2022-08-26 12:05 ` [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter Shubhrajyoti Datta
@ 2022-08-26 17:38   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-26 17:38 UTC (permalink / raw)
  To: Shubhrajyoti Datta, linux-serial
  Cc: git, devicetree, jirislaby, linux, krzysztof.kozlowski+dt,
	robh+dt, gregkh

On 26/08/2022 15:05, Shubhrajyoti Datta wrote:
> Some of the implementations support only 32-bit accesses.
> Add a parameter reg-io-width for such platforms.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-26 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 12:05 [PATCH v4 0/2] serial: pl011: Add xilinx uart Shubhrajyoti Datta
2022-08-26 12:05 ` [PATCH v4 1/2] dt-bindings: serial: pl011: Add a reg-io-width parameter Shubhrajyoti Datta
2022-08-26 17:38   ` Krzysztof Kozlowski
2022-08-26 12:05 ` [PATCH v4 2/2] serial: pl011: Add reg-io-width parameters Shubhrajyoti Datta
2022-08-26 14:52   ` Ilpo Järvinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.