From patchwork Wed Nov 22 01:40:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Tang X-Patchwork-Id: 10069069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF7F46022E for ; Wed, 22 Nov 2017 02:00:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCADD297F1 for ; Wed, 22 Nov 2017 02:00:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDC2729B05; Wed, 22 Nov 2017 02:00:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05F35297F1 for ; Wed, 22 Nov 2017 01:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409AbdKVB77 (ORCPT ); Tue, 21 Nov 2017 20:59:59 -0500 Received: from mail-dm3nam03on0064.outbound.protection.outlook.com ([104.47.41.64]:46615 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751364AbdKVB76 (ORCPT ); Tue, 21 Nov 2017 20:59:58 -0500 Received: from CY1PR03CA0017.namprd03.prod.outlook.com (10.174.128.27) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.239.5; Wed, 22 Nov 2017 01:59:56 +0000 Received: from BL2FFO11FD035.protection.gbl (2a01:111:f400:7c09::122) by CY1PR03CA0017.outlook.office365.com (2603:10b6:600::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Wed, 22 Nov 2017 01:59:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD035.mail.protection.outlook.com (10.173.161.131) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.218.12 via Frontend Transport; Wed, 22 Nov 2017 01:59:55 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vAM1xlMQ009532; Tue, 21 Nov 2017 18:59:48 -0700 From: To: , , CC: , , , Yuantian Tang Subject: [PATCH v2] clk: qoriq: add more divider clocks support Date: Wed, 22 Nov 2017 09:40:53 +0800 Message-ID: <20171122014053.13597-1-Andy.tang@nxp.com> X-Mailer: git-send-email 2.14.1 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131557895960731125; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(346002)(39860400002)(39380400002)(376002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(50466002)(48376002)(50986999)(305945005)(53936002)(106466001)(105606002)(356003)(110136005)(72206003)(54906003)(4326008)(36756003)(189998001)(77096006)(2876002)(498600001)(1076002)(316002)(8676002)(81166006)(81156014)(50226002)(8936002)(47776003)(86152003)(5003940100001)(68736007)(104016004)(5660300001)(85426001)(2906002)(575784001)(97736004)(86362001)(8656006)(6666003)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD035; 1:W4JP+2sySrf86Gb5YgBYqJ3/9LCi6qFEBR3XTB4A2P78UCvoHRsQCjzPo4pqzIuWn/QA2qW9Krc5YLx8E1oR2PRX0nLyeEq48ZIQL1L6bNeErqg1ANznfpHnJV0RtQBM MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3ef99f2-cfff-4275-502b-08d5314cba82 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600022)(4604075)(4534020)(4628075)(201703131517081)(2017052603258); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:I2hffO9+16ypZHlik3bNtitXi+DAYXjoO5KNVOWMPifYQc8lM+dI643+E7/z97XLBumGzbYF9wtQWLKBg08PKHrPpgAIOia9Z6dS5yciCL7ftBHXg0Ww9Na7+hRLGDrh1cizsBQsfH6bD9w0mzwBiAcN+dXZzrrui6pAkrmEyWbpdQwB95536TQKYOtYBeKopDZ2i8KOvIuhliRXszhagAq4+yf1buItTzZjjPgj51OP/BTDogptdKHWvaqkl9ipmHvYLE1ewDozIvd2SC54mYZpWsELOBPBeKHWZE6HpMJVqihqn3bCBj0xc3/G/TNFr8zc6vjm7QaV7XNybuQJIvbo9bRk036Gg4HAFN4uBCI=; 25:1Rd1XcRiovvql4RCKTOkj1a+3WUV4X8MSLhoC+2lOBSgt0WSyFHTm8Wn7iJBWyZFyS1lC/Nrq+WdWFX0IBq72d4+OQs6dDDeiGn2Ocua8COi4K3dDra9RJVruxvNmwZSbiDVL08ibI1+3gx75yrNkbImw7JaNj+wXQUdMZPtvrzzXhk2XXOp96hCfXSPXJRmpIoFVFPo5MOU/8Nou6UMCL6irTx8hGOBRa/MK+sRELMaCd1QV5QfquO1GolQfcMlGZCnJDRvjv94InLLAWSU1Ti6IHozEupO5oZh9X+UMfjYTIZpn5qk1UMf1wh1yhfpnR8Gg8/JsL21wEqW8GmE5w== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:I5Q0fPmT4qb2Mw6OfvZmGg+JrVdDspXc36iBYVNcVdD/WXvmC+TsjpbUYg4BKtMBHXAPedbPi+73aN22FmviqeFbnTs4x0DOHM9QG6s9nAejflbTC5E56DgTfVOEBroX1VWQZQTVWogbFW2px+eZmDNlDagpoEd6F9GP2qh3CNtd2xJm9K8+p/EGJBtfP/nWtcYWU6t+J0HZTaSCrrtOdCYclwTVd0oRFEntVbWJwJA=; 4:o8fUnx1oEJTDQol4sguzefkgq06yHLsi3KrVavKNqf+iKSESyqcUkAq7GTi5l/pcue2jToY0OSHoQIiIswuBx/HBEFd/qPIO7wkL6UL1s62VzqdYEgs4KV8J9+7NDYQNnGNiViJGoFTpQHo5WYtmmPudES3ZHLJwuHQpDIBPeFov52Oydk1T0IhBnVVROMnWTBCiIBVg/0X3caPcvLtSsEXBpzfVTpH8QQggKJIYyx0aWqjuru9KN9FnfsSabrF30Qyr6LWhsW7ue0Mnlvq1flsZhxz2+TZigXqt7fHB3vpfQaXmfDvKQSfVp/SvnB23 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231022)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 0499DAF22A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2702; 23:k4jTlmwpkeq1g9DsvZqmjbAC0e7ROdYAElDDlykjy?= =?us-ascii?Q?N/aroUOeYmgPhr6dwPwGJo3LqcDi8v/sGo7H5ORXuP/2J9LSw9f6X6wpIm/R?= =?us-ascii?Q?n5gYvaIfRJvBNHoklN9+EJtdFARPGJ7f3f7RUNpv+vOh8qurejXt3gOVxBRD?= =?us-ascii?Q?aH1NiC7O7xIMVDWjnqaeZmzjkzzOUeEL/1siGicduzBYhVOXnC9TH8xNgxdw?= =?us-ascii?Q?SUSMHeSltbpU83Ze+Ba5zoxy5Ek5jUsReHdVefFnd1fstkJJlmduG8teZGWl?= =?us-ascii?Q?TdCdTxPcwXT4MBU95UhRi7Lu5DfPLpkehOz5tj/iisESjnl4yp6rcG6yJIKZ?= =?us-ascii?Q?rWmxsrMdOMhG6XWEF+S5R6IcTRz1JGZJX/azwAoDzlpcXWiX3WFLLQyNttXk?= =?us-ascii?Q?XNNC8wmvFZ4VK1H7ooUfGolX8Dr8bM31kchJeoS21ux1YK5aVZ8F1pDY5WIw?= =?us-ascii?Q?nI/ajmj9f0NpuPtwk87gnUCgWLliL/kEu6crGQOjbH2v68uMN8prAgOatERl?= =?us-ascii?Q?w8C70iv23igKtT4zbgaP/K5XI0W6eQc1ztAmtBHaDd+fUI+PVhgQy0R+3XhU?= =?us-ascii?Q?3pIe2LA5KcBcjD3iHmxfCbzlO55JJExy1aeupSjDuY+/FBEFJSce1K2Jua0u?= =?us-ascii?Q?rl3KMxRUksXVBAb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k=; 5:dm+hQsm0GhXh1LjJw8NYyGjMpqOO757XZYsGCLBGypHr1EBoeLSQ7FghLSwboLbdUczj4yXWbQO8V1nPsj3JuvTSpUj05iULaV/duViuQNVEGxppKygkNFSOBN2vVcbiOzumPmyoLDP0/KIJ4oThUui8MEpKUV+bfyvW4wNoxE8=; 24:l7LRUluNlJ0RCEAZea5rgs+G8UAouUnyjtDj/hOuRMXiU4VAirjcl2Zb27Tld2uU7xfUAX0bLc0FvY7Qe1q/OZI+a1Nu4Nmw6HjFobvyrks=; 7:izbDHazMTWtLyZl4zXyGCuRfuSH6RcAxz4qeXz/Su92xbRngFTONrhC7xfW+Y0Moku9qvVYX/J63tS4Kio3zRA5GADAZC3EqQaLNyw9J3LhI3Edau1Me2TizrOeoFMR7P+07jzBFRceAdhS1gAjFfiT9giybqez7OFi6z1QDC1jCYpWNQ6xuX1K6K0tju6ollgiY07wcCAF1Wv4F7Rgmch/Bqvd9/QB11amBcQIMfzyiszm6qz8t4eKlQKkrwC17 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2017 01:59:55.7611 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3ef99f2-cfff-4275-502b-08d5314cba82 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2702 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yuantian Tang More divider clocks are needed by IP. So enlarge the PLL divider array to accommodate more divider clocks. Signed-off-by: Tang Yuantian Acked-by: Rob Herring --- resend with ack added v2: - fix a logical error Documentation/devicetree/bindings/clock/qoriq-clock.txt | 1 + drivers/clk/clk-qoriq.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/clock/qoriq-clock.txt b/Documentation/devicetree/bindings/clock/qoriq-clock.txt index 6498e1fdbb33..97f46adac85f 100644 --- a/Documentation/devicetree/bindings/clock/qoriq-clock.txt +++ b/Documentation/devicetree/bindings/clock/qoriq-clock.txt @@ -78,6 +78,7 @@ second cell is the clock index for the specified type. 2 hwaccel index (n in CLKCGnHWACSR) 3 fman 0 for fm1, 1 for fm2 4 platform pll 0=pll, 1=pll/2, 2=pll/3, 3=pll/4 + 4=pll/5, 5=pll/6, 6=pll/7, 7=pll/8 5 coreclk must be 0 3. Example diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index b0ea753b8709..3a1812f65e5d 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c @@ -41,7 +41,7 @@ struct clockgen_pll_div { }; struct clockgen_pll { - struct clockgen_pll_div div[4]; + struct clockgen_pll_div div[8]; }; #define CLKSEL_VALID 1 @@ -1127,6 +1127,13 @@ static void __init create_one_pll(struct clockgen *cg, int idx) struct clk *clk; int ret; + /* + * For platform PLL, there are 8 divider clocks. + * For core PLL, there are 4 divider clocks at most. + */ + if (idx != PLATFORM_PLL && i >= 4) + break; + snprintf(pll->div[i].name, sizeof(pll->div[i].name), "cg-pll%d-div%d", idx, i + 1);