From patchwork Thu Nov 1 15:20:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10664117 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 A8E7717D5 for ; Thu, 1 Nov 2018 15:20:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9605F2C03C for ; Thu, 1 Nov 2018 15:20:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89A5D2BFD7; Thu, 1 Nov 2018 15:20:21 +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 1E2CF2BFCB for ; Thu, 1 Nov 2018 15:20:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbeKBAXg (ORCPT ); Thu, 1 Nov 2018 20:23:36 -0400 Received: from mail-eopbgr80073.outbound.protection.outlook.com ([40.107.8.73]:20352 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728197AbeKBAXg (ORCPT ); Thu, 1 Nov 2018 20:23:36 -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=u5ePSTyQe/l8MAasi+XOwaPoODfqJXnSNgKE6wd6OhA=; b=JJwf25FJaRnBdDhtfQUIqouHv3KM9DSLZdwHEFTWIglRvoeCbd3W5CsSz2OsN+tIW4I1EPdV14TOasN029CP22VBS0igMx19BtPNE8fydao62u4Fzl5RgDdC0/XAkaBChSirwbvEYWMXuzrOHZmjpKSjyIhQSRaDN06ffy7e0OE= Received: from VI1PR04MB4222.eurprd04.prod.outlook.com (52.134.31.21) by VI1PR04MB5166.eurprd04.prod.outlook.com (20.177.50.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.20; Thu, 1 Nov 2018 15:20:08 +0000 Received: from VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::f535:83fe:d4d4:d0e5]) by VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::f535:83fe:d4d4:d0e5%4]) with mapi id 15.20.1273.028; Thu, 1 Nov 2018 15:20:08 +0000 From: "A.s. Dong" To: "linux-arm-kernel@lists.infradead.org" CC: "dongas86@gmail.com" , "kernel@pengutronix.de" , "shawnguo@kernel.org" , Fabio Estevam , dl-linux-imx , "rjw@rjwysocki.net" , "ulf.hansson@linaro.org" , "khilman@kernel.org" , "robh+dt@kernel.org" , "linux-pm@vger.kernel.org" , "A.s. Dong" Subject: [PATCH V9 4/5] firmware: imx: add pm svc headfile Thread-Topic: [PATCH V9 4/5] firmware: imx: add pm svc headfile Thread-Index: AQHUcfZfQ1pv2TEIaU+W1EaEGG+5sg== Date: Thu, 1 Nov 2018 15:20:08 +0000 Message-ID: <1541085298-375-5-git-send-email-aisheng.dong@nxp.com> References: <1541085298-375-1-git-send-email-aisheng.dong@nxp.com> In-Reply-To: <1541085298-375-1-git-send-email-aisheng.dong@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR03CA0050.apcprd03.prod.outlook.com (2603:1096:203:52::14) To VI1PR04MB4222.eurprd04.prod.outlook.com (2603:10a6:803:3e::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB5166;6:nbMaIDSJCR1c68EwWjRnoe/NVZ95MfIHZLVrbO7ba1WeIIReQYkxEWWSv3SNMC1AGXAP+kfyyEnOMwJ8Buwo2BWVLAFesA/ehXwoq8dFLwEPg28RMhaMy1QELfPWAdk+dJ50rvrSw7XjslkhjS6qZwfHXR4XoKYzGnCDYRmuTzLytKYzUgpobsyes/B51hzt1RaU+Gcu2T9bjEoOy7g9MtdYALXXg0kJE1PtgzHNl1lI6uFnNr+XFgJRKXtx245JA4mbrLdsGs3yz2uBJRgDFRuvpRbzSYkf3xO5L22Bq0Ma+8cI3Ki068iGxz1qHpmq+ISnkCUOqzFl8qnq++d4ketWn8rlx+Zw8dOgx2tt0KMn22+/WpBYmEWo/r2rsN2edkkRj4xnSUIotrAFAF+9rOWRcDMZ6Jn0+mkgbP8E096RLyK2/MmKAEkREqDey3YmO1nNAV211YyE1Zs332cIXg==;5:19YPuOlo2r/OyMtxtBuVftt7EronxeSZ03lHSqUOKcDwuOh563y8DQ+iwxobgLhr5vrzESMgtE5DfNIsIffGMlnQj0Ri7b8khrxuxu3qBIvLblI9DLMqhmPaQ8lP003AqYd7PFkvlcRLVrmY1N2PKxp0wzLaJ2o414kAMLxs4JA=;7:AY5REAEQqqzH/WAtdCzMQlAoaYvLoULWXMLdwa0ezOVGIsi5/+aYG9F2EesBmJ12G+VzztSCR3RSaRQDShTgRtTq8TzpXST6StUdQbVgJ687Pe1NwY2G7UkPclij382rONR4A5qRKDPr+SEma7xvZg== x-ms-office365-filtering-correlation-id: 37a1d753-e994-4bf6-6891-08d6400d822f 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:VI1PR04MB5166; x-ms-traffictypediagnostic: VI1PR04MB5166: 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)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB5166;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB5166; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(39860400002)(396003)(366004)(199004)(189003)(52116002)(105586002)(486006)(26005)(102836004)(186003)(106356001)(6916009)(6506007)(386003)(446003)(316002)(478600001)(76176011)(11346002)(36756003)(25786009)(99286004)(68736007)(2351001)(5660300001)(2616005)(476003)(14454004)(54906003)(4326008)(81166006)(81156014)(97736004)(8936002)(6486002)(86362001)(2900100001)(5250100002)(7736002)(39060400002)(305945005)(8676002)(66066001)(6512007)(3846002)(5640700003)(14444005)(256004)(2906002)(6436002)(53936002)(6116002)(2501003)(71200400001)(50226002)(71190400001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5166;H:VI1PR04MB4222.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-microsoft-antispam-message-info: xCY08joE8NHOtnQVQWNWT0ZGU4R3ArhipE49M1kmylgK4T5huO5dTKlLFjz0XyD6ggP8gOZGzdpN7mwt5l3A5Z22O8xFzg0+9eM4pi6WB85GgxYHLLcM/FYBPacUiOK6e9bqlZnckvZGfxgVbieA7TKpOYjNu09Wnv9xUHRol26GpXgoAxJ8waXV8o717n47MQ+iiW+6D1SE+TyRqPgUhpEH5gV0UjyoC6PPlLWKXgLbD2mFCvupD3AJ4v3CC4DlYviQCOPqL2bWqb1ASAsYaNtnmAb77+LDeIa91zRFhW/HURo8sOaiWjbAi4UFDffbwIqJZxdidJM4i/q7PWObaZiKAtTPOm1DGaGD8rDsERA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37a1d753-e994-4bf6-6891-08d6400d822f X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:20:08.6384 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5166 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 Reviewed-by: Ulf Hansson Signed-off-by: Dong Aisheng --- v4->v8: * no changes 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..1f6975d --- /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 */