* [PATCH v2 1/7] tty: serial: meson: use dev_err_probe
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 6:59 ` neil.armstrong
2023-07-05 18:18 ` [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver Dmitry Rokosov
` (5 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
Use dev_err_probe() helper for error checking and standard logging.
It makes the driver's probe() function a little bit shorter.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
drivers/tty/serial/meson_uart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 2501db5a7aaf..bca54f3d92a1 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -726,8 +726,8 @@ static int meson_uart_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
if (meson_ports[pdev->id]) {
- dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
- return -EBUSY;
+ return dev_err_probe(&pdev->dev, -EBUSY,
+ "port %d already allocated\n", pdev->id);
}
port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL);
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 1/7] tty: serial: meson: use dev_err_probe
2023-07-05 18:18 ` [PATCH v2 1/7] tty: serial: meson: use dev_err_probe Dmitry Rokosov
@ 2023-07-06 6:59 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 6:59 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> Use dev_err_probe() helper for error checking and standard logging.
> It makes the driver's probe() function a little bit shorter.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> drivers/tty/serial/meson_uart.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 2501db5a7aaf..bca54f3d92a1 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -726,8 +726,8 @@ static int meson_uart_probe(struct platform_device *pdev)
> of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
>
> if (meson_ports[pdev->id]) {
> - dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
> - return -EBUSY;
> + return dev_err_probe(&pdev->dev, -EBUSY,
> + "port %d already allocated\n", pdev->id);
> }
>
> port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL);
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
2023-07-05 18:18 ` [PATCH v2 1/7] tty: serial: meson: use dev_err_probe Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 6:59 ` neil.armstrong
2023-07-05 18:18 ` [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs Dmitry Rokosov
` (4 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
Actually, the meson_uart module is already a platform_driver, but it is
currently registered manually and the uart core registration is run
outside the probe() scope, which results in some restrictions. For
instance, it is not possible to communicate with the OF subsystem
because it requires an initialized device object.
To address this issue, apply module_platform_driver() instead of direct
module init/exit routines. Additionally, move uart_register_driver() to
the driver probe(), and destroy manual console registration because it's
already run in the uart_register_driver() flow.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
drivers/tty/serial/meson_uart.c | 51 ++++++++++-----------------------
1 file changed, 15 insertions(+), 36 deletions(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index bca54f3d92a1..dcf994a11a21 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -621,12 +621,6 @@ static struct console meson_serial_console = {
.data = &meson_uart_driver,
};
-static int __init meson_serial_console_init(void)
-{
- register_console(&meson_serial_console);
- return 0;
-}
-
static void meson_serial_early_console_write(struct console *co,
const char *s,
u_int count)
@@ -652,9 +646,6 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
#define MESON_SERIAL_CONSOLE (&meson_serial_console)
#else
-static int __init meson_serial_console_init(void) {
- return 0;
-}
#define MESON_SERIAL_CONSOLE NULL
#endif
@@ -738,6 +729,13 @@ static int meson_uart_probe(struct platform_device *pdev)
if (ret)
return ret;
+ if (!meson_uart_driver.state) {
+ ret = uart_register_driver(&meson_uart_driver);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "can't register uart driver\n");
+ }
+
port->iotype = UPIO_MEM;
port->mapbase = res_mem->start;
port->mapsize = resource_size(res_mem);
@@ -776,6 +774,13 @@ static int meson_uart_remove(struct platform_device *pdev)
uart_remove_one_port(&meson_uart_driver, port);
meson_ports[pdev->id] = NULL;
+ for (int id = 0; id < AML_UART_PORT_NUM; id++)
+ if (meson_ports[id])
+ return 0;
+
+ /* No more available uart ports, unregister uart driver */
+ uart_unregister_driver(&meson_uart_driver);
+
return 0;
}
@@ -809,33 +814,7 @@ static struct platform_driver meson_uart_platform_driver = {
},
};
-static int __init meson_uart_init(void)
-{
- int ret;
-
- ret = meson_serial_console_init();
- if (ret)
- return ret;
-
- ret = uart_register_driver(&meson_uart_driver);
- if (ret)
- return ret;
-
- ret = platform_driver_register(&meson_uart_platform_driver);
- if (ret)
- uart_unregister_driver(&meson_uart_driver);
-
- return ret;
-}
-
-static void __exit meson_uart_exit(void)
-{
- platform_driver_unregister(&meson_uart_platform_driver);
- uart_unregister_driver(&meson_uart_driver);
-}
-
-module_init(meson_uart_init);
-module_exit(meson_uart_exit);
+module_platform_driver(meson_uart_platform_driver);
MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
MODULE_DESCRIPTION("Amlogic Meson serial port driver");
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver
2023-07-05 18:18 ` [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver Dmitry Rokosov
@ 2023-07-06 6:59 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 6:59 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> Actually, the meson_uart module is already a platform_driver, but it is
> currently registered manually and the uart core registration is run
> outside the probe() scope, which results in some restrictions. For
> instance, it is not possible to communicate with the OF subsystem
> because it requires an initialized device object.
>
> To address this issue, apply module_platform_driver() instead of direct
> module init/exit routines. Additionally, move uart_register_driver() to
> the driver probe(), and destroy manual console registration because it's
> already run in the uart_register_driver() flow.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> drivers/tty/serial/meson_uart.c | 51 ++++++++++-----------------------
> 1 file changed, 15 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index bca54f3d92a1..dcf994a11a21 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -621,12 +621,6 @@ static struct console meson_serial_console = {
> .data = &meson_uart_driver,
> };
>
> -static int __init meson_serial_console_init(void)
> -{
> - register_console(&meson_serial_console);
> - return 0;
> -}
> -
> static void meson_serial_early_console_write(struct console *co,
> const char *s,
> u_int count)
> @@ -652,9 +646,6 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
>
> #define MESON_SERIAL_CONSOLE (&meson_serial_console)
> #else
> -static int __init meson_serial_console_init(void) {
> - return 0;
> -}
> #define MESON_SERIAL_CONSOLE NULL
> #endif
>
> @@ -738,6 +729,13 @@ static int meson_uart_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> + if (!meson_uart_driver.state) {
> + ret = uart_register_driver(&meson_uart_driver);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "can't register uart driver\n");
> + }
> +
> port->iotype = UPIO_MEM;
> port->mapbase = res_mem->start;
> port->mapsize = resource_size(res_mem);
> @@ -776,6 +774,13 @@ static int meson_uart_remove(struct platform_device *pdev)
> uart_remove_one_port(&meson_uart_driver, port);
> meson_ports[pdev->id] = NULL;
>
> + for (int id = 0; id < AML_UART_PORT_NUM; id++)
> + if (meson_ports[id])
> + return 0;
> +
> + /* No more available uart ports, unregister uart driver */
> + uart_unregister_driver(&meson_uart_driver);
> +
> return 0;
> }
>
> @@ -809,33 +814,7 @@ static struct platform_driver meson_uart_platform_driver = {
> },
> };
>
> -static int __init meson_uart_init(void)
> -{
> - int ret;
> -
> - ret = meson_serial_console_init();
> - if (ret)
> - return ret;
> -
> - ret = uart_register_driver(&meson_uart_driver);
> - if (ret)
> - return ret;
> -
> - ret = platform_driver_register(&meson_uart_platform_driver);
> - if (ret)
> - uart_unregister_driver(&meson_uart_driver);
> -
> - return ret;
> -}
> -
> -static void __exit meson_uart_exit(void)
> -{
> - platform_driver_unregister(&meson_uart_platform_driver);
> - uart_unregister_driver(&meson_uart_driver);
> -}
> -
> -module_init(meson_uart_init);
> -module_exit(meson_uart_exit);
> +module_platform_driver(meson_uart_platform_driver);
>
> MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
> MODULE_DESCRIPTION("Amlogic Meson serial port driver");
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
2023-07-05 18:18 ` [PATCH v2 1/7] tty: serial: meson: use dev_err_probe Dmitry Rokosov
2023-07-05 18:18 ` [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 7:08 ` neil.armstrong
2023-07-05 18:18 ` [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family Dmitry Rokosov
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
It is worth noting that the devname ttyS is a widely recognized tty name
and is commonly used by many uart device drivers. Given the established
usage and compatibility concerns, it may not be feasible to change the
devname for older SoCs. However, for new definitions, it is acceptable
and even recommended to use a new devname to help ensure clarity and
avoid any potential conflicts on lower or upper software levels.
For more information please refer to IRC discussion at [1].
Links:
[1]: https://libera.irclog.whitequark.org/linux-amlogic/2023-07-03
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
drivers/tty/serial/meson_uart.c | 82 ++++++++++++++++++++++-----------
1 file changed, 56 insertions(+), 26 deletions(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index dcf994a11a21..ad0748a10db7 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -72,16 +72,22 @@
#define AML_UART_PORT_NUM 12
#define AML_UART_PORT_OFFSET 6
-#define AML_UART_DEV_NAME "ttyAML"
#define AML_UART_POLL_USEC 5
#define AML_UART_TIMEOUT_USEC 10000
-static struct uart_driver meson_uart_driver;
+#define MESON_UART_DRIVER(_devname) meson_uart_driver_##_devname
+
+#define MESON_UART_DRIVER_DECLARE(_devname) \
+ static struct uart_driver MESON_UART_DRIVER(_devname)
+
+MESON_UART_DRIVER_DECLARE(ttyAML);
+MESON_UART_DRIVER_DECLARE(ttyS);
static struct uart_port *meson_ports[AML_UART_PORT_NUM];
struct meson_uart_data {
+ struct uart_driver *uart_driver;
bool has_xtal_div2;
};
@@ -611,15 +617,21 @@ static int meson_serial_console_setup(struct console *co, char *options)
return uart_set_options(port, co, baud, parity, bits, flow);
}
-static struct console meson_serial_console = {
- .name = AML_UART_DEV_NAME,
- .write = meson_serial_console_write,
- .device = uart_console_device,
- .setup = meson_serial_console_setup,
- .flags = CON_PRINTBUFFER,
- .index = -1,
- .data = &meson_uart_driver,
-};
+#define MESON_SERIAL_CONSOLE(_devname) meson_serial_console_##_devname
+
+#define MESON_SERIAL_CONSOLE_DEFINE(_devname) \
+ static struct console MESON_SERIAL_CONSOLE(_devname) = { \
+ .name = __stringify(_devname), \
+ .write = meson_serial_console_write, \
+ .device = uart_console_device, \
+ .setup = meson_serial_console_setup, \
+ .flags = CON_PRINTBUFFER, \
+ .index = -1, \
+ .data = &MESON_UART_DRIVER(_devname), \
+ }
+
+MESON_SERIAL_CONSOLE_DEFINE(ttyAML);
+MESON_SERIAL_CONSOLE_DEFINE(ttyS);
static void meson_serial_early_console_write(struct console *co,
const char *s,
@@ -644,18 +656,22 @@ meson_serial_early_console_setup(struct earlycon_device *device, const char *opt
OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
meson_serial_early_console_setup);
-#define MESON_SERIAL_CONSOLE (&meson_serial_console)
+#define MESON_SERIAL_CONSOLE_PTR(_devname) (&MESON_SERIAL_CONSOLE(_devname))
#else
-#define MESON_SERIAL_CONSOLE NULL
+#define MESON_SERIAL_CONSOLE_PTR(_devname) (NULL)
#endif
-static struct uart_driver meson_uart_driver = {
- .owner = THIS_MODULE,
- .driver_name = "meson_uart",
- .dev_name = AML_UART_DEV_NAME,
- .nr = AML_UART_PORT_NUM,
- .cons = MESON_SERIAL_CONSOLE,
-};
+#define MESON_UART_DRIVER_DEFINE(_devname) \
+ static struct uart_driver MESON_UART_DRIVER(_devname) = { \
+ .owner = THIS_MODULE, \
+ .driver_name = "meson_uart", \
+ .dev_name = __stringify(_devname), \
+ .nr = AML_UART_PORT_NUM, \
+ .cons = MESON_SERIAL_CONSOLE_PTR(_devname), \
+ }
+
+MESON_UART_DRIVER_DEFINE(ttyAML);
+MESON_UART_DRIVER_DEFINE(ttyS);
static int meson_uart_probe_clocks(struct platform_device *pdev,
struct uart_port *port)
@@ -681,8 +697,16 @@ static int meson_uart_probe_clocks(struct platform_device *pdev,
return 0;
}
+static struct uart_driver *meson_uart_current(const struct meson_uart_data *pd)
+{
+ return (pd && pd->uart_driver) ?
+ pd->uart_driver : &MESON_UART_DRIVER(ttyAML);
+}
+
static int meson_uart_probe(struct platform_device *pdev)
{
+ const struct meson_uart_data *priv_data;
+ struct uart_driver *uart_driver;
struct resource *res_mem;
struct uart_port *port;
u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
@@ -729,8 +753,12 @@ static int meson_uart_probe(struct platform_device *pdev)
if (ret)
return ret;
- if (!meson_uart_driver.state) {
- ret = uart_register_driver(&meson_uart_driver);
+ priv_data = device_get_match_data(&pdev->dev);
+
+ uart_driver = meson_uart_current(priv_data);
+
+ if (!uart_driver->state) {
+ ret = uart_register_driver(uart_driver);
if (ret)
return dev_err_probe(&pdev->dev, ret,
"can't register uart driver\n");
@@ -748,7 +776,7 @@ static int meson_uart_probe(struct platform_device *pdev)
port->x_char = 0;
port->ops = &meson_uart_ops;
port->fifosize = fifosize;
- port->private_data = (void *)device_get_match_data(&pdev->dev);
+ port->private_data = (void *)priv_data;
meson_ports[pdev->id] = port;
platform_set_drvdata(pdev, port);
@@ -759,7 +787,7 @@ static int meson_uart_probe(struct platform_device *pdev)
meson_uart_release_port(port);
}
- ret = uart_add_one_port(&meson_uart_driver, port);
+ ret = uart_add_one_port(uart_driver, port);
if (ret)
meson_ports[pdev->id] = NULL;
@@ -768,10 +796,12 @@ static int meson_uart_probe(struct platform_device *pdev)
static int meson_uart_remove(struct platform_device *pdev)
{
+ struct uart_driver *uart_driver;
struct uart_port *port;
port = platform_get_drvdata(pdev);
- uart_remove_one_port(&meson_uart_driver, port);
+ uart_driver = meson_uart_current(port->private_data);
+ uart_remove_one_port(uart_driver, port);
meson_ports[pdev->id] = NULL;
for (int id = 0; id < AML_UART_PORT_NUM; id++)
@@ -779,7 +809,7 @@ static int meson_uart_remove(struct platform_device *pdev)
return 0;
/* No more available uart ports, unregister uart driver */
- uart_unregister_driver(&meson_uart_driver);
+ uart_unregister_driver(uart_driver);
return 0;
}
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs
2023-07-05 18:18 ` [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs Dmitry Rokosov
@ 2023-07-06 7:08 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 7:08 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
Hi,
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> It is worth noting that the devname ttyS is a widely recognized tty name
> and is commonly used by many uart device drivers. Given the established
> usage and compatibility concerns, it may not be feasible to change the
> devname for older SoCs. However, for new definitions, it is acceptable
> and even recommended to use a new devname to help ensure clarity and
> avoid any potential conflicts on lower or upper software levels.
>
> For more information please refer to IRC discussion at [1].
>
> Links:
> [1]: https://libera.irclog.whitequark.org/linux-amlogic/2023-07-03
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> drivers/tty/serial/meson_uart.c | 82 ++++++++++++++++++++++-----------
> 1 file changed, 56 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index dcf994a11a21..ad0748a10db7 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -72,16 +72,22 @@
>
> #define AML_UART_PORT_NUM 12
> #define AML_UART_PORT_OFFSET 6
> -#define AML_UART_DEV_NAME "ttyAML"
>
> #define AML_UART_POLL_USEC 5
> #define AML_UART_TIMEOUT_USEC 10000
>
> -static struct uart_driver meson_uart_driver;
> +#define MESON_UART_DRIVER(_devname) meson_uart_driver_##_devname
> +
> +#define MESON_UART_DRIVER_DECLARE(_devname) \
> + static struct uart_driver MESON_UART_DRIVER(_devname)
> +
> +MESON_UART_DRIVER_DECLARE(ttyAML);
> +MESON_UART_DRIVER_DECLARE(ttyS);
Not sure those macros are useful:
MESON_UART_DRIVER_DECLARE(ttyAML)
vs
static struct uart_driver meson_uart_driver_ttyAML
I prefer the second...
>
> static struct uart_port *meson_ports[AML_UART_PORT_NUM];
>
> struct meson_uart_data {
> + struct uart_driver *uart_driver;
> bool has_xtal_div2;
> };
>
> @@ -611,15 +617,21 @@ static int meson_serial_console_setup(struct console *co, char *options)
> return uart_set_options(port, co, baud, parity, bits, flow);
> }
I think the uart_driver meson_uart_driver_ttyXXX should be declared here instead or..
>
> -static struct console meson_serial_console = {
> - .name = AML_UART_DEV_NAME,
> - .write = meson_serial_console_write,
> - .device = uart_console_device,
> - .setup = meson_serial_console_setup,
> - .flags = CON_PRINTBUFFER,
> - .index = -1,
> - .data = &meson_uart_driver,
> -};
> +#define MESON_SERIAL_CONSOLE(_devname) meson_serial_console_##_devname
> +
> +#define MESON_SERIAL_CONSOLE_DEFINE(_devname) \
> + static struct console MESON_SERIAL_CONSOLE(_devname) = { \
> + .name = __stringify(_devname), \
> + .write = meson_serial_console_write, \
> + .device = uart_console_device, \
> + .setup = meson_serial_console_setup, \
> + .flags = CON_PRINTBUFFER, \
> + .index = -1, \
> + .data = &MESON_UART_DRIVER(_devname), \
> + }
... you could even declare the meson_uart_driver_ttyXXX in this macro instead.
> +
> +MESON_SERIAL_CONSOLE_DEFINE(ttyAML);
> +MESON_SERIAL_CONSOLE_DEFINE(ttyS);
>
> static void meson_serial_early_console_write(struct console *co,
> const char *s,
> @@ -644,18 +656,22 @@ meson_serial_early_console_setup(struct earlycon_device *device, const char *opt
> OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
> meson_serial_early_console_setup);
>
> -#define MESON_SERIAL_CONSOLE (&meson_serial_console)
> +#define MESON_SERIAL_CONSOLE_PTR(_devname) (&MESON_SERIAL_CONSOLE(_devname))
> #else
> -#define MESON_SERIAL_CONSOLE NULL
> +#define MESON_SERIAL_CONSOLE_PTR(_devname) (NULL)
> #endif
>
> -static struct uart_driver meson_uart_driver = {
> - .owner = THIS_MODULE,
> - .driver_name = "meson_uart",
> - .dev_name = AML_UART_DEV_NAME,
> - .nr = AML_UART_PORT_NUM,
> - .cons = MESON_SERIAL_CONSOLE,
> -};
> +#define MESON_UART_DRIVER_DEFINE(_devname) \
> + static struct uart_driver MESON_UART_DRIVER(_devname) = { \
> + .owner = THIS_MODULE, \
> + .driver_name = "meson_uart", \
> + .dev_name = __stringify(_devname), \
> + .nr = AML_UART_PORT_NUM, \
> + .cons = MESON_SERIAL_CONSOLE_PTR(_devname), \
> + }
> +
> +MESON_UART_DRIVER_DEFINE(ttyAML);
> +MESON_UART_DRIVER_DEFINE(ttyS);
Those macros are fine, but drop the MESON_UART_DRIVER & MESON_SERIAL_CONSOLE macros and drop the _DEFINE in those macros.
>
> static int meson_uart_probe_clocks(struct platform_device *pdev,
> struct uart_port *port)
> @@ -681,8 +697,16 @@ static int meson_uart_probe_clocks(struct platform_device *pdev,
> return 0;
> }
>
> +static struct uart_driver *meson_uart_current(const struct meson_uart_data *pd)
> +{
> + return (pd && pd->uart_driver) ?
> + pd->uart_driver : &MESON_UART_DRIVER(ttyAML);
I'll definitely prefer if you use the real variable name everywhere and in the 2 following patches
> +}
> +
> static int meson_uart_probe(struct platform_device *pdev)
> {
> + const struct meson_uart_data *priv_data;
> + struct uart_driver *uart_driver;
> struct resource *res_mem;
> struct uart_port *port;
> u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
> @@ -729,8 +753,12 @@ static int meson_uart_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - if (!meson_uart_driver.state) {
> - ret = uart_register_driver(&meson_uart_driver);
> + priv_data = device_get_match_data(&pdev->dev);
> +
> + uart_driver = meson_uart_current(priv_data);
> +
> + if (!uart_driver->state) {
> + ret = uart_register_driver(uart_driver);
> if (ret)
> return dev_err_probe(&pdev->dev, ret,
> "can't register uart driver\n");
> @@ -748,7 +776,7 @@ static int meson_uart_probe(struct platform_device *pdev)
> port->x_char = 0;
> port->ops = &meson_uart_ops;
> port->fifosize = fifosize;
> - port->private_data = (void *)device_get_match_data(&pdev->dev);
> + port->private_data = (void *)priv_data;
>
> meson_ports[pdev->id] = port;
> platform_set_drvdata(pdev, port);
> @@ -759,7 +787,7 @@ static int meson_uart_probe(struct platform_device *pdev)
> meson_uart_release_port(port);
> }
>
> - ret = uart_add_one_port(&meson_uart_driver, port);
> + ret = uart_add_one_port(uart_driver, port);
> if (ret)
> meson_ports[pdev->id] = NULL;
>
> @@ -768,10 +796,12 @@ static int meson_uart_probe(struct platform_device *pdev)
>
> static int meson_uart_remove(struct platform_device *pdev)
> {
> + struct uart_driver *uart_driver;
> struct uart_port *port;
>
> port = platform_get_drvdata(pdev);
> - uart_remove_one_port(&meson_uart_driver, port);
> + uart_driver = meson_uart_current(port->private_data);
> + uart_remove_one_port(uart_driver, port);
> meson_ports[pdev->id] = NULL;
>
> for (int id = 0; id < AML_UART_PORT_NUM; id++)
> @@ -779,7 +809,7 @@ static int meson_uart_remove(struct platform_device *pdev)
> return 0;
>
> /* No more available uart ports, unregister uart driver */
> - uart_unregister_driver(&meson_uart_driver);
> + uart_unregister_driver(uart_driver);
>
> return 0;
> }
Anyway this looks much better :-)
Thanks,
Neil
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
` (2 preceding siblings ...)
2023-07-05 18:18 ` [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 7:09 ` neil.armstrong
2023-07-05 18:18 ` [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 " Dmitry Rokosov
` (2 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
In order to use the correct devname value for the S4 SoC family, it
is imperative that we implement separate uart_data. Unlike the legacy
g12a architecture, the S4 architecture should employ the use of 'ttyS'
devname.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
drivers/tty/serial/meson_uart.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index ad0748a10db7..6a63184b8091 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -818,6 +818,11 @@ static struct meson_uart_data meson_g12a_uart_data = {
.has_xtal_div2 = true,
};
+static struct meson_uart_data meson_s4_uart_data = {
+ .uart_driver = &MESON_UART_DRIVER(ttyS),
+ .has_xtal_div2 = true,
+};
+
static const struct of_device_id meson_uart_dt_match[] = {
{ .compatible = "amlogic,meson6-uart" },
{ .compatible = "amlogic,meson8-uart" },
@@ -829,7 +834,7 @@ static const struct of_device_id meson_uart_dt_match[] = {
},
{
.compatible = "amlogic,meson-s4-uart",
- .data = (void *)&meson_g12a_uart_data,
+ .data = (void *)&meson_s4_uart_data,
},
{ /* sentinel */ },
};
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family
2023-07-05 18:18 ` [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family Dmitry Rokosov
@ 2023-07-06 7:09 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 7:09 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> In order to use the correct devname value for the S4 SoC family, it
> is imperative that we implement separate uart_data. Unlike the legacy
> g12a architecture, the S4 architecture should employ the use of 'ttyS'
> devname.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> drivers/tty/serial/meson_uart.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index ad0748a10db7..6a63184b8091 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -818,6 +818,11 @@ static struct meson_uart_data meson_g12a_uart_data = {
> .has_xtal_div2 = true,
> };
>
> +static struct meson_uart_data meson_s4_uart_data = {
> + .uart_driver = &MESON_UART_DRIVER(ttyS),
> + .has_xtal_div2 = true,
> +};
> +
> static const struct of_device_id meson_uart_dt_match[] = {
> { .compatible = "amlogic,meson6-uart" },
> { .compatible = "amlogic,meson8-uart" },
> @@ -829,7 +834,7 @@ static const struct of_device_id meson_uart_dt_match[] = {
> },
> {
> .compatible = "amlogic,meson-s4-uart",
> - .data = (void *)&meson_g12a_uart_data,
> + .data = (void *)&meson_s4_uart_data,
> },
> { /* sentinel */ },
> };
With the real struct name:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 SoC family
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
` (3 preceding siblings ...)
2023-07-05 18:18 ` [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 7:09 ` neil.armstrong
2023-07-05 18:18 ` [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1 Dmitry Rokosov
2023-07-05 18:18 ` [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string Dmitry Rokosov
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
Implement separate uart_data to ensure proper devname value for the A1
SoC family. Use 'ttyS' devname, as required by the A1 architecture,
instead of the legacy gx architecture.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
drivers/tty/serial/meson_uart.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 6a63184b8091..84cf10b0ca5c 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -818,6 +818,11 @@ static struct meson_uart_data meson_g12a_uart_data = {
.has_xtal_div2 = true,
};
+static struct meson_uart_data meson_a1_uart_data = {
+ .uart_driver = &MESON_UART_DRIVER(ttyS),
+ .has_xtal_div2 = false,
+};
+
static struct meson_uart_data meson_s4_uart_data = {
.uart_driver = &MESON_UART_DRIVER(ttyS),
.has_xtal_div2 = true,
@@ -836,6 +841,10 @@ static const struct of_device_id meson_uart_dt_match[] = {
.compatible = "amlogic,meson-s4-uart",
.data = (void *)&meson_s4_uart_data,
},
+ {
+ .compatible = "amlogic,meson-a1-uart",
+ .data = (void *)&meson_a1_uart_data,
+ },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, meson_uart_dt_match);
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 SoC family
2023-07-05 18:18 ` [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 " Dmitry Rokosov
@ 2023-07-06 7:09 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 7:09 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> Implement separate uart_data to ensure proper devname value for the A1
> SoC family. Use 'ttyS' devname, as required by the A1 architecture,
> instead of the legacy gx architecture.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> drivers/tty/serial/meson_uart.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 6a63184b8091..84cf10b0ca5c 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -818,6 +818,11 @@ static struct meson_uart_data meson_g12a_uart_data = {
> .has_xtal_div2 = true,
> };
>
> +static struct meson_uart_data meson_a1_uart_data = {
> + .uart_driver = &MESON_UART_DRIVER(ttyS),
> + .has_xtal_div2 = false,
> +};
> +
> static struct meson_uart_data meson_s4_uart_data = {
> .uart_driver = &MESON_UART_DRIVER(ttyS),
> .has_xtal_div2 = true,
> @@ -836,6 +841,10 @@ static const struct of_device_id meson_uart_dt_match[] = {
> .compatible = "amlogic,meson-s4-uart",
> .data = (void *)&meson_s4_uart_data,
> },
> + {
> + .compatible = "amlogic,meson-a1-uart",
> + .data = (void *)&meson_a1_uart_data,
> + },
> { /* sentinel */ },
> };
> MODULE_DEVICE_TABLE(of, meson_uart_dt_match);
With the real struct name:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
` (4 preceding siblings ...)
2023-07-05 18:18 ` [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 " Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-05 21:10 ` Conor Dooley
2023-07-06 17:57 ` Rob Herring
2023-07-05 18:18 ` [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string Dmitry Rokosov
6 siblings, 2 replies; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
Introduce meson uart serial bindings for A1 SoC family.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
.../devicetree/bindings/serial/amlogic,meson-uart.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
index 01ec45b3b406..f1ae8c4934d9 100644
--- a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
+++ b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
@@ -33,6 +33,7 @@ properties:
- amlogic,meson8b-uart
- amlogic,meson-gx-uart
- amlogic,meson-s4-uart
+ - amlogic,meson-a1-uart
- const: amlogic,meson-ao-uart
- description: Always-on power domain UART controller on G12A SoCs
items:
@@ -46,6 +47,7 @@ properties:
- amlogic,meson8b-uart
- amlogic,meson-gx-uart
- amlogic,meson-s4-uart
+ - amlogic,meson-a1-uart
- description: Everything-Else power domain UART controller on G12A SoCs
items:
- const: amlogic,meson-g12a-uart
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1
2023-07-05 18:18 ` [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1 Dmitry Rokosov
@ 2023-07-05 21:10 ` Conor Dooley
2023-07-06 17:57 ` Rob Herring
1 sibling, 0 replies; 16+ messages in thread
From: Conor Dooley @ 2023-07-05 21:10 UTC (permalink / raw)
To: Dmitry Rokosov
Cc: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl, kelvin.zhang,
xianwei.zhao, kernel, rockosov, linux-amlogic, linux-serial,
devicetree, linux-kernel, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]
On Wed, Jul 05, 2023 at 09:18:32PM +0300, Dmitry Rokosov wrote:
> Introduce meson uart serial bindings for A1 SoC family.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Looks like there's a missing Ack here from Rob:
https://lore.kernel.org/all/168858360022.1592604.9922710628917242811.robh@kernel.org/
Cheers,
Conor.
> ---
> .../devicetree/bindings/serial/amlogic,meson-uart.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
> index 01ec45b3b406..f1ae8c4934d9 100644
> --- a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
> +++ b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml
> @@ -33,6 +33,7 @@ properties:
> - amlogic,meson8b-uart
> - amlogic,meson-gx-uart
> - amlogic,meson-s4-uart
> + - amlogic,meson-a1-uart
> - const: amlogic,meson-ao-uart
> - description: Always-on power domain UART controller on G12A SoCs
> items:
> @@ -46,6 +47,7 @@ properties:
> - amlogic,meson8b-uart
> - amlogic,meson-gx-uart
> - amlogic,meson-s4-uart
> + - amlogic,meson-a1-uart
> - description: Everything-Else power domain UART controller on G12A SoCs
> items:
> - const: amlogic,meson-g12a-uart
> --
> 2.36.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1
2023-07-05 18:18 ` [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1 Dmitry Rokosov
2023-07-05 21:10 ` Conor Dooley
@ 2023-07-06 17:57 ` Rob Herring
1 sibling, 0 replies; 16+ messages in thread
From: Rob Herring @ 2023-07-06 17:57 UTC (permalink / raw)
To: Dmitry Rokosov
Cc: jbrunet, martin.blumenstingl, linux-serial, linux-amlogic,
conor+dt, jirislaby, gregkh, krzysztof.kozlowski+dt, xianwei.zhao,
linux-kernel, neil.armstrong, robh+dt, linux-arm-kernel,
kelvin.zhang, rockosov, khilman, devicetree, kernel
On Wed, 05 Jul 2023 21:18:32 +0300, Dmitry Rokosov wrote:
> Introduce meson uart serial bindings for A1 SoC family.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> .../devicetree/bindings/serial/amlogic,meson-uart.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
Please add Acked-by/Reviewed-by tags when posting new versions. However,
there's no need to repost patches *only* to add the tags. The upstream
maintainer will do that for acks received on the version they apply.
If a tag was not added on purpose, please state why and what changed.
Missing tags:
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string
2023-07-05 18:18 [PATCH v2 0/7] tty: serial: meson: support ttyS devname Dmitry Rokosov
` (5 preceding siblings ...)
2023-07-05 18:18 ` [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1 Dmitry Rokosov
@ 2023-07-05 18:18 ` Dmitry Rokosov
2023-07-06 7:10 ` neil.armstrong
6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Rokosov @ 2023-07-05 18:18 UTC (permalink / raw)
To: gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel,
Dmitry Rokosov
In the current implementation, the meson-a1 configuration incorporates a
unique compatibility tag "amlogic,meson-a1-uart' within the meson-uart
driver due to its usage of the new console device name "ttyS".
Consequently, the previous compatibility tag designated for the
'amlogic,meson-gx-uart' configuration has become obsolete and is no
longer relevant to the current setup.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index c5567031ba12..6273b9c862b3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -344,7 +344,7 @@ mux {
};
uart_AO: serial@1c00 {
- compatible = "amlogic,meson-gx-uart",
+ compatible = "amlogic,meson-a1-uart",
"amlogic,meson-ao-uart";
reg = <0x0 0x1c00 0x0 0x18>;
interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;
@@ -354,7 +354,7 @@ uart_AO: serial@1c00 {
};
uart_AO_B: serial@2000 {
- compatible = "amlogic,meson-gx-uart",
+ compatible = "amlogic,meson-a1-uart",
"amlogic,meson-ao-uart";
reg = <0x0 0x2000 0x0 0x18>;
interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
--
2.36.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string
2023-07-05 18:18 ` [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string Dmitry Rokosov
@ 2023-07-06 7:10 ` neil.armstrong
0 siblings, 0 replies; 16+ messages in thread
From: neil.armstrong @ 2023-07-06 7:10 UTC (permalink / raw)
To: Dmitry Rokosov, gregkh, robh+dt, krzysztof.kozlowski+dt, conor+dt,
jbrunet, jirislaby, khilman, martin.blumenstingl
Cc: kelvin.zhang, xianwei.zhao, kernel, rockosov, linux-amlogic,
linux-serial, devicetree, linux-kernel, linux-arm-kernel
On 05/07/2023 20:18, Dmitry Rokosov wrote:
> In the current implementation, the meson-a1 configuration incorporates a
> unique compatibility tag "amlogic,meson-a1-uart' within the meson-uart
> driver due to its usage of the new console device name "ttyS".
> Consequently, the previous compatibility tag designated for the
> 'amlogic,meson-gx-uart' configuration has become obsolete and is no
> longer relevant to the current setup.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> index c5567031ba12..6273b9c862b3 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
> @@ -344,7 +344,7 @@ mux {
> };
>
> uart_AO: serial@1c00 {
> - compatible = "amlogic,meson-gx-uart",
> + compatible = "amlogic,meson-a1-uart",
> "amlogic,meson-ao-uart";
> reg = <0x0 0x1c00 0x0 0x18>;
> interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;
> @@ -354,7 +354,7 @@ uart_AO: serial@1c00 {
> };
>
> uart_AO_B: serial@2000 {
> - compatible = "amlogic,meson-gx-uart",
> + compatible = "amlogic,meson-a1-uart",
> "amlogic,meson-ao-uart";
> reg = <0x0 0x2000 0x0 0x18>;
> interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread