From patchwork Sun Oct 7 13:10:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10629631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0989A112B for ; Sun, 7 Oct 2018 13:25:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD42129171 for ; Sun, 7 Oct 2018 13:25:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D11C429206; Sun, 7 Oct 2018 13:25:42 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 4E3FF29230 for ; Sun, 7 Oct 2018 13:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbeJGUcw (ORCPT ); Sun, 7 Oct 2018 16:32:52 -0400 Received: from mail-ve1eur01on0077.outbound.protection.outlook.com ([104.47.1.77]:4640 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726803AbeJGUcw (ORCPT ); Sun, 7 Oct 2018 16:32:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pAXTFMSDSJclu2oTmE6incz1DdLpfWEJB8AnUUMIEPY=; b=RUY3QQzBO2I/r/+uVfjSkgKhL4D/EPiabKPOF2GYfe/vXbtZE1aUy5+jHJx0pVWMo7yH1MJ/1973dq6iM1P6kO0/jm5YD1TYFYrxCa/LwTcA/XNYI6coH15afyDKjutxMg4Gv2+8YLXGneL76KdqYdMR21lQgjA2R37WZs4ugQQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; Received: from shlinux2.ap.freescale.net (119.31.174.66) by AM6PR04MB4215.eurprd04.prod.outlook.com (2603:10a6:209:4f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.18; Sun, 7 Oct 2018 13:25:31 +0000 From: Dong Aisheng To: linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, fabio.estevam@nxp.com, linux-imx@nxp.com, rjw@rjwysocki.net, ulf.hansson@linaro.org, khilman@kernel.org, linux-pm@vger.kernel.org, Dong Aisheng Subject: [PATCH V4 1/2] firmware: imx: add pm svc headfile Date: Sun, 7 Oct 2018 21:10:06 +0800 Message-Id: <1538917807-1921-2-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538917807-1921-1-git-send-email-aisheng.dong@nxp.com> References: <1538917807-1921-1-git-send-email-aisheng.dong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0045.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::33) To AM6PR04MB4215.eurprd04.prod.outlook.com (2603:10a6:209:4f::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4667021f-8d3d-4039-ff17-08d62c585d22 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR04MB4215; X-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4215;3:o+/ZcsgDZDvesNqCKBgWwPprHntYIIX0QX2idRxSf7GSHfGvpAbXFHVt2RYj0EOxVS8KL4LxSAN1SIsKgJCs8TN7q56ON/+rAO4gR0T9oXBhsUr1664qokJUnlBIH281j05f7OJge36apZXlawyoMlQrWb3he6zFpb41UkY5gHsE8tzjniQYcTayqqnLpB2XsJ5dSR02WHXBexZ83TCM7NYbeaoq8yvw01k/LFbkFuzFG+nS1s8ZvLou3UCOyZUM;25:mVY/pT8QNuZPEMu2JIM/KPYT7tXjKT+SNlf4z3j91Yj9XtCd7tgJciyozMX6QSQj0H07fyPUGlx+yeSQC4lUawYPVx2zKYxKE2wWHZdhMaNspxA6OnUbJCy8/lYTka8as+ay0a/5majjMWhzGoEFpKfs2hyWLQrhdr+qQIG+29POcsSz/9KaQZjZGLYNguctlQDMPdHB6wAaXGtxXqD1QiTNAmppiN+wXisml9z9cwnf24Tk01fI35LtSyyxab7Zalai2zj3E26FD5mqgJfN8c1o63LqSjhOvopDaeoBOlg5tkdcnIbn5+fqyiAosrj7oMsbF7pqWyeiIKx0r0OuyA==;31:fcgw43FG1U+JaKwVU5K+tLjudIx6Vh2I1+DCMliMPnFOv/tuMqjEHVFlFavEyJ5fM3bjT3nvTvV7jYZ9th1vNNn9sJ/JdSOzeGXHQnH7wSaFOzRAhVb6Z6gYPxFFwGP+kGFG3GL8Drt3jHPcKz9V+boleOih4giwedb9ZJxItYG4uj2xliu812y0ujVxpWl/4ouY9K9VtQ7LS+L7kueahQ3iylzsb7B2rcxY6ir+vQ0= X-MS-TrafficTypeDiagnostic: AM6PR04MB4215: X-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4215;20:1gXsT5z963bYUu3HRgaBwQOH2m/b82YgWcJIASkjX96cyYz1agHBF+9BU1vyh5deBlDtFNrnJBJEIZfV73514VBXlmjtRLlAMrf8d48BhaBSQBnomTiD/1TzK2Q6FyWdZLuYIjSHjnpX4QgqKT1A37N7SZ1F1NYgJoTv/GXiGYleSQYtiPRyExf3v2qXW77WIxrGn/rGL21SbAA6rv/8FVHbcjgpaDeM8tfgZf4E/nck0vndnELJlEKeZFspwEiPpEd3OnE4GCr2IVTRJWbOfJ6mTqlkzBSei/IVyBJCzz4U9RMuSknA0EGlqSkTLHwqQg/+EDB/xMtqfAN/vtnhnEd9HJPZLA1yjoweBrR5J9wD8+8zA7Y8NPmnRllSHrq+uX9bV/LXZtlkIjRcDkm8pYZUYe4QIJqifQPjR2nQxAgbvD6rkPWPu9D1H2Fud8+8W69d1a1/PpqlZ0Vx8P5IB9t7Rxyz5mV4pLOioEOBZiXSuxrSqSECsKedEB3XjtAa;4:7yYSIgD9XcZ70dyZIoIDtet1lCQ7NoZGVtAqagANJEGAVtnP4oqHDRO/ERdRR9+4jGyYf0U03PKP00hJW4764nGtGzu+YdbFz3VYtVrcjbjg+AzwaVFRxF0lR7jCWQ522O++tbnmgbaG/xw1SS/7n/0LHcsUb5MkFl2PehB3yvAhm3xjA6D0YeT8vlDc2HWlFFjh3WmeFgvqp5p6wnPrRoqwMWroPKvzdra+nPdP7I8ssLI5ZNRMvn/NJMkk8LeINKpa7YRAKuOAekMcmgQ1vFZ66uCVcj+RGK6ZmEs6yjirIbERarOff98eqraEphWks9AF6K6oNa0sry3ZRsMdOczcstB/ZFf5PFZ6f+1+8vk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(269456686620040)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699051);SRVR:AM6PR04MB4215;BCL:0;PCL:0;RULEID:;SRVR:AM6PR04MB4215; X-Forefront-PRVS: 0818724663 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39850400004)(376002)(346002)(366004)(136003)(396003)(199004)(189003)(4326008)(16586007)(39060400002)(8936002)(8676002)(86362001)(2906002)(106356001)(50226002)(478600001)(2361001)(52116002)(51416003)(36756003)(68736007)(81166006)(2351001)(76176011)(81156014)(6486002)(14444005)(105586002)(316002)(6506007)(386003)(48376002)(16526019)(186003)(97736004)(6512007)(50466002)(476003)(2616005)(956004)(11346002)(53936002)(446003)(486006)(3846002)(6116002)(7736002)(305945005)(25786009)(66066001)(6666003)(6916009)(5660300001)(26005)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR04MB4215;H:shlinux2.ap.freescale.net;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-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4215;23:fI0yRQ4NZfOw98TvqxWn3SJPWcFEV8CvIqiWqhv4C8DGk7qH39bMi+mWjvKObgdlyYDCEC1zYd5TUzqumTI7eO43O5GSH/htadkVUWCXTlF7IAlaySZh8epgRZcYr6id8DabQNtC6ERAmT2/WwLas+QZjgn7Zeus9QmZID6PixF2kNFRZgQ8k+s8qjhqVzCB7Q9mwLhLtxrC+A2X+wwnSs88hCMRyBQzE0piDpXToLMerB4a8VO1tcTMW1r9PAgNs7TkAg2sVgofZpoNpJyJp3VY5Abu5XivfyEhB0X+cDsvFRuWcjSNWsuB4LQK7Mz9c8NU7M338QZ2TLY5sajv+BrmZYn+yJECP7EJW6A5x8bApu7VOuO5KMNYbZ4BFfF9aY9zDOhdXK/WVJVG4auzpIxBA9as51lxyPvinkciXKAZkUJhufIRAtyl139xO1ph9Qtgy5oOIb/fEQay8IgDPrmJvxy6rfDGmiWZ4q9HK5B4Jwuk5MYtdtyaUqded75H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UC21K8N7S5K//kvxW4StC/SB5Wb3Vz31c3DpPMIsSTg74f2OW5hA6EnJRg= X-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4215;6:ZEIRlM34s08LAaFFncbCwQKoT1JAG/DLhtRo6B0WIyJKpL5dF2cBxw6yehI3MpBAVd3RPrqo90AMMD96pPfs/G9SwROmRK0bWo8Q4G8vaxTImlCWweLGfBtTz+4wXiXWQ++6NWRxKEvRWISBkat4TWnGzuq+r/lBXdtxkD5E9Di7BmbtTjJYk3t9yaQ/q47mGNwaL0cX1VHT0JKNx3KrsYYco3SzCzsJeJhbAB3wobIiRlt70Y2fkl90tbm9ymgAsozAQYGpEG68tkXzDkYxI88wSLhnVPrzYQmCWVptQSIygfjY0watWCSb1KSiC7FWIL4OowYos3YRvSHVFnPoeboP5lasr/32YDEViLksjfqtgHAM5j4gDTLvG9BaBn6WkwP2N5cZ0PZFgva2btbA/ZV74pnNCqD3UOprd5Cau3dNuuhym7L8XBh2BNMa0Tve2n1ctqHxMqVfRgwoDRb6xA==;5:45lC/Bee5Kuek9vqVlujrKQBBi7DA4E4EJfXcVmt76JO2mVVYgCJ7nHkpGTbBLsNEW0CHwvW6qXSvhp72DZt7lKh2pcAuwwfyhYjrbQrU9SutFcCY4BR3A9u7FtDugoylsfm9uvzg+hQmREi04fOeaIaROVXrtImPWqvn6uZC84=;7:uDzDiQnEyVlV/4efhIaiyWrLBTy4aVgkVMpFLKwR/DtJTv5bQopHzRQXv0p8He0KR8vzPKi++Lv8icOp3NGQ4LactmOs30neyeaKgan2LaM4WiLSSTOTOd46yyd1IRSpbJoIni+Jghv6qO5/wtKRZVX1PRxGjSZLKaolUk/3dQUX+bQa5zBx9O9SkGGbO/J8Venih26GteLLOV1DpdD1Tm/Hkow4rtrfdu0c26NXXlj7X+6ShU/FO8tV1IijUmsQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2018 13:25:31.8349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4667021f-8d3d-4039-ff17-08d62c585d22 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4215 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add SCU PM SVC related protocol definitions which will be used by a number of PM functions like Power Domain, Clock, Reset and etc. The detailed implementation of each function will put in the individual function drivers. Cc: Shawn Guo Cc: Sascha Hauer Signed-off-by: Dong Aisheng --- v3->v4: * update firmware headfile patch from include/soc/imx to include/linux/firmware/imx v2->v3: * name updated with IMX_SC prefix v1->v2: * new introduced --- include/linux/firmware/imx/sci.h | 1 + include/linux/firmware/imx/svc/pm.h | 85 +++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 include/linux/firmware/imx/svc/pm.h diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h index 29ada60..ebc5509 100644 --- a/include/linux/firmware/imx/sci.h +++ b/include/linux/firmware/imx/sci.h @@ -14,4 +14,5 @@ #include #include +#include #endif /* _SC_SCI_H */ diff --git a/include/linux/firmware/imx/svc/pm.h b/include/linux/firmware/imx/svc/pm.h new file mode 100644 index 0000000..ee5a7bb --- /dev/null +++ b/include/linux/firmware/imx/svc/pm.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017~2018 NXP + * + * Header file containing the public API for the System Controller (SC) + * Power Management (PM) function. This includes functions for power state + * control, clock control, reset control, and wake-up event control. + * + * PM_SVC (SVC) Power Management Service + * + * Module for the Power Management (PM) service. + */ + +#ifndef _SC_PM_API_H +#define _SC_PM_API_H + +#include + +/* + * This type is used to indicate RPC PM function calls. + */ +enum imx_sc_pm_func { + IMX_SC_PM_FUNC_UNKNOWN = 0, + IMX_SC_PM_FUNC_SET_SYS_POWER_MODE = 19, + IMX_SC_PM_FUNC_SET_PARTITION_POWER_MODE = 1, + IMX_SC_PM_FUNC_GET_SYS_POWER_MODE = 2, + IMX_SC_PM_FUNC_SET_RESOURCE_POWER_MODE = 3, + IMX_SC_PM_FUNC_GET_RESOURCE_POWER_MODE = 4, + IMX_SC_PM_FUNC_REQ_LOW_POWER_MODE = 16, + IMX_SC_PM_FUNC_SET_CPU_RESUME_ADDR = 17, + IMX_SC_PM_FUNC_REQ_SYS_IF_POWER_MODE = 18, + IMX_SC_PM_FUNC_SET_CLOCK_RATE = 5, + IMX_SC_PM_FUNC_GET_CLOCK_RATE = 6, + IMX_SC_PM_FUNC_CLOCK_ENABLE = 7, + IMX_SC_PM_FUNC_SET_CLOCK_PARENT = 14, + IMX_SC_PM_FUNC_GET_CLOCK_PARENT = 15, + IMX_SC_PM_FUNC_RESET = 13, + IMX_SC_PM_FUNC_RESET_REASON = 10, + IMX_SC_PM_FUNC_BOOT = 8, + IMX_SC_PM_FUNC_REBOOT = 9, + IMX_SC_PM_FUNC_REBOOT_PARTITION = 12, + IMX_SC_PM_FUNC_CPU_START = 11, +}; + +/* + * Defines for ALL parameters + */ +#define IMX_SC_PM_CLK_ALL UINT8_MAX /* All clocks */ + +/* + * Defines for SC PM Power Mode + */ +#define IMX_SC_PM_PW_MODE_OFF 0 /* Power off */ +#define IMX_SC_PM_PW_MODE_STBY 1 /* Power in standby */ +#define IMX_SC_PM_PW_MODE_LP 2 /* Power in low-power */ +#define IMX_SC_PM_PW_MODE_ON 3 /* Power on */ + +/* + * Defines for SC PM CLK + */ +#define IMX_SC_PM_CLK_SLV_BUS 0 /* Slave bus clock */ +#define IMX_SC_PM_CLK_MST_BUS 1 /* Master bus clock */ +#define IMX_SC_PM_CLK_PER 2 /* Peripheral clock */ +#define IMX_SC_PM_CLK_PHY 3 /* Phy clock */ +#define IMX_SC_PM_CLK_MISC 4 /* Misc clock */ +#define IMX_SC_PM_CLK_MISC0 0 /* Misc 0 clock */ +#define IMX_SC_PM_CLK_MISC1 1 /* Misc 1 clock */ +#define IMX_SC_PM_CLK_MISC2 2 /* Misc 2 clock */ +#define IMX_SC_PM_CLK_MISC3 3 /* Misc 3 clock */ +#define IMX_SC_PM_CLK_MISC4 4 /* Misc 4 clock */ +#define IMX_SC_PM_CLK_CPU 2 /* CPU clock */ +#define IMX_SC_PM_CLK_PLL 4 /* PLL */ +#define IMX_SC_PM_CLK_BYPASS 4 /* Bypass clock */ + +/* + * Defines for SC PM CLK Parent + */ +#define IMX_SC_PM_PARENT_XTAL 0 /* Parent is XTAL. */ +#define IMX_SC_PM_PARENT_PLL0 1 /* Parent is PLL0 */ +#define IMX_SC_PM_PARENT_PLL1 2 /* Parent is PLL1 or PLL0/2 */ +#define IMX_SC_PM_PARENT_PLL2 3 /* Parent in PLL2 or PLL0/4 */ +#define IMX_SC_PM_PARENT_BYPS 4 /* Parent is a bypass clock. */ + +#endif /* _SC_PM_API_H */