From patchwork Sun Jan 5 13:11:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 855387 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2125.outbound.protection.outlook.com [40.107.21.125]) (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 578F114AD29; Sun, 5 Jan 2025 13:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.125 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736082746; cv=fail; b=GpfEVd6/fYmfTHytDDrsfWOxWbztfk/7j40uFUTxfHy5PSxXzB1A3tS+hf+CIXgJZyVkwzlpg7s2X1OKCcj9JeeP37npld1/6S7ALp8GBDY272Am2z30IMDqLKyC8NdwRDx3GYoWchQnIkgLMbiD6blH96JUbabcNqS67KWN+y8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736082746; c=relaxed/simple; bh=8OqEMIK2Ycw6/vCDcpHe8JRFAUaqclklIegH7XNfvyc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=h3TvvHNBgqxGLG7vtnbk/JprKg3ZU6Atrvp7Vfapjr2vRPRW/SDAeQqi+Wj73aYlSTPIm5RzfHdt5SAFrUw1slZmkmUHPSmHVU2DMuiAZ8duDrbUYOq7LVfSqJByQwO5+Cl+b7C/GtuJjRkaUeLtYtH0kE2oCjvLlkL8qRgcVMk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=genexis.eu; spf=pass smtp.mailfrom=genexis.eu; dkim=pass (1024-bit key) header.d=genexis.eu header.i=@genexis.eu header.b=cKP8Ly4V; arc=fail smtp.client-ip=40.107.21.125 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=genexis.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=genexis.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=genexis.eu header.i=@genexis.eu header.b="cKP8Ly4V" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N+278Jo2sBU5+yZCbw7w+RewN0hj/11omPfupmLLxeiTI9Sx6Ll24yErzS7lynBkUYMRbQr9OLIHAvw15HhQTbm7MVCfooC1JpLVSfnRfKHT4Fx0vr3H5jL7GxfKE78XiEMSRbTG86RbwG+2zBORL12HNGflB7h2lw4+vZkMk8WUvok5ONWNhXuBNThbdvtioutTi3QWZeCbm/oPWKeWiwzs8Vktjp3inFHKrfregHgZ28EOeFGqP8qz7C/UkmF/PK9Bh0fLhOGCsPCpieBxmJS1rUuTcr3pkCfjdpVQ4KLU7paVkC8bgoSn5JMPKPCYSA62QhnKZhVKbAzeLtZ8zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qlXOkzWaKOltlOHhqLjbmu4kNZTEaeU/7NQgo9VwXoo=; b=CNmC1PAd8YPPSrC4qn9k1t6YKRcdMNZwdb7swbGgaRxqjLHzIezW1r1CiU+Fugytdbpqamxg3kmDnh3SNW76SQpK9gZlm1To3dWXd+3LhYUd+MsyLKNpUNrlajgKsOB4hrwbKiatsw8RBRPEmlAJjpy7tNm1/vkL6KjZ/G53xD7cESGj78Yn128aB/m73Wbdkl5vlDxMWtw+AnhPm4ZmpzUo6Hg/r4WYNZy0QhRu9iwZCMoNfmCyoQXTc5wRozDSh1JHe7xU9NCpOYXlJvFAGSMtX+HKgEhm7AAwirmcaeX+Hf8WH/fww3yP4Y4xZfBZoZHe/xdnbIFWxHuWsOvUnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=genexis.eu; dmarc=pass action=none header.from=genexis.eu; dkim=pass header.d=genexis.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=genexis.eu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qlXOkzWaKOltlOHhqLjbmu4kNZTEaeU/7NQgo9VwXoo=; b=cKP8Ly4VJ7iYS54QstZWoh3YBvPggTXOiVyNVqtaEeojmRowb/Vzb7UnQfyYNIzm3H+vqFuC14Ki/otLQspz0RYIYChTul6m6JdWdC4GtzNQRozcOnXAzk6Hl1MDXESKY8sLFXlVkfCLt0PBWwwWp08cAAxbJAl8yCMQ0wgOiFc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=genexis.eu; Received: from AM6PR08MB4215.eurprd08.prod.outlook.com (2603:10a6:20b:90::16) by PAWPR08MB9613.eurprd08.prod.outlook.com (2603:10a6:102:2e4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Sun, 5 Jan 2025 13:12:16 +0000 Received: from AM6PR08MB4215.eurprd08.prod.outlook.com ([fe80::f8bd:a866:322f:7b42]) by AM6PR08MB4215.eurprd08.prod.outlook.com ([fe80::f8bd:a866:322f:7b42%7]) with mapi id 15.20.8314.015; Sun, 5 Jan 2025 13:12:16 +0000 From: Benjamin Larsson To: linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: ansuelsmth@gmail.com, lorenzo@kernel.org, Benjamin Larsson Subject: [PATCH 1/2] dt-bindings: serial: 8250: Add Airoha compatibles Date: Sun, 5 Jan 2025 14:11:46 +0100 Message-Id: <20250105131147.2290237-2-benjamin.larsson@genexis.eu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250105131147.2290237-1-benjamin.larsson@genexis.eu> References: <20250105131147.2290237-1-benjamin.larsson@genexis.eu> X-ClientProxiedBy: GV3PEPF00002BAE.SWEP280.PROD.OUTLOOK.COM (2603:10a6:144:1:0:6:0:8) To AM6PR08MB4215.eurprd08.prod.outlook.com (2603:10a6:20b:90::16) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR08MB4215:EE_|PAWPR08MB9613:EE_ X-MS-Office365-Filtering-Correlation-Id: 359b7a1b-5dac-4d25-b7ce-08dd2d8a93db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|10070799003; X-Microsoft-Antispam-Message-Info: 955UTqzoBerTaXibtXgVy/HK8l42k6bkQLibbi1IOKZBAMjYa23Y/C2W0R4bGP0k3hlRjaiVMwzTXcY6jd7nxG3A7QOPX4p0C8L/RuMSpxpnecfON5arRXwrOBcAQgOW+tZAckQSgrzX6/N+w+qYxVHRCUfvIuJAAZa3upXt/jaK50nvt9ufNdFlZZtUIn14FIhnV+Y1h95OrGOZML9GP2P2+9i8mgLr1zcomA5A0X9fIynGYMvnV31BIwQzcAAfbjHmIpWkLPhG/wv5r0jD/rOoqMvSBpOFnqyhGFvQJwmDlmlOXh0OyR3kX7lBLQ1Gd4MdUNPW03p7mQ4kpDEn+a7p+o3X49swHPw8B70WgxvPnsMf9mAzUMIDbDtwk9QTqoi63fnqU2cZXQbzjMCoKt60ft8jj3b3wixP330ObO/SZu18uavdwudogs9mHZ0OLpG7em/8o7XD9EB1oqStF0IZQmxS1SZECT6Cfk6Whu8qADHEmoSafvVHQjIYZ8cMlad0kSPD4ejoXI9LkTe8fT8yBAlgFRwYbfJbVftNhBOKnpsqZ5kar4qRQdmoekThOJsFo2sSgVJ+NIIrTvKI+fYnO0b1Xt/mbxehulrmIoXr88Y3vWEuyAgkq4mUsppx+NaLL09efnCwD91H85mIEs3CKyJqlCTCjEvdZMCxhYwQD/3ogDWDuCnignb5Va3Kex7gwlBoAxa25Rpq2QOas5WrFEaNxb9sxKIT53DAcpf409MsPUgw/UYvILpjOElwmlxrEZg7mZSkrjGSQ+zdtudVY76XJedj8E2cKrmsOOtCXZSs0OP5FUWaByUaPHtPVoW3N84ogEhQs9aK6TQ9POJnfQh3WOVzOVkRGdE6p5CXsxtVk12u+ReroDVQXQ+4DXF+rND2MYhkcmh9iUtVGhG73i3AlrQJvR4ade5GwUm/XX0tuEGSNuhYQbhE9fRTgk4tigHJrR9fE5yXlVEsu+/4+z4ZO2n95uXPn1sk1zcxzegSUSj95dCoJCcrOkOqpITMbcnL7ps8jckVu06mbYB5CqZFp7WTjFd1D4bTbAiCLXywkn4dp7WL8l9p9Xp0+wANtet2WKg5XuoqSkEZnlobBOvQvNbeLnPD4Jl0s5Gj39rbYvULDjoYr5ge/TMQkpyyHA1+88LhfKTIkVc5cHvxwvBYKfcEGuDnxDKiDzanQ3OWqdQiqodKimqzQFd6WNL7BwCR81+hxDV8du7tUV7YnHOLeVXyiaMdWK9FL7q1eXN823dh3D2EgMfszFJcy2wc2/xIhCjqRXc3E36d3PpikjKVUTOAcKJ7nCOXwjN/6fHox1dinGB6S4upYVhMOlwFb8TJI1pvKXdffCYp8uYE8hHK6c4D0QlhHfADzJReN6TtF0f2tXEcRb4JkAFB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB4215.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(10070799003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KM4KRiWodpTiFZ2BLHtlFkIPo0eNpausMa2dNXn1ES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+TRav+VK+gGHiv2tWYGpl7l1rxOR5lBdJ0N318KAmYEiWmPyQpqM+hlFzF/f+PCMwKrEQBxvsN2ByfSwqg8iyx50vG50IW/55s8KeVwndzO37fsLEReeCLctuALiXFCJlxyT5Con9+pjB5WpI+wLrjR3MAlsE3lhT7sGDINDOEMuksCvMGIqmf4uHfjfBoFuYvdHC4GUXM9rdeUOBeATEQXIpA2zTQJUmAB9oDRESZq5kqjB4/QVxPhi8d4hdCcLHJSa3oNf6FuWxt+/LpMx6drvObXqgYGKZ+jyAH5UFCWKmJje8hjbwTIWWhrJ2y1F0s39thtdbikOxbcUnc+uC8MuAykb0/tNmJKN6+mXT2s80j3MYasMpL1+F8uk1FdFHba6jjvsKr+uY7SZYj+hF71tj0S46Nd98Diysykyip7tpSD+6sAPErOeTnecrje5kf/a7ZjhaK5bMJLRT/IBiCQ5+iYtO1rHNDLSYawLWChOaIbNkCZuoiXp16dznjXAVMagWudIwHrRy1Ao0qX3z5NuI7DqMbvIlo4ksacaiigVbd3PgXw== X-OriginatorOrg: genexis.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 359b7a1b-5dac-4d25-b7ce-08dd2d8a93db X-MS-Exchange-CrossTenant-AuthSource: AM6PR08MB4215.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2025 13:12:16.7390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8d891be1-7bce-4216-9a99-bee9de02ba58 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n4kKTQ31fm8cSHfMV+4vc0RNbyEYJHdTQOEt3WyqKrEY2jnigbN52q559VDjHi60SJZvHp0CAsdIa8IfJzXwHXqET64smMu9Qs7yIFvSdH8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9613 The Airoha SoC family have a mostly 16550-compatible UART hardware with the exception of custom baud rate settings register. Specifying one of the following compatibles will enable routines for calculating the baud rate. For the regular UART use: compatible = "airoha,airoha-uart"; For the high speed HSUART use: compatible = "airoha,airoha-hsuart"; Signed-off-by: Benjamin Larsson --- Documentation/devicetree/bindings/serial/8250.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml index 692aa05500fd..2fbb972e5460 100644 --- a/Documentation/devicetree/bindings/serial/8250.yaml +++ b/Documentation/devicetree/bindings/serial/8250.yaml @@ -63,6 +63,8 @@ properties: - const: mrvl,pxa-uart - const: nuvoton,wpcm450-uart - const: nuvoton,npcm750-uart + - const: airoha,airoha-uart + - const: airoha,airoha-hsuart - const: nvidia,tegra20-uart - const: nxp,lpc3220-uart - items: From patchwork Sun Jan 5 13:11:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 855258 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2125.outbound.protection.outlook.com [40.107.21.125]) (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 CCAAF14F9E2; Sun, 5 Jan 2025 13:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.125 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736082748; cv=fail; b=jpQsO+bbCnXUl+fN9WibwrdAI3n/o+q6iZLBiGhrVP1Yf1ozJUD4dycitIlAl0WmlCwNOO0tYr8CYqQHTCA3EzqjXnX027Tc5Uh/bFMfpNO6Jqt4HdNAlTGcLifZOg89bzwjQNXcNEXMKw2vZOyhtyP4R5AibTtUly4/lpaPzcU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736082748; c=relaxed/simple; bh=0aY/M4barwYpYAT2ipKbpLBK59fQbP5NJLNlJyl+46Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GswAQ49PkeeRAJYepf6IJr3AuebSt+DzOdKW6FrJVzx4eC7B0fYEVTKZz1MvWgHUnpVG6/8aGEkbD5Wk1Cl/gcXBw2OU0Zb5Vhgf2zKEbYDVkLQKBbTHQr90Zjylr1eLjYtOQqhhIxOGbH5vn2A/nLvbulOjfJEOQnHKWNpAM7o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=genexis.eu; spf=pass smtp.mailfrom=genexis.eu; dkim=pass (1024-bit key) header.d=genexis.eu header.i=@genexis.eu header.b=Zn0Txbxw; arc=fail smtp.client-ip=40.107.21.125 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=genexis.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=genexis.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=genexis.eu header.i=@genexis.eu header.b="Zn0Txbxw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AkBldhVs8Xbqh2zgBX5j7ycDiOpPFTqGTVBji/jBvSPN7AUSih9FVcsRVcI4t4DjuYDAWYiU5bAdmArosewI8CNjCWsbRPhd+vOSE7DuwyPTBGZtP0PufnjusvJnkEd4L+mFGjRQSRAkQSqOPj+TBQwxijPtEbMW0gA/dS5nG9o8ALMlWkW1WAm9cgdgqeLCeGA7SIGNip+kfvkdDlbogS0m6YCRgBbIhr4runmsCu49VKsI3ollAqXwIemLIZKWMeIycsMGoXUoh7z0jdnEeC6Bz2wX+J2MyZLZP7gssPYp+pZQvHJr+LOW67kOZii6FsK/pVeq8iRxZOwMje+TRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=hd+36EAui6O0tfut1PSp3SLXRLcKm/m8f+1qaM3NEdY=; b=dpSlk4Ah5jyFo00Y7a1pl0mmh+SKZm1DdpOomtOQW7autKUND8zx/mqt9I1GztJpxiQl5xASgn6mwf3bFXoCPoqNJaY/dZrF/vPLM8GmzFqVZyUgOmPMumI+bhze0yjpy6x5uLLPkeChfYIIrVMudTn9OBTT8QXLDE/LHs8Oggy9ZHliU++s3KQ6rb95KKOZaFSsE13rOQj6x+KcxN2Ho5nRYSIij2PAYD9f9qPOPqfylWJDKOEKc6gvSCQFkRsfB5dzNY+Eqw95k+BAe48lUqDK7P16HZ4AXBrZqTqhlfuyTUT0VFoHJd/g5cpy7pWosyoU6caGrZo+dMypz+6ZDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=genexis.eu; dmarc=pass action=none header.from=genexis.eu; dkim=pass header.d=genexis.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=genexis.eu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hd+36EAui6O0tfut1PSp3SLXRLcKm/m8f+1qaM3NEdY=; b=Zn0TxbxwI2CtJfT3OrjnilRNzFNhWky3USZ70XyJ10OiSrNwK/xywLBgz9uItX8TPNrwtgxFcCcwpSjuoG8okk0rD1JRNKEGnpNWROppDGh2Kiatw6ddL046cViqBaKfLVe27n+K1RaiGx0oDYfyxTlhxrPLL5GMJp2yyJrrh+U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=genexis.eu; Received: from AM6PR08MB4215.eurprd08.prod.outlook.com (2603:10a6:20b:90::16) by PAWPR08MB9613.eurprd08.prod.outlook.com (2603:10a6:102:2e4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Sun, 5 Jan 2025 13:12:18 +0000 Received: from AM6PR08MB4215.eurprd08.prod.outlook.com ([fe80::f8bd:a866:322f:7b42]) by AM6PR08MB4215.eurprd08.prod.outlook.com ([fe80::f8bd:a866:322f:7b42%7]) with mapi id 15.20.8314.015; Sun, 5 Jan 2025 13:12:18 +0000 From: Benjamin Larsson To: linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: ansuelsmth@gmail.com, lorenzo@kernel.org, Benjamin Larsson Subject: [PATCH 2/2] serial: Airoha SoC UART and HSUART support Date: Sun, 5 Jan 2025 14:11:47 +0100 Message-Id: <20250105131147.2290237-3-benjamin.larsson@genexis.eu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250105131147.2290237-1-benjamin.larsson@genexis.eu> References: <20250105131147.2290237-1-benjamin.larsson@genexis.eu> X-ClientProxiedBy: GV3PEPF00002BAE.SWEP280.PROD.OUTLOOK.COM (2603:10a6:144:1:0:6:0:8) To AM6PR08MB4215.eurprd08.prod.outlook.com (2603:10a6:20b:90::16) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR08MB4215:EE_|PAWPR08MB9613:EE_ X-MS-Office365-Filtering-Correlation-Id: 77808265-84b3-47d3-4053-08dd2d8a94c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|10070799003; X-Microsoft-Antispam-Message-Info: BPgtUyo8dlEVp2+a4CltepdZwpeEgzAH+Pihtuh0txxPl9NEFNJM41af5SirOriwpnf6s/h1wHU9LKuhcKDpV41j0OX5p6AjvJEL5Oe5BCbZksjIblRSkgeCfA/oA5Oi5fJQDQo2Tx4GPgdY/wHRQS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sZ+x/WHJqa6WTKnO/SaLY7722YnugnFpiuiRyNGM4krBhvJkjctqhL+rMrf5vPpmK2lpK8U79aVh2C9c2VTvxIRGDkKhr3gyroQdxpXrazg4jCzGaJQwHQGFhWq76zLrA5besHNaJu2KUpA8UinB9FTmnKVGbCzarq2xozNbGaTgrYE X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB4215.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(10070799003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5StAOFcoebsyVHOD/JyI+mD94R8C4V9XpJVHD5WOl/IoKz2nVxhvC+L2eFTfD47UYuy+HkCeyk5yfirR/HT/8gdN3XE/QN8kQ7aNQc7YIcc1nOTOviRRxGoHnaHRyuPVwF6hRbEJzCGUvvrJde4sxFdgCJPpN7JSwRwGRQbgQ3rnO2dc3uNbp9w8HoakIy1ILlpG0PLKbExlnS0Z6i07zeXLtY1lR01cWcbOEyBaPwK+rjel4A101/PvH+xFVr2Lvg/SDt2aQd4eWN5cz2X8PGCnKSuc7zs8Ex8jL2lp5CKIGnz/lfaPViW5GNv6FCj+vz9BO23cRbY5nJP9cza+yOfb1EjMDAC/WRWjlM6P98nIwCCj/5xC8ZhjUM/hqGESqh9y8flDmH8bJQF4NKoT6VS8oJXCM1OtAgOjFGf3UhbeLlVeLdNvSxu/HVkROibl9auy0uB1W4B6vpU2ovMhOVfWFV7WAr4vLDxqLIdxJsZwovc0mamEmNhfKvUp7lUUpZYqVJpSECkXnR0Tj9xcScAxHlqY7o2J+C1oehUTG/ghddgx3UFnvQfYeWR3xt5E7lYaiAIwq3bMvTajoBzabiRFAqkUCEkxgaTq6wxJ8FLDA9IFL6JvRSddpQPKrEEC1iKPaRjZZMmLXfOrPwMBbXI6xWCQfj79Gm0bf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3-4053-08dd2d8a94c2 X-MS-Exchange-CrossTenant-AuthSource: AM6PR08MB4215.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2025 13:12:18.2293 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8d891be1-7bce-4216-9a99-bee9de02ba58 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YCfhF6ckKZ44ffGRko427P1Nw+Hme91K49E8YmiFniGLVmgo2Y19W42iQrQgSX1VZ0F0aDsTop7vOttXYn8JQCPxpvyqdEYMnm3+VkRpcLc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9613 Support for Airoha AN7581 SoC UART and HSUART baud rate calculation routine. Signed-off-by: Benjamin Larsson --- drivers/tty/serial/8250/8250_airoha.c | 85 +++++++++++++++++++++++++++ drivers/tty/serial/8250/8250_of.c | 2 + drivers/tty/serial/8250/8250_port.c | 26 ++++++++ drivers/tty/serial/8250/Kconfig | 10 ++++ drivers/tty/serial/8250/Makefile | 1 + include/linux/serial_8250.h | 1 + include/uapi/linux/serial_core.h | 6 ++ include/uapi/linux/serial_reg.h | 9 +++ 8 files changed, 140 insertions(+) create mode 100644 drivers/tty/serial/8250/8250_airoha.c diff --git a/drivers/tty/serial/8250/8250_airoha.c b/drivers/tty/serial/8250/8250_airoha.c new file mode 100644 index 000000000000..c57789dcc174 --- /dev/null +++ b/drivers/tty/serial/8250/8250_airoha.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Airoha UART driver. + * + * Copyright (c) 2025 Genexis Sweden AB + * Author: Benjamin Larsson + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "8250.h" + +/* The Airoha UART is 16550-compatible except for the baud rate calculation. + * + * crystal_clock = 20 MHz + * xindiv_clock = crystal_clock / clock_div + * (x/y) = XYD, 32 bit register with 16 bits of x and then 16 bits of y + * clock_div = XINCLK_DIVCNT (default set to 10 (0x4)), + * - 3 bit register [ 1, 2, 4, 8, 10, 12, 16, 20 ] + * + * baud_rate = ((xindiv_clock) * (x/y)) / ([BRDH,BRDL] * 16) + * + * XYD_y seems to need to be larger then XYD_x for proper waveform generation. + * Setting [BRDH,BRDL] to [0,1] and XYD_y to 65000 give even values + * for usual baud rates. + * + * Selecting divider needs to fulfill + * 1.8432 MHz <= xindiv_clk <= APB clock / 2 + * The clocks are unknown but a divider of value 1 did not result in a valid + * waveform. + * + */ + +#define CLOCK_DIV_TAB_ELEMS 3 +#define XYD_Y 65000 +#define XINDIV_CLOCK 20000000 +#define UART_BRDL_20M 0x01 +#define UART_BRDH_20M 0x00 +static int clock_div_tab[] = { 10, 4, 2}; +static int clock_div_reg[] = { 4, 2, 1}; + +int airoha8250_set_baud_rate(struct uart_port *port, + unsigned int baud, unsigned int hs) +{ + struct uart_8250_port *up = up_to_u8250p(port); + unsigned int xyd_x, nom, denom; + + int i; + /* set DLAB to access the baud rate divider registers (BRDH, BRDL) */ + serial_port_out(port, UART_LCR, up->lcr | UART_LCR_DLAB); + /* set baud rate calculation defaults */ + /* set BRDIV ([BRDH,BRDL]) to 1 */ + serial_port_out(port, UART_BRDL, UART_BRDL_20M); + serial_port_out(port, UART_BRDH, UART_BRDH_20M); + /* calculate XYD_x and XINCLKDR register + * for the HSUART xyd_x needs to be scale by a factor of 2 + */ + for (i = 0 ; i < CLOCK_DIV_TAB_ELEMS ; i++) { + denom = (XINDIV_CLOCK/40) / clock_div_tab[i]; + nom = (baud * (XYD_Y/40)); + xyd_x = ((nom/denom) << 4) >> hs; + if (xyd_x < XYD_Y) + break; + } + serial_port_out(port, UART_XINCLKDR, clock_div_reg[i]); + serial_port_out(port, UART_XYD, (xyd_x<<16) | XYD_Y); + /* unset DLAB */ + serial_port_out(port, UART_LCR, up->lcr); + return 0; +} +EXPORT_SYMBOL_GPL(airoha8250_set_baud_rate); diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 64aed7efc569..5315bc1bc06d 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -341,6 +341,8 @@ static const struct of_device_id of_platform_serial_table[] = { { .compatible = "ti,da830-uart", .data = (void *)PORT_DA830, }, { .compatible = "nuvoton,wpcm450-uart", .data = (void *)PORT_NPCM, }, { .compatible = "nuvoton,npcm750-uart", .data = (void *)PORT_NPCM, }, + { .compatible = "airoha,airoha-uart", .data = (void *)PORT_AIROHA, }, + { .compatible = "airoha,airoha-hsuart", .data = (void *)PORT_AIROHA_HS, }, { /* end of list */ }, }; MODULE_DEVICE_TABLE(of, of_platform_serial_table); diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 1ea52fce9bf1..00163a3d35cd 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -319,6 +319,22 @@ static const struct serial8250_config uart_config[] = { .rxtrig_bytes = {1, 8, 16, 30}, .flags = UART_CAP_FIFO | UART_CAP_AFE, }, + [PORT_AIROHA] = { + .name = "Airoha UART", + .fifo_size = 8, + .tx_loadsz = 1, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01 | UART_FCR_CLEAR_RCVR, + .rxtrig_bytes = {1, 4}, + .flags = UART_CAP_FIFO, + }, + [PORT_AIROHA_HS] = { + .name = "Airoha HSUART", + .fifo_size = 128, + .tx_loadsz = 128, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01 | UART_FCR_CLEAR_RCVR, + .rxtrig_bytes = {1, 4}, + .flags = UART_CAP_FIFO, + }, }; /* Uart divisor latch read */ @@ -2847,6 +2863,16 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, serial8250_set_divisor(port, baud, quot, frac); + + /* + * Airoha SoCs have custom registers for baud rate settings + */ +#ifdef CONFIG_SERIAL_8250_AIROHA + if (port->type == PORT_AIROHA) + airoha8250_set_baud_rate(port, baud, 0); + if (port->type == PORT_AIROHA_HS) + airoha8250_set_baud_rate(port, baud, 1); +#endif /* * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR * is written without DLAB set, this mode will be disabled. diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 55d26d16df9b..97fe6ea9393d 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -356,6 +356,16 @@ config SERIAL_8250_ACORN system, say Y to this option. The driver can handle 1, 2, or 3 port cards. If unsure, say N. +config SERIAL_8250_AIROHA + tristate "Airoha UART support" + depends on (ARCH_AIROHA || COMPILE_TEST) && OF && SERIAL_8250 + help + Selecting this option enables an Airoha SoC specific baud rate + calculation routine on an otherwise 16550 compatible UART hardware. + + If you have an Airoha based board and want to use the serial port, + say Y to this option. If unsure, say N. + config SERIAL_8250_BCM2835AUX tristate "BCM2835 auxiliar mini UART support" depends on ARCH_BCM2835 || COMPILE_TEST diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile index 1516de629b61..b7f07d5c4cca 100644 --- a/drivers/tty/serial/8250/Makefile +++ b/drivers/tty/serial/8250/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o +obj-$(CONFIG_SERIAL_8250_AIROHA) += 8250_airoha.o obj-$(CONFIG_SERIAL_8250_ASPEED_VUART) += 8250_aspeed_vuart.o obj-$(CONFIG_SERIAL_8250_BCM2835AUX) += 8250_bcm2835aux.o obj-$(CONFIG_SERIAL_8250_BCM7271) += 8250_bcm7271.o diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index e0717c8393d7..33e7e1922149 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -195,6 +195,7 @@ void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl); void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, unsigned int quot); int fsl8250_handle_irq(struct uart_port *port); +int airoha8250_set_baud_rate(struct uart_port *port, unsigned int baud, unsigned int hs); int serial8250_handle_irq(struct uart_port *port, unsigned int iir); u16 serial8250_rx_chars(struct uart_8250_port *up, u16 lsr); void serial8250_read_char(struct uart_8250_port *up, u16 lsr); diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 9c007a106330..c71fb338accb 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h @@ -231,6 +231,12 @@ /* Sunplus UART */ #define PORT_SUNPLUS 123 +/* Airoha UART */ +#define PORT_AIROHA 124 + +/* Airoha HSUART */ +#define PORT_AIROHA_HS 125 + /* Generic type identifier for ports which type is not important to userspace. */ #define PORT_GENERIC (-1) diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 9c987b04e2d0..72a71e171602 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h @@ -383,5 +383,14 @@ #define UART_ALTR_EN_TXFIFO_LW 0x01 /* Enable the TX FIFO Low Watermark */ #define UART_ALTR_TX_LOW 0x41 /* Tx FIFO Low Watermark */ +/* + * These are definitions for the Airoha UART + * Normalized because of 32 bit registers. + */ +#define UART_BRDL 0 +#define UART_BRDH 1 +#define UART_XINCLKDR 10 +#define UART_XYD 11 + #endif /* _LINUX_SERIAL_REG_H */