From patchwork Mon Jan 8 13:54:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513927 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01rlnn2059.outbound.protection.outlook.com [40.95.53.59]) (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 4C7E354F9A; Mon, 8 Jan 2024 19:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="E83Rq2hT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdBqQlcv6XsPhDb7IWYDv5qkbIEK1iakUm3eGpTg/Z1mOZ95bMxaHN+sINEtNKSjvYkPsHw4xDvRb1PFobo9okQmpUYX7OpbjtJ/L8kqXv3RxNLiwBLtltmP+/1gOap4Xl99sWY+JBYsJjNguClG6GYol3+522Odq10lwfc3lOlmyOeVHOCNb4igONtCpmzfSev7oXZ2cAOwF6T64MvfB/ylKz7oLq28t8zjwhARsbPDUaTmzdLqz5B9StlNjZYUybU+tZSFtzqitHmWHdjPUD77UB2GXGdgj1OKHFRI8b42ZEsgjMhLZr1rOewKUnwsEw7msm7F9yEh1pJtSDG3mw== 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=oTDBqhtG79Qcgr0/MTD7QS5cQnpcScK+QVZSf3W+EIo=; b=NrzOcVOVRoKex6cZ2zULgI6g+M70W64dlnqq8cySk4gFATP9pnd5tkftueAGPLjgM5/LmL1gDr07jTWs+v9i18AnLvFAmTX+Q+OWTgsGAQvSYXTnSNsuoLTuuMuyLiqMKa5Zo/QIkXPzKqOpR9eNST6Zp9aXuTmT0i+FuN5l/BSUEGmlKcjeHf0PH5W0kLXRpUkWwnY8O3AXRbWVOzgC9uOcyberOvn6hQuGVeiMS0OzxEqsqe44mWf2e9wSGUW0LX1nuVCVqOyW3qCAHgjXbrLC8kxIAplDH02VE4rOYl05pGUxLQyrTZ3G3CiflBprSrVKve6FskzQYE2NOfzd/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 175.98.123.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oTDBqhtG79Qcgr0/MTD7QS5cQnpcScK+QVZSf3W+EIo=; b=E83Rq2hTHFU2qOy0cch4UuQZZ2I+e54l6+KRAM7c736cTWeXXVRgiIYnSGYWNuFEXQEmKJW4PacpdOMqr6TamatGepjWSedXSesVU6dnlWr1+OFleAmuTrMuX0llMsFsi46XqLBwg/nh4k9GYAMrKmlJTdi3I1DJzLSp5/8F+JI= Received: from PS2PR02CA0092.apcprd02.prod.outlook.com (2603:1096:300:5c::32) by TYZPR03MB6621.apcprd03.prod.outlook.com (2603:1096:400:1fe::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:26 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::a4) by PS2PR02CA0092.outlook.office365.com (2603:1096:300:5c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23 via Frontend Transport; Mon, 8 Jan 2024 13:54:26 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 175.98.123.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS04.nuvoton.com (175.98.123.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:24 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS04.nuvoton.com (10.1.8.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.14; Mon, 8 Jan 2024 21:54:23 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id 6FCE75F5FA; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 6B50EDC004A; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 1/8] dt-bindings: clock: npcm845: Add reference 25m clock property Date: Mon, 8 Jan 2024 15:54:14 +0200 Message-ID: <20240108135421.684263-2-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|TYZPR03MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e49ca8c-c36b-4473-68b1-08dc105152de X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0bJTba4SiXT+jOHiz8pSm9kXAbUZZxwGFYdY9+/LEv40sDCIvSkLL5+nBvzDw1Tcl/F/uI/jn00gqfy3JhvJ0imWDgd0KOgaMef/EYuKgpBTUBE0WWYFThSkwZq5QN4tTdO+YPL7Oa0VTe7NDdGxtJ1R9LerANqsUntfWJrf6xr7n6mMHnl0chVDm2OhCZbgBNubcaebN88FFYXJYiz11tI/rHQutv28mJ51Q/lznqvBgg4EVMQIkYfeeeeC/CIA/tS+CMoIaukAwHLDvtd4MwbP7/vQnbZIbqY47xQfs+yLHxMrTB3EE5Qf5R2sdZ//cK9F2JAxVCLuzjwmYs7aH8+ss03x+sO0KbYN9l7NESAXzqGuXsnV9itfquKv8FBb+d/ZxPQK5wJNaYXv4JNDF2BoY6s7CwiDegkARF0BLN42GTSR//J5AU9XEYeJ5k59vGoiZOITX9JrVQE5EITfJ4Fl/BetAD8ijq35dVcVsIWwbksDKLMnxzJ4IKPbSWWnnzhSVOK3Y8pPYNaF+fVYwpSK3bY+UL6/L4FBSmDVKzOthRfPZhXcfDpB0iT8dEpyt5YcFQhFsm09/6uIFyol/794xDwuEsau+0d8xSBJng99PgGNaPmu+K4XS4LNhKaHkuB5LGj7rlQPS0eZkT+xe7wEovKImapfNKaqFi+exx3lvKzqViwdpYL9cbQ6yrWxrFvWFHuXfrE8ElbDLeAXnH9PCKOEl9DpQyp+EMgK52H2Q1aMTjm4Hk80xnSND6bZlNew1bu6GdT0C4cXmEIw8U/of3eCNVy/29zEWKDSjGy0eWofxj4IUEqw9aMG6JLK0j6OrSJDmR4VLwN9H07Z/UklD4pHkZiK5WI8sJFVQogkl240UD8Hbql+C7ksX+Hm X-Forefront-Antispam-Report: CIP:175.98.123.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS04.nuvoton.com;PTR:175-98-123-7.static.tfn.net.tw;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(376002)(39860400002)(136003)(84050400002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(451199024)(48200799006)(61400799012)(82310400011)(46966006)(40470700004)(40460700003)(40480700001)(6266002)(26005)(2616005)(336012)(1076003)(6666004)(498600001)(82740400003)(36756003)(55446002)(356005)(81166007)(83170400001)(2906002)(5660300002)(7416002)(41300700001)(47076005)(83380400001)(35950700001)(82202003)(73392003)(42882007)(8676002)(110136005)(54906003)(42186006)(70586007)(76482006)(70206006)(316002)(4326008)(8936002)(45356006)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:24.8002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e49ca8c-c36b-4473-68b1-08dc105152de X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[175.98.123.7];Helo=[NTHCCAS04.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR03MB6621 The NPCM8XX clock driver uses 25Mhz external clock, therefor adding refclk property. Signed-off-by: Tomer Maimon --- .../bindings/clock/nuvoton,npcm845-clk.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml index b901ca13cd25..0b642bfce292 100644 --- a/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml +++ b/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml @@ -21,6 +21,14 @@ properties: reg: maxItems: 1 + clocks: + items: + - description: 25Mhz referance clock + + clock-names: + items: + - const: refclk + '#clock-cells': const: 1 description: @@ -30,12 +38,20 @@ properties: required: - compatible - reg + - clocks + - clock-names - '#clock-cells' additionalProperties: false examples: - | + refclk: refclk-25mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; + ahb { #address-cells = <2>; #size-cells = <2>; From patchwork Mon Jan 8 13:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13514216 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01rlnn2054.outbound.protection.outlook.com [40.95.54.54]) (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 D3E3017C3; Tue, 9 Jan 2024 00:41:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="Qze6DUv0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l4Bo27UZ1MiHpAh4ubPAjIM9QPtfatKtiv+KN5b1cSID4PikMDt5wO+gaN1hBU6IaIMpqKG3YP4glNV2FY8OfX9Rzl0k3nBFsSnaYsY2JqpJuQckXkGrLd6UYkB548P0ah0zLLaBP1/Ppl52+ABKyyipo92x+QRdqIrMOSVoKJX1MNikkaxM/sxac4ycpA8yPGh7tj+pmDrptTvXJ+puN+ESoo7qUk/Abq9xi3B65pTbyDmb5fDmIfv+CW62Uieh/3/Ob0/em39cA8cU6f+HogosWq2pSJyZnMz59Jr/IdZq8Ligm5W/5mB3x1iVEgb77Z5KJF4o6eHZMiWbnq5s4g== 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=lk/t4Je0EhRYfDFXarUnqdP29sWrNaQHRiZiggUIAgA=; b=YYd2oxWLn3dWftqjml6Z3M01QmicZnVZHzck5MgUoTEzszLcO9dkpLJ+jrLitNbNMhnvx2yvjC2k88mX+F+LWlrVXOwBST2Bd3/xNqAZA5t648zYN8leNaMLyoRpxFya6rfSfl6xydtADjlZFNW6XxrlNT42mMacHgchSUHifEdLyio4sOospUlZeZIMgXF3YZsNXt3KcMh5whzCK/g/0KIMk5BD5VwNMF2dGUDrd4NtSNlzQoYymb2c6YWbg2ZkuwU67syMky8Pr88sWuVWuZY1+ghVwDEoCHHiiD2MqUyI1psCwJGMqTQBlQvD9hzqqRgHeXaXfjeg9psuuEjdlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 211.75.126.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lk/t4Je0EhRYfDFXarUnqdP29sWrNaQHRiZiggUIAgA=; b=Qze6DUv0HpeH2mC5ciuebWHQiFfwDg3Lk3T9wUY1qNExJVw0HiYqL+GqVA9Xh3SSjMYQNkGEtoMAGjUiF6JhTivT5dbSQQWgXNnV/GJ9tDHSL6TRbEZECTsp4OsI834QA0f7XyIPb5Q2S4KRWiWWptExTIRyfeJBLj0KxdyxGIg= Received: from PS2PR02CA0086.apcprd02.prod.outlook.com (2603:1096:300:5c::26) by TYSPR03MB8852.apcprd03.prod.outlook.com (2603:1096:405:9a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:28 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::83) by PS2PR02CA0086.outlook.office365.com (2603:1096:300:5c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:28 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 211.75.126.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS01.nuvoton.com (211.75.126.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:27 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id 778625F642; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 770EDDC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 2/8] arm64: dts: nuvoton: npcm8xx: add refernace clock Date: Mon, 8 Jan 2024 15:54:15 +0200 Message-ID: <20240108135421.684263-3-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|TYSPR03MB8852:EE_ X-MS-Office365-Filtering-Correlation-Id: 87758586-9d7f-4fb2-3165-08dc1051544b X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aC49QO1L1Get/v+jkfNxmxI6+a+ehKj77SdXAKIYI/AfQAHZlA57WyAnp0kVOtNvAsm95KcUGNxL3GNlbDMfy18enKyrsr4y+cNVvrh/okzDEiOF1S+sT4+FnZOZ9QtqVK/TOPqvuO9cv6yE3XLoSNx/1yp09xcGtm512HiBnUvkG152SQ4EVx3SasHlfTTrdTab55bWrl5KmLrpwFZLEgxH//pQvC80CO4JnuE1DKSGztBF2tyTbwbk3VcK9ApjiYtpK+t7wcTb7lIAu3LXjGexdrfPC4HzDcrvkywWtBU78NBHKCgvmziBCpnPMYSv0aVMWZJR09Z0h/e5aCqNrNBpyq/Xg7QuToJQKUAR0rWsI1Sh7Y74JqaPiN+DDtstQ7Zt3gjTRmZAgYJsCU/+mvWqYU2Xf1eGCm3y6G3D0Ajv1hr2uYUIszg6q6c+F8uPcTyDFjajzHqAjdInNR62IApkYkYOv3we/JrIMamM//lxk8L/bRnVnoypg7AncmqS8qCpUYRCz1QiRNp0Zi7WnSMpMipWc7GVa5ysnHZdrik6AFofkxQOxIcwO64fcbUEStMmDv1zJiMzVJgfI5LR4ANQC0Og4Gga5vyszJlOEho3x3TDpvr2i0xpKN+qPmTOY2oTKCXtMsyePc/2x9VceC7mA6vuu7hWi2NB3H+NCiwR3gKpskyoM8JJXR4EPsYQjDscQK/YHHrTNrA4RHc1oz2+0cfThJnioALQsqiPTiE9FFUO5bxv6+IzFk1sPEeV/jatTTAHPRtk3gH+kUEOVS+azXpsuSdHnxJ3B3F6sZV70TVmhgZLyD9GInLpbnnm8cR31sxfGo0L0g09BIyvnM7FReWHEaLjGbrWvk5IqVEsWy5Mr26/Iiox0+8GIi1u X-Forefront-Antispam-Report: CIP:211.75.126.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS01.nuvoton.com;PTR:211-75-126-7.hinet-ip.hinet.net;CAT:NONE;SFS:(13230031)(4636009)(376002)(39860400002)(396003)(346002)(136003)(230922051799003)(82310400011)(64100799003)(451199024)(61400799012)(48200799006)(40470700004)(46966006)(40460700003)(40480700001)(2616005)(1076003)(6266002)(336012)(498600001)(6666004)(26005)(82740400003)(36756003)(55446002)(356005)(81166007)(83170400001)(47076005)(7416002)(2906002)(41300700001)(35950700001)(83380400001)(42882007)(82202003)(73392003)(70586007)(5660300002)(42186006)(110136005)(4326008)(76482006)(316002)(70206006)(54906003)(8936002)(8676002)(45356006)(32563001)(35450700002);DIR:OUT;SFP:1022; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:27.1908 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87758586-9d7f-4fb2-3165-08dc1051544b X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[211.75.126.7];Helo=[NTHCCAS01.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR03MB8852 X-OriginatorOrg: nuvoton.com Add 25Mhz reference clock since the reference clock in not a part of Nuvoton BMC NPCM8XX SoC. Signed-off-by: Tomer Maimon --- .../arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 10 ++++++---- arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi index ecd171b2feba..9c4df91031e7 100644 --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi @@ -58,6 +58,8 @@ clk: clock-controller@f0801000 { compatible = "nuvoton,npcm845-clk"; #clock-cells = <1>; reg = <0x0 0xf0801000 0x0 0x1000>; + clocks = <&refclk>; + clock-names = "refclk"; }; apb { @@ -81,7 +83,7 @@ timer0: timer@8000 { compatible = "nuvoton,npcm845-timer"; interrupts = ; reg = <0x8000 0x1C>; - clocks = <&clk NPCM8XX_CLK_REFCLK>; + clocks = <&refclk>; clock-names = "refclk"; }; @@ -153,7 +155,7 @@ watchdog0: watchdog@801c { interrupts = ; reg = <0x801c 0x4>; status = "disabled"; - clocks = <&clk NPCM8XX_CLK_REFCLK>; + clocks = <&refclk>; syscon = <&gcr>; }; @@ -162,7 +164,7 @@ watchdog1: watchdog@901c { interrupts = ; reg = <0x901c 0x4>; status = "disabled"; - clocks = <&clk NPCM8XX_CLK_REFCLK>; + clocks = <&refclk>; syscon = <&gcr>; }; @@ -171,7 +173,7 @@ watchdog2: watchdog@a01c { interrupts = ; reg = <0xa01c 0x4>; status = "disabled"; - clocks = <&clk NPCM8XX_CLK_REFCLK>; + clocks = <&refclk>; syscon = <&gcr>; }; }; diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts index a5ab2bc0f835..722a46d78d23 100644 --- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts @@ -19,6 +19,12 @@ chosen { memory { reg = <0x0 0x0 0x0 0x40000000>; }; + + refclk: refclk-25mhz { + compatible = "fixed-clock"; + clock-frequency = <25000000>; + #clock-cells = <0>; + }; }; &serial0 { From patchwork Mon Jan 8 13:54:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513707 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01rlnn2054.outbound.protection.outlook.com [40.95.54.54]) (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 AA58352F80; Mon, 8 Jan 2024 16:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="fIh9O+Ev" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=afRb3xHEswKlTnVE2ozMwe8l6SGnxYg2UCEBRhd+9XqvCwxaospTqqVNnt02i3V2hsMn3lrYu0McTFd5sdnW+mGQ+fBZoJ9QmQUAicDN0CrKJ6oDLVS1z5LKfgg9knPfxlGACcKjme2BlmjnU9z+Np3lg8uU/F+IJoJzpO7fDZ+4D/8+zz2QMyux6EXz/qRPoXEdsDXZ9PeBQgcmjmlS003zsR478uTFoZCJnqODZDytdcYmHONYsZ3rHJ89R+4b56Al1gcgJKMZACm1vlcqChQNV1GpIx8syB+G4tEoTdQN0hrKRP57oq3q/B5N1hXUPltLs9xWXBGD3WVZWYZHrA== 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=Srrtx+a88TNyD5zyiXiMbEkBzrKR7ULA+ZK45jCj/S8=; b=WYUgYmjARAcEEkc3yADRY2wRqXoUA25pNfCjFJyXHxzvtMZdsoyuXWPG81YmYJVW1MQGVasx7P6dd1A+WNi/dE1ozS3H/MG6V3coGDEs0mb/ljD1Iv9Xr/1Aoh47KBwyv2JliEwHX0x9kXorljBsoEyk3a5VGHSPTv0FaWlJA1jkhhbem3jSENg0LGiYjYpWr0LH1yJ06GH0rWnBBzMjSYop3LIuTl7rMAPKRhDzXG/2Pl9PNrk71u7rPPE2uTTsD6+v6feBy86TnEZVrFkTxDIYS9gyot71qIz9wP7BSepm/1Pb1QfmLZN8CEgpLMt0b9LvK0+tMOsUPfKXqDN8Ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 211.75.126.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Srrtx+a88TNyD5zyiXiMbEkBzrKR7ULA+ZK45jCj/S8=; b=fIh9O+EvxJUWPgPMFlg0MJq2pRAZ0o9ll0Q40i8qO12FUilbtxQo0somQfM8UYKxP50bfacDppdGUjF360MTzM5l06+9a9ir3mZc5LgKxSYPoG7vIYONoFmTTz+qyMe3USS/2yxazilM0QD3kkjuY6EAAr7nHzvb7wHt6h6OA1o= Received: from PS2PR02CA0087.apcprd02.prod.outlook.com (2603:1096:300:5c::27) by SEZPR03MB7840.apcprd03.prod.outlook.com (2603:1096:101:18a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Mon, 8 Jan 2024 13:54:32 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::4) by PS2PR02CA0087.outlook.office365.com (2603:1096:300:5c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:32 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 211.75.126.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS01.nuvoton.com (211.75.126.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:30 +0000 Received: from NTHCML01A.nuvoton.com (10.1.8.177) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 8 Jan 2024 21:54:24 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCML01A.nuvoton.com (10.1.8.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id 81CF35F646; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 8127DDC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 3/8] arm: dts: nuvoton: npcm7xx: modify rst syscon node Date: Mon, 8 Jan 2024 15:54:16 +0200 Message-ID: <20240108135421.684263-4-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|SEZPR03MB7840:EE_ X-MS-Office365-Filtering-Correlation-Id: c354a121-1abc-4d12-2c1c-08dc1051568c X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DxQJgjR7AWQorLlPsA9RQlcsKKDYDugMAzVsEpV419Mv0czVAKBGmusiDBXqZa/n68BznUlMcmhogO6um23LaoMycjNf/TDYO2shg7VeparierbSTPa1qTQmNj+Fh2W+quZW6L8faVxCF+8nZgdHaJGxhHi8jNPgNok8dmUJCNfJzgSIWJyySQdhsqap7iLMKrIR6rbL/I4nm8SYE2SiQkZNKbcg9hS2OEhUBC/yfCzH9gdAugLpmVpRSAf13aYL/iWBBm9eO9Utq9Kf3NiuXXBM7SQl2nnjkb12Npv5Z2HQzArQooDt1kN9xAZonvVx4w75CgkzW2faZxIuaspu4YI5KCEorMMA3XyJDXnawj5gGLOUB+0d8gRgR4Ng9gy8R5kAI2Bc2+yhea+tV6f0tGS9VrdrWfv2Ul+lodmcfPA61MhEvjFVkNjdpx9hA49zMIPtgIrP6uD6pfQg2n1hgxBexuILF5RlPjzuogQLQY7HOePYw4ZLVTxggBArbAyMI8qu26QgfNckMIbNrlJE34LNx+TEz8C0p9vYYO4xfjHHknm3aTO9coAMspfm63E4FTganMyOdatM+jI9UgJ5AxMpJfXRi5WKY8fA1CK1PVn+VnIB8Aan5M9X9R3IgPl6+Yn4klTaVsHBSVwhYgEPjc6wF3qHFfYcRpMQXl9xSZjKYjs90RFoLtUpfPSzQZC2ARPrk9ZS/1mgrOEkgMD/AcydR2c5COEIOPsZA6SFWXTygyQmHVFNaVa0MDqskz+PycKiYLYA8AYUFzJ+DzgIDCkj39DUCzQ0txogTa1bHtvDae/M/oAEUQBkc0E4sZT2RMNXfYfAo3O9o52xCwdq/S8H1Y7FcJpo3tiaZmckOew= X-Forefront-Antispam-Report: CIP:211.75.126.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS01.nuvoton.com;PTR:211-75-126-7.hinet-ip.hinet.net;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(396003)(376002)(346002)(136003)(230922051799003)(48200799006)(61400799012)(82310400011)(451199024)(64100799003)(40470700004)(46966006)(40460700003)(6666004)(4326008)(110136005)(40480700001)(76482006)(70586007)(70206006)(8676002)(8936002)(316002)(54906003)(42186006)(336012)(26005)(82202003)(83380400001)(1076003)(2616005)(498600001)(6266002)(73392003)(42882007)(4744005)(7416002)(5660300002)(2906002)(47076005)(35950700001)(82740400003)(356005)(83170400001)(55446002)(81166007)(41300700001)(36756003)(45356006)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:30.9721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c354a121-1abc-4d12-2c1c-08dc1051568c X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[211.75.126.7];Helo=[NTHCCAS01.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR03MB7840 rst node name and compatible property modified since clock and reset are handled in the same memory region. Signed-off-by: Tomer Maimon --- arch/arm/boot/dts/nuvoton/nuvoton-common-npcm7xx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/nuvoton/nuvoton-common-npcm7xx.dtsi b/arch/arm/boot/dts/nuvoton/nuvoton-common-npcm7xx.dtsi index 868454ae6bde..f72c5a03d04c 100644 --- a/arch/arm/boot/dts/nuvoton/nuvoton-common-npcm7xx.dtsi +++ b/arch/arm/boot/dts/nuvoton/nuvoton-common-npcm7xx.dtsi @@ -93,8 +93,8 @@ gcr: gcr@800000 { reg = <0x800000 0x1000>; }; - rst: rst@801000 { - compatible = "nuvoton,npcm750-rst", "syscon", "simple-mfd"; + clk_rst: syscon@801000 { + compatible = "nuvoton,npcm750-clk-rst", "syscon", "simple-mfd"; reg = <0x801000 0x6C>; }; }; From patchwork Mon Jan 8 13:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513558 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01rlnn2050.outbound.protection.outlook.com [40.95.110.50]) (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 394314777C; Mon, 8 Jan 2024 14:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="uttHVWk3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Toq+zBhFGLG++L0jAmn0+DOMlFPrWREuQ2ihXl8OQ7CqBL7dFI5JYM5957dC9yBDSte8yTGmXbJ0lwaSP4J8g8EpA5KEZlsKUPGsuPIzWB6uLcmWrIKOskpu7HAhGgsHLnnhBcmh56WutN1vwChF8c28Wh3EtxK1wFCsRaub8zpmvKdKaUDYa1ZaOlZvYP3NOcLx9wEPlZwj+HJ95fSjYcLJKOn3K7nPYS+JXAyoHgzcaH1fuibQ1vBoMfjwcoDl88e5hD7LxgpMeZXfqTARSYXMFiVHSsq6kRX4+uJ9mMSm0hPJcF/LWNU/dLgCo99gWKEmrW6hnLOWkFTlFcU+gw== 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=XvTno2ldL33EagYWpxaNixMNkdbH0dEQ0CPhyIa9KWY=; b=VHh3AvH5bsxdzmu9XW1oQD+kRCw+b3tjCkHuoRn/kDXHf1SJTgy4UD4qVoy+kiYBl/nxbvv7Ou2zZocMZRL+WJRGBOyrGhLVafTf/4qLqJZ3vJeWryR4LFqH4gHBRv9k/C2LIJE/eqsZDRi3WZdmVWxJ+HqACKo8c7shB6eLU7fVFFFcN8HyrkCDBgZw1p57JqV8bqNqAi9LKRr3MNjI6gEARcndje6t8ibPbRxW7zwbVuAskkeyPKoVXIi0Y343ZrZldf3fOj50y1+FDmLjh3do3qb9q+WAI8NE4z4ifP/GEuPT2J+mmeFG95o5errnD9X9x15Bsm7MFZys/w/wTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 211.75.126.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XvTno2ldL33EagYWpxaNixMNkdbH0dEQ0CPhyIa9KWY=; b=uttHVWk3xgMag4pByyKzbjXLB3tsq62KgeQunEPXdPbDwxg8ouFzPRKdapf59oJasl2i/fkdxtMbnfxDiIyfBXwatUGpY+xvyZJxrggsmEWHLFTqC9SjW6JwbV+jkxCt5CLocgPQRWBA8Cf282qrN0K8Fqk72TM+P5YVsw/PO/A= Received: from PS2PR02CA0091.apcprd02.prod.outlook.com (2603:1096:300:5c::31) by SEYPR03MB7968.apcprd03.prod.outlook.com (2603:1096:101:168::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:30 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::ac) by PS2PR02CA0091.outlook.office365.com (2603:1096:300:5c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:30 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 211.75.126.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS01.nuvoton.com (211.75.126.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:29 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id 8C75F5F649; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 8BF9CDC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 4/8] dt-bindings: soc: nuvoton: add binding for clock and reset registers Date: Mon, 8 Jan 2024 15:54:17 +0200 Message-ID: <20240108135421.684263-5-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|SEYPR03MB7968:EE_ X-MS-Office365-Filtering-Correlation-Id: 11d72320-b249-4be3-aee6-08dc1051556b X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ePeVN6yWmgxcfRl8nzvRTI+Y8369zHx/Aov5bTLywIPvuqHXjnLdMbNW3WMxfUa0P65NZP8FugLKcjCma6iOVi+IwiIiH7VbvUefB7UHuaSoLS5u88y7TCA/6LZgQG2406Q4dHrfGzLS372xRYkD5pB6Mmj0cLbtCCfVifyC60aRfhkj728qg8Dapbz0Diq+OqcSJdKQlkGi0SGgaaRy1zcjyjcdAKJNQVXBYED1ogcjaexjDBhTd94d1L1NJpckNidYpP0G+eyGNwE9AEeyGEPVfmNaMmgsHUBBGZ4pt6cVYdR2UINmYSpA+JXVqA3AbC/CEkujHyEm5RKF1T1SclmSDMu8M0FI9bwh8CVVr5LPEDy2RPvegmiJmshGWhKaRjY+Zy6dVZsyUkNNrDjGUmR3WuKOAytPSnYJ2B3pqtOZjat/ZhnYRuDP5Z6FacNcsEBvInCVu9DVOILnsVbO5FVu69ORw96JQDnVuuSow+d835Bbki+nUSgFx/9gZCDDJZ4f22eEEhmb9GCSTFokp2B52MkJink/d5VvnY4EzOLM2HWRlD4VBubCzbK6ni90+jwJsVNU4Buwh24at3iO6JNV6GIqkICirKX6nCef8+0JzyDVMzTtBRj4/KKxMRPNKeCWoc4avjwHWMnrsfmhnMEq7IP3bMnh+B2ahiNiCrFAGR0vXMM5TDhJOp33zWhyYE6hIW3G1GkVTDboVmQQ1IknlUbaYYjGrhNc+PbWXjS2Mfncxe8Ue+feIJFfTUIlZsGLcsJdFgBwUHwumFPM0CeFJBalkL9B7J4MA7Y7wPio6k4bg9uDDV2Hw8XcZ6h3uTX3QT0ohK01rbY9K06stw== X-Forefront-Antispam-Report: CIP:211.75.126.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS01.nuvoton.com;PTR:211-75-126-7.hinet-ip.hinet.net;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230922051799003)(61400799012)(48200799006)(64100799003)(82310400011)(451199024)(46966006)(40470700004)(966005)(1076003)(26005)(2616005)(336012)(6266002)(498600001)(6666004)(47076005)(35950700001)(83380400001)(73392003)(82202003)(42882007)(5660300002)(2906002)(7416002)(41300700001)(70206006)(42186006)(316002)(76482006)(54906003)(8936002)(110136005)(8676002)(4326008)(70586007)(82740400003)(55446002)(36756003)(356005)(81166007)(83170400001)(40460700003)(40480700001)(45356006)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:29.0814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11d72320-b249-4be3-aee6-08dc1051556b X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[211.75.126.7];Helo=[NTHCCAS01.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR03MB7968 A nuvoton,*-clk-rst node is present in nuvoton-common-npcm7xx.dtsi and will be added to nuvoton-common-npcm8xx.dtsi. It is necessary for the NPCM7xx and NPCM8xx clock and reset drivers, and may later be used to retrieve SoC model and version information. This patch adds a binding to describe this node. Signed-off-by: Tomer Maimon --- .../soc/nuvoton/nuvoton,npcm-clk-rst.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-clk-rst.yaml diff --git a/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-clk-rst.yaml b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-clk-rst.yaml new file mode 100644 index 000000000000..dfec64a8eb26 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-clk-rst.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/nuvoton/nuvoton,npcm-clk-rst.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Clock and reset registers block in Nuvoton SoCs + +maintainers: + - Tomer Maimon + +description: + The clock and reset registers are a registers block in Nuvoton SoCs that + handle both reset and clock functionality. + +properties: + compatible: + items: + - enum: + - nuvoton,npcm750-clk-rst + - nuvoton,npcm845-clk-rst + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: + type: object + +examples: + - | + clk_rst: syscon@801000 { + compatible = "nuvoton,npcm750-clk-rst", "syscon", "simple-mfd"; + reg = <0x801000 0x6C>; + }; From patchwork Mon Jan 8 13:54:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513928 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01rlnn2079.outbound.protection.outlook.com [40.95.110.79]) (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 157FD45C0D; Mon, 8 Jan 2024 19:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="JQbipxoY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qw6bBZNRZzilX0z6YnGHzMXt6MG0tebgGVdwsU/piOWDg7HhQzxLaruLxqQQs+2uOK2rw6X7TFTZHw30rmynai2pjapsKbfZv43FnxtaHlZE8uT+SVgyua1h4C0sboooVgNI1Ti5VNaG9b2iD1Kh3dMozis2AAwHJU+mAsbO3SZiglU/xNUmoFYFmymSOdIAIiGCucr5ETWppbRG1lPH+KoMOgXJNPzj/cmDKATanhaYfDcSEUYLjZn2P/LpAxnp6LAEmEWGUy2mzFQs46FQneakR/6/hxp2QJmEhtzv7qpagW6kNp2LRNTX2wahsnCn/5rngQTNgL/1ljz3CVGB0Q== 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=v2D468flie3JNhJ+N5NYFfoJqr/veU8Xh/sDR5huZgc=; b=a/QkMYRDym6RP/+CxQO9Gm8wrTINQr3C4T0+RZvLao3flxcqFlmTFKJOIYL0PQt33fxpontcbDuNJL8Haw3OxWVT7d/mEDk/YBIXsB6fwYsJUtbcijTGud5MsggH5woqDkh6eDGFHVv1MqoHZYQ+h98Api8WHPWAtpxEJqM+IhyXRKeUN9jfooEuy5gBmzYs4IMwqXHHT8CDnANBuv3wrZfWIkDlo+I0mONO0fGUOKLomSqWlf1PTl87u10hmAEgfDzP0li6yFNPxHfpmBF5y3jTvMlDyymOdTK/RtME5Ttn12TXkr26UuVAw6yr01uheHVNe7ab4FYzyDvAPy7fbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 211.75.126.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v2D468flie3JNhJ+N5NYFfoJqr/veU8Xh/sDR5huZgc=; b=JQbipxoYbAo+FY9POlT2KWZc0MwCO8reoFohLhwDev3Ww9KeEH/Mz6cbpGElQf/peIvHQGuanUuiOPMm/ByJv0JFqAUwl4OyDLAa4Hf/uJfAHXSX8/uJ9M7DvdLimpwmsmGYLe/UkrvzE6Ld61RlfTb+t/2Tv319o1cP5KLoxrE= Received: from PS2PR02CA0082.apcprd02.prod.outlook.com (2603:1096:300:5c::22) by SEYPR03MB7681.apcprd03.prod.outlook.com (2603:1096:101:13d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:35 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::b7) by PS2PR02CA0082.outlook.office365.com (2603:1096:300:5c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:35 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 211.75.126.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS01.nuvoton.com (211.75.126.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:34 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id 97D175F64B; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 97224DC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 5/8] arm64: dts: nuvoton: npcm8xx: add clock reset syscon node Date: Mon, 8 Jan 2024 15:54:18 +0200 Message-ID: <20240108135421.684263-6-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|SEYPR03MB7681:EE_ X-MS-Office365-Filtering-Correlation-Id: 84125afc-d926-4982-9c15-08dc105158e2 X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 30A8GdJ4Y3sRrJQp8gWd8ptywWyvFxh6Y+C2Y3t4XrIGEwIf/ZfTlODxPIk0x6u9AR8/aAf2XxzmBmh4y/Lg8Mx+cM1+rMO00i9sH5BxiVnWMXLdu/wDzmQhM2axWVxhgD+lCnstKhPuz45nyEQ4RwYEYme6+IqnOUkkTN3RGO3QQ4u7hsWsswzubgpB3cWhvF8Nf059ty/uAyH4grJaw477S2f6NXQcPe3BN2eAy8b4FugySAYMKM20CQX03ZGxr2NC5/NdBM5cYtxQey0xRE6/sRzHKDYycdSo0Sa7btrqglu8j5TmlXOXE46spAnL279xKOfBbgZZFUGyLQzqvvDDEsOgCyY7j9UA6xyOw4zV/WOq2ATI/lHOLeIGv4IZTt2U+XqH0UIV3MfealxTnniPYX3rthoImeJEeNEmv9s6YWh6DwRnXHBS5ChfrKwGqQPu23aWVvnvhTKQi9/W+eXbcbvUNKKK8eLhMxxwL4QzjxasYV7uSX/ppsVKzOVMUtOxAT7ihtKVJ+a/Nam6yYQPRpa5G0kjEVm08spYPWIkby2IeJvj1Ibggypfb+ebD1Y0321C7UDvrk/nGkn14RWEcAgFF2lW82oTBKDU5ckpApZ48ZVBhELIe0qHJI5i4Dl/S9FmOyPcz+7WNYaziIaHjiA3vurpg07FW6XNrFMVjjKfJmDbYni8qUgiCo1TpdcRZvc7kQB42uGOXXg18cDmCcB8JGUFXN5VEU/8WKxJZBssv0V509p8Drjm+Z0DBH0tBoHVqhoe6lAsboi4qpGIcHKJyLPZKEnzemlLdBq5i0hA7FPlogGL83xk0tkbtl6malWQ4GmGuQ34sIdEZ7cdWkMuEhBiph5llwlwFCh3Kf61kkjyMbRo4wKudwlx X-Forefront-Antispam-Report: CIP:211.75.126.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS01.nuvoton.com;PTR:211-75-126-7.hinet-ip.hinet.net;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(61400799012)(451199024)(82310400011)(48200799006)(64100799003)(46966006)(40470700004)(47076005)(35950700001)(5660300002)(2906002)(4744005)(7416002)(83170400001)(36756003)(41300700001)(81166007)(356005)(55446002)(82740400003)(40460700003)(4326008)(2616005)(6666004)(110136005)(316002)(54906003)(42186006)(498600001)(76482006)(70206006)(8936002)(8676002)(336012)(6266002)(70586007)(40480700001)(73392003)(42882007)(83380400001)(82202003)(26005)(1076003)(45356006)(32563001)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:34.9096 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84125afc-d926-4982-9c15-08dc105158e2 X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[211.75.126.7];Helo=[NTHCCAS01.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR03MB7681 Add clock reset syscon node to handle reset and clock registers controllers. Signed-off-by: Tomer Maimon --- arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi index 9c4df91031e7..7d5956e2c9f3 100644 --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi @@ -22,6 +22,11 @@ gcr: system-controller@f0800000 { reg = <0x0 0xf0800000 0x0 0x1000>; }; + clk_rst: syscon@f0801000 { + compatible = "nuvoton,npcm845-clk-rst", "syscon", "simple-mfd"; + reg = <0x0 0xf0801000 0x0 0xC4>; + }; + gic: interrupt-controller@dfff9000 { compatible = "arm,gic-400"; reg = <0x0 0xdfff9000 0x0 0x1000>, From patchwork Mon Jan 8 13:54:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513958 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01rlnn2045.outbound.protection.outlook.com [40.95.110.45]) (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 479F855C2C; Mon, 8 Jan 2024 20:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="kfAEPqD9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YVWl6iN1QF8u1RSfewnGPBkR2wv56e1fS4lgQBT5ZK9bDFDhWpilP7su/t/zuWp2d2qjfiFS5rW6DEDbAl8TRackPHoQJtGR7t2DtG0VlS0Siaz5Dhuv1s+MbRnIr1IWgVK9lrQ2BojILX3L2Ec/cHFd6Gzo1JPpfkk2+D8Pz6q1QXtSl8+7z6buEKsQVEmj6J30QU8qdAXPjts9eorNZBpqc/iHnn7MCA+PYzkAvfCnBvaYRyD80N2+ePj+g6/i4X9XrY8VaLgQR+6u2SmSQyy426F5zINrA+T4UnIEyowhergR/KfToCEQNqzzapApqYgBhGrZjJKEjai9mgahuA== 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=zY8s7hL1jWM32I5tZuFHUstdY+XmbEDMFLcUrhza4lY=; b=l1VP2OCX0W36ClAmppWtgtealr0LnTmmlNp85ji2jRVCUwV3Dv20RZAvwKS0Z7Auk2GflhMz+bAMSq96x7Cr5YX2K04J/WNztXs+xb0FNE+wXfBqdMLck+jFo2VlxV+c31uQTfEAN5MLGDvYyW74k0KSi51Rzmnong6eG+psH08NjEPtURBd4fIA2QxoCKYnbiXLbtAH7yCZNVleFNkXfEynn5ER8XdMAwcG5wgbcMFbwYqrll+eUfM/2iSBvkWHKXazjZlh8L2FCmmV13VVc5cSEHhwrQrX3PzdQl201LeCdJyju+HWDZS5xCrdHUeyN4Fl+pIJ8R0WO2c5DZPhOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 175.98.123.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zY8s7hL1jWM32I5tZuFHUstdY+XmbEDMFLcUrhza4lY=; b=kfAEPqD9xvy9vpZus7mKjeFLMNDazR85qJBmhgG7nv0TQD2yQ2Oi+jYI5h1D3xKoiMug/4OFrSjLQKgHu8xkAo5RNQi/Dzz/3k9wxFS3JHCckDeqICxJSBCnOmcEJ14ZCUwzXhbHQ22G4FPN3a8dD6GRygTyWf6RZnQDZWdcp2U= Received: from PS2PR02CA0073.apcprd02.prod.outlook.com (2603:1096:300:5c::13) by KL1PR03MB6286.apcprd03.prod.outlook.com (2603:1096:820:a5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:29 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::74) by PS2PR02CA0073.outlook.office365.com (2603:1096:300:5c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:28 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 175.98.123.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS04.nuvoton.com (175.98.123.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:27 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS04.nuvoton.com (10.1.8.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.14; Mon, 8 Jan 2024 21:54:24 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id A36305F64C; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id A2E5ADC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 6/8] dt-bindings: clock: npcm845: replace reg with syscon property Date: Mon, 8 Jan 2024 15:54:19 +0200 Message-ID: <20240108135421.684263-7-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|KL1PR03MB6286:EE_ X-MS-Office365-Filtering-Correlation-Id: fb3907f9-4e6a-4a00-3165-08dc1051544b X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yLLXCp249SaCAj2KB1EpIxy5hg/zAFIpIuArWUih9ulyeZmyFMfqOJed+6RTgS2nmQki7Aq+iFLkVSrTiJ8BQGFeF1v76Jax694LimXA19LnW188BA0hu0WNLB7tATiUss+K8UaXf66S+ZA3O77PkZZZnpKhICk6M2Yr4hVrhrflH+Jsa9rozcUAixOQAwynudQqA2XnQFbaK402IqpBl+PPQC+VfhDUdvMU/+U7eMhVXSfcu6wEHgcPZZ0tY8HZdiXPfNbcS+YY7lJA+YC6kVvpx5DREnw1DXYG4R+b7xFwz+C8P+/VKzmFLS1Pq1OTob/ZVikSOghSHzT42ESht0ZauJa4agwUni1Hn9Cc51/rknBG+EJqoGCGVnM4pxhL6ZUYMIOP/pcs2EIsrnwUyEXbEqzIGxCug7gHEVzuuSv04+w+FlQ7mdyD2ZQRUaN4mX9mkKlUJQ1xMayMnAxtIvkxJ8mX0QSVq/NM7WDxdzh8IrJfnba4BN4dU2nn2JwGiAf0z0TcBLReoDDDLudubUXZdV3OjDSJXFvWGAd7lvq/5q4PifX04/2Uj5OLvbtYAQSG87mjfqSphee9uJ2gJVWJVT4D3ghbHVz8z7dFlEY5ox186fLDccLHodhS9GGeVL27396TsBD/H2AsnkEx/9fnCrdswVb2IEMwuoBjbXvCPyHuy8oEdtWdJdhVi2BgrzZRP7p7yNC3OEgOUkG73d85xjj4VwfkZSX3xoFjDwdAxvZVWCkt+FbU3MS9UZkk35T54OYN1JYWYYwSRnyc6Fej1kz7Rl0vhkrSP98QUYtOuyY1z18Qxiq5IafJVYgabzH52n+hGXcGaNGRC6uxC85K9T0G0kjOKy46RdjhG9k= X-Forefront-Antispam-Report: CIP:175.98.123.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS04.nuvoton.com;PTR:175-98-123-7.static.tfn.net.tw;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(136003)(396003)(376002)(84050400002)(230922051799003)(61400799012)(451199024)(48200799006)(64100799003)(82310400011)(40470700004)(46966006)(41300700001)(336012)(47076005)(1076003)(73392003)(83380400001)(6266002)(42882007)(82202003)(6666004)(40460700003)(40480700001)(54906003)(70586007)(76482006)(70206006)(2906002)(316002)(110136005)(83170400001)(498600001)(2616005)(26005)(35950700001)(82740400003)(356005)(55446002)(81166007)(42186006)(36756003)(5660300002)(7416002)(8676002)(4326008)(8936002)(45356006)(35450700002);DIR:OUT;SFP:1022; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:27.0970 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb3907f9-4e6a-4a00-3165-08dc1051544b X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[175.98.123.7];Helo=[NTHCCAS04.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR03MB6286 X-OriginatorOrg: nuvoton.com Replace reg with syscon property since the clock registers handle the reset registers as well. Signed-off-by: Tomer Maimon --- .../bindings/clock/nuvoton,npcm845-clk.yaml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml index 0b642bfce292..c6bf05c163b4 100644 --- a/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml +++ b/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml @@ -18,8 +18,9 @@ properties: enum: - nuvoton,npcm845-clk - reg: - maxItems: 1 + nuvoton,sysclk: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to access clock registers. clocks: items: @@ -37,7 +38,7 @@ properties: required: - compatible - - reg + - nuvoton,sysclk - clocks - clock-names - '#clock-cells' @@ -52,14 +53,11 @@ examples: clock-frequency = <25000000>; }; - ahb { - #address-cells = <2>; - #size-cells = <2>; - - clock-controller@f0801000 { - compatible = "nuvoton,npcm845-clk"; - reg = <0x0 0xf0801000 0x0 0x1000>; - #clock-cells = <1>; - }; + clk: clock-controller { + compatible = "nuvoton,npcm845-clk"; + nuvoton,sysclk = <&clk_rst>; + #clock-cells = <1>; + clocks = <&refclk>; + clock-names = "refclk"; }; ... From patchwork Mon Jan 8 13:54:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513542 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01rlnn2071.outbound.protection.outlook.com [40.95.53.71]) (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 F34B046B99; Mon, 8 Jan 2024 14:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="ss/M/dov" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qxr6f9mZ3jHGTRBG3OAjJHmrXvehkgkzPaIsIRbbRjQQkIZYsAoT0KQjn6jg4L91fTrNbIrKXsHwURCZMlnd+F178ckM8VDCvdmu6kSkmV+7keb3NhjxttpqlcmT1Afr2iCFYZ05IN2fnmW58nyutBfiW/T86OpY21G3R339DpXsAxofxdARkVNa6XEt9n6NszXgce/UrjYZ5UweXjfg421bF0W4iyKAXLmMk4dLampYWTnvgcyeG132a8aM20HiV75vfBwI2Om2PtF8rNyo1uoBqTPN0e80TY0LvYLfyX4fh3WTxJ8ozRwHeUTXQCx6VCYqin3B8Pj6kkKFZ+Iywg== 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=RvUhDHYoU9YFrryA5rfo0pqlGp1xJAYI7AjUQCu11Bg=; b=BnKL4GKQTvdl1/nCRAgWumJypgYuOYwmr0CWTirx5I+6MvPEFZLRBzpRc57hxRAFHNVJh7pszvI0zDikdePFgObsUqZTOqEsJtZZBMwGhyyPD6tHtjcI7KwccolyuHoO+A8DfEhuTzYXws3lo353ST0s0NgnNqCV78sSt9DvZwSsLDA+i5b4I+Bd8/DhKn3vzEtwtRFzUojZhWECKT4hWQdhSVOeYCupF2VbUOXMcktZFDT09kGvnkbppueWTb/qCHUk9aL4Sn1zDTJeW+FjLan8KyB7sf2gnSd2r33WorIYsDTko2HNV4SUl5zUeyLCj8jglED40Yos+M+Nlcaz7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 211.75.126.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RvUhDHYoU9YFrryA5rfo0pqlGp1xJAYI7AjUQCu11Bg=; b=ss/M/dovphW62xwObeYhmSMx5In1RN9H/yF8ulhFqr6+UkA9Pvlsq0DeplCApglGHl+Y/DFrqx/n/TdjACKCNJ81zqln+8FOsNjJobZlKETw1Ohsr0GnyG3zn0QmpZZwouLa/ZQq02W6+Kgjx6j3zBRimSY4Yh8KdqRf0uW7xD8= Received: from PS2PR02CA0091.apcprd02.prod.outlook.com (2603:1096:300:5c::31) by SEZPR03MB7677.apcprd03.prod.outlook.com (2603:1096:101:12e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Mon, 8 Jan 2024 13:54:34 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::9a) by PS2PR02CA0091.outlook.office365.com (2603:1096:300:5c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:34 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 211.75.126.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS01.nuvoton.com (211.75.126.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:32 +0000 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id AE8675F64D; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id ADCB1DC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 7/8] arm64: dts: nuvoton: npcm8xx: replace reg with syscon property Date: Mon, 8 Jan 2024 15:54:20 +0200 Message-ID: <20240108135421.684263-8-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|SEZPR03MB7677:EE_ X-MS-Office365-Filtering-Correlation-Id: fcca10f4-85dd-4995-0c10-08dc105157af X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZGrcuAJYbMly5fREhdV5JI6z+75sb6myLZqRTcy3nHEHuU4WtboY0hxgZDGiIEeKG+bLJDIaVnyV9ooKH35SZBHo80eMIF6DRDyiIDlHfUmZySeRygO8Wo5BnSvUshBN1LYWRhbgpEv+ADMl4zTarsnfqVAnaZNG2cGGq7KIUa2XU7t0SbDEumQAb3KtGKAySwJ/v3IHKw8d1iyAtKRfilLvgA2nlzTkX4z3t4wC3uc91dviZ4/HrTTBOsQcmlfdXIrIPMMBDSjNL5eCSQEW8Kr8MuXUJAkS6c/RPSjfIacDD3D+RcUHTPfy01LkBJsEpPV0BQn+Qk+XimI5+g0+UYR058Sq6jmYvsZfFRkyEgZiS8nmsQa92depKKS0SUQn+PwfuylZD278i2HE8kEpGaVCshAS1lVWsriYaUQJljqEfFG+sK2IKodLYQhQKPdAfwPwcox2pheZGVJsSioreK9BtUwJ2M3GlHawf16+O2Mz2mIvZDbc+eSg5PGijaMFbIAF2cqiXu7uem7utp77S5zoxS3JxLtvWfA7RtHuThbf8zP9gBaktyE8D5CVrrDZuhHCJ7jz4J+E8hNlC6LpjGpq0sJlani9hJAoXATeyfJLQunQx/5+DEf94dYYCjhknc6bxRrQkNDt/1K0atkM+HIZ+w1BqSVpcsfPRhuTyf9COgYiYEB1idPKXFvaZqGZWv2bFmk1F9UV7bX7tOtGY+C8gNUlFb3SkA4SSXK0TTKtmMY7T4jYXml738QmxEV9JIu7oq94nc7Q3gKPYys41TTlpg+UZCnRfbfnzlsBOMHWeaytZGtTQ3AXPjRZLjvm/gLxRzgcCQOzhn9ZLyZn1LH1Flvtt3G00ic3jApJGnNQbINPmkoTvOCBDRausQ4P X-Forefront-Antispam-Report: CIP:211.75.126.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS01.nuvoton.com;PTR:211-75-126-7.hinet-ip.hinet.net;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(136003)(396003)(39860400002)(230922051799003)(48200799006)(61400799012)(451199024)(64100799003)(82310400011)(40470700004)(46966006)(41300700001)(47076005)(1076003)(83380400001)(336012)(42882007)(82202003)(73392003)(6266002)(40480700001)(40460700003)(2906002)(76482006)(70586007)(70206006)(42186006)(54906003)(110136005)(82740400003)(83170400001)(498600001)(2616005)(26005)(356005)(35950700001)(55446002)(81166007)(316002)(36756003)(5660300002)(7416002)(4744005)(4326008)(8936002)(8676002)(45356006)(32563001)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:32.8940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcca10f4-85dd-4995-0c10-08dc105157af X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[211.75.126.7];Helo=[NTHCCAS01.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR03MB7677 Replace reg with syscon property since the clock registers handle the reset registers as well. Signed-off-by: Tomer Maimon --- arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi index 7d5956e2c9f3..5cc0efdbb3c7 100644 --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi @@ -59,10 +59,10 @@ rstc: reset-controller@f0801000 { nuvoton,sysgcr = <&gcr>; }; - clk: clock-controller@f0801000 { + clk: clock-controller { compatible = "nuvoton,npcm845-clk"; #clock-cells = <1>; - reg = <0x0 0xf0801000 0x0 0x1000>; + nuvoton,sysclk = <&clk_rst>; clocks = <&refclk>; clock-names = "refclk"; }; From patchwork Mon Jan 8 13:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Maimon X-Patchwork-Id: 13513949 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01rlnn2086.outbound.protection.outlook.com [40.95.110.86]) (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 45CDF55E45; Mon, 8 Jan 2024 20:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=taln60.nuvoton.co.il Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.onmicrosoft.com header.i=@nuvoton.onmicrosoft.com header.b="Do4Ga7Em" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQT7Yv9+CUPGLSzRKzB5WBcq3jpMx/l6gJyVNpmNNgSA88EdrS0fKKbEUsujpkjXokBVEHbP2978M2aTR1/BQMUNg1FGmtraFphA3+iA18IhEYTNGVBJh8jf82DVvd9VFYyOICew7jPnSQ6AqHyMl/kLH+PT+bUfG/F+q7CSyI4d+QpaK0YWlymdZ/Vkpoz5or+gzlwwuyVtRlXQ2jIdEJm0QlxO4x6zzmubF+Zd/rJCa8YjBq4D6xhuJT08Qasa2eBbH4NWWexXDcA/JUS1XoD4uBZMAbdrKQKfFkqSjkUq+eNwt7P1pJeJ592Qte6jZy78rSNwgqgCoigTmExNfg== 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=zkUvv6RboQ2qBZmOGNSFtjy02IaPYQGrrgEyCJiVKlw=; b=IZ4Vhr7aN4BhW8uEociB+SWYbC8jWWGxfPwYD3Y3XR8g5oLTGduvGH1SMDGbUn1L9nlQYv2+6H1Bx5RLfXyFeYf/1bNkUEPvXRlbT1idbLSUESxv76KAXPaCqMOPCwWwPY/V2Qi7/7T2SrRumnPImV4lZJXEtEQVB91nqNmWaTuTUJDds3KPUTW6gBVgxkKxVz6oIjrel62bQcGaK7ZtEWAg+ouF/XRG3Zy3Vew61byQQChF5lAFhF1/AZGcwvDH4pyK3gm3EdIYX/3w5jNCzsySlolp9CvwYJZ8afvjukgfTdbSTdVgb9kLr0mB4zVHVsH8MwQcSYNPdg6MpLF3CQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 175.98.123.7) smtp.rcpttodomain=baylibre.com smtp.mailfrom=taln60.nuvoton.co.il; dmarc=fail (p=none sp=quarantine pct=100) action=none header.from=gmail.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.onmicrosoft.com; s=selector2-nuvoton-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zkUvv6RboQ2qBZmOGNSFtjy02IaPYQGrrgEyCJiVKlw=; b=Do4Ga7EmUS0l7C7FVR0QaQyJAUFhNewCmElKJ/JgsMBnEea/oWcjgNipWYWcmDUSZuyMJgUFVVOmpwnghWy/2OUNgXOddKxTwOyWZVqISoZj72ml2NoGCvIskkfDwMStbShLRZhh+DpRQ52ToraSBjfjs5/K9iC12f0ntzGkgx4= Received: from PS2PR02CA0093.apcprd02.prod.outlook.com (2603:1096:300:5c::33) by JH0PR03MB7545.apcprd03.prod.outlook.com (2603:1096:990:8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 13:54:32 +0000 Received: from HK2PEPF00006FB5.apcprd02.prod.outlook.com (2603:1096:300:5c:cafe::a3) by PS2PR02CA0093.outlook.office365.com (2603:1096:300:5c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 13:54:31 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 175.98.123.7) smtp.mailfrom=taln60.nuvoton.co.il; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=gmail.com; Received-SPF: None (protection.outlook.com: taln60.nuvoton.co.il does not designate permitted sender hosts) Received: from NTHCCAS04.nuvoton.com (175.98.123.7) by HK2PEPF00006FB5.mail.protection.outlook.com (10.167.8.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.7181.12 via Frontend Transport; Mon, 8 Jan 2024 13:54:29 +0000 Received: from NTHCML01A.nuvoton.com (10.1.8.177) by NTHCCAS04.nuvoton.com (10.1.8.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.14; Mon, 8 Jan 2024 21:54:25 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCML01A.nuvoton.com (10.1.8.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln58.nuvoton.co.il (10.191.1.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 8 Jan 2024 21:54:25 +0800 Received: from taln60.nuvoton.co.il (taln60 [10.191.1.180]) by taln58.nuvoton.co.il (Postfix) with ESMTP id BAF7D5F64E; Mon, 8 Jan 2024 15:54:23 +0200 (IST) Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id B8897DC0047; Mon, 8 Jan 2024 15:54:23 +0200 (IST) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v22 8/8] clk: npcm8xx: add clock controller Date: Mon, 8 Jan 2024 15:54:21 +0200 Message-ID: <20240108135421.684263-9-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108135421.684263-1-tmaimon77@gmail.com> References: <20240108135421.684263-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NotSetDelaration: True X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK2PEPF00006FB5:EE_|JH0PR03MB7545:EE_ X-MS-Office365-Filtering-Correlation-Id: 72cf149e-02e7-4c06-5c8f-08dc105155ba X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EmBPQYw4Vv5FIbEIGYLtfvwu9qcwuNU9oGDLbgZRxjBPmoC9bWvWXUQlOuUwDJ5/e7LdbwrEHg8YUNu5IEGT/W5pFHtNmm/kYAz13CiZ3aX5VnExmoa8NAcKmSOGK+hqH2VOhNGgqxGVxkdCOnlo2vrfJaDv8j6ZyKWYQzK/IXEFnfU+dl1DNa0jPRvCwNeF3ggBturYxdewaA3XV1eImS23RoJmXQaePE5cKAHsOf8FHoiaw7eOQzFLtg0cljy2RkJ5xGxQxvmgiiA1ElGVc7Gew45qgXEfRjMU/3Y/8udhm+Cf3kedEaZLDh0j5A0ACfZS8uKS5iAmRS2o5DCGSgSC3UupN6GSb5+S8d4Y9P58jtzDUnMY0WMUTP0tbLJg1s/u02sVqOLlitvNoPklubZvheQDPwwsYD1tn7Jz2fAERmMXaDFGsNomhNU2zr/fkdZ/dy+zmQEplkk81Ls6NNdJORe2bh6k6e0kbJ3CbP4K6/hUjW9sscvfyeOb1T408irY5LGGljmy6yspkHH9pPyPQP9DOBFkw11Oc4kfXAQrfUYxltWZ8WqQFeSevwnlqSxgfcdIUasn5MuNdb+PR1vZEOuSGrNYCfvz/rQPYV8MVRygdmD6EPrE+qkxoei3KFM1zS46893NKYVmQlvLBu6U9b6TC0xk2syw4gPyvi3XOwN70uZ6/+wJesvp15JgX5tb2PvtFtin+99y/Xv73mpocyj0sAUyaZQ/MWo1vSwa88+WalQc7gFSJgwNfSWapxEGGHVHEwNf1061f4FofKD9CUy5BkHW9NYja3FgUB3e7m6wwffBt2fOot337+ABfsryVi8GfsioKtjiXPeYc6Bhssh7WSHUG8uWWW9m1ALvsS99rTw/8JgSDyNCL3LO0DNAKhA9InoGl1diwUmH6pk8GWUVWMFWwOkLGUVTP3s= X-Forefront-Antispam-Report: CIP:175.98.123.7;CTRY:TW;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:NTHCCAS04.nuvoton.com;PTR:175-98-123-7.static.tfn.net.tw;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(396003)(376002)(136003)(230273577357003)(230922051799003)(230173577357003)(64100799003)(48200799006)(451199024)(61400799012)(82310400011)(40470700004)(46966006)(40460700003)(40480700001)(2616005)(1076003)(6266002)(336012)(498600001)(26005)(82740400003)(36756003)(55446002)(356005)(81166007)(83170400001)(5660300002)(7416002)(30864003)(2906002)(41300700001)(47076005)(35950700001)(42882007)(83380400001)(73392003)(82202003)(70586007)(4326008)(8676002)(76482006)(70206006)(54906003)(42186006)(316002)(8936002)(110136005)(45356006)(32563001)(35450700002);DIR:OUT;SFP:1022; X-OriginatorOrg: nuvoton.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 13:54:29.6127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72cf149e-02e7-4c06-5c8f-08dc105155ba X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3f24931-d403-4b4a-94f1-7d83ac638e07;Ip=[175.98.123.7];Helo=[NTHCCAS04.nuvoton.com] X-MS-Exchange-CrossTenant-AuthSource: HK2PEPF00006FB5.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR03MB7545 Nuvoton Arbel BMC NPCM8XX contains an integrated clock controller which generates and supplies clocks to all modules within the BMC. Signed-off-by: Tomer Maimon Acked-by: Joel Stanley --- drivers/clk/clk-npcm8xx.c | 510 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 510 insertions(+) create mode 100644 drivers/clk/clk-npcm8xx.c diff --git a/drivers/clk/clk-npcm8xx.c b/drivers/clk/clk-npcm8xx.c new file mode 100644 index 000000000000..35123a460acd --- /dev/null +++ b/drivers/clk/clk-npcm8xx.c @@ -0,0 +1,510 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Nuvoton NPCM8xx Clock Generator + * All the clocks are initialized by the bootloader, so this driver allows only + * reading of current settings directly from the hardware. + * + * Copyright (C) 2020 Nuvoton Technologies + * Author: Tomer Maimon + */ + +#define pr_fmt(fmt) "npcm8xx_clk: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* npcm8xx clock registers*/ +#define NPCM8XX_CLKSEL 0x04 +#define NPCM8XX_CLKDIV1 0x08 +#define NPCM8XX_CLKDIV2 0x2C +#define NPCM8XX_CLKDIV3 0x58 +#define NPCM8XX_CLKDIV4 0x7C +#define NPCM8XX_PLLCON0 0x0C +#define NPCM8XX_PLLCON1 0x10 +#define NPCM8XX_PLLCON2 0x54 +#define NPCM8XX_PLLCONG 0x60 +#define NPCM8XX_THRTL_CNT 0xC0 + +#define PLLCON_LOKI BIT(31) +#define PLLCON_LOKS BIT(30) +#define PLLCON_FBDV GENMASK(27, 16) +#define PLLCON_OTDV2 GENMASK(15, 13) +#define PLLCON_PWDEN BIT(12) +#define PLLCON_OTDV1 GENMASK(10, 8) +#define PLLCON_INDV GENMASK(5, 0) + +struct npcm8xx_clk { + struct regmap *clk_regmap; + unsigned int offset; + const char *name; + const u32 *table; + u32 mask; + u8 shift; + unsigned long width; + unsigned long flags; + struct clk_hw hw; +}; + +#define to_npcm8xx_clk(_hw) container_of(_hw, struct npcm8xx_clk, hw) + +struct npcm8xx_clk_pll_data { + const char *name; + struct clk_parent_data parent; + unsigned int reg; + unsigned long flags; + struct clk_hw hw; +}; + +struct npcm8xx_clk_div_data { + u32 reg; + u8 shift; + u8 width; + const char *name; + const struct clk_hw *parent_hw; + unsigned long clk_divider_flags; + unsigned long flags; + int onecell_idx; + struct clk_hw hw; +}; + +struct npcm8xx_clk_mux_data { + u8 shift; + u32 mask; + const u32 *table; + const char *name; + const struct clk_parent_data *parent_data; + u8 num_parents; + unsigned long flags; + struct clk_hw hw; +}; + +/* external clock definition */ +#define NPCM8XX_CLK_S_REFCLK "refclk" + +/* pll definition */ +#define NPCM8XX_CLK_S_PLL0 "pll0" +#define NPCM8XX_CLK_S_PLL1 "pll1" +#define NPCM8XX_CLK_S_PLL2 "pll2" +#define NPCM8XX_CLK_S_PLL_GFX "pll_gfx" + +/* early divider definition */ +#define NPCM8XX_CLK_S_PLL2_DIV2 "pll2_div2" +#define NPCM8XX_CLK_S_PLL_GFX_DIV2 "pll_gfx_div2" +#define NPCM8XX_CLK_S_PLL1_DIV2 "pll1_div2" + +/* mux definition */ +#define NPCM8XX_CLK_S_CPU_MUX "cpu_mux" + +/* div definition */ +#define NPCM8XX_CLK_S_TH "th" +#define NPCM8XX_CLK_S_AXI "axi" + +static struct clk_hw hw_pll1_div2, hw_pll2_div2, hw_gfx_div2, hw_pre_clk; +static struct npcm8xx_clk_pll_data npcm8xx_pll_clks[] = { + { NPCM8XX_CLK_S_PLL0, { .index = 0 }, NPCM8XX_PLLCON0, 0 }, + { NPCM8XX_CLK_S_PLL1, { .index = 0 }, NPCM8XX_PLLCON1, 0 }, + { NPCM8XX_CLK_S_PLL2, { .index = 0 }, NPCM8XX_PLLCON2, 0 }, + { NPCM8XX_CLK_S_PLL_GFX, { .index = 0 }, NPCM8XX_PLLCONG, 0 }, +}; + +static const u32 cpuck_mux_table[] = { 0, 1, 2, 7 }; +static const struct clk_parent_data cpuck_mux_parents[] = { + { .hw = &npcm8xx_pll_clks[0].hw }, + { .hw = &npcm8xx_pll_clks[1].hw }, + { .index = 0 }, + { .hw = &npcm8xx_pll_clks[2].hw } +}; + +static const u32 pixcksel_mux_table[] = { 0, 2 }; +static const struct clk_parent_data pixcksel_mux_parents[] = { + { .hw = &npcm8xx_pll_clks[3].hw }, + { .index = 0 } +}; + +static const u32 default_mux_table[] = { 0, 1, 2, 3 }; +static const struct clk_parent_data default_mux_parents[] = { + { .hw = &npcm8xx_pll_clks[0].hw }, + { .hw = &npcm8xx_pll_clks[1].hw }, + { .index = 0 }, + { .hw = &hw_pll2_div2 } +}; + +static const u32 sucksel_mux_table[] = { 2, 3 }; +static const struct clk_parent_data sucksel_mux_parents[] = { + { .index = 0 }, + { .hw = &hw_pll2_div2 } +}; + +static const u32 mccksel_mux_table[] = { 0, 2 }; +static const struct clk_parent_data mccksel_mux_parents[] = { + { .hw = &hw_pll1_div2 }, + { .index = 0 } +}; + +static const u32 clkoutsel_mux_table[] = { 0, 1, 2, 3, 4 }; +static const struct clk_parent_data clkoutsel_mux_parents[] = { + { .hw = &npcm8xx_pll_clks[0].hw }, + { .hw = &npcm8xx_pll_clks[1].hw }, + { .index = 0 }, + { .hw = &hw_gfx_div2 }, + { .hw = &hw_pll2_div2 } +}; + +static const u32 gfxmsel_mux_table[] = { 2, 3 }; +static const struct clk_parent_data gfxmsel_mux_parents[] = { + { .index = 0 }, + { .hw = &npcm8xx_pll_clks[2].hw } +}; + +static const u32 dvcssel_mux_table[] = { 2, 3 }; +static const struct clk_parent_data dvcssel_mux_parents[] = { + { .index = 0 }, + { .hw = &npcm8xx_pll_clks[2].hw } +}; + +static const u32 default3_mux_table[] = { 0, 1, 2 }; +static const struct clk_parent_data default3_mux_parents[] = { + { .hw = &npcm8xx_pll_clks[0].hw }, + { .hw = &npcm8xx_pll_clks[1].hw }, + { .index = 0 } +}; + +static struct npcm8xx_clk_mux_data npcm8xx_muxes[] = { + { 0, 7, cpuck_mux_table, NPCM8XX_CLK_S_CPU_MUX, cpuck_mux_parents, + ARRAY_SIZE(cpuck_mux_parents), CLK_IS_CRITICAL }, + { 4, 3, pixcksel_mux_table, "gfx_pixel_mux", pixcksel_mux_parents, + ARRAY_SIZE(pixcksel_mux_parents), 0 }, + { 6, 3, default_mux_table, "sd_mux", default_mux_parents, + ARRAY_SIZE(default_mux_parents), 0 }, + { 8, 3, default_mux_table, "uart_mux", default_mux_parents, + ARRAY_SIZE(default_mux_parents), 0 }, + { 10, 3, sucksel_mux_table, "serial_usb_mux", sucksel_mux_parents, + ARRAY_SIZE(sucksel_mux_parents), 0 }, + { 12, 3, mccksel_mux_table, "mc_mux", mccksel_mux_parents, + ARRAY_SIZE(mccksel_mux_parents), 0 }, + { 14, 3, default_mux_table, "adc_mux", default_mux_parents, + ARRAY_SIZE(default_mux_parents), 0 }, + { 16, 3, default_mux_table, "gfx_mux", default_mux_parents, + ARRAY_SIZE(default_mux_parents), 0 }, + { 18, 7, clkoutsel_mux_table, "clkout_mux", clkoutsel_mux_parents, + ARRAY_SIZE(clkoutsel_mux_parents), 0 }, + { 21, 3, gfxmsel_mux_table, "gfxm_mux", gfxmsel_mux_parents, + ARRAY_SIZE(gfxmsel_mux_parents), 0 }, + { 23, 3, dvcssel_mux_table, "dvc_mux", dvcssel_mux_parents, + ARRAY_SIZE(dvcssel_mux_parents), 0 }, + { 25, 3, default3_mux_table, "rg_mux", default3_mux_parents, + ARRAY_SIZE(default3_mux_parents), 0 }, + { 27, 3, default3_mux_table, "rcp_mux", default3_mux_parents, + ARRAY_SIZE(default3_mux_parents), 0 }, +}; + +static struct npcm8xx_clk_div_data npcm8xx_pre_divs[] = { + { NPCM8XX_CLKDIV1, 21, 5, "pre_adc", &npcm8xx_muxes[6].hw, CLK_DIVIDER_READ_ONLY, 0, -1 }, + { NPCM8XX_CLKDIV1, 26, 2, "ahb", &hw_pre_clk, CLK_DIVIDER_READ_ONLY, CLK_IS_CRITICAL, NPCM8XX_CLK_AHB }, +}; + +/* configurable dividers: */ +static struct npcm8xx_clk_div_data npcm8xx_divs[] = { + { NPCM8XX_CLKDIV1, 28, 3, "adc", &npcm8xx_pre_divs[0].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_ADC }, + { NPCM8XX_CLKDIV1, 16, 5, "uart", &npcm8xx_muxes[3].hw, 0, 0, NPCM8XX_CLK_UART }, + { NPCM8XX_CLKDIV1, 11, 5, "mmc", &npcm8xx_muxes[2].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_MMC }, + { NPCM8XX_CLKDIV1, 6, 5, "spi3", &npcm8xx_pre_divs[1].hw, 0, 0, NPCM8XX_CLK_SPI3 }, + { NPCM8XX_CLKDIV1, 2, 4, "pci", &npcm8xx_muxes[7].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_PCI }, + + { NPCM8XX_CLKDIV2, 30, 2, "apb4", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_APB4 }, + { NPCM8XX_CLKDIV2, 28, 2, "apb3", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_APB3 }, + { NPCM8XX_CLKDIV2, 26, 2, "apb2", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_APB2 }, + { NPCM8XX_CLKDIV2, 24, 2, "apb1", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_APB1 }, + { NPCM8XX_CLKDIV2, 22, 2, "apb5", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_APB5 }, + { NPCM8XX_CLKDIV2, 16, 5, "clkout", &npcm8xx_muxes[8].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_CLKOUT }, + { NPCM8XX_CLKDIV2, 13, 3, "gfx", &npcm8xx_muxes[7].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_GFX }, + { NPCM8XX_CLKDIV2, 8, 5, "usb_bridge", &npcm8xx_muxes[4].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SU }, + { NPCM8XX_CLKDIV2, 4, 4, "usb_host", &npcm8xx_muxes[4].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SU48 }, + { NPCM8XX_CLKDIV2, 0, 4, "sdhc", &npcm8xx_muxes[2].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SDHC }, + + { NPCM8XX_CLKDIV3, 16, 8, "spi1", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SPI1 }, + { NPCM8XX_CLKDIV3, 11, 5, "uart2", &npcm8xx_muxes[3].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_UART2 }, + { NPCM8XX_CLKDIV3, 6, 5, "spi0", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SPI0 }, + { NPCM8XX_CLKDIV3, 1, 5, "spix", &npcm8xx_pre_divs[1].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_SPIX }, + + { NPCM8XX_CLKDIV4, 28, 4, "rg", &npcm8xx_muxes[11].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_RG }, + { NPCM8XX_CLKDIV4, 12, 4, "rcp", &npcm8xx_muxes[12].hw, CLK_DIVIDER_READ_ONLY, 0, NPCM8XX_CLK_RCP }, + + { NPCM8XX_THRTL_CNT, 0, 2, NPCM8XX_CLK_S_TH, &npcm8xx_muxes[0].hw, CLK_DIVIDER_READ_ONLY | CLK_DIVIDER_POWER_OF_TWO, 0, NPCM8XX_CLK_TH }, +}; + +static struct clk_hw * +npcm8xx_clk_register(struct device *dev, const char *name, + struct regmap *clk_regmap, unsigned int offset, + unsigned long flags, const struct clk_ops *npcm8xx_clk_ops, + const struct clk_parent_data *parent_data, + const struct clk_hw *parent_hw, u8 num_parents, + u8 shift, u32 mask, unsigned long width, + const u32 *table, unsigned long clk_flags) +{ + struct npcm8xx_clk *clk; + struct clk_init_data init = {}; + int ret; + + clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL); + if (!clk) + return ERR_PTR(-ENOMEM); + + init.name = name; + init.ops = npcm8xx_clk_ops; + init.parent_data = parent_data; + init.parent_hws = parent_hw ? &parent_hw : NULL; + init.num_parents = num_parents; + init.flags = flags; + + clk->clk_regmap = clk_regmap; + clk->hw.init = &init; + clk->offset = offset; + clk->shift = shift; + clk->mask = mask; + clk->width = width; + clk->table = table; + clk->flags = clk_flags; + + ret = devm_clk_hw_register(dev, &clk->hw); + if (ret) + return ERR_PTR(ret); + + return &clk->hw; +} + +static unsigned long npcm8xx_clk_pll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct npcm8xx_clk *pll = to_npcm8xx_clk(hw); + unsigned long fbdv, indv, otdv1, otdv2; + unsigned int val; + u64 ret; + + if (parent_rate == 0) { + pr_debug("%s: parent rate is zero\n", __func__); + return 0; + } + + regmap_read(pll->clk_regmap, pll->offset, &val); + + indv = FIELD_GET(PLLCON_INDV, val); + fbdv = FIELD_GET(PLLCON_FBDV, val); + otdv1 = FIELD_GET(PLLCON_OTDV1, val); + otdv2 = FIELD_GET(PLLCON_OTDV2, val); + + ret = (u64)parent_rate * fbdv; + do_div(ret, indv * otdv1 * otdv2); + + return ret; +} + +static const struct clk_ops npcm8xx_clk_pll_ops = { + .recalc_rate = npcm8xx_clk_pll_recalc_rate, +}; + +static u8 npcm8xx_clk_mux_get_parent(struct clk_hw *hw) +{ + struct npcm8xx_clk *mux = to_npcm8xx_clk(hw); + u32 val; + + regmap_read(mux->clk_regmap, mux->offset, &val); + val = val >> mux->shift; + val &= mux->mask; + + return clk_mux_val_to_index(hw, mux->table, mux->flags, val); +} + +static const struct clk_ops npcm8xx_clk_mux_ops = { + .get_parent = npcm8xx_clk_mux_get_parent, +}; + +static unsigned long npcm8xx_clk_div_get_parent(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct npcm8xx_clk *div = to_npcm8xx_clk(hw); + unsigned int val; + + regmap_read(div->clk_regmap, div->offset, &val); + val = val >> div->shift; + val &= clk_div_mask(div->width); + + return divider_recalc_rate(hw, parent_rate, val, NULL, div->flags, + div->width); +} + +static const struct clk_ops npcm8xx_clk_div_ops = { + .recalc_rate = npcm8xx_clk_div_get_parent, +}; + +static int npcm8xx_clk_probe(struct platform_device *pdev) +{ + struct clk_hw_onecell_data *npcm8xx_clk_data; + struct device_node *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; + struct regmap *clk_regmap; + struct clk_hw *hw; + unsigned int i; + + npcm8xx_clk_data = devm_kzalloc(dev, struct_size(npcm8xx_clk_data, hws, + NPCM8XX_NUM_CLOCKS), + GFP_KERNEL); + if (!npcm8xx_clk_data) + return -ENOMEM; + + clk_regmap = syscon_regmap_lookup_by_phandle(np, "nuvoton,sysclk"); + if (IS_ERR(clk_regmap)) { + dev_err(&pdev->dev, "Failed to find nuvoton,sysclk\n"); + return PTR_ERR(clk_regmap); + } + + npcm8xx_clk_data->num = NPCM8XX_NUM_CLOCKS; + + for (i = 0; i < NPCM8XX_NUM_CLOCKS; i++) + npcm8xx_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER); + + /* Register plls */ + for (i = 0; i < ARRAY_SIZE(npcm8xx_pll_clks); i++) { + struct npcm8xx_clk_pll_data *pll_clk = &npcm8xx_pll_clks[i]; + + hw = npcm8xx_clk_register(dev, pll_clk->name, clk_regmap, + pll_clk->reg, pll_clk->flags, + &npcm8xx_clk_pll_ops, &pll_clk->parent, + NULL, 1, 0, 0, 0, NULL, 0); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register pll\n"); + pll_clk->hw = *hw; + } + + /* Register fixed dividers */ + hw = devm_clk_hw_register_fixed_factor(dev, NPCM8XX_CLK_S_PLL1_DIV2, + NPCM8XX_CLK_S_PLL1, 0, 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register fixed div\n"); + hw_pll1_div2 = *hw; + + hw = devm_clk_hw_register_fixed_factor(dev, NPCM8XX_CLK_S_PLL2_DIV2, + NPCM8XX_CLK_S_PLL2, 0, 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register pll2 div2\n"); + hw_pll2_div2 = *hw; + + hw = devm_clk_hw_register_fixed_factor(dev, NPCM8XX_CLK_S_PLL_GFX_DIV2, + NPCM8XX_CLK_S_PLL_GFX, 0, 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register gfx div2\n"); + hw_gfx_div2 = *hw; + + /* Register muxes */ + for (i = 0; i < ARRAY_SIZE(npcm8xx_muxes); i++) { + struct npcm8xx_clk_mux_data *mux_data = &npcm8xx_muxes[i]; + + hw = npcm8xx_clk_register(dev, mux_data->name, clk_regmap, + NPCM8XX_CLKSEL, mux_data->flags, + &npcm8xx_clk_mux_ops, + mux_data->parent_data, NULL, + mux_data->num_parents, + mux_data->shift, mux_data->mask, 0, + mux_data->table, 0); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register mux\n"); + mux_data->hw = *hw; + } + + hw = devm_clk_hw_register_fixed_factor(dev, "pre_clk", + NPCM8XX_CLK_S_CPU_MUX, 0, 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register pre clk div2\n"); + hw_pre_clk = *hw; + + hw = devm_clk_hw_register_fixed_factor(dev, NPCM8XX_CLK_S_AXI, + NPCM8XX_CLK_S_TH, 0, 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register axi div2\n"); + npcm8xx_clk_data->hws[NPCM8XX_CLK_AXI] = hw; + + hw = devm_clk_hw_register_fixed_factor(dev, "atb", NPCM8XX_CLK_S_AXI, 0, + 1, 2); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register atb div2\n"); + npcm8xx_clk_data->hws[NPCM8XX_CLK_ATB] = hw; + + /* Register clock pre dividers specified in npcm8xx_divs */ + for (i = 0; i < ARRAY_SIZE(npcm8xx_pre_divs); i++) { + struct npcm8xx_clk_div_data *div_data = &npcm8xx_pre_divs[i]; + + hw = npcm8xx_clk_register(dev, div_data->name, clk_regmap, + div_data->reg, div_data->flags, + &npcm8xx_clk_div_ops, NULL, + div_data->parent_hw, 1, + div_data->shift, 0, div_data->width, + NULL, div_data->clk_divider_flags); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register pre div table\n"); + div_data->hw = *hw; + + if (div_data->onecell_idx >= 0) + npcm8xx_clk_data->hws[div_data->onecell_idx] = hw; + } + + /* Register clock dividers specified in npcm8xx_divs */ + for (i = 0; i < ARRAY_SIZE(npcm8xx_divs); i++) { + struct npcm8xx_clk_div_data *div_data = &npcm8xx_divs[i]; + + hw = npcm8xx_clk_register(dev, div_data->name, clk_regmap, + div_data->reg, div_data->flags, + &npcm8xx_clk_div_ops, NULL, + div_data->parent_hw, 1, + div_data->shift, 0, div_data->width, + NULL, div_data->clk_divider_flags); + if (IS_ERR(hw)) + return dev_err_probe(dev, PTR_ERR(hw), "Can't register div table\n"); + + if (div_data->onecell_idx >= 0) + npcm8xx_clk_data->hws[div_data->onecell_idx] = hw; + } + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, + npcm8xx_clk_data); +} + +static const struct of_device_id npcm8xx_clk_dt_ids[] = { + { .compatible = "nuvoton,npcm845-clk", }, + { } +}; +MODULE_DEVICE_TABLE(of, npcm8xx_clk_dt_ids); + +static struct platform_driver npcm8xx_clk_driver = { + .probe = npcm8xx_clk_probe, + .driver = { + .name = "npcm8xx_clk", + .of_match_table = npcm8xx_clk_dt_ids, + }, +}; + +static int __init npcm8xx_clk_driver_init(void) +{ + return platform_driver_register(&npcm8xx_clk_driver); +} +arch_initcall(npcm8xx_clk_driver_init); + +static void __exit npcm8xx_clk_exit(void) +{ + platform_driver_unregister(&npcm8xx_clk_driver); +} +module_exit(npcm8xx_clk_exit); + +MODULE_DESCRIPTION("Clock driver for Nuvoton NPCM8XX BMC SoC"); +MODULE_AUTHOR("Tomer Maimon "); +MODULE_LICENSE("GPL v2"); +