Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp515852yba; Wed, 15 May 2019 05:29:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCtLhV3nFYhvCDkRDs/uIINIJ+0XHLcwKBlr0Ix1hA7/+B8LiJI91b2ci3+N7vAihTU/n0 X-Received: by 2002:aa7:9f01:: with SMTP id g1mr34348921pfr.259.1557923387215; Wed, 15 May 2019 05:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557923387; cv=none; d=google.com; s=arc-20160816; b=L8byEJlVLQyrUgdvrCX25TyEbpLGb7zVRXbZJ2ic3Qrs6etF+33Ozq7JsfCUCUFwCj tpB3HTYj1gchB3huCPXKwnIdk2VpesSEpE54QEE5YuTEFL7XIKyBgaWujATHtw4bPZ0u p2Fawi/6z+bT8OoKWmkKHijPKNVfhkOf40fw0hwO35Kue2/LXgKRTbi/1Gq+ouMZ5Thh AcKxOM3JDCBNqPXDY62671xeWusCae0P/418wdoXhavx++5tP1BKM2wezPKZdEfxqWuz dYCxy4wQCcIoOYVTsyirDBWzlFo9J0ser32iD/R/sFV6ipHzBwfIdCKPRjTaIEyZsAEK gmsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=jZ10VM0E0QGH+rFqn+KCRa0x5MdVNWbZ2uV9Wh376JI=; b=LDzMdkqcoehsn9s8/tqoXZKhYmoXcdHoWmXMyBCAL59YFupGoFhbIj0mR+49/4K5+1 qfi64T6KNMjsgZuLZ8to2dk1cDkTQVSOK4XAnWEoyAP2Z27ABNL1iNIs6LhVXTrC7oeY tzCdPxmRv+i3u1r8jI63L9b6iEzvjTEkgqDwUC611F1dMf/dMyNqhLrRU8/HoHM29HZZ NBfozK0xCzCLtEJi79Xflz4pqe8vIRafCCE6/08KrsWAbAe8Uwf333V2h+KONyva1TW9 EXh/SfninvGliVg8RO4hG4ZiagwZi6wXaMWzHwXNX+mBs/TNHrMfqMwcGw4kMFraKIIo iElw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AqPqrT5H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si1613282pgg.96.2019.05.15.05.29.32; Wed, 15 May 2019 05:29:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AqPqrT5H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726758AbfEOM2S (ORCPT + 99 others); Wed, 15 May 2019 08:28:18 -0400 Received: from mail-eopbgr150077.outbound.protection.outlook.com ([40.107.15.77]:45343 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726441AbfEOM2S (ORCPT ); Wed, 15 May 2019 08:28:18 -0400 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=jZ10VM0E0QGH+rFqn+KCRa0x5MdVNWbZ2uV9Wh376JI=; b=AqPqrT5HrrjsZ/E1b/BtEOa7Q9Oe7xML1e0jZ8xILy1nFWb5sPxqBkcZPiYjMY45w1CQ1o9C2xdVM0/Z71+Z6B2swAlmMt2fh/w4tnghDiWy+ngfVmTUINr9WhMVlUbzN2XIYMeAxKibO8f93j9oqV5X0or0EJH56xkRCnyt4/4= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3946.eurprd04.prod.outlook.com (52.134.72.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Wed, 15 May 2019 12:28:13 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d%2]) with mapi id 15.20.1900.010; Wed, 15 May 2019 12:28:13 +0000 From: Anson Huang To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "l.stach@pengutronix.de" , Aisheng Dong , "tiny.windzz@gmail.com" , "pp@emlix.com" , "colin.didier@devialet.com" , "robh@kernel.org" , "hofrat@osadl.org" , Jacky Bai , Leonard Crestez , "stefan@agner.ch" , "michael@amarulasolutions.com" , Abel Vesa , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" CC: dl-linux-imx Subject: [PATCH V2 1/2] clk: imx: Add common API for masking MMDC handshake Thread-Topic: [PATCH V2 1/2] clk: imx: Add common API for masking MMDC handshake Thread-Index: AQHVCxmq80TspEKNo0uWdJG5ctX+bA== Date: Wed, 15 May 2019 12:28:13 +0000 Message-ID: <1557922984-20811-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0P153CA0031.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::19) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dcad10e4-0a7e-423a-ebf7-08d6d930cc51 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:DB3PR0402MB3946; x-ms-traffictypediagnostic: DB3PR0402MB3946: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2089; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(346002)(376002)(136003)(396003)(366004)(199004)(189003)(5660300002)(68736007)(99286004)(8676002)(36756003)(2501003)(50226002)(66066001)(256004)(14444005)(110136005)(14454004)(478600001)(81166006)(81156014)(8936002)(52116002)(66556008)(3846002)(73956011)(6116002)(6486002)(64756008)(66446008)(7416002)(2906002)(2201001)(66946007)(6506007)(102836004)(6436002)(7736002)(305945005)(6512007)(386003)(316002)(26005)(86362001)(486006)(71200400001)(71190400001)(4326008)(25786009)(476003)(2616005)(186003)(66476007)(53936002)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3946;H:DB3PR0402MB3916.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: k0N4P84mGLD6Scdfuxo96GiZVd3ggiZeJeFvP9RZdmVKGed4/dCQMOXra7w6kWDYPVXLg9fCrtlJIb1WjD6rI1fI8vrrKbWMdL15Ne9FQ6vSkIRdeo257OsCEYupqGde61CC7ap40/MlG1Ls6Ao3zREs8apw2DVZzQTiZ9+c0ggv+cdNZg4nAaO5REv4Z3lcIRzydGXvvA9zkhGN6spZwlJVQp+S603Rvz9Q7EtyIxkmN8wBqDtikepgQhumpmTegRUG2REphdW7aZ1FRsfSdB6AQNI6aneIj7V/fjZVQJcCgFT40NkeiJwsJlw4zi+tX7ljzEB0jPzcJ6wfjI1F5eBO223tNgHx1i7FxdcCa6VctRBkEel2waJl4eOy/NlkBokMsJj5fzs2q1MYsHeQxHkGiKe4viT4Vypl/olWWVA= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <02B300F23F96AE42A8237D96181AD782@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcad10e4-0a7e-423a-ebf7-08d6d930cc51 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 12:28:13.3645 (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: DB3PR0402MB3946 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All i.MX6 SoCs need to mask unused MMDC channel's handshake for low power modes, this patch provides common API for masking the MMDC channel passed from caller. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng --- Changes since V1: - add necessary "io.h" head file to avoid build error based on latest linu= x-next. --- drivers/clk/imx/clk.c | 15 +++++++++++++++ drivers/clk/imx/clk.h | 1 + 2 files changed, 16 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 1efed86..9cd7097 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -1,13 +1,28 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include #include "clk.h" =20 +#define CCM_CCDR 0x4 +#define CCDR_MMDC_CH0_MASK BIT(17) +#define CCDR_MMDC_CH1_MASK BIT(16) + DEFINE_SPINLOCK(imx_ccm_lock); =20 +void __init imx_mmdc_mask_handshake(void __iomem *ccm_base, + unsigned int chn) +{ + unsigned int reg; + + reg =3D readl_relaxed(ccm_base + CCM_CCDR); + reg |=3D chn =3D=3D 0 ? CCDR_MMDC_CH0_MASK : CCDR_MMDC_CH1_MASK; + writel_relaxed(reg, ccm_base + CCM_CCDR); +} + void __init imx_check_clocks(struct clk *clks[], unsigned int count) { unsigned i; diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 8639a8f..6dcdc91 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -10,6 +10,7 @@ extern spinlock_t imx_ccm_lock; void imx_check_clocks(struct clk *clks[], unsigned int count); void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count); void imx_register_uart_clocks(struct clk ** const clks[]); +void imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn); =20 extern void imx_cscmr1_fixup(u32 *val); =20 --=20 2.7.4