From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2104.outbound.protection.partner.outlook.cn [139.219.17.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCBB41DDA18; Fri, 25 Sep 2026 05:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.104 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790313074; cv=fail; b=EyZVFzo1kwTjWgzvD2b5QjOMs5emGSuYzKL2q+Jpi8nL+xIIvhzF7J+f9eEz6IR2Zh+vcyicMXldb9f33tMB82jHNDRbdeJgqkSqOXAHVzNARNGgoBCULXyEKiVQ+Z8rDZVPghz2ClGtLBSIBCYcA7UpwL3McxrjXBnsIsWvLVY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790313074; c=relaxed/simple; bh=a3HGHKub9JFgo+WBNtKpj5ko6hFy0aiQWlIViTPhRjw=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=UR/nANTSXqq94isRdVCDmQPhszjscbwFfsvUSOyVBF5T23s6HOkJFzaGZJLJa2fZ6EkmxRiiyI2UL2q4jybwsKuTwB+YsDyl3Mts92T62wJi1HrpX4kd2ZQqFqw64ByX1k70GM7BU1OeUg+etHSpX5sGMcR7u+bLOn9zQgKxcFc= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.17.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJiX4P8ouR4pkKK25NEe5fMnieVTNTQksQCKBtb9A3XsZxylycHeZd2iXaqk9ftypug/eizyH8mb0esnHX3A5uNFoOpfw1bbXT9gGzL1LhtkNpCv3y1XVCBWIfJfG6l9yW8G1FPkdc0CnbEuUD36zgUwQT9/kQe5ORPE0x2zJUj+fNvMepDR7+95D1QeM5IlitEgJyxmJdqoLpYz6IU3HbqgZE3AsybGvoY64zbri2FUwP2Y7kyN/cg2gjuvWtv0u4W9wodyAzhc14smlnQmXrybsB6y1eEO7jtJ5eUr6Yikji8fPk2XLUZDfLjAD/EWk0NTGNjctNzgPmDdB9Y3zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vS0mwKKUID6NtqCRyzu/4zn9jVsRM7VA/+aPh41MbwE=; b=ih1pQrcVVwPUjenH7qOXrI4Fbrjbu3QIbuzrk+m5tHWC7ujFbe95EDFMnUnCfmeaIoUnltJe6MQTu/t/pbpiwsNkTKhGzt6mbWmOBKI9vkKdBsQWbXRb6Y8J5q7Qtgb13ltQNAr47OJpEEJgaTKf5vS2wo7FIB1NMfcssURehrH0EbvU9+H9GCRN1QI1d2OG+sYu+CQDAPBm2pRE6DUz5RitQ7DzBD1A5M9U5mHbarArOoDlz4K7nr0S01jcTu8s7n+cX97KJ1SuRxxyBwmX8HZ0UcYiLYBvWfjkbjyxSu/Y/lhvw3HRgXcIDMjRekcKBKh2b/wgiiKSy7MtFztjjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:17::6) by ZQ4PR01MB1169.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:13::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.22; Fri, 25 Sep 2026 05:10:59 +0000 Received: from ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn ([fe80::e7d4:256c:b066:850d]) by ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn ([fe80::e7d4:256c:b066:850d%4]) with mapi id 15.21.0451.014; Fri, 25 Sep 2026 05:10:59 +0000 From: Changhuang Liang To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Joel Stanley , Andrew Jeffery , Chia-Wei Wang , Oskar Senft , Greg Kroah-Hartman Cc: Changhuang Liang , Shuah Khan , Jani Nikula , Vitaly Lubart , Hanjun Guo , Andrew Morton , Alexander Usyskin , Jason Gunthorpe , Breno Leitao , Philipp Zabel , James Morse , Paolo Abeni , Stephen Hemminger , Dave Penkler , Jakub Kicinski , Jonathan Cameron , Dan Williams , Mukesh Rathor , Vladimir Oltean , Alexandra Winter , Julian Braha , Karthikeyan KS , Pengpeng Hou , openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH v3 0/4] Add support for StarFive JHB100 UART Routing Date: Thu, 24 Sep 2026 22:09:43 -0700 Message-Id: <20260925050947.9900-1-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SH0PR01CA0005.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:5::17) To ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:17::6) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQ4PR01MB1202:EE_|ZQ4PR01MB1169:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a402724-6b59-430e-285c-08df1ac362db X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|1800799024|7416014|52116014|366016|10067099003|18002099003|56012099006|38350700014; X-Microsoft-Antispam-Message-Info: uf7dDOgohsxMdlJYJ9X61RY1xPmGu/ei6gULtnol0SKEBJ9dYLowQQtNOSkzjvUHF73zhFittn4AzSw/B1IybjRDcji4a/Qiqn+x6Y3f51TSZk4L3sWiydmx+L/1/+AQXsEBXzgP5LgK7kNE0lI6lWq3towGzIYgr7d1706W3fpgJRa8a9LPjTFJeSf/ASd4ztxvl48h94izivLzlTtgQOvZHQQAn0aaR+DN7mk6n2mvxKJlTEBry6breF2MKK6ZnCXbsv+uewYqZRyDIyVK6WQGbHVvUY3UR6dhCw85H9HMjPLfPbXeRiDgqHA6/mvJ7iBhzlYAmLGr5pFfxI9TfUsvS8H6BtKkrjWmvKw9TeUDfSlYNFXfr6Pe8iPoG6nArzA1jMuApdvCeGv16p0NsoqtfYDXcIsplRFbLfUo1LYZaWkzpw/mv9rSwWyH4Ngp9/t2dqFx09Kye6a5+Q8pJ5Q8ZVXoenJbGF4s4LZiNGmaKHQqm/dmwozZMmwxJXxOckhZsS8QeNR/F3CiDtNvctpzCIDnkIiXTOiwyIxfi05nCJC981xy7vcxFDViSl4d X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(7416014)(52116014)(366016)(10067099003)(18002099003)(56012099006)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-Anti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oJsMcyCoywrrHz1BLtkdD0eaymjXTdbG2?= =?us-ascii?Q?OxNh8bUg/ejbcI1EHWtC3zWmdsArtHa/B8v9ELW4ht4kNfm11Ces?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a402724-6b59-430e-285c-08df1ac362db X-MS-Exchange-CrossTenant-AuthSource: ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2026 05:10:59.1539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /hKK//bnQ/lbFJQJcDutB3i6ABBrh6UtfTmtOcbS81ABfDWxerN6i6tbp5ayNE2DxGyHxpg9LSIYOfrDV6lMtc11/kuGU3N/V254ULa7WBWH0PQeNyqVr+FK+pDpNqNy X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ4PR01MB1169 Currently, since Aspeed also has a similar driver, there is some code with identical structures on both sides, but a common framework is lacking. Therefore, this series introduces a generic UART routing framework. It also moves aspeed-uart-routing.c under this generic framework and makes it use the interfaces provided by the generic framework. At the same time, StarFive also registers its own driver based on this generic framework. StarFive JHB100 UART Routing allows dynamic routing of inputs between built-in UARTs and physical serial I/O ports, enabling use cases such as Host <-> BMC communication via UARTs. This series has been tested on the EVB1 board. changes since v2: PATCH 2: - Add a "depends on ARCH_ASPEED || COMPILE_TEST" to the "UART routing drivers" menu. PATCH 3: - Move the binding to bindings/soc/starfive/ and update the $id PATCH 4: - Append the depends on ARCH_STARFIVE to the "UART routing drivers" - Use RST literal blocks instead of backslash-escaped asterisks in the sysfs ABI documentation. - Update the MAINTAINERS entry for binding. v2: https://lore.kernel.org/all/20260905102901.126035-1-changhuang.liang@starfivetech.com/ v1: https://lore.kernel.org/all/20260830065118.51551-1-changhuang.liang@starfivetech.com/ Changhuang Liang (4): uart-routing: Add common UART routing framework soc: aspeed: Move UART routing driver to drivers/uart-routing dt-bindings: soc: starfive: Add StarFive JHB100 UART routing uart-routing: Add UART Routing driver for StarFive JHB100 SoC .../sysfs-driver-starfive-uart-routing | 49 ++ .../soc/starfive/starfive,uart-routing.yaml | 46 ++ Documentation/driver-api/index.rst | 1 + Documentation/driver-api/uart-routing.rst | 145 +++++ MAINTAINERS | 25 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/soc/aspeed/Kconfig | 10 - drivers/soc/aspeed/Makefile | 1 - drivers/soc/aspeed/aspeed-uart-routing.c | 601 ------------------ drivers/uart-routing/Kconfig | 45 ++ drivers/uart-routing/Makefile | 5 + drivers/uart-routing/aspeed-uart-routing.c | 415 ++++++++++++ drivers/uart-routing/starfive-uart-routing.c | 192 ++++++ drivers/uart-routing/uart-routing.c | 200 ++++++ drivers/uart-routing/uart-routing.h | 84 +++ 16 files changed, 1210 insertions(+), 612 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-starfive-uart-routing create mode 100644 Documentation/devicetree/bindings/soc/starfive/starfive,uart-routing.yaml create mode 100644 Documentation/driver-api/uart-routing.rst delete mode 100644 drivers/soc/aspeed/aspeed-uart-routing.c create mode 100644 drivers/uart-routing/Kconfig create mode 100644 drivers/uart-routing/Makefile create mode 100644 drivers/uart-routing/aspeed-uart-routing.c create mode 100644 drivers/uart-routing/starfive-uart-routing.c create mode 100644 drivers/uart-routing/uart-routing.c create mode 100644 drivers/uart-routing/uart-routing.h -- 2.25.1