From patchwork Tue Aug 28 08:36:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10578045 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 A731C920 for ; Tue, 28 Aug 2018 08:41:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 931A029B43 for ; Tue, 28 Aug 2018 08:41:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8623B29B4C; Tue, 28 Aug 2018 08:41:35 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 A879D29B43 for ; Tue, 28 Aug 2018 08:41:34 +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=d88H6zPqJJXWYLyV4DdnGGqTCGlALiqNRuksLVXZjEw=; b=RMTh9y/yypemYQ 2GxrQF21Co0h3dTshTKGFBOYSVXO9FakJQX1Tx3clU3rBeHU4c2+EebhmlZoh+WQf6xkSl6fpykJ9 jQ73uiCMYPCSsDoZAW7ZZqGijr9gInKtdsONItsMK1JWjvEBvLO5IbQv/T3UGDvkIpFIsGGR1JUv/ jrrWWtJnXg6RYNeO86h2fTgz+sKtXNAcJDMjKVtepSwJstAGEv+ZGf/nKfkzk65CMzUiayD9XdsOP 26UTjXi8SFKYSk4AoELhSklhM+9I+Hjo4VrSpVt5gguAJNpFmWUIlW5qPJ+ilm++0b9kiDKKxI8Kd kwWY7++obpryfItZsfVw==; 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 1fuZZ0-0006bQ-2g; Tue, 28 Aug 2018 08:41:26 +0000 Received: from mail-he1eur01on0086.outbound.protection.outlook.com ([104.47.0.86] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuZYw-0006a5-4x for linux-arm-kernel@lists.infradead.org; Tue, 28 Aug 2018 08:41:23 +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=lE4DodF5h+CGT3VfehyEU8j7rYJgOEw0AwstzRmDlsw=; b=XpvSrm6sCzsvHUVsWuql0xgUOdVljpkkwREVF59GMC6/TNN5tc1RQ7ZOGHPsWOo0KGDSDUBztg3/YZj9dMWpTWc5hIcA2Eq9U5JR5ReGGlkEDBqjUKZSbroPVerUJUNykFjJvwKrvr0AQv9h2vksgbvahK4n/s1BGIevyEg0kkE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; Received: from anson-OptiPlex-790.ap.freescale.net (119.31.174.66) by AM0PR0402MB3907.eurprd04.prod.outlook.com (2603:10a6:208:f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Tue, 28 Aug 2018 08:41:04 +0000 From: Anson Huang To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, fabio.estevam@nxp.com, andrew.smirnov@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/2] soc: imx: gpc: use A_CORE instread of A7 for more i.MX platforms Date: Tue, 28 Aug 2018 16:36:45 +0800 Message-Id: <1535445406-19633-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0067.apcprd03.prod.outlook.com (2603:1096:203:52::31) To AM0PR0402MB3907.eurprd04.prod.outlook.com (2603:10a6:208:f::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5941b1e-48e9-4842-7bb6-08d60cc1ffe8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0402MB3907; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3907; 3:4PDpECzgOqCjceE8REU0871JxyL67LyHn3TDjOy222vLeZxaDcyuKryksqDqiT3RSrSL9fj0WuxEKIKD+1ULK/XC1efO3S2+3g7JzA/ganeOArqoXYr2hr1sdwwFdS0lFPXMA/vCOldqHVpW/iDTdcKR93uPcJt0qu1Cu2N7/UGfPrVKJFR9lb1TPk6ejRBx7fFd6qvZAqLRRC+pRJPu/plWxnToUdlwV/JMJnUN0pPr3WpN/0rj5nc21cOX8Xjv; 25:qvsgJ8a6H08J5mytNVi466uVCRsib2aC+jXhi9rWDoVhf70K3NOBFt6ogf64//NpG35/vyvHnbaCz/lmC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Z8jtOwePQTl+SPNnpUnJBT/rl; 4:PoXVDBzixcndPJa996Iwn8SGoLJ1hs+DwyZ5JeGgUmKGlEo/Uhc6rax8q8L7kBKBedQTCtaXq9vIHtzDnNbos2Spv5FEok+mPbx4GRHVDi4FD2Khq6G8W91PmWUy74veEHWvkmzsNsVjQE6JP9+mzOYytONLypMg9U+zIDZCFkcItzZSCWutpLRl2x09TvaaoofvTY4haveII7xyXJCs1Y02EDHb3jDd4A4taaROGO3dUwzfwbv/SSZNH66vyESCOjfNcu6k4TPGzK4669QZrBDuaCrr6/dwO2CbHETTwiA6WdlRiJsdntcDyOM2HusW+3BV9ZjkqQ7Tt2SrLq86rbvIga2z7uHcB86DQox3a0k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699016); SRVR:AM0PR0402MB3907; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0402MB3907; X-Forefront-PRVS: 077884B8B5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(366004)(396003)(199004)(189003)(106356001)(50466002)(105586002)(68736007)(50226002)(8936002)(48376002)(52116002)(16526019)(186003)(51416003)(6506007)(386003)(47776003)(66066001)(39060400002)(305945005)(26005)(4326008)(25786009)(36756003)(486006)(2616005)(956004)(476003)(5660300001)(6116002)(3846002)(97736004)(6486002)(6666003)(8676002)(81156014)(81166006)(2906002)(86362001)(7736002)(575784001)(478600001)(6512007)(16586007)(316002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0402MB3907; H:anson-OptiPlex-790.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: =?us-ascii?Q?1; AM0PR0402MB3907; 23:zYgDQUJthum7jNp/Wph/bLxHZl+tuUnGJKov6QQ?= b9e5lK1UYmMIc9ByzPB2Fv3TATMfRKl8BuOec2W3QV6dNmizYLqAYxJm7/97vnjDMq+czhh/dN1+5+2IzMMG/YypkWcdzgsxvujco6oJAFvIUYBSxJMamld/fl+xE/Ur/HA1svTBtbbKZ3DGFW0+FF9wrfQOYezm2N2S3ZBWzw74RvRoxg7d/yKDGKk32FGHwN60RRKEkHTehNxuc8bvT5k3Br4ZKNbhqi2+72BJNxZbqeGj9Qx9ceTXiDeAV4Oo5Kf6vTabTPeY0VxOzONSCuwZdAixfbexvQNdyVJj/wYUyLKmFyMavKdhnmpl829IYg5EBByiuwjTu+P/bxQNFP/vQybo5DbxAV6nZDijxnW8+Nkfe37cp9EUtKHXdBt1qVZlVt+PxtLNloupFbh0mYLsKrUXD9zcZd7NLk5Rtv1jFhJ9yXeSMlzP7/dZF06O1GJ+ulUYPYaNhqULyuZniVaHx7FuamOmUm4f/rkXHSUO3jKRESHhbNh5mfKUMaI/zKBu3jTCC1rjIHXKwdVzDckHy53aES4y4r2B7wFNMRpFN5ztw+Z5aCxPGR/Ny9ykii7Hmj30sG9HPcTD0repDqvz8J8aK/UV0yWvLGhiyR15WDVyy/PmkaJnqMBDrdaS7B72gSsGxJOONEwDcC1FT0FZ+qNy3UmctyhtP2jfQTfWxH43+ywYXm9twLdR68NxarD4d7KY71/tLXrIq+F3N7VwDr0xdjjrbTAnTEbT1RSK5jeozEMohLEgNd1hs9lpiRAaI/wRK25ygSAHSQpfRzD/TfEUxguj723iXzFuRqd+ZjQOQkq3IM04bkdAUOFgHLNC9AuB2ICAtLpC7YqUaU4ndhsdvi4InXDShpAzLVdjK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hMhPzF/HDQv3t6+OGvIeC5Im5wqIfBrSD/UcZv1o35qNw==; 5:8n91Q4zKZEcWgat6CgOOV54vQR6G79sP0zSVDOyieTrPfAuatKyqkrPCgExPs2zZLQQnZlinlC5EKKLINGUsLqQW+u4ofPv4trTbF9HgigFDYuMMS3JAfwtFbpnU0nJt6W6i/SddsvWBSq7dZKdTl8Br8FlNiVugEKz590C37Q4=; 7:EqbJcVnW4FcmqzRV7N1eT0KQ/MeZ6Q85cRfiEVrmULdSwZqDh1HMN5DjsTuv+AEzjrpV41IMSJsAJ/scKKxeUFALRVgwihGe/sXj6abidyLY2tFm2SIo7SLPj3n/a+HSBffae16bPoe1FSzvaLEWDM9IAe2enTkz7iXj58iXMXzpUk0bYIDa4P1YkRr/dCBQb1WKU9f79ptZGQMoW15OLGBg98BzT582MaZnqj79IwEdIzc+6H3efJA0v9fh5ZhB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2018 08:41:04.8737 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5941b1e-48e9-4842-7bb6-08d60cc1ffe8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180828_014122_371413_AB917504 X-CRM114-Status: GOOD ( 11.87 ) 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: Linux-imx@nxp.com 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 gpcv2 driver is NOT just used on i.MX7D which has Cortex-A7 cores, but also on i.MX8MQ/i.MX8MM platforms which use Cortex-A53 cores, so let's use A_CORE instread of A7 to avoid confusion. Signed-off-by: Anson Huang Acked-by: Andrey Smirnov --- no change since V1. drivers/soc/imx/gpcv2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 6ef18cf..0e31465 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -20,14 +20,14 @@ #include #include -#define GPC_LPCR_A7_BSC 0x000 +#define GPC_LPCR_A_CORE_BSC 0x000 #define GPC_PGC_CPU_MAPPING 0x0ec -#define USB_HSIC_PHY_A7_DOMAIN BIT(6) -#define USB_OTG2_PHY_A7_DOMAIN BIT(5) -#define USB_OTG1_PHY_A7_DOMAIN BIT(4) -#define PCIE_PHY_A7_DOMAIN BIT(3) -#define MIPI_PHY_A7_DOMAIN BIT(2) +#define USB_HSIC_PHY_A_CORE_DOMAIN BIT(6) +#define USB_OTG2_PHY_A_CORE_DOMAIN BIT(5) +#define USB_OTG1_PHY_A_CORE_DOMAIN BIT(4) +#define PCIE_PHY_A_CORE_DOMAIN BIT(3) +#define MIPI_PHY_A_CORE_DOMAIN BIT(2) #define GPC_PU_PGC_SW_PUP_REQ 0x0f8 #define GPC_PU_PGC_SW_PDN_REQ 0x104 @@ -167,7 +167,7 @@ static const struct imx7_pgc_domain imx7_pgc_domains[] = { }, .bits = { .pxx = MIPI_PHY_SW_Pxx_REQ, - .map = MIPI_PHY_A7_DOMAIN, + .map = MIPI_PHY_A_CORE_DOMAIN, }, .voltage = 1000000, .pgc = PGC_MIPI, @@ -179,7 +179,7 @@ static const struct imx7_pgc_domain imx7_pgc_domains[] = { }, .bits = { .pxx = PCIE_PHY_SW_Pxx_REQ, - .map = PCIE_PHY_A7_DOMAIN, + .map = PCIE_PHY_A_CORE_DOMAIN, }, .voltage = 1000000, .pgc = PGC_PCIE, @@ -191,7 +191,7 @@ static const struct imx7_pgc_domain imx7_pgc_domains[] = { }, .bits = { .pxx = USB_HSIC_PHY_SW_Pxx_REQ, - .map = USB_HSIC_PHY_A7_DOMAIN, + .map = USB_HSIC_PHY_A_CORE_DOMAIN, }, .voltage = 1200000, .pgc = PGC_USB_HSIC, @@ -261,7 +261,7 @@ builtin_platform_driver(imx7_pgc_domain_driver) static int imx_gpcv2_probe(struct platform_device *pdev) { static const struct regmap_range yes_ranges[] = { - regmap_reg_range(GPC_LPCR_A7_BSC, + regmap_reg_range(GPC_LPCR_A_CORE_BSC, GPC_M4_PU_PDN_FLG), regmap_reg_range(GPC_PGC_CTRL(PGC_MIPI), GPC_PGC_SR(PGC_MIPI)), From patchwork Tue Aug 28 08:36:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10578047 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 396C313B8 for ; Tue, 28 Aug 2018 08:42:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2658C29B4C for ; Tue, 28 Aug 2018 08:42:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AA4629B57; Tue, 28 Aug 2018 08:42:24 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 5130F29B4F for ; Tue, 28 Aug 2018 08:42:23 +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: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=1MulrpGXxpjhuYT+aTzachU62xRiRw7m1RbNPP6t26Y=; b=rfxSsAu5b/iiv2 IbgCda408mgiA6NCD/zCbvVgPKnyFNop80JvTmsVGa2OpKDip0zVkAJflPm5y/g5+G03cHWA6bnh1 Z1X3liiDxKGILCRGp1rhb/lnr5isKa4yS5LVPCDS3DfWs7DX23W67FvWkppeanA6OIhE3/kJ4hNfo GZixThfhapu2RmnklWVHOdslYsqMMjvfkXR+uglVSB5JkCZgCipfVFoPDGrQkVaseLDMZicdyAsQe yZPwmJG/KiNqKXO0Zqm2jrt6GnMMqMl8tVZayMOYjDLkw9l0w6S3Hz1B70r3nE2iLanAR29I9aLxP H3vF73wuW5g3oqHOiK/g==; 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 1fuZZi-0006sN-5Y; Tue, 28 Aug 2018 08:42:10 +0000 Received: from mail-he1eur01on0086.outbound.protection.outlook.com ([104.47.0.86] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuZYy-0006a5-B4 for linux-arm-kernel@lists.infradead.org; Tue, 28 Aug 2018 08:41:26 +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=bvk8HM5VJEKcRP4yhfqjrm9u41zfvt0P4tglQdaqvEw=; b=hA9XhAUI6T2MbAsz4vTl2gQk0hNpVKhdSXp54o+xF8Wg6kgcQ6/crAzqiEyHBs8wHxVX7X3qRuLJclBTZXCkEWK3VFPPLJ0KClPYLzF8sL7Nn/Y4ZVQdECII4u1cxYxBD4mi0HxdRYPieDlSWo0U88HCM8Ffa9ru8hTg7Q+NcMU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; Received: from anson-OptiPlex-790.ap.freescale.net (119.31.174.66) by AM0PR0402MB3907.eurprd04.prod.outlook.com (2603:10a6:208:f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Tue, 28 Aug 2018 08:41:08 +0000 From: Anson Huang To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, fabio.estevam@nxp.com, andrew.smirnov@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] soc: imx: gpcv2: make pgc driver more generic for other i.MX platforms Date: Tue, 28 Aug 2018 16:36:46 +0800 Message-Id: <1535445406-19633-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535445406-19633-1-git-send-email-Anson.Huang@nxp.com> References: <1535445406-19633-1-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0067.apcprd03.prod.outlook.com (2603:1096:203:52::31) To AM0PR0402MB3907.eurprd04.prod.outlook.com (2603:10a6:208:f::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19a12b11-fe87-4a64-8885-08d60cc201f6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0402MB3907; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3907; 3:Suqr9xxOgEJPZEv8bb/m3qOHr2GaK50g2G7ahSiSkd8YBCO8Ze1kcG0uVO8yqu/igl6fmfzUOHwmRyvGPfQ2T3A+shmfKiRvaRzWtfkKGgr6qedTvORFr2b0c5cJXe7vsovJKY/67S/V75F3fFv20Q3XfyKHh0hNEZBbZCvma6574ncffjoeMVb6Xxg/RtRrE9wTboQB5SqYgUyjezsxzdtia6SpJTB+G7z06ds+vmp2VUTtrvh9lISu78yrlSLo; 25:AcyOjpQEDMviOVOVwF5O0h/6aMBh8fFgJ/J6UQs4UJeG5TQ1HzgjlZmqi9tYwVtv6zfZfLkMA9KCWq8NY1cLGL3FnzjOHkWC/W4RWkzOW/t14oiMI8MXOkdOSxSUECnZMrYmuLVpvraCM7ibNOB8tf7n1f5BADuHdPTaJYF4EFl7htUuwWTJANC20zWPBnCCj/yWkcId2NRT/hSCwvJQli/UZzJVjw138arX9RUPgGzSIPudJIwhg3NRlhCIuYa88bdemCQGj/8uO5LaBuWILM74mEdAMdSDua/hd+OXZxIcOFR0kWVlpcc1EMzKjA+4+ea79oVJBdkZG4ALxQmUIg==; 31:WmdSH6+C5+/y27Zj23JA0h4v/kVTozNTX/jicqR3SHCdSkQTgZxZ0pJ97xmHo8wHyaWZThh55IJ8fH0Ru3pG32lrsjscxOch7Y+Lb5SOyh05VD72p1mpvGaoQtMQvWHQ0G4xv8wTyUy6r3RW/Tirdj8scviLpmEnO7yoNesokycozpW0bhelEnUjlOz249xljKeJVXwLG9/1ZO9wqQQ3t5pWNe2H5VArX3FvTb3pGuA= X-MS-TrafficTypeDiagnostic: AM0PR0402MB3907: X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3907; 20:tb3KeTk6mm1u2D7K9lqU9dx3cmRUazGxShmOdJLmTJTtPGQ2g2NKpOfFD9YcrSRa9OqkcaoteDZl+LYMR/FKicYHEQYD5Fz2rrlgykU482pWqdqFJj86Bu/SEKd8zIdQtv/OePR6T0PcK4ILvXOPD9jbrnykczsdrTGVAPbYl3MxjroLMVdVf83K2EykmTcDEsPjilJLt7q+xccykUJoxcD+cPSMXkiCNUU9bgqoKGAi9oULd6/P3yuFmN4pPSpUWkGdHjtW5VwhtdELsugP6GdQORNZJRcNgAOtL9lNlzQyE/fJ6YSf9zoAnWhq6h4zjT8EXyrshqdMzZUj7w6guVM6yg4vkWbRtG6qFlb+Na9hJvV/6eIbsNlfgtLkNFeGZ6AY/MKVXraoTz+sLFKAJ0ESLEcTiWiW6bPVnlbCr1m2Qptvm5M1M4hQbXkHWUCOkBRXR4f1GO5bvJmpiu5AUBBUFNAPw2gix9z+0B9cqMAOTph7D/7A1Mrrh0ZrP13u; 4:MOcN4myDlHT57xhtuM0xiHY3KTPyzepUJ7ZjzCWqc1S1WZ+ycY93FYaaRka45YBBIFKrZ6d+B8dZ/HtWg2xM5TSEuvkvTT58TBzAVKrhmQWBQ4Un5PTMqTuVlH9fy2cPu5glyRzZFTPA0+QT9TW0KAKZPKdmp2ify/gkWrwO3xx9RkLZmAeYUCLCKJbcY/SIG5ucir1oAlU8XvB+qEBFq6L/tNKb237NAdCEjsQDQ/Mriz23d24o/LXCnHPgMfWZlrlX8wvYuSV6UzGJXMPr1vcB+XDXa7twEP74Kvbu1C+7syyxLz/QX1GQgz7tVLDnxTZscFWEVLA4U03ECrkFflGZTVVK3a8Y5QB2mDhwimw6QH9T34UOsps9DSXiZiLCgd0BK47QqI+6Uh12puxz5+ZXu6Vt+z+tcKH84faRseU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(185117386973197)(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699016); SRVR:AM0PR0402MB3907; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0402MB3907; X-Forefront-PRVS: 077884B8B5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(366004)(396003)(199004)(189003)(106356001)(50466002)(105586002)(68736007)(50226002)(8936002)(48376002)(52116002)(16526019)(186003)(51416003)(76176011)(6506007)(386003)(47776003)(66066001)(39060400002)(305945005)(26005)(4326008)(25786009)(36756003)(486006)(446003)(2616005)(956004)(476003)(5660300001)(11346002)(6116002)(3846002)(97736004)(6486002)(6666003)(8676002)(81156014)(81166006)(966005)(2906002)(86362001)(7736002)(478600001)(6512007)(6306002)(16586007)(316002)(53936002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0402MB3907; H:anson-OptiPlex-790.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: =?us-ascii?Q?1; AM0PR0402MB3907; 23:YfALGUp4DAn/VRpljG0d6o2UTa4AXCLAoT7x+OF?= DgGHinjxu5kfyujLTX2pY9s33KZ44svu30bloke98wF5DcFJrGq3Tft1nBNABSaky3+Fv10M3698kVPJSHmhBiexU/USzb1UEClTkUCz2vA2t66CvyGKqOVrEsER5Sspq8xPEgCEU6G/8DzDB7Oc7a9mT+fMXqK28aLFMRoQqvYn3QoF9RRMRhETRzpz1aqdL2i5k8EhRmpAyssrqnknaS8lNXHgTG/CNJkrXNqYtm63Rszrix9eHFBOLIhwR27Oa1T3mFHbmNXc7pCmKVUyEZ3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gEXeI6ODRXpYJyQ9Z5I0yT9sV9LzRi5aFY0oEFOYXWYQMRIBKGpxbtq4wE2bdonKa2EHOuvBKcNHJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2018 08:41:08.6255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19a12b11-fe87-4a64-8885-08d60cc201f6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180828_014124_410945_A3E7B767 X-CRM114-Status: GOOD ( 14.93 ) 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: Linux-imx@nxp.com 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 i.MX8MQ and i.MX8MM share same gpc module with i.MX7D, they can reuse gpcv2 pgc driver for power domain control, this patch renames all functions and structure definitions started with "imx7" to "imx", and use .data in imx_gpcv2_dt_ids[] to pass platform specific power domain data for power domain driver, thus make gpcv2 pgc driver more generic for i.MX platforms. Signed-off-by: Anson Huang Acked-by: Andrey Smirnov --- changes since V1: use .data in imx_gpcv2_dt_ids[] instead of calling of_machine_is_compatible() for different platforms support. drivers/soc/imx/gpcv2.c | 72 +++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 0e31465..938103a 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -14,6 +14,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include #include #include #include @@ -53,7 +54,7 @@ #define GPC_PGC_CTRL_PCR BIT(0) -struct imx7_pgc_domain { +struct imx_pgc_domain { struct generic_pm_domain genpd; struct regmap *regmap; struct regulator *regulator; @@ -69,11 +70,16 @@ struct imx7_pgc_domain { struct device *dev; }; -static int imx7_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, +struct imx_pgc_domain_data { + const struct imx_pgc_domain *domains; + size_t domains_num; +}; + +static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, bool on) { - struct imx7_pgc_domain *domain = container_of(genpd, - struct imx7_pgc_domain, + struct imx_pgc_domain *domain = container_of(genpd, + struct imx_pgc_domain, genpd); unsigned int offset = on ? GPC_PU_PGC_SW_PUP_REQ : GPC_PU_PGC_SW_PDN_REQ; @@ -150,17 +156,17 @@ static int imx7_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, return ret; } -static int imx7_gpc_pu_pgc_sw_pup_req(struct generic_pm_domain *genpd) +static int imx_gpc_pu_pgc_sw_pup_req(struct generic_pm_domain *genpd) { - return imx7_gpc_pu_pgc_sw_pxx_req(genpd, true); + return imx_gpc_pu_pgc_sw_pxx_req(genpd, true); } -static int imx7_gpc_pu_pgc_sw_pdn_req(struct generic_pm_domain *genpd) +static int imx_gpc_pu_pgc_sw_pdn_req(struct generic_pm_domain *genpd) { - return imx7_gpc_pu_pgc_sw_pxx_req(genpd, false); + return imx_gpc_pu_pgc_sw_pxx_req(genpd, false); } -static const struct imx7_pgc_domain imx7_pgc_domains[] = { +static const struct imx_pgc_domain imx7_pgc_domains[] = { [IMX7_POWER_DOMAIN_MIPI_PHY] = { .genpd = { .name = "mipi-phy", @@ -198,9 +204,14 @@ static const struct imx7_pgc_domain imx7_pgc_domains[] = { }, }; -static int imx7_pgc_domain_probe(struct platform_device *pdev) +static const struct imx_pgc_domain_data imx7_pgc_domain_data = { + .domains = imx7_pgc_domains, + .domains_num = ARRAY_SIZE(imx7_pgc_domains), +}; + +static int imx_pgc_domain_probe(struct platform_device *pdev) { - struct imx7_pgc_domain *domain = pdev->dev.platform_data; + struct imx_pgc_domain *domain = pdev->dev.platform_data; int ret; domain->dev = &pdev->dev; @@ -233,9 +244,9 @@ static int imx7_pgc_domain_probe(struct platform_device *pdev) return ret; } -static int imx7_pgc_domain_remove(struct platform_device *pdev) +static int imx_pgc_domain_remove(struct platform_device *pdev) { - struct imx7_pgc_domain *domain = pdev->dev.platform_data; + struct imx_pgc_domain *domain = pdev->dev.platform_data; of_genpd_del_provider(domain->dev->of_node); pm_genpd_remove(&domain->genpd); @@ -243,23 +254,24 @@ static int imx7_pgc_domain_remove(struct platform_device *pdev) return 0; } -static const struct platform_device_id imx7_pgc_domain_id[] = { - { "imx7-pgc-domain", }, +static const struct platform_device_id imx_pgc_domain_id[] = { + { "imx-pgc-domain", }, { }, }; -static struct platform_driver imx7_pgc_domain_driver = { +static struct platform_driver imx_pgc_domain_driver = { .driver = { - .name = "imx7-pgc", + .name = "imx-pgc", }, - .probe = imx7_pgc_domain_probe, - .remove = imx7_pgc_domain_remove, - .id_table = imx7_pgc_domain_id, + .probe = imx_pgc_domain_probe, + .remove = imx_pgc_domain_remove, + .id_table = imx_pgc_domain_id, }; -builtin_platform_driver(imx7_pgc_domain_driver) +builtin_platform_driver(imx_pgc_domain_driver) static int imx_gpcv2_probe(struct platform_device *pdev) { + static const struct imx_pgc_domain_data *domain_data; static const struct regmap_range yes_ranges[] = { regmap_reg_range(GPC_LPCR_A_CORE_BSC, GPC_M4_PU_PDN_FLG), @@ -307,9 +319,11 @@ static int imx_gpcv2_probe(struct platform_device *pdev) return ret; } + domain_data = of_device_get_match_data(&pdev->dev); + for_each_child_of_node(pgc_np, np) { struct platform_device *pd_pdev; - struct imx7_pgc_domain *domain; + struct imx_pgc_domain *domain; u32 domain_index; ret = of_property_read_u32(np, "reg", &domain_index); @@ -319,14 +333,14 @@ static int imx_gpcv2_probe(struct platform_device *pdev) return ret; } - if (domain_index >= ARRAY_SIZE(imx7_pgc_domains)) { + if (domain_index >= domain_data->domains_num) { dev_warn(dev, "Domain index %d is out of bounds\n", domain_index); continue; } - pd_pdev = platform_device_alloc("imx7-pgc-domain", + pd_pdev = platform_device_alloc("imx-pgc-domain", domain_index); if (!pd_pdev) { dev_err(dev, "Failed to allocate platform device\n"); @@ -335,8 +349,8 @@ static int imx_gpcv2_probe(struct platform_device *pdev) } ret = platform_device_add_data(pd_pdev, - &imx7_pgc_domains[domain_index], - sizeof(imx7_pgc_domains[domain_index])); + &domain_data->domains[domain_index], + sizeof(domain_data->domains[domain_index])); if (ret) { platform_device_put(pd_pdev); of_node_put(np); @@ -345,8 +359,8 @@ static int imx_gpcv2_probe(struct platform_device *pdev) domain = pd_pdev->dev.platform_data; domain->regmap = regmap; - domain->genpd.power_on = imx7_gpc_pu_pgc_sw_pup_req; - domain->genpd.power_off = imx7_gpc_pu_pgc_sw_pdn_req; + domain->genpd.power_on = imx_gpc_pu_pgc_sw_pup_req; + domain->genpd.power_off = imx_gpc_pu_pgc_sw_pdn_req; pd_pdev->dev.parent = dev; pd_pdev->dev.of_node = np; @@ -363,7 +377,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev) } static const struct of_device_id imx_gpcv2_dt_ids[] = { - { .compatible = "fsl,imx7d-gpc" }, + { .compatible = "fsl,imx7d-gpc", .data = &imx7_pgc_domain_data, }, { } };