diff mbox series

[7/9] serial: lpuart: add new compatible fsl,ls1028a-lpuart

Message ID 20210831154028.1649864-8-michael@walle.cc
State Superseded
Delegated to: Priyanka Jain
Headers show
Series arm: dts: ls1028a: sync device tree with linux | expand

Commit Message

Michael Walle Aug. 31, 2021, 3:40 p.m. UTC
The offical ls1028a binding of the driver uses the following as
compatibles:
  compatible = "fsl,ls1028a-lpuart";

Add the missing compatible to the driver and update the device tree.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/dts/fsl-ls1028a.dtsi  | 12 ++++++------
 drivers/serial/serial_lpuart.c |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

Comments

Vladimir Oltean Aug. 31, 2021, 6:28 p.m. UTC | #1
On Tue, Aug 31, 2021 at 05:40:26PM +0200, Michael Walle wrote:
> The offical ls1028a binding of the driver uses the following as
> compatibles:
>   compatible = "fsl,ls1028a-lpuart";

s/offical/official/

> diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
> index 2b473d70f6..3c9a69598a 100644
> --- a/drivers/serial/serial_lpuart.c
> +++ b/drivers/serial/serial_lpuart.c
> @@ -553,6 +553,8 @@ static const struct dm_serial_ops lpuart_serial_ops = {
>  static const struct udevice_id lpuart_serial_ids[] = {
>  	{ .compatible = "fsl,ls1021a-lpuart", .data =
>  		LPUART_FLAG_REGMAP_32BIT_REG | LPUART_FLAG_REGMAP_ENDIAN_BIG },
> +	{ .compatible = "fsl,ls1028a-lpuart",
> +		.data = LPUART_FLAG_REGMAP_32BIT_REG },

The LS1028A LPUART is identical to LS1021A except for endianness, true.
So the U-Boot driver uses the "little-endian" OF property to clear the
LPUART_FLAG_REGMAP_ENDIAN_BIG flag from LS1021A, while the Linux driver
selects endianness based on compatible string.

>  	{ .compatible = "fsl,imx7ulp-lpuart",
>  		.data = LPUART_FLAG_REGMAP_32BIT_REG },
>  	{ .compatible = "fsl,vf610-lpuart"},
> -- 
> 2.30.2

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Michael Walle Aug. 31, 2021, 9:37 p.m. UTC | #2
Am 2021-08-31 20:28, schrieb Vladimir Oltean:
> On Tue, Aug 31, 2021 at 05:40:26PM +0200, Michael Walle wrote:
>> The offical ls1028a binding of the driver uses the following as
>> compatibles:
>>   compatible = "fsl,ls1028a-lpuart";
> 
> s/offical/official/
> 
>> diff --git a/drivers/serial/serial_lpuart.c 
>> b/drivers/serial/serial_lpuart.c
>> index 2b473d70f6..3c9a69598a 100644
>> --- a/drivers/serial/serial_lpuart.c
>> +++ b/drivers/serial/serial_lpuart.c
>> @@ -553,6 +553,8 @@ static const struct dm_serial_ops 
>> lpuart_serial_ops = {
>>  static const struct udevice_id lpuart_serial_ids[] = {
>>  	{ .compatible = "fsl,ls1021a-lpuart", .data =
>>  		LPUART_FLAG_REGMAP_32BIT_REG | LPUART_FLAG_REGMAP_ENDIAN_BIG },
>> +	{ .compatible = "fsl,ls1028a-lpuart",
>> +		.data = LPUART_FLAG_REGMAP_32BIT_REG },
> 
> The LS1028A LPUART is identical to LS1021A except for endianness, true.
> So the U-Boot driver uses the "little-endian" OF property to clear the
> LPUART_FLAG_REGMAP_ENDIAN_BIG flag from LS1021A, while the Linux driver
> selects endianness based on compatible string.

Yeah, and it seems that parsing of the little-endian flag was introduced
just for the ls1028a. If that is true, one could remove that, but I 
wasn't
sure, so I just left it there.

>>  	{ .compatible = "fsl,imx7ulp-lpuart",
>>  		.data = LPUART_FLAG_REGMAP_32BIT_REG },
>>  	{ .compatible = "fsl,vf610-lpuart"},
>> --
>> 2.30.2
> 
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Vladimir Oltean Aug. 31, 2021, 10:01 p.m. UTC | #3
On Tue, Aug 31, 2021 at 11:37:19PM +0200, Michael Walle wrote:
> Yeah, and it seems that parsing of the little-endian flag was introduced
> just for the ls1028a. If that is true, one could remove that, but I wasn't
> sure, so I just left it there.

Leave NXP something to do too ;)
diff mbox series

Patch

diff --git a/arch/arm/dts/fsl-ls1028a.dtsi b/arch/arm/dts/fsl-ls1028a.dtsi
index 4186df17e1..69850fe7f2 100644
--- a/arch/arm/dts/fsl-ls1028a.dtsi
+++ b/arch/arm/dts/fsl-ls1028a.dtsi
@@ -305,7 +305,7 @@ 
 		};
 
 		lpuart0: serial@2260000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x2260000 0x0 0x1000>;
 			interrupts = <0 232 0x4>;
 			clocks = <&sysclk>;
@@ -315,7 +315,7 @@ 
 		};
 
 		lpuart1: serial@2270000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x2270000 0x0 0x1000>;
 			interrupts = <0 233 0x4>;
 			clocks = <&sysclk>;
@@ -325,7 +325,7 @@ 
 		};
 
 		lpuart2: serial@2280000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x2280000 0x0 0x1000>;
 			interrupts = <0 234 0x4>;
 			clocks = <&sysclk>;
@@ -335,7 +335,7 @@ 
 		};
 
 		lpuart3: serial@2290000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x2290000 0x0 0x1000>;
 			interrupts = <0 235 0x4>;
 			clocks = <&sysclk>;
@@ -345,7 +345,7 @@ 
 		};
 
 		lpuart4: serial@22a0000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x22a0000 0x0 0x1000>;
 			interrupts = <0 236 0x4>;
 			clocks = <&sysclk>;
@@ -355,7 +355,7 @@ 
 		};
 
 		lpuart5: serial@22b0000 {
-			compatible = "fsl,ls1021a-lpuart";
+			compatible = "fsl,ls1028a-lpuart";
 			reg = <0x0 0x22b0000 0x0 0x1000>;
 			interrupts = <0 237 0x4>;
 			clocks = <&sysclk>;
diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index 2b473d70f6..3c9a69598a 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -553,6 +553,8 @@  static const struct dm_serial_ops lpuart_serial_ops = {
 static const struct udevice_id lpuart_serial_ids[] = {
 	{ .compatible = "fsl,ls1021a-lpuart", .data =
 		LPUART_FLAG_REGMAP_32BIT_REG | LPUART_FLAG_REGMAP_ENDIAN_BIG },
+	{ .compatible = "fsl,ls1028a-lpuart",
+		.data = LPUART_FLAG_REGMAP_32BIT_REG },
 	{ .compatible = "fsl,imx7ulp-lpuart",
 		.data = LPUART_FLAG_REGMAP_32BIT_REG },
 	{ .compatible = "fsl,vf610-lpuart"},