From patchwork Tue Feb 4 13:34:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D060B14D5 for ; Tue, 4 Feb 2020 13:41:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5022222C2 for ; Tue, 4 Feb 2020 13:41:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EdyLjzne"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="aTQdMg9v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5022222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=youw1OHHkMSw4FEGvMwZIu/XBuO/YSF/Q0/vY3ciVZ0=; b=EdyLjznel+mhAd bgdIQWh5PBwxubXc+3ZGUYPFh4bj/LVgAjDmZfzW4uG374dgaLhA5wij9hjSqBBOsig+UfQcFVxKI QLhzi+pG64rpt0ZXB6e/RRwYQZ+gpseOZH/aa7C/tIAyHbdEjqCaKbvTvgwgMmZML5hJym+Xit12Z z+no48Pe4M8BHpQBnyknoaS5riZ6nJIL5SCHYrR7C5wRBuU1GJDRh67yFS9ciK6mjO5SQBGuLVglp xgHqe1YW1KwXD9lt3lbnlICczipTsxC3UWLq7l160eQJ/TI29m/KVe2n5eiTWu+fGNek0t+RTlcce 9fU4/1cUkJtYs5Snw2LQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySI-0005ah-6U; Tue, 04 Feb 2020 13:41:30 +0000 Received: from mail-eopbgr150089.outbound.protection.outlook.com ([40.107.15.89] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyS6-0005Rc-5O for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gJ43OzHw4fAlkMdHzhZlUxbzDV9TWj8SRguWckDaVO18XV2IcktGKNlV/CturLqC1/tMbk7r5vVGQnMBCypNAXTjqO0Ddvp153ZgYrHsXtmKsO5GOUwdL/WLdSyTPa9/mNYpGB5NYu4r4n9LPI6ybleUCzRVNrqUYHdY7H9YiZlWsHv9txfBEHT/QQMQ8ipZ346RAKY1QZrx7S+drqTfT3TXqDpUVMkHm1/iT3HAcuzpyIOP9XlL1jM3woW/v/qzwa3+iyeybw6bLUafZ0f6DbkPDiD2MdwrioiIlKugGakTmTlUsWCfOYSitFlo5o7cGMbSdghd/UW3NP129OASvQ== 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-SenderADCheck; bh=mfZ44Kb0NxQ+7sVLy7y6S4fCrQNN8UZjk8uRJkhLVhU=; b=VQ2H69mGoXUldovjb/W+z7McHXZg8w5D++GXOcezThFNBwoknxuvZCtqrLMLdNlyxAY2woDAl+JgjdwrP5kPPK/0HMtoERH11oJpornMpjcKFxHPwtLYNMKrqfpLO3OfVt1gGedfddo0TdgY59DXkhre+fezc0QRvwugf4CNepCtecQE4CzVGImZsY86Pv1PlhkqTD4EIIBkrV6j2vwOx4iyF0jlWFXiewG9JfFzZ7Pk9s4vZyNxjE3URmBqRESjZdFJwUmG0MLBlkQFZ24kxk13sGQN2ygS1S+mk6Wlb6FicpZgKlLEJJ7jGrDqJ/IrfBnNk+rcOIysGbdMh2nolg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mfZ44Kb0NxQ+7sVLy7y6S4fCrQNN8UZjk8uRJkhLVhU=; b=aTQdMg9vJlA9Cs3sfw9Lge/fSjGrBOuVhB/6gemz+tVCMox2WAehaFT5X410V2XeBrCBz85EstZrnQ5ovjKt5TErrgDt13N4cQWIx4QFTFvwVjqss1P9DPGDXC3gnb/Zvp+B7BkKDK/rJP9fV0Bnxb8y3nAZ0JDcr2WsRWiFrV8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4851.eurprd04.prod.outlook.com (20.176.215.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.32; Tue, 4 Feb 2020 13:41:14 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:13 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 1/7] clk: imx: Fix division by zero warning on pfdv2 Date: Tue, 4 Feb 2020 21:34:31 +0800 Message-Id: <1580823277-13644-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:09 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0dcdd428-2816-4a69-4c8f-08d7a977e6f2 X-MS-TrafficTypeDiagnostic: AM0PR04MB4851:|AM0PR04MB4851: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:113; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(199004)(189003)(26005)(956004)(2616005)(316002)(6486002)(186003)(16526019)(8676002)(2906002)(69590400006)(81156014)(36756003)(6506007)(81166006)(86362001)(6666004)(8936002)(478600001)(66946007)(66476007)(66556008)(4326008)(52116002)(9686003)(5660300002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4851; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UyPLrvuSh2iv8/eVYilLOSHoklSJ6VpAar8OqDh+0Ra5zB/x7ZMcQjw6D4K6llyrkTmFpOUCtxMLj0O6BFvVDeq1J0CVIfb909zJPqy2QLbwWiI8cin1jXKoDSjWLyhteQZegpyJ+Z5VoZsmKsgNtWk7zh4HGahUCb3zMq3U5En7/YDobeLOLP7zo8Lhr4KnhsbTowE74UZdx5EGVh9hhamSeb03vBltetXuk4H1KsRtO4YlmzQ/t3oe7I64NFFJDmrWA1OePxVFXij/7nSxZUZSSAuBjPFnIhRNxPY5hdrBh1kKaZ3Lrj13/AkRDWCo1b3LBWWdZrgC01Urb0hWpsucRtIT19zB/g3KLc7B7tGPhj8sW6w+kI5mGdIIcEeTvPBSIeG6UO/Ns6sqp18prXOI2+4+CxlUI67+45uTUs2ql8YtmQSeEeDnqMNBIlQ12OdYIgp3UecSi1aVayi9a0TxJCZxx9bw5v8PM5VH5/b4KwUlebiwNvBiKCMLiuKRjoJu0Vsdz3ZkqN4uL9Tiki6KtqxqimqSCYWQn/VLgbE= X-MS-Exchange-AntiSpam-MessageData: qfEs+7Q6AiYnFjgxKAZaX/u4+pgmdRigfg1rZMqmaAJloBoOElIQfWJnVHx1Mm/oNEG7TlQm6sVorsqxLLmEZwdUCx0gW0bsle2lKavilugSGGgZ+NCD73aETX2xQHeR2bTrwJTg62yryqYK+QPaWg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dcdd428-2816-4a69-4c8f-08d7a977e6f2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:13.8734 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: utvxhXN0jpUOcgvOFgZHsXQ7hk7RUtW9NuU+spnm3kaQZ9i59vfJUr+Wexg0bXtuHsDuFna0LsB1/BuB4osAUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4851 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054118_219080_E9381A68 X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.15.89 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Anson Huang Fix below division by zero warning: [ 3.176443] Division by zero in kernel. [ 3.181809] CPU: 0 PID: 88 Comm: kworker/0:2 Not tainted 5.3.0-rc2-next-20190730-63758-ge08da51-dirty #124 [ 3.191817] Hardware name: Freescale i.MX7ULP (Device Tree) [ 3.197821] Workqueue: events dbs_work_handler [ 3.202849] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 3.211058] [] (show_stack) from [] (dump_stack+0xd8/0x110) [ 3.218820] [] (dump_stack) from [] (Ldiv0_64+0x8/0x18) [ 3.226263] [] (Ldiv0_64) from [] (clk_pfdv2_set_rate+0x54/0xac) [ 3.234487] [] (clk_pfdv2_set_rate) from [] (clk_change_rate+0x1a4/0x698) [ 3.243468] [] (clk_change_rate) from [] (clk_change_rate+0x280/0x698) [ 3.252180] [] (clk_change_rate) from [] (clk_core_set_rate_nolock+0x1a0/0x278) [ 3.261679] [] (clk_core_set_rate_nolock) from [] (clk_set_rate+0x30/0x64) [ 3.270743] [] (clk_set_rate) from [] (imx7ulp_set_target+0x184/0x2a4) [ 3.279501] [] (imx7ulp_set_target) from [] (__cpufreq_driver_target+0x188/0x514) [ 3.289196] [] (__cpufreq_driver_target) from [] (od_dbs_update+0x130/0x15c) [ 3.298438] [] (od_dbs_update) from [] (dbs_work_handler+0x2c/0x5c) [ 3.306914] [] (dbs_work_handler) from [] (process_one_work+0x2ac/0x704) [ 3.315826] [] (process_one_work) from [] (worker_thread+0x2c/0x574) [ 3.324404] [] (worker_thread) from [] (kthread+0x134/0x148) [ 3.332278] [] (kthread) from [] (ret_from_fork+0x14/0x20) [ 3.339858] Exception stack(0xe82d5fb0 to 0xe82d5ff8) [ 3.345314] 5fa0: 00000000 00000000 00000000 00000000 [ 3.353926] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 3.362519] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 Signed-off-by: Anson Huang Signed-off-by: Peng Fan --- drivers/clk/imx/clk-pfdv2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c index de93ce73101b..f8707278aad9 100644 --- a/drivers/clk/imx/clk-pfdv2.c +++ b/drivers/clk/imx/clk-pfdv2.c @@ -139,6 +139,12 @@ static int clk_pfdv2_set_rate(struct clk_hw *hw, unsigned long rate, u32 val; u8 frac; + if (!rate) + return -EINVAL; + + /* PFD can NOT change rate without gating */ + WARN_ON(clk_pfdv2_is_enabled(hw)); + tmp = tmp * 18 + rate / 2; do_div(tmp, rate); frac = tmp; From patchwork Tue Feb 4 13:34:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6434138D for ; Tue, 4 Feb 2020 13:41:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 821382084E for ; Tue, 4 Feb 2020 13:41:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZvRjmAUT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gDxDpojQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 821382084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qPVf2WYHqhdjl1RATWFghYlshqY14rbzPEfzpbCbVzE=; b=ZvRjmAUT0bLEls JPlme+fSUzPQPKRTXngGe0V0tWVbH5+tnLAJq+0lTgnPOHPv8iqGpkb1Ri6vBQsc2bXWy6ILPbaKX JFc9JsLG9TLbqdaSrYu1KSKzSbglNnfr7+8cLHSocdaZP2J1wg4o7Tdwskwwb4ApWdsZbFBDgDwrK W2DLajYQBZBkyjeLuvmMClIiIVEJbReaTXaFepyJsAqHnA8oHYpT/u2wKGaC7wKA5Se6BvKehKJ1o GiHnuWcMnpA6gnkVWJGiYNKkefxyaQN7zNvNh3Ln/ErYt49H8wAKKc6A5d51yh3mGGu5e3rkKYRQP 22sxXsaO8m11aKNgCOCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySf-0005tb-5x; Tue, 04 Feb 2020 13:41:53 +0000 Received: from mail-eopbgr150089.outbound.protection.outlook.com ([40.107.15.89] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyS8-0005Rc-Eg for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bwrK/UAMt5S2x2MkhK+sS/J0hz1GDPaJxiuGnaIxeLyeHgFRxxLdQpJDunZTJ3I58zNHcwa7MdWxUvVLJxw4CuZDaHGHkwZgWp/yPaYbU5c0r67i0VGEwc+ZeLZfiQyPZvGuFCt7NXLN6bWzWR6h9QSGVYy6n9r9HI5ETR73IDcBYcqcu+JQ+1esWa5Og1fnMNqxLPk0YU5iYSkAjinkTnpQqBIlL+uLpIcgDNqi8RIV8mpTJgJXUCf+0XSXGdARZ9O6dvS4ptARM7gMjazOljOTKcGfMTkdK18AGx6XUNTkHOQ78ms45W/PAv63tb5LG69yICqSBn5VHIKl5wICrg== 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-SenderADCheck; bh=tUlRr8faB/i66fx3x80G7m9tQuoYyRbLoNWtPavuV8Y=; b=YI8TAGYx/sZe4U/XlsCA02QgXppn/RINJ7GPn0tfoQOTdnyPrSn3KF1RIKu7MerqLudRHTxPloa5rwLM0oops5YTGiJxy4XGLnl+K8yDXiTzaPSECDQDP9WiGJXxwiNQEOamsWEEx0peHAs9EZ0sekdeC7qswNbfAHqu5QTgwxck3B8BbuFShGU+q/Z8vUk/EHrGA6XwR/42f6fMTrEngid7SoIqAOgie7lt4hTt0GlQEO+FQ0+GpWrOEmXPIXfoEF1SDZaLJZCEOp2lUD+YQxTAh0R1VP06Ei27ZiOHzXx/pUS6HJ3LB0C/tFhuF6O9RMamCLeOfalg5rLMRwgM8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tUlRr8faB/i66fx3x80G7m9tQuoYyRbLoNWtPavuV8Y=; b=gDxDpojQxtou0jJ2F0yyf/JFNRtHCO4vx6kH9XEzIKYagU2cksO9dLo2e+5/Gnpyz4kX4QFt/4m6wHJATrdZsHEq1ONyvBotXo6t4ekoO8lsKjdiE828aT2W0dEXvBIz+n7GfLBxwk5JGFTVQCUl+fe0/RVRciL8WAATlDU+NTk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4851.eurprd04.prod.outlook.com (20.176.215.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.32; Tue, 4 Feb 2020 13:41:18 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:18 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 2/7] clk: imx: pfdv2: switch to use determine_rate Date: Tue, 4 Feb 2020 21:34:32 +0800 Message-Id: <1580823277-13644-3-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:14 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 33823662-8acd-443d-a244-08d7a977e996 X-MS-TrafficTypeDiagnostic: AM0PR04MB4851:|AM0PR04MB4851: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(199004)(189003)(26005)(956004)(2616005)(316002)(6486002)(186003)(16526019)(8676002)(2906002)(69590400006)(81156014)(36756003)(6506007)(81166006)(86362001)(6666004)(8936002)(478600001)(66946007)(66476007)(66556008)(4326008)(52116002)(9686003)(5660300002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4851; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VOFaNlzlD+bJQuQgOXr+i+zmZnWnsnhUVrg5ocClv7XE1ArB9SmCe4PhRrFYCBg+n3OxPBhymed3i/P6Zshx7N+8nzDwQILxAq2MQ+EABSuOLCAB2OWnRgXwgIVJTwOcKz8XtAot/fX38fL2C3IgzS13mz+Tfx2iUicCz6uoQ0NjtLULf/ltyO3NWtljCy7IGHu7KyJuQlvPNwml18UeJlC1k1+C36Vmgirpw2agBR2eXOvDterowhw2g0pgA9Vdxsc0r/EDCHm1mXfMlrOKhIO2fgE2ATC4HEQ6y/xjto0J6PQARF2Y09wNtM+ZoKBtsXGQKsEJDQsEZTkg/aERf/v8KNFra893MpoPiE2CqOZu33jOM6UWjPSgbR465kDCiUxr8/jcivhTLUZ+GJog4RLHJQ1WdFV8dqjgodLmy9D5Bz0uRBhRaZuZwwsY4KiQ+xuDpPI9I19TKu0DuAZFx/RYk5PpOogKwMM1tZiyLdS6sigRXh5KXwM5yhvgo1AThDe3j//4tmhxqJrfLlK12JhdCe3qc0Mf9DLt/vU7+68= X-MS-Exchange-AntiSpam-MessageData: wKFv5zwNx9l1kNYKxFyZTvQvhdWKejGrsJ5ItEnF3PeS/pquUpBk2NoF523NPvUS97CDWC+wC+fyyL4aT18p6Rm6dkXsDNv/9LB8f6EDAhnlA5/UCOKUWxQOQdHDbw69oNX0j9x+iVWLs6+JF3X/iA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33823662-8acd-443d-a244-08d7a977e996 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:18.3179 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EngCBdEmtW6+VRpAIrkityBcW/PGi7YQf2Ff1+7ng+qOIhdfdwn1L0EVEbgSHVcPyp8IPJfgUEj6uyuzfBi89w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4851 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054120_511770_B68B258F X-CRM114-Status: GOOD ( 13.86 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.15.89 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Per clk_ops, compared with round_rate, determine_rate could optionally support the parent clock that should be used to provide the clock rate. In this patch, the parent clock is just parent->rate as round_rate. The following patch will calculate the best parent clock. Signed-off-by: Peng Fan --- drivers/clk/imx/clk-pfdv2.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c index f8707278aad9..28b5f208ced9 100644 --- a/drivers/clk/imx/clk-pfdv2.c +++ b/drivers/clk/imx/clk-pfdv2.c @@ -98,10 +98,11 @@ static unsigned long clk_pfdv2_recalc_rate(struct clk_hw *hw, return tmp; } -static long clk_pfdv2_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int clk_pfdv2_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - u64 tmp = *prate; + u64 tmp = req->best_parent_rate; + u64 rate = req->rate; u8 frac; tmp = tmp * 18 + rate / 2; @@ -113,11 +114,13 @@ static long clk_pfdv2_round_rate(struct clk_hw *hw, unsigned long rate, else if (frac > 35) frac = 35; - tmp = *prate; + tmp = req->best_parent_rate; tmp *= 18; do_div(tmp, frac); - return tmp; + req->rate = tmp; + + return 0; } static int clk_pfdv2_is_enabled(struct clk_hw *hw) @@ -167,7 +170,7 @@ static const struct clk_ops clk_pfdv2_ops = { .enable = clk_pfdv2_enable, .disable = clk_pfdv2_disable, .recalc_rate = clk_pfdv2_recalc_rate, - .round_rate = clk_pfdv2_round_rate, + .determine_rate = clk_pfdv2_determine_rate, .set_rate = clk_pfdv2_set_rate, .is_enabled = clk_pfdv2_is_enabled, }; From patchwork Tue Feb 4 13:34:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A91F0138D for ; Tue, 4 Feb 2020 13:42:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 871572084E for ; Tue, 4 Feb 2020 13:42:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PC4jVok9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mQI/pCcI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 871572084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=puvbFunL+YBQuSPOGkxt+pdIfPDyjoJSQVeAIJzBJUQ=; b=PC4jVok9I9TY/D +3OhWq7uzpAm580fwLXh6TjJOjj1bnR45nIo8CsaZU388HI7OokTXccMXVGB2kqpUM77oG87ZrTqn Cj/CfX9DutpDubvtGaQJfOkgK2OEyoWhNVEy/o4DugboVQ7rTsdOQq1PXTX9r2Tt6kKJZZotheNE1 HTrkEC0InCe4EMM8JW6UniQEm0AktdVrSAFNaQgUvh91vnoHNMwceHWjs1CKozdZvfKIuv95DiA9y 2xn0TpvQj4GaM1dGIlUF+VobliUWB1BE7OcxCnZoJRTSa4FLhSODv35ko6Xy3RkvQb8ZTKeNVCv92 HVb/EGqHDiQhn91QePuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySw-0006BL-Cv; Tue, 04 Feb 2020 13:42:10 +0000 Received: from mail-eopbgr150084.outbound.protection.outlook.com ([40.107.15.84] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySE-0005ZB-E0 for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ikNl+ZG6DjqdKfvNr9WmM/VSQzCJFnhFmB7LjW7ELBbCN/p5dDbXNRxCDIrevt35ojqGOky7TH2YM0tC2GpWTyij5+Af2ssdxHKLZEZcDhsDlNJ5N9hCRsJGQywuYOX6aWti2NtDeDcf4mgvCNOxDC6FgaiA7VelgMk/RxlG+yXVrLl0Rcu5JZTyCGVh9Tnr80wAt7mf+L8R2eb/jwjEjapNeaB3V0FQ0GPhXbN7dskKSTBl5w6sD31XUewYM5ig9aZVzCAqqOVHIl8DMlA+cOfV9PLSZkq0FCF1kV3QViFbZ5tmAxJw1KZEowWhqUkG1LttU6RHhN4ltf5ls1T4tw== 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-SenderADCheck; bh=gwQeBUQfJB4vEvPaPWLOwmRp6IYIhy/cz/rkO377RO4=; b=ofyvhD4Gy8ZUFnm/r5Q6xRgZAEtomK/FZ2AbjeDBhYJ+KPuPmpRdhFiZAW+b7fublsj4XieF0pAl26hraUS8FyCe/Fm0cLigFLLy69PBJbQ0dEQDMmko3n34tA+v7o6nZfst2MHu8QRK5/Yo79MNG6vIvmmFCNkkHi3lgqcPRg1vKlRqenCOmuPTB5Bp1r0BKTEhXyqFAykd2F+7kk+ySojPTrltVMFQbtU3Sg2atigYlKfpNbEKytOd8pyCL/AovBElh0ifV+Ys57tjhxMm/ut7IenTfuSu47b6TmPQbLKrWPEoFMdrMnfXl6M3ge40QCloON1EBLUfa1m7xRhPJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gwQeBUQfJB4vEvPaPWLOwmRp6IYIhy/cz/rkO377RO4=; b=mQI/pCcIkjjbfbeUOndxBFVTIONsKdmZkk7YrrGzq2pCuUPnvCKKgs6IMmR42QZ6x/Spy95iNlSvB7CGcV4XN+Qh+lePr3Xfb9Thtl2upyD52C6wOkb1ZO3mFP8dNjAhxwKIr0gywp5CLvaKVK4viZ7zpwsLcWAwLYukg6InyVQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4851.eurprd04.prod.outlook.com (20.176.215.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.32; Tue, 4 Feb 2020 13:41:22 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:22 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 3/7] clk: imx: pfdv2: determine best parent rate Date: Tue, 4 Feb 2020 21:34:33 +0800 Message-Id: <1580823277-13644-4-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:18 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9b078402-46f4-4641-0936-08d7a977ec3c X-MS-TrafficTypeDiagnostic: AM0PR04MB4851:|AM0PR04MB4851: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(199004)(189003)(26005)(956004)(2616005)(316002)(6486002)(186003)(16526019)(8676002)(2906002)(69590400006)(81156014)(36756003)(6506007)(81166006)(86362001)(6666004)(8936002)(478600001)(66946007)(66476007)(66556008)(4326008)(52116002)(9686003)(5660300002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4851; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wS/WT40PMLW/HdoNw8LnyfAhXhf7zM+wr2JdCCI5GOKbb8CCFD5odz69Oc9Lu1Fkxsui0Mh0uraBR5iscqbLgk37mL1e3bAb8ynkTpXWLToiqlNxDFQ6SmSww0HATfADchNpY/enSPWcQ3Geh6TNaEPVU4xXCH1p73FwamKjXH0maNMctaI19mL1V0EQM1h2LSOg44xoylYPXJj9OSshexn29bYYZ8ayDqNCxSDmn3T7pGzB15vxVlxEty+AhL8xhCG1n2+CtQ/uxi0zd8k7H6rneFtmUd/PM2HaR/hG4gKgXvJ91WR8XlvHbABCG6u3p5u13y63nCe4Hg67X2b3pYSDrgERyfZVzhIRm9OnndnUo8bnUWvtlqXQStXcZ9TeA1LnpKrrtDAUmjhVXZY/vuZl1272wsJtFgKYDUDC5MnDi0TT17ogOecS2g53De0AFihRlmjWH1Mh1guzt1AoumWEHJGbeN/6fxpXWftABO6emCH2nRC9bSkuQW0qNdqP9Wzfn7sw9d/vb98TjyljB3SWQA4o5mQUgPqyBkK95UQ= X-MS-Exchange-AntiSpam-MessageData: t4FMgWgD3bHDR/aKSFu2vRJ9tr3E4m1kcf7+a2HVyPhlgTrXyvwhKmFu/EssIK9RLlaCxXYbvRM+S+rbq5UTbhuOnhJ7slSlCTz/bsON/dWq2yNDz9KtaQtqTqHNFvSD6uU+wgbw+7zlU6V+nVikzw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b078402-46f4-4641-0936-08d7a977ec3c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:22.7523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D00aXIlSZ2iIlF+oziBIwyvmxGQX/GOPYzcDLBl4WT9mbCgS0Jv4NcYVGJg5i0nX4RopddjWek/D4Vy2VLn0aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4851 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054126_507932_8EB2F661 X-CRM114-Status: GOOD ( 15.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.15.84 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan pfdv2 is only used in i.MX7ULP. To get best pfd output, the i.MX7ULP Datasheet defines two best PLL rate and pfd frac. Per Datasheel All PLLs on i.MX 7ULP either have VCO base frequency of 480 MHz or 528 MHz. So when determine best rate, we also determine best parent rate which could match the requirement. For some reason the current parent might not be 480MHz or 528MHz, so we still take current parent rate as a choice. And we also enable flag CLK_SET_RATE_PARENT to let parent rate to be configured. Signed-off-by: Peng Fan --- drivers/clk/imx/clk-pfdv2.c | 50 ++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c index 28b5f208ced9..78e1f7641aaa 100644 --- a/drivers/clk/imx/clk-pfdv2.c +++ b/drivers/clk/imx/clk-pfdv2.c @@ -101,24 +101,40 @@ static unsigned long clk_pfdv2_recalc_rate(struct clk_hw *hw, static int clk_pfdv2_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { - u64 tmp = req->best_parent_rate; - u64 rate = req->rate; + unsigned long parent_rates[] = { + 480000000, + 528000000, + req->best_parent_rate + }; + unsigned long best_rate = -1UL, rate = req->rate; + unsigned long best_parent_rate = req->best_parent_rate; + u64 tmp; u8 frac; + int i; + + for (i = 0; i < ARRAY_SIZE(parent_rates); i++) { + tmp = parent_rates[i]; + tmp = tmp * 18 + rate / 2; + do_div(tmp, rate); + frac = tmp; + + if (frac < 12) + frac = 12; + else if (frac > 35) + frac = 35; + + tmp = parent_rates[i]; + tmp *= 18; + do_div(tmp, frac); + + if (abs(tmp - req->rate) < abs(best_rate - req->rate)) { + best_rate = tmp; + best_parent_rate = parent_rates[i]; + } + } - tmp = tmp * 18 + rate / 2; - do_div(tmp, rate); - frac = tmp; - - if (frac < 12) - frac = 12; - else if (frac > 35) - frac = 35; - - tmp = req->best_parent_rate; - tmp *= 18; - do_div(tmp, frac); - - req->rate = tmp; + req->best_parent_rate = best_parent_rate; + req->rate = best_rate; return 0; } @@ -198,7 +214,7 @@ struct clk_hw *imx_clk_hw_pfdv2(const char *name, const char *parent_name, init.ops = &clk_pfdv2_ops; init.parent_names = &parent_name; init.num_parents = 1; - init.flags = CLK_SET_RATE_GATE; + init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT; pfd->hw.init = &init; From patchwork Tue Feb 4 13:34:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364633 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 296581395 for ; Tue, 4 Feb 2020 13:42:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1D3720730 for ; Tue, 4 Feb 2020 13:42:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oajwzdc2"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="nytRbPL3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1D3720730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b0mRgN2tbxvWE9jZjj/ZBy/obZuCFYMetgkJDk3Hy4g=; b=oajwzdc2yG2n+j eP9Twdg0sKLCzNqgf9DOr/t3dh07rJTTwAJjtuFB2td/HaTQfGI+o+xMMry2939gQhx5ERX9iIOn9 M3mHQWfN4b0tIDL+ct35NZE6UyUef38GWnf4MYRVlcFB+/ihuqUo1/hSorVgqm6NFszBB13aO6nrU yTlV381Nf4RRQ0MXcYQs2GEsRkPc/tyx/FI+F3WNN8J4daYh2HGvLljGnS9hVx5Hl3q39KPdiSNzX JCtDk/mVTSN8cpkLEUe5wmompzfCLSpyUdINyoNOTXRTC86mGpusfFUGdTfpTtv+TEizGo2nGWVi0 l4/efOeSusoMaT5SJ8nQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyT9-0006NW-AA; Tue, 04 Feb 2020 13:42:23 +0000 Received: from mail-eopbgr150084.outbound.protection.outlook.com ([40.107.15.84] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySH-0005ZB-E6 for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3ftOINwGo+HFxru8tipcMgRpGhcR3H/NSZZLGhFdH9toaVxb6C645WkCcKI4fRz2yAXaA5ye16R63XZ+iAIebnxDBB8gt6MwTIMrj1Fl4pKLFWExw57NgocX9RIyCgFJeOzTNdA5DJKwrQHY844NTML4gpPAVT2/gzGOqMy2DcO/ucs72cIbYLd6aoX/UHzogVF531LZirOoDVgBuwznMDWIya58GVcMqZSiYuqFx8/Eg65LVYieCJuKSv9NnK7wCr0ek5ZpDuoEb0Pj5GECtUWtkq2o2CRHevRDKoiuACvhlPcBVnrwr7pSzefTZRRszQDOVz3+yK10MbKg/fjMA== 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-SenderADCheck; bh=856MVVHfaue28uC7j+zrjbOHalXQ/kbePxN3row+0Yg=; b=bETpXd+rF5C0zTu3lg6dSw7qR1O1plN+1spl9UthFh4gW6526pHurte48Piqrq/k7/vSpbEpIs9+uSmmp7nC5xHInCP8txpLc2QtUh5zbAlbCh8K2S5OLWJHDhA+RhmQSPFqxQSYvx8mHyUOfLpNKbjDxkc3q3H4j3HaGneZv6BAHeUVZUL9ZBBZGiEThpyn+D7AIHw+J7SQ9JLqqbiXO5ShnFYPWYxXLkVp/YM6QUU4EpGTDw62V3oMXKdXuJiWBkh3wBy/7cUKxPWVSTKTYcpqwAQ0sPh1ugczwVU/39CPekZKu58PmUzGasGtYNIyoATdNSKlGLrYPa7rJyiTEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=856MVVHfaue28uC7j+zrjbOHalXQ/kbePxN3row+0Yg=; b=nytRbPL3+ftY8W0um3Q3Jon/NiY6zxsUBSx620L3WOXi68WEaEI6zGsdN+M0lsf0T4lcKwfQFJBhSyPzqVqdBxgXFBuojxG6u3zaL/2gFYftVpHVT1wttFK/V9GsvPN8WNH24Osm1o8mLxvxIT4LIUB55pV80LPy2z7PfeiBY7A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4851.eurprd04.prod.outlook.com (20.176.215.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.32; Tue, 4 Feb 2020 13:41:27 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:27 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 4/7] clk: imx: add imx_hw_clk_cpuv2 for i.MX7ULP Date: Tue, 4 Feb 2020 21:34:34 +0800 Message-Id: <1580823277-13644-5-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:23 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 483429a0-f596-40ef-188c-08d7a977eeee X-MS-TrafficTypeDiagnostic: AM0PR04MB4851:|AM0PR04MB4851: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(199004)(189003)(26005)(956004)(2616005)(316002)(6486002)(186003)(16526019)(8676002)(2906002)(69590400006)(81156014)(36756003)(6506007)(81166006)(86362001)(6666004)(8936002)(478600001)(66946007)(66476007)(66556008)(4326008)(52116002)(9686003)(5660300002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4851; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ntERt7V2Ae1q9yW6Wb1cXzhnou5gZoHOjuI2B1WKsGIDXetydDN5d/z2pwGXpTjcO8j22FysB6bE2SMF+ERQKcropowPjZvgjJUgdCxsfKsJEtN3gtVX0xUrOsMFrdCczT2G69mZEIthL3ItPtaWMjPKBpf8JI3eQAKAEAuh+Q4oCDkGH2U+PTikave5iDCnhqH0uphCwI3WKgWdRfXyoMOYhLO+dqIyt1Zp26nbTDhaToRRHTnDj0ki+GZsXxvW/OnPgmw+V9lNnAQgspUj4OQn+JrDF7NW5zwRb/I9K/Fac1Ot8ZBZC94/qx2aGKgnX4CoFL/+Rn3nJvx/gwOTsLOXvxOuDLOzKs8XEnF3IuQFlEhRHqolaaDAv4zYnTey6bpvFHj+OU146n3skA1Vbe511uIukn3BoiT5Psf/kVIU1IghMkOTnZ/UNiZ0iutUVsSE8XEldgC7EQOSGlmfqSCOXUv0KetdRCe5TonNE8YKcSinu7MYe8BMGJKBC5k49EC93dR4QQO1Bh72Zx5v4Sgqux5Ar+vL/XsGSZpRQoc= X-MS-Exchange-AntiSpam-MessageData: ktK6WV4ic6ZWck9I5qTsKtPADTSIfxySxaXVlD5TFpWsUn93lTMgB7cVmgBbHSXu5LunqOQDhxeQyYiorsmAMiTfT5tXRjhqnOg7uwAEFIbxJK7B4MFb3r3olo6DxzPFKHRi04E1JioEqocI2HgrMg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 483429a0-f596-40ef-188c-08d7a977eeee X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:27.4725 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Hx4P6SD/2g1O8fC25A3JOMoY9XY5lv2FOisOg9DZcnbRfRSkgindMg68nm4Ptc5bwyffbSCztcGy5flfQe0Bkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4851 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054129_513966_015EB790 X-CRM114-Status: GOOD ( 16.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.15.84 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Add a clk api for i.MX7ULP ARM core clk usage. imx_hw_clk_cpu could not be reused, because i.MX7ULP ARM core clk has totally different design. To simplify ARM core clk change logic, add a new clk api. A draft picture to show the ARM core clock. |-sirc |-> run(500MHz) -> div -> mux -------------|-firc ARM| | |-> hsrun(720MHz) -> hs div -> hs mux -------|-spll pfd |-.... Need to configure PMC when ARM core runs in HSRUN or RUN mode. RUN and HSRUN related registers are not same, but their mux has same clocks as input. The API takes arm core, div, hs div, mux, hs mux, mux parent, pfd, step as params for switch clk freq. When set rate, need to switch mux to take firc as input, then set spll pfd freq, then switch back mux to spll pfd as parent. Per i.MX7ULP requirement, when clk runs in HSRUN mode, it could only support arm core wfi idle, so add pm qos to support it. Signed-off-by: Peng Fan --- drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-cpuv2.c | 137 ++++++++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 9 +++ 3 files changed, 147 insertions(+) create mode 100644 drivers/clk/imx/clk-cpuv2.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 928f874c73d2..9707fef8da98 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_MXC_CLK) += \ clk-busy.o \ clk-composite-8m.o \ clk-cpu.o \ + clk-cpuv2.o \ clk-composite-7ulp.o \ clk-divider-gate.o \ clk-fixup-div.o \ diff --git a/drivers/clk/imx/clk-cpuv2.c b/drivers/clk/imx/clk-cpuv2.c new file mode 100644 index 000000000000..a73d97a782aa --- /dev/null +++ b/drivers/clk/imx/clk-cpuv2.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2020 NXP + * + * Peng Fan + */ + +#include +#include +#include +#include +#include "clk.h" + +static struct pm_qos_request pm_qos_hsrun; + +#define MAX_NORMAL_RUN_FREQ 528000000 + +struct clk_cpu { + struct clk_hw hw; + struct clk_hw *core; + struct clk_hw *div_nor; + struct clk_hw *div_hs; + struct clk_hw *mux_nor; + struct clk_hw *mux_hs; + struct clk_hw *mux_parent; + struct clk_hw *pfd; + struct clk_hw *step; +}; + +static inline struct clk_cpu *to_clk_cpu(struct clk_hw *hw) +{ + return container_of(hw, struct clk_cpu, hw); +} + +static unsigned long clk_cpu_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_cpu *cpu = to_clk_cpu(hw); + + return clk_hw_get_rate(cpu->core); +} + +static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + return rate; +} + +static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_cpu *cpu = to_clk_cpu(hw); + int ret; + struct clk_hw *div, *mux_now; + unsigned long old_rate = clk_hw_get_rate(cpu->core); + + div = clk_hw_get_parent(cpu->core); + + if (div == cpu->div_nor) + mux_now = cpu->mux_nor; + else + mux_now = cpu->mux_hs; + + ret = clk_hw_set_parent(mux_now, cpu->step); + if (ret) + return ret; + + ret = clk_set_rate(cpu->pfd->clk, rate); + if (ret) { + clk_hw_set_parent(mux_now, cpu->mux_parent); + return ret; + } + + if (rate > MAX_NORMAL_RUN_FREQ) { + pm_qos_add_request(&pm_qos_hsrun, PM_QOS_CPU_DMA_LATENCY, 0); + clk_hw_set_parent(cpu->mux_hs, cpu->mux_parent); + clk_hw_set_parent(cpu->core, cpu->div_hs); + } else { + clk_hw_set_parent(cpu->mux_nor, cpu->mux_parent); + clk_hw_set_parent(cpu->core, cpu->div_nor); + if (old_rate > MAX_NORMAL_RUN_FREQ) + pm_qos_remove_request(&pm_qos_hsrun); + } + + return 0; +} + +static const struct clk_ops clk_cpu_ops = { + .recalc_rate = clk_cpu_recalc_rate, + .round_rate = clk_cpu_round_rate, + .set_rate = clk_cpu_set_rate, +}; + +struct clk_hw *imx_clk_hw_cpuv2(const char *name, const char *parent_names, + struct clk_hw *core, + struct clk_hw *div_nor, struct clk_hw *div_hs, + struct clk_hw *mux_nor, struct clk_hw *mux_hs, + struct clk_hw *mux_parent, + struct clk_hw *pfd, struct clk_hw *step, + unsigned long flags, + unsigned long plat_flags) +{ + struct clk_cpu *cpu; + struct clk_hw *hw; + struct clk_init_data init; + int ret; + + cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); + if (!cpu) + return ERR_PTR(-ENOMEM); + + cpu->core = core; + cpu->div_nor = div_nor; + cpu->div_hs = div_hs; + cpu->mux_nor = mux_nor; + cpu->mux_hs = mux_hs; + cpu->mux_parent = mux_parent; + cpu->pfd = pfd; + cpu->step = step; + + init.name = name; + init.ops = &clk_cpu_ops; + init.flags = flags; + init.parent_names = &parent_names; + init.num_parents = 1; + + cpu->hw.init = &init; + hw = &cpu->hw; + + ret = clk_hw_register(NULL, hw); + if (ret) { + kfree(cpu); + return ERR_PTR(ret); + } + + return hw; +} diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index f074dd8ec42e..7deaba2e525c 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -521,4 +521,13 @@ struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, const struct clk_div_table *table, spinlock_t *lock); + +struct clk_hw *imx_clk_hw_cpuv2(const char *name, const char *parent_names, + struct clk_hw *core, + struct clk_hw *div_nor, struct clk_hw *div_hs, + struct clk_hw *mux_nor, struct clk_hw *mux_hs, + struct clk_hw *mux_parent, + struct clk_hw *pfd, struct clk_hw *step, + unsigned long flags, + unsigned long plat_flags); #endif From patchwork Tue Feb 4 13:34:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364639 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA0951395 for ; Tue, 4 Feb 2020 13:42:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A73B72084E for ; Tue, 4 Feb 2020 13:42:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Y5NzJI7s"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="AbxBgErG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A73B72084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AXE+xt1Er/bHf5pzWIykffrZcqEXJMoZpPEm4hOr+hQ=; b=Y5NzJI7sE0FiBc KfNIEH+q7i2spB7Wz36KG77bnENyFO/vX1h2CSfhoJckEH5gZz5jlYbEIjuQzbRSa7DYPNt1VueDr RxRVjDitIe4k/JY+CyoxiNpEhZHnq2YLgQC57snxNMOeE8hl3jp7uAGnkwmBn0KU8JJnoCeru0HrB F+7T+tFaN5y8p1FdvSfad2/1YB8uedlOxvcLSezYRhs+QqFSOYEW2h/q4rl0puHTxicGTjwSJ7Fdn yEyP1cHdRf54EeSxIErNbgUmClU/Tzq8HegpqBrln2MC7KUcGUeOAjYOIXVfe1hu9qEZDudOtWJd8 bgY9vgLUGkAdgSLLCbWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyTN-0006az-JL; Tue, 04 Feb 2020 13:42:37 +0000 Received: from mail-eopbgr150081.outbound.protection.outlook.com ([40.107.15.81] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySN-0005hI-Th for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k+6JgSbfQwCKDJLBFA+Xt+RNIYcpA3ELGIzMuZ2y+24EXaoCJ5meTjOLq/lFXDo5O1K1OHMHP3RP6O8Hq5VLsE3mNEx3ZjwFdC1cFp9iAzqPcV3rGaPTL/G891Vswt0Z4jeUW+ajzCMuWEW4Vc/K3yJ6eFZM3QlP+gYW+Bf8xBFX1ltE3tL+K6tav1/lpymSt+yYtDQ3yKyPsnAB3WZdwTRVNd/2Z5Mj8UZaW3Bqupf6FGVUrqPyQQwrQMPXTr2popeczVWp6R2HN6r27jCtYTYaGV0cCNwL9q7c1S+2w8y0vY9V6cYmV4WoKZJCSWSxgzUF9vEMTQ3VwULF5IhYuw== 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-SenderADCheck; bh=ciaWO3VO+pP0EQZX28jcraO/8X95/AMNfFw8OgXbf0A=; b=PyqTcTEEqtVNFjtJ5HHxNTQ6MplzSVwSlAlde0Dd2v7lrs4G2wDk7EodcWf1iY21hHBsX8DZEN19h+MFFXvulIRNMgkwdzBqWLOI7aBZLcMHwbGQRPDs+FAKNlmwowfwZprbew1kF0/AyVWp4BaaeGREF/Dv/HnFsfRjUXF3jeoVCGTXNQzu5zaRai3XjEO7MOiseuoccuYcKCZ4udoukLLVvDfqHsET0bk6adPfxloer6Wy7JJateU8t46r32QKg6OuQubh+phwncCZ/SX3cWwNjHqgkp30EwlyrD1ORmXtk1ktsnQYHuHvhnP6JqDQ5thEPbIE6ypHdKaX0s7r3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ciaWO3VO+pP0EQZX28jcraO/8X95/AMNfFw8OgXbf0A=; b=AbxBgErGLi+49EjG+pGD6mfRZ517lJgHeTpnvSMVP3bJjNWxDH2LjdGB9lSwpt+MrNlfzlpHUQu0n3yNZHPhn74JQhFIqfroWOBARvje9yb98SVzKPGdM4Rw8UgLlRomRqv59uOqvDuDxlxEbXxEileqMZ3fuFk6YiSzxDIB0Fk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4851.eurprd04.prod.outlook.com (20.176.215.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.32; Tue, 4 Feb 2020 13:41:32 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:31 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 5/7] clk: imx: imx7ulp: add IMX7ULP_CLK_ARM_FREQ clk Date: Tue, 4 Feb 2020 21:34:35 +0800 Message-Id: <1580823277-13644-6-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:27 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 75873d72-7d49-4e75-4491-08d7a977f1b6 X-MS-TrafficTypeDiagnostic: AM0PR04MB4851:|AM0PR04MB4851: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:546; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(199004)(189003)(26005)(956004)(2616005)(316002)(6486002)(186003)(16526019)(8676002)(2906002)(69590400006)(81156014)(36756003)(6506007)(81166006)(86362001)(6666004)(8936002)(478600001)(66946007)(66476007)(66556008)(4326008)(52116002)(9686003)(5660300002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4851; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E5PGXiDKWdyrnGD8LfvB6tI6bDavEKrqylPdLYPd2qnC+Hp8TnZoLGgxyZj1bOrrYKAJyv1vMMNpemlAX+0i3wAR2mJ06sm/2CcjiAx3rdyVg/2UljzFlOouJhH67PgIbgHU6gPX0ODVigi0472bHECTztdfxHeEMF7OtCKLYUng3YAFNCaROGW3uR5WY7QhnurAJPYpCXPkWJSoIAmEdQjh7hyLaSXOqAsxl1YHlkYzaOH+WDMBpBisnxSIOQFri+R/Y2HOqT3lHVZn8EoOT30HxxgMuH2ZAtmyaMmt1pyM3TK79ONVx5SljeAXJSUTIY6elVtVlx02S6F/A87ynRPnfXvYWAdc/H/dzKC74OdGey2KFhhMijMa6zQ9IPDsIMJ/u5X1COmf01/z3rm5eTWcZHruQsl9LpONnk+/rCp714fxNnOPgJwmEZ9IHygOo0z0OA3+I6bOIrTs7DMcWdUdlBDNocMGRFkyl30ELAdJOBeIkwpXEVaXVcNOaPM6Tf6BmxmlUUHH5Ty+0p3bVAmE2L8GTwbHfZznCKdn9bg= X-MS-Exchange-AntiSpam-MessageData: mM4OvLd0zZ3EG6QjmyyUfh7EP65dr/EJscZM3XoZHHmwD8festI8s2vpisQpxqYP2S9MJ+UQ48Id6FCnPd7MnBQdBAvmKJsdIjqkO9LrfxbJZmKsEIvnE1P3BBkuI2WQySXDqaCnwMfRd3zNoa9G8w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75873d72-7d49-4e75-4491-08d7a977f1b6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:31.9370 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UY6SDJ+3x4bz5fGi9Mi4sbS+lJX7Mp4/59xa3U5ygVrJ2BoOwldHCsB6DdnLl9lJgJGW0uOtA/jCh43hHy0kwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4851 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054136_105364_4D5200C7 X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.15.81 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Add IMX7ULP_CLK_ARM_FREQ clk entry for cpufreq usage. The cpu in device tree needs use this index as clock. Signed-off-by: Peng Fan --- drivers/clk/imx/clk-imx7ulp.c | 15 ++++++++++++++- include/dt-bindings/clock/imx7ulp-clock.h | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c index 0620d6c8c072..daa770432bc8 100644 --- a/drivers/clk/imx/clk-imx7ulp.c +++ b/drivers/clk/imx/clk-imx7ulp.c @@ -56,6 +56,7 @@ static const int pcc3_uart_clk_ids[] __initconst = { static struct clk **pcc2_uart_clks[ARRAY_SIZE(pcc2_uart_clk_ids) + 1] __initdata; static struct clk **pcc3_uart_clks[ARRAY_SIZE(pcc3_uart_clk_ids) + 1] __initdata; +static struct clk_hw **hws_scg1; static void __init imx7ulp_clk_scg1_init(struct device_node *np) { struct clk_hw_onecell_data *clk_data; @@ -139,6 +140,8 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) imx_check_clk_hws(hws, clk_data->num); + hws_scg1 = hws; + of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); } CLK_OF_DECLARE(imx7ulp_clk_scg1, "fsl,imx7ulp-scg1", imx7ulp_clk_scg1_init); @@ -270,7 +273,17 @@ static void __init imx7ulp_clk_smc1_init(struct device_node *np) base = of_iomap(np, 0); WARN_ON(!base); - hws[IMX7ULP_CLK_ARM] = imx_clk_hw_mux_flags("arm", base + 0x10, 8, 2, arm_sels, ARRAY_SIZE(arm_sels), CLK_IS_CRITICAL); + hws[IMX7ULP_CLK_ARM] = imx_clk_hw_mux_flags("arm", base + 0x10, 8, 2, arm_sels, ARRAY_SIZE(arm_sels), 0); + + hws[IMX7ULP_CLK_ARM_FREQ] = imx_clk_hw_cpuv2("arm_freq", "arm", + hws[IMX7ULP_CLK_ARM], + hws_scg1[IMX7ULP_CLK_CORE_DIV], + hws_scg1[IMX7ULP_CLK_HSRUN_CORE_DIV], + hws_scg1[IMX7ULP_CLK_SYS_SEL], + hws_scg1[IMX7ULP_CLK_HSRUN_SYS_SEL], + hws_scg1[IMX7ULP_CLK_SPLL_SEL], + hws_scg1[IMX7ULP_CLK_SPLL_PFD0], + hws_scg1[IMX7ULP_CLK_FIRC], CLK_IS_CRITICAL, 0); imx_check_clk_hws(hws, clk_data->num); diff --git a/include/dt-bindings/clock/imx7ulp-clock.h b/include/dt-bindings/clock/imx7ulp-clock.h index 38145bdcd975..ecd832dd1c9c 100644 --- a/include/dt-bindings/clock/imx7ulp-clock.h +++ b/include/dt-bindings/clock/imx7ulp-clock.h @@ -110,7 +110,8 @@ /* SMC1 */ #define IMX7ULP_CLK_ARM 0 +#define IMX7ULP_CLK_ARM_FREQ 1 -#define IMX7ULP_CLK_SMC1_END 1 +#define IMX7ULP_CLK_SMC1_END 2 #endif /* __DT_BINDINGS_CLOCK_IMX7ULP_H */ From patchwork Tue Feb 4 13:34:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D81D1138D for ; Tue, 4 Feb 2020 13:42:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B59B22084E for ; Tue, 4 Feb 2020 13:42:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gN/V7j9l"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cG0rWpGq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B59B22084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SWelJdfmJckLIjLUzr7l9MNIH2XTcxFpGJX9f+F8cBM=; b=gN/V7j9lc7cjuf wMLSo/VCzEAN53qVX4gX1r4t1hQF/NSW5eOwVd+luChOKYL7H+ktziEhECTLM+pFt0/rYtNHrsWDN 7PLZhd+7njvmMBgXHN7DURi2wJeIrhsrwMUreHhYNG8kB/I7YC60iayYVA4Ovx6SICMG9CaeFIyXP wDGAjhO0oEAx6W9CL0HpPlJyPOAullY8syVuFrzkQ6baM+TaGj0EHg1mlbtPvXqjlVgnaDGMoNcG+ z0XaziRiU9NJ9oOM5p2HinB9E65CFAHKtQcsr9CTYgHHLWm7zjjEi84A7mpgC+c+AdkWvy+h8Z7ow A7SB41DeafFntbcjqw8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyTf-0006xg-C9; Tue, 04 Feb 2020 13:42:55 +0000 Received: from mail-db8eur05on2072.outbound.protection.outlook.com ([40.107.20.72] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySR-0005ji-HC for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=msGO8O7q7PA6KxcxMn6QnMpwVAtdxBJEmnbChaoN36F0xoINaH4A0LhNOQ5HI13iUmX4m+xZcTaxHf6aWbujqIFEM4ejlLO3+4VQSR6r9/kZ/ycF1PK69AHuHJjvGLjz14Tc+AvRNUnwfoW4pfCSPbCf+BdVF9AGqPAyuy+rw7U+RU5l8jdCh3OpOZHHdzM6Dep30yXuej5PVWheMqNljOvxnSYtK3xi/W9/HbRvKPSwENDV5JtsUPN1bpG06B8J7FtokSat66sivs9MFdUyGtsdTPJ/827k9z8KVWydm3L5/hNeSF83auHGls5DH4dVYAL6XLdZ2hkpfpuTlI/nMA== 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-SenderADCheck; bh=KjcVH/OE1OYbG2WI3e1JdUW90gQac/Y3FTEYb7pvf3M=; b=AD9jRoDTux6c5fnHzPLgdnyyK8cs8Jj4HD7bxLOZpstnO/MJ6/JWh9/8Mxse3IbPshqoln2e5G/A56Sd6J1/uMfyZa0byDO8EJgXjpsQFvhY+P32J6Md2EWI7DuAFArZQZe0NhlJt88hEQtMC67MQJuj82znbTwl+G0RkV+E89VWOw6dR3SPlxyzgPFSClWQ7zBEDAQLb2Cv9X+me4745AFW/2drFffCmvIN0NxM8V+b9sqesEBt3Nxwg7LKspTJno+uTpT5tlGfmpdv1khEz2bfqSvwzbDHwsPc1NylgcjQ4ZRrueybEVZpVQZvp71d9F1XZYV4BdkvqLox1jz89Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KjcVH/OE1OYbG2WI3e1JdUW90gQac/Y3FTEYb7pvf3M=; b=cG0rWpGqSSI5Xe30xFONRtv5uEhvPcLA4LUZPyO4ulrsYYv3OS1qaNGJk5Siem+B8umEgSdGpWoGj8CVFbQj5XmvCJAZw2k7Qp7S4RX0ZE5fwPDPahvvubxkHfMWy0iAcjg9x1aeq1ipS4xgNdmHplpqp7vKHLM1OxnfkUD8Tqg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6932.eurprd04.prod.outlook.com (52.132.213.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.27; Tue, 4 Feb 2020 13:41:36 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:36 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 6/7] ARM: imx: imx7ulp: support HSRUN mode Date: Tue, 4 Feb 2020 21:34:36 +0800 Message-Id: <1580823277-13644-7-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:32 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2407a0d4-64d7-43b6-fd7a-08d7a977f462 X-MS-TrafficTypeDiagnostic: AM0PR04MB6932:|AM0PR04MB6932: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:459; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(366004)(39860400002)(396003)(136003)(346002)(189003)(199004)(16526019)(8936002)(26005)(186003)(2616005)(8676002)(81156014)(956004)(81166006)(4326008)(36756003)(86362001)(478600001)(6506007)(66476007)(66556008)(66946007)(69590400006)(4744005)(6512007)(9686003)(316002)(6486002)(2906002)(5660300002)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6932; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A88d7CU9T7ACFWmM2sKHbhSFcbGLfOXlyT+ah9Syzn01sqT2sq96yqPpdvAqmkR4OTQDvS4nnIzp1areINXQpdWU/U9jZRMr63mq2fOhVRxj+JjiAFdUCly0lfQY02eerryonj4XRPF14IzQmvR7NhiwK70p+ElSUoukBYwNw3m01sb0tEyMVvt3MWwwsehV74wQ/OKdXej5nUoS064xmfId/AIJ77JI2F/gi74PMzSNIHFWuXixa4uTqubeCJQ6lBrg7nGSrdIF6IsK3t0rxBu4mqeqv8UsxvBT1Y+aMfqM/1d4bw5uu5zUVPqV+wAYkurjdAF1aatnF7LwVsd8u8Ou7RIIMA5jMz13rU8Nohim9IdhrqWZUvhH1nyiHuIgl5ngz2hI+YQ1rh3mERHqYXk2SGHsAZRNI0jcI9f1I5fe1z0SnE3BwpMqz2u+8QhoQYEhw+z3U7WBEeD82BWOVx6funO3Fv700bD7btKHrkGXfcM5xTshW7AWpJU6O6jPLXMLPpuJw4uTBGfHIFVPIRw07UtjSuCEhqLKT63UK0w= X-MS-Exchange-AntiSpam-MessageData: /k9+Hfg7AfuMfIHy9uWeY5DaYldn2AnlZw7CJt2Ez3WIs9+KegCAhdkB18POu1ycstD5LOsTWpHAmT9381gjUL/x25PLAVjDwI6u2JhyqLCJNzOTmb32EmGOsCr/1jZTVXOWxAfTcz3k6DlRDpvLrg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2407a0d4-64d7-43b6-fd7a-08d7a977f462 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:36.6042 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vhk80Wb0AS0XMMZRoUKcWThbAg4Wnfz3sWAWVXdRPHG1WssoogtqaJU13ebBqlIn1Oy5WPHMGl1oKuzBrSYH7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6932 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054139_703451_5E0EAC2A X-CRM114-Status: GOOD ( 10.14 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.20.72 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.72 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Configure pmprot to let ARM core could run into HSRUN mode. Signed-off-by: Peng Fan --- arch/arm/mach-imx/pm-imx7ulp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-imx/pm-imx7ulp.c b/arch/arm/mach-imx/pm-imx7ulp.c index 7b2f7387e662..dc2bc6f2cadd 100644 --- a/arch/arm/mach-imx/pm-imx7ulp.c +++ b/arch/arm/mach-imx/pm-imx7ulp.c @@ -11,6 +11,7 @@ #include "common.h" +#define SMC_PMPROT 0x8 #define SMC_PMCTRL 0x10 #define BP_PMCTRL_PSTOPO 16 #define PSTOPO_PSTOP3 0x3 @@ -25,6 +26,8 @@ #define BM_PMCTRL_RUNM (3 << BP_PMCTRL_RUNM) #define BM_PMCTRL_STOPM (7 << BP_PMCTRL_STOPM) +#define BM_PMPROT_AHSRUN BIT(7) + static void __iomem *smc1_base; int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode) @@ -51,6 +54,7 @@ int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode) return -EINVAL; } + writel_relaxed(BM_PMPROT_AHSRUN, smc1_base + SMC_PMPROT); writel_relaxed(val, smc1_base + SMC_PMCTRL); return 0; From patchwork Tue Feb 4 13:34:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11364657 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 937111395 for ; Tue, 4 Feb 2020 13:43:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BADF20730 for ; Tue, 4 Feb 2020 13:43:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i5LUNWYy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZGrGqP42" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BADF20730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yeveuOTGlDw46aDI5QAVGStncdO7P5C7Kq8e+5yspng=; b=i5LUNWYyUxG07h U3nLXRedoqoEdGxBJkMgmTYhylMK7KarfBBhISt6lGAfIjmOm8vSZEabQqlH5OmRcCb43kOwzn0cr HeXNlztIwLX4INB2NVBlEBWfifSgBtR43oR+NoLZLc434WFUgqHU51Y/zoEkSd8BDRScKas6S2TD5 ut3Al5dhCF68jx4L/2DWhxCI9BkgebdydsDX81DBhf0ZDmwvi8R0s4mtx3F3RxEKTOZyU2rA2VSVO Ys28CBbiFFjbOcxRO+i5Nv+zowrB+BqSVfBKqe8+MuifnTLMfyOH34Fee6K58+BP6PiLTVfSoPnvf QfSSpcvSCWiWJnLyoSwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyyTy-0007F9-81; Tue, 04 Feb 2020 13:43:14 +0000 Received: from mail-db8eur05on2057.outbound.protection.outlook.com ([40.107.20.57] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyySW-0005nx-51 for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2020 13:41:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lD1Hcq8XItEIfUat0huGq9C0JLHXIbgeGiTtjQMcrM0Ok61QQr/PA0JhEg/yF/7SFgA88fKBe3PB44tNHK849XxVdzgqg015TET3yqRxfpRb2hOvRBTcNszrph8DSNEk0qHg7fUYKQZvIvKAWIoyp2q2oXYLROTMCj/4koiP7d7aZcdvFw6DoyYf9apsDWrKFAuDTfHK+zqOhdcNLSyy1FVMh+XTVfa4c+vt+koNxuJcxs72ecvMs9NnFrX5cYi67WVAojdeP9h6KkyZFr7OmD+a/Sd3VyO4x0EoqF3VtknqYjGpmukniDxVtPyZtKbgP8BrZ+btY5zw/G611kSS6w== 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-SenderADCheck; bh=NEvjWr/4AdbPMAtC1YFADze47JBcfN0qbQO1FdM2O68=; b=SL22kKevIjInpACyB4NUXI8azzwUjgbjT2/p9C2YZJt0wBzIeNJ0KQbPCEh88uqzos9wiEPYWe/uM9UzVUclSqXPKmhdl+UBAv6+44Oz8qYugnn4FcutQeY4/wNev+7cnZFcJvnBdnSgBlEBv4oR4qn5TaD87kwq2L5ojN4qYkkGW2WDGF80/Q/kIZVXAeTRgquvM3VjPzjg914bHiOQMm0JuVLTd1nAR2s28PlD2bSVXUfeZEP/MhD/T6S9DPJcPC/J+sA4WGNQG2mfVueBaJVcEqjHHYvf27DG0329h41hv+/3gIbi0vc9C9iclSZz3LPbFpxfeGhPqX7n4y5oAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NEvjWr/4AdbPMAtC1YFADze47JBcfN0qbQO1FdM2O68=; b=ZGrGqP42cLN9VPfkKfNCfpkR7BtHsNToGhk7VIRs7Pmx1B57dta9NeHJ4gCFQFGMIid+oBB7vRETKURErTGQbL/tYmcr/UYu64LwbnpHB2dUTUE4KSB0WyHwD6DxWIP/wbTxXt0H3ffxOUfvuCyVJ6Dz/XbEMgNUteAk7ianIH4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6932.eurprd04.prod.outlook.com (52.132.213.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.27; Tue, 4 Feb 2020 13:41:41 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2686.031; Tue, 4 Feb 2020 13:41:41 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, sboyd@kernel.org, abel.vesa@nxp.com, aisheng.dong@nxp.com, leonard.crestez@nxp.com Subject: [PATCH 7/7] ARM: imx: imx7ulp: create cpufreq device Date: Tue, 4 Feb 2020 21:34:37 +0800 Message-Id: <1580823277-13644-8-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> References: <1580823277-13644-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 Received: from localhost.localdomain (119.31.174.66) by HK0PR03CA0107.apcprd03.prod.outlook.com (2603:1096:203:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2686.28 via Frontend Transport; Tue, 4 Feb 2020 13:41:36 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2ee1e305-793f-4cd0-36fa-08d7a977f725 X-MS-TrafficTypeDiagnostic: AM0PR04MB6932:|AM0PR04MB6932: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:459; X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(366004)(39860400002)(396003)(136003)(346002)(189003)(199004)(16526019)(8936002)(26005)(186003)(2616005)(8676002)(81156014)(956004)(81166006)(4326008)(36756003)(86362001)(478600001)(6506007)(66476007)(66556008)(66946007)(69590400006)(4744005)(6512007)(9686003)(316002)(6486002)(2906002)(5660300002)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6932; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uRKqjbExcXdjnzh42MlKq/RN0e5hNSOIooptQxI8q/jSI0RlSp/s5ErUMCK7gLuHc4mfkceBP4oHO6+5P6RKNc1QVrteqexLRgrdpdCpMs36fG8wqgiVBFq6HmM0YEP9mc05OjqSJ0xLTdkQlFfmGJ5x7i6ir//ndLXNmej3mLFLuT6+DYrxDYjq2GiKYL+Fq17dZzwtGUDlZ4ar8PwoVp/TzR4tMA1/0oSTxuaM8qu3nu4ImyGN9zG/FtTwu2ExFLz5V3q/Ok/U616E7yxezo50FRw/WTCMvsGCN+bXiBPLn1iypEFS78h+zzSPgsaua5VBFZgCl5AVWaCxZK0HrUA7X9qWh8i0P6ISIylmo7COoUg/nBBKtYtARzQzmFPOnohzyIjMrUlFiPGVLU/wQwXjmWfiN6reyn5NItDSWNna4YbNXCaykwNxDYZ79uAUWNwtVQryo5hJALzXk/JPAFcnKBYfA9yLpECm3vMwP3wPbA2U01AWUrEC0XDSfgNpNqY6Kp0lTnUiwvOEuiL6cHKS15YwTIZN5QC80hfypDw= X-MS-Exchange-AntiSpam-MessageData: nFnRvmrc5t4r63UlwMxbjLlWz6Prm/xRqZEJjkrooVMixm7J59os+T/asyqgXdJP47ftZ8WtMCYtxKHZrD3H1fv9UZK66ffocKAlh4O/ZPQewttpr8aD+mIwqneUDwAmEMJT+JaBj6TPvcns1OZCiQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ee1e305-793f-4cd0-36fa-08d7a977f725 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2020 13:41:41.2645 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bvei+I6lgn3QdydFwK3Bq1lz6cTIBb3bGA/q0k5M2SBppfVNlJo9d4C3OpxdnX2G+M2FnHK0tom9jbREcSbHmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6932 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_054144_244756_A145A464 X-CRM114-Status: GOOD ( 10.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.20.57 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , ping.bai@nxp.com, Anson.Huang@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Create cpufreq device to let cpufreq driver could probe Signed-off-by: Peng Fan --- arch/arm/mach-imx/mach-imx7ulp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx7ulp.c b/arch/arm/mach-imx/mach-imx7ulp.c index 128cf4c92aab..fc44fb4ca48b 100644 --- a/arch/arm/mach-imx/mach-imx7ulp.c +++ b/arch/arm/mach-imx/mach-imx7ulp.c @@ -67,6 +67,8 @@ static const char *const imx7ulp_dt_compat[] __initconst = { static void __init imx7ulp_init_late(void) { + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); + imx7ulp_cpuidle_init(); }