From patchwork Wed Apr 17 05:27:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 10904511 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 17AD517E6 for ; Wed, 17 Apr 2019 05:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F27782871C for ; Wed, 17 Apr 2019 05:27:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E68F428A00; Wed, 17 Apr 2019 05:27:48 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 476702871C for ; Wed, 17 Apr 2019 05:27:48 +0000 (UTC) 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: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:In-Reply-To:References: List-Owner; bh=CdZiO2500bmA+j8wJeM2tOLr2svFmCID7xzP/z6M+6Y=; b=QCRoF88g2WGE1y Ga4VGd5rCaXlL1vDD/Kj1gJo+bxw3yO0CKNlmE+hhmuhzPRmVyODVnyAV3uZP+vVsmM3YzOPDMYdj oE6cj7eiPVzq8TECwrTOS+Y594nEXQw6NlfJWBdAbxJKlBp0CZER5jUVum213ErP2rUvdkncpQFXZ aj6W9CVx1S3r/QEcbZMkCJYQjqhbUnVzbUpyftrXfSOxJxpRGOaH8K8RuEF8H2ZXMDClx/OK9BprX pHL5cuOP7mupginw+Golg9UJ1ywolnJ5Fd9c7KHda1qzGqluKYUXmfpXL+UqxnsWPJZY7KaZPrrE2 7v26Zr+zAQIyIQEyS38Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGd6k-00037g-O3; Wed, 17 Apr 2019 05:27:42 +0000 Received: from mail-eopbgr10084.outbound.protection.outlook.com ([40.107.1.84] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGd6d-0002wM-0P for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 05:27:40 +0000 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=U7S31ybC4sILknm9/9ehnVGZ56cZrPI3yBeEzxL5KoE=; b=WRLiwbeBO/phhgn2+riKLw5PyUdJ5MDNOq2IvscbTvb94ISiKB1cdQiJr4vzUGWc7dNPEcCfqTVZqbcod4AazcXvjGVsNnhypKFxEmoVPpY0pBHaUFU6HilDyDVDwTGS/FmKqsQkcqSaSxSnY7jZVyBikx57kD8Vq080Igwr5bE= Received: from VI1PR0402MB3519.eurprd04.prod.outlook.com (52.134.4.24) by VI1PR0402MB3552.eurprd04.prod.outlook.com (52.134.4.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Wed, 17 Apr 2019 05:27:24 +0000 Received: from VI1PR0402MB3519.eurprd04.prod.outlook.com ([fe80::f830:3f53:72c1:b14f]) by VI1PR0402MB3519.eurprd04.prod.outlook.com ([fe80::f830:3f53:72c1:b14f%3]) with mapi id 15.20.1792.018; Wed, 17 Apr 2019 05:27:24 +0000 From: Jacky Bai To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "l.stach@pengutronix.de" , Aisheng Dong Subject: [PATCH 0/3] Add power domain driver support for i.mx8m family Thread-Topic: [PATCH 0/3] Add power domain driver support for i.mx8m family Thread-Index: AQHU9N491dF9TR2ZQUOhhg21Z/3URw== Date: Wed, 17 Apr 2019 05:27:24 +0000 Message-ID: <20190417053211.2195-1-ping.bai@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.21.0 x-clientproxiedby: HK0PR01CA0031.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::19) To VI1PR0402MB3519.eurprd04.prod.outlook.com (2603:10a6:803:8::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ping.bai@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2afd8fc1-b580-4760-1f70-08d6c2f55f62 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600140)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:VI1PR0402MB3552; x-ms-traffictypediagnostic: VI1PR0402MB3552: x-microsoft-antispam-prvs: x-forefront-prvs: 0010D93EFE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(136003)(39860400002)(376002)(366004)(199004)(189003)(71200400001)(71190400001)(106356001)(6512007)(53936002)(66066001)(105586002)(36756003)(6116002)(3846002)(6436002)(5660300002)(50226002)(8936002)(8676002)(7736002)(81156014)(81166006)(305945005)(6636002)(97736004)(6486002)(486006)(14454004)(478600001)(14444005)(256004)(2501003)(102836004)(4326008)(2906002)(86362001)(25786009)(54906003)(110136005)(1076003)(476003)(99286004)(52116002)(6506007)(386003)(2201001)(186003)(68736007)(26005)(2616005)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3552; H:VI1PR0402MB3519.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-message-info: dLWJmCq9V1WXPPAePGC4ATVqZAiRHmr/v1gQVWpeGA90+tCnABCfoqlR/au4qt1U8/VdnE1IvReqrIimJf/3x/xaLgzJvtD1dYOfjhkDC+wVrEz+FMRkWtjtPCocil3hcuWiyP721gq51FSihGL5aSRE2H24XVDq6OPNhJfv/PHNhKuMZhfnki8oifCPH3rp9xaXkVS/W9fPjZZkIgH8BsPwm4lfsWT5zIWHQoGf4fzzNLeuVaaR8+Nw2J0qNMTnkA3XBVwJMdMj+tVhty2Bh4jOav815hjRILRdGsp1SWsjvgYysMItV1OnX752m1qn4gDQMd1B1uDL3msG/eFHBnazvWaXstSM9BGMo7WxASRvTlP1OmypSrRIpXE4RUpRTAifdW0DslJXUyzKY0F08zmlYZiCxdJ9cIVJTCPqqnc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2afd8fc1-b580-4760-1f70-08d6c2f55f62 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2019 05:27:24.7639 (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-Transport-CrossTenantHeadersStamped: VI1PR0402MB3552 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_222735_368305_0287300C X-CRM114-Status: GOOD ( 16.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , "festevam@gmail.com" , dl-linux-imx , "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 X-Virus-Scanned: ClamAV using ClamSMTP The i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption. i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family. The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference. all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range. it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2. The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code. This patchset add a more generic power domain driver that give us the possibility to use one driver to cover the whole i.MX8M family power domain in kernel side. kernel side doesn't need to handle the power domain difference anymore, all the sequence can be abstracted & handled in TF-A side. Most important, We don't need to care if the GPC & SRC is security protected. Jacky Bai (3): dt-bindings: power: Add power domain binding for i.mx8m family soc: imx: Add power domain driver support for i.mx8m family arm64: dts: freescale: Add power domain nodes for i.mx8mm .../bindings/power/fsl,imx8m-genpd.txt | 46 ++++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 103 ++++++++ drivers/soc/imx/Kconfig | 6 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m_pm_domains.c | 224 ++++++++++++++++++ include/soc/imx/imx_sip.h | 12 + 6 files changed, 392 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/fsl,imx8m-genpd.txt create mode 100644 drivers/soc/imx/imx8m_pm_domains.c create mode 100644 include/soc/imx/imx_sip.h