From patchwork Wed Jul 5 18:18:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 699542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 908EEEB64DD for ; Wed, 5 Jul 2023 18:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233568AbjGESVI (ORCPT ); Wed, 5 Jul 2023 14:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233479AbjGESUo (ORCPT ); Wed, 5 Jul 2023 14:20:44 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C415B2D58; Wed, 5 Jul 2023 11:19:51 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 8F56A100083; Wed, 5 Jul 2023 21:18:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 8F56A100083 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581123; bh=kyAhP+a5MdH8156TEXfJ8bCkKxhir6gem5fgbZ1Vf6U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=jKv+4qIu5x9/akaqn98sZ4oL/q7DPy88yXc+C+z6niQGXwfmfLWDQEvNx0+4bVoZP YVDJHEet2JJwNL5SKryfCn5Iy29+zEnmq8pDKR40LggEBlC4po1GfC94EJPMijWLq0 LHela+VJu4JotoLDNZ9tZfvUxd7WUthth/MEX6Qk+mK6ltMzpFax8phra282mo931G GRcp3QV726iXp/eVZLF1TiyyITNEbx4ZlaBkuHpwWfkU0ZSRt5ATlSNlLO5NN/Lkqz N/OvFTrE3rL8N7aW3iZfF44FvUOYMWw+uPrTMJXXJ36P9gDPApTpltncPBfRYNqgWc VxW25HgudoF+Q== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:43 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:40 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 1/7] tty: serial: meson: use dev_err_probe Date: Wed, 5 Jul 2023 21:18:27 +0300 Message-ID: <20230705181833.16137-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2; 100.64.160.123:7.1.2; sberdevices.ru:5.0.1,7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 Reviewed-by: Neil Armstrong --- 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); From patchwork Wed Jul 5 18:18:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 701445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A01AC001DF for ; Wed, 5 Jul 2023 18:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232992AbjGESdN (ORCPT ); Wed, 5 Jul 2023 14:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjGEScl (ORCPT ); Wed, 5 Jul 2023 14:32:41 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4D34130; Wed, 5 Jul 2023 11:32:39 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 61188120070; Wed, 5 Jul 2023 21:18:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 61188120070 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581124; bh=CgHHkQaUikVmJKKkBOsrWXHsYXYWRSpDbopAmvzkH28=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=m8bzVULfvgpsjAsLxm1m3ICpSlxMY9LsGIWbgVVbBmSm4Vif3k4o9+HvSuWL8D/pS lA7Jqxb50eyjtESVEU65kLxKkKjHj3EYnPv9toJ4XMghjtKwQa5KW2byuuPfEYk4iD /9k9nwHZ/IGnJaCbWmRUNw1F5KBdm2TvEyojO1AedN+S3hubWdGraLh16xuDP0XJ/k ZUCfLGPUbWpRlg8yN4vwVolYZfgUcxWJt7NO2GGwANFNtiIC3mzwjBt4BQd8XNLlve aUJdbmeFgFf+9fRZyxLOJh+BR6xBvtdJuU8SC1vVOxHbtn3AWir3e2f6qbs0Js+YaV dYH6gNxDXQoEQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:44 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:41 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 2/7] tty: serial: meson: redesign the module to platform_driver Date: Wed, 5 Jul 2023 21:18:28 +0300 Message-ID: <20230705181833.16137-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2; p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; sberdevices.ru:7.1.1,5.0.1; 127.0.0.199:7.1.2, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- 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 "); MODULE_DESCRIPTION("Amlogic Meson serial port driver"); From patchwork Wed Jul 5 18:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 701448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99B00C001DD for ; Wed, 5 Jul 2023 18:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233551AbjGESU4 (ORCPT ); Wed, 5 Jul 2023 14:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233529AbjGESUl (ORCPT ); Wed, 5 Jul 2023 14:20:41 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63743273E; Wed, 5 Jul 2023 11:19:47 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 55F19100088; Wed, 5 Jul 2023 21:18:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 55F19100088 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581125; bh=94uluQFPCIUYqZVpJLF+nD32K2aS5ta69HMKmaPydDo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=kwRXq9uCpVKdVoRPcxYiZQFiPbFFtob1yr+QdKoTnhg7KX9HzYLMiU9xUuax4hs7F 1m4DbYUvMdYB5L37/js9v+m2O+gU3kPTu+fSUz8EI3eJSTL4Lcn/TF/BaM7TQ10sEI x9mpxb9Gqybtw7Xr8swG0z8asZH4n4uMOvGR47hM2/PqcOhyYaiv9YvjVfIz6yWVgz HtMb5P29CM7LRjmchSfrtLVtipmNenQwGH85sLMMqJbhKd9OceKOzKCgggFxbZ+57w jMFgFTLJNEtjbB9RwSuWO9U/KDhGVwNBJhvIBiJpMQ79KFRk5FOgOF4TQ3HauCl1aU 9NHZobsRyig2Q== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:45 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:42 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 3/7] tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs Date: Wed, 5 Jul 2023 21:18:29 +0300 Message-ID: <20230705181833.16137-4-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2; 100.64.160.123:7.1.2; p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1; sberdevices.ru:5.0.1,7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; libera.irclog.whitequark.org:7.1.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2023/07/05 16:50:00 X-KSMG-LinksScanning: Clean, bases: 2023/07/05 16:49:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- 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; } From patchwork Wed Jul 5 18:18:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 701446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC58CC0015E for ; Wed, 5 Jul 2023 18:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbjGESdM (ORCPT ); Wed, 5 Jul 2023 14:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjGEScl (ORCPT ); Wed, 5 Jul 2023 14:32:41 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A472212A; Wed, 5 Jul 2023 11:32:39 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1B56B120071; Wed, 5 Jul 2023 21:18:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1B56B120071 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581126; bh=OllYyhrUJ08P7wMySV5F6J3h9lBYzlt948FsMshI588=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=RRT2fsKX+4aBYJHk8wqotSPoX9ajwXxJA/z27vHSCg28qI07e4Q3QdC+DOQsO05aN hJWNJT7JyoITSJ4W8TewnamvRVio5cwFyBtd18QTd78qZ5fZhUBEEPsYgKhtXQg98R OZw41A7gm/a+8r4ZRMiv9smll3uwcpCj1Ie7W53Iw2TT61UHCyXv3r/TwcUnxVFy1q 2Ph9Dk5ZSBXyn8IKTK+VrA0kzGN/DHf2PDOzX7PZgnh9ChFI3TM/XrqFDeXeteaBgG JRv1YXTsqR/howZcb0PHfXCf6xOMtL6UOi+pBpy7VFI7u/MnMz3eiCoUisXrcj0O8+ OxJznG/mrlH+w== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:45 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:43 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 4/7] tty: serial: meson: introduce separate uart_data for S4 SoC family Date: Wed, 5 Jul 2023 21:18:30 +0300 Message-ID: <20230705181833.16137-5-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2; p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; sberdevices.ru:7.1.1,5.0.1; 127.0.0.199:7.1.2, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- 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 */ }, }; From patchwork Wed Jul 5 18:18:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 699543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C851CEB64DA for ; Wed, 5 Jul 2023 18:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233525AbjGESUz (ORCPT ); Wed, 5 Jul 2023 14:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233468AbjGESUl (ORCPT ); Wed, 5 Jul 2023 14:20:41 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D24C2D46; Wed, 5 Jul 2023 11:19:48 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id CC95E100089; Wed, 5 Jul 2023 21:18:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru CC95E100089 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581126; bh=lUsGVmEZ9HdiqCKFqlDHSTPFlOQgyzCZXz2/LX15NfQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=a9CLMmEI8Df+FkG502jMBMHrmtNz0M+Fh8z+c+neESXtLH03/lSf1ur9h0oT1nJWl 9GoPJsLrJNfSr28TqTMYoOjA8GCY6AhhOVl3A43hEiMNaE+Bwyu6kHy5vkO8NKGZ3o vWRHq2+FS9D6e8kd2NfgV0hTl3zNw2N/QvSD1/lIoSkuzZfXtlMY2Kws2FqgUZKszO GGgB0zrkxW57/AyDDff2KKNqlUKMAkt7Gd3vdBuhxVXOTET+TCThxCsOCxQlaUn9Ny fmUrxpMjpc9tdPdkdFPluLrHOdiETG+qXhLjutBr6V5tO/Z2NID+4kwpYsLphI86lA 6tyqqV4fTogCA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:46 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:44 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 5/7] tty: serial: meson: add independent uart_data for A1 SoC family Date: Wed, 5 Jul 2023 21:18:31 +0300 Message-ID: <20230705181833.16137-6-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2; 100.64.160.123:7.1.2; sberdevices.ru:5.0.1,7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 Reviewed-by: Neil Armstrong --- 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); From patchwork Wed Jul 5 18:18:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 701444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1056DEB64DA for ; Wed, 5 Jul 2023 18:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230178AbjGEShn (ORCPT ); Wed, 5 Jul 2023 14:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjGEShm (ORCPT ); Wed, 5 Jul 2023 14:37:42 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF17136; Wed, 5 Jul 2023 11:37:39 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A87C4120072; Wed, 5 Jul 2023 21:18:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A87C4120072 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581127; bh=dFRSuVZiYwDdVCYDf8lScbiLvLEgKBhX1VHxXBr3arc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=cNsMGvyLTh7ygX0RBtlkGSvYULyqDP4PeCpzgueTC/FTwnlsnI5Ej/9pKJSFkV9Po s/RJuXwWWTyffhy3RPUbi2k+1e88eaItXISuZLEIFrQTuGHnQOaR2ApWtjZGdoN4xn +e86rfMxRL+ajNO+5G/39wut7rsMifLf/MssGVbt0FpKun0J/2IP0bsMHTEgCl3qrC sKyz2VUWHLLkUznBBC3kHmh1rIgjpF2A8dK77+llbk5O+kCNN75T3RvHcfWGkOuXUR AAITh4irSKUnsfn7hz9SAZ8y787vdtALakp6V5w9XyS+MzSjXUBcIFZwVO6hc0N1uf 0xT9PjQjv4fGg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:47 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:45 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 6/7] dt-bindings: serial: amlogic,meson-uart: support Amlogic A1 Date: Wed, 5 Jul 2023 21:18:32 +0300 Message-ID: <20230705181833.16137-7-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2; p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; sberdevices.ru:7.1.1,5.0.1; 127.0.0.199:7.1.2, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Introduce meson uart serial bindings for A1 SoC family. Signed-off-by: Dmitry Rokosov --- .../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 From patchwork Wed Jul 5 18:18:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 699541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14D2AEB64DA for ; Wed, 5 Jul 2023 18:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbjGESci (ORCPT ); Wed, 5 Jul 2023 14:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjGESch (ORCPT ); Wed, 5 Jul 2023 14:32:37 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292D811D; Wed, 5 Jul 2023 11:32:35 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 114A810008A; Wed, 5 Jul 2023 21:18:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 114A810008A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688581129; bh=SVqe3A4FxeAdixEi7Nd7L65hAuANY8HEBhEw2Kj2u+8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=WHiJoQEoJApoLtBEzj03EJrI6awNmuGRtUyYBEpNbNn8VKD5kj3Uz+MydQTEb32Je BFnt8YM5M778FzibKRA8ii/F2Qcdq+5/Ost7LLg7T6HBkCmpkXJG9MJQHF91/7dSCE 4FKS4cFcggNYWG1+DziLfxB8GIBF3+Q+pPFT3O6rSYh9h1bayvtgqF5ziAALyJDLFl 2v0289b8q44/EYA4drx8anDifV5LQ8oXtU+qpevAYFXFzHAC3PqbtVs2/7iDWaZA+u wPKhXNm3w0rj1XqnEH3gMeMWItpaFjj+XcO21UkQB/W1JyMjpO8L+Nl3k8FjOf/OXj 2uxHbPLnwAfgA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 5 Jul 2023 21:18:48 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 5 Jul 2023 21:18:46 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , , Dmitry Rokosov Subject: [PATCH v2 7/7] arm64: dts: meson: a1: change uart compatible string Date: Wed, 5 Jul 2023 21:18:33 +0300 Message-ID: <20230705181833.16137-8-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230705181833.16137-1-ddrokosov@sberdevices.ru> References: <20230705181833.16137-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178461 [Jul 05 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: DDRokosov@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2; 100.64.160.123:7.1.2; sberdevices.ru:5.0.1,7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/05 14:57:00 #21566867 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 Reviewed-by: Neil Armstrong --- 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 = ; @@ -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 = ;