Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4027587yba; Sun, 12 May 2019 03:25:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwre/uTUtsKLyrLH7ovIDHT4F+421oeF5l+gKaDUK5Wiz0ql3o46WG4xFH+KT5sKSTdTHEi X-Received: by 2002:a63:317:: with SMTP id 23mr25105578pgd.414.1557656724283; Sun, 12 May 2019 03:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557656724; cv=none; d=google.com; s=arc-20160816; b=lmYX24Jbxwb/JyDI9qRCfRz5KAq+P7G+A3mg5y2TJYj4sbGtrUVKB+liJpe5B7yL82 8SSx2b4cYq5DKMCqdtwX6Ap1rLMYK2aiwjO2PhZNV9zNQnBVdx+e2UoQSAB+fBostjSp U4y3KeYYRLeUvg1Z+xo8Lk5Du3kltBz5zwpnTkHh1lGYn/dTRBZYv38fbS/HXumr2F+S LyiwqTFBesvH1LnhmflU3vaqK0N35meGlryKw93KuyFnYCVJVXf6YyA9M/xgFCR/WUEn rUeS1BXYyqJdX5PoPzf6pmOS/CJclgjihy/R94FfYp8M+6vPZw5VMY4ZUpfjv1r1Guaw nT2g== 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=JsHyy5VJgiWsLf0tWEzdrvTf3kLNw/sCXTHWc+VAdJQ=; b=stuAgXIrQZbbxeh/IC8z9EuBwZ02qaKPbxHlGibkd3yWqHyeqNzhlq7h5gWAYt/FR5 pUAi1Q2hci++LU+ovBu2o5z43FybFqHKIHdCuNwt6DYWaaQr5gCZhzufanJZwYiilNWR iSOEhVnrwW5TjkfTD4VUQH9dg4eGwME4cIxWwKdBU/xfyAExLL35oXPh4h8xOxWaoMKR 5ckNL+bzTdEgN0z91sPlDpDsHE3tsx0qYRlWfr2+93mPKa3sMHuUX3+COBKAJTc5MHdj ybLPwr59v/VY661o9HNn0vkjGl6wMMT5ydrHmjIIZXArziLT9XYd0KOJsqJ2vm4ZXqz8 hl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="L9/q0iKw"; 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 d40si13562789pla.87.2019.05.12.03.25.07; Sun, 12 May 2019 03:25:24 -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="L9/q0iKw"; 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 S1726556AbfELKYT (ORCPT + 99 others); Sun, 12 May 2019 06:24:19 -0400 Received: from mail-eopbgr80084.outbound.protection.outlook.com ([40.107.8.84]:11907 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726274AbfELKYS (ORCPT ); Sun, 12 May 2019 06:24: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=JsHyy5VJgiWsLf0tWEzdrvTf3kLNw/sCXTHWc+VAdJQ=; b=L9/q0iKw6TSt9pIcYkhjdj2Xyr2by3Ap3h4vI9td82vKWlaQoXns3O+mLQdTWi5Or7i1XS6bf/pYUfGABqQ2N6Vdm48HmMJO7U8XNTCTHmankdq4hyB6rtHvvNr9+hp8K9ZbeEfxv75TcvTJ4DGi2gKU9P/7GClHDaQmD33Qe8w= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3675.eurprd04.prod.outlook.com (52.134.69.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Sun, 12 May 2019 10:24:12 +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.1878.022; Sun, 12 May 2019 10:24:12 +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" , Jacky Bai , Leonard Crestez , "hofrat@osadl.org" , "michael@amarulasolutions.com" , "stefan@agner.ch" , Abel Vesa , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" CC: dl-linux-imx Subject: [PATCH RESEND 1/2] clk: imx: Add common API for masking MMDC handshake Thread-Topic: [PATCH RESEND 1/2] clk: imx: Add common API for masking MMDC handshake Thread-Index: AQHVCKzXj5CeLLFh1kCpP4B8xSmy8A== Date: Sun, 12 May 2019 10:24:12 +0000 Message-ID: <1557656348-13040-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: HK0P153CA0036.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::24) 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: 97fdc2b7-a1a7-4a0d-6bf5-08d6d6c3fa17 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:DB3PR0402MB3675; x-ms-traffictypediagnostic: DB3PR0402MB3675: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(376002)(39860400002)(396003)(346002)(366004)(199004)(189003)(14444005)(3846002)(6116002)(256004)(7416002)(2201001)(26005)(2906002)(66476007)(66556008)(64756008)(66446008)(5660300002)(8936002)(102836004)(73956011)(66946007)(6512007)(6506007)(71200400001)(386003)(99286004)(71190400001)(476003)(86362001)(2616005)(486006)(186003)(52116002)(110136005)(25786009)(14454004)(4326008)(305945005)(478600001)(2501003)(6436002)(7736002)(6486002)(53936002)(36756003)(68736007)(316002)(50226002)(66066001)(81166006)(81156014)(8676002)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3675;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: nHeNxPNSywblom9gjuTzn6EGrSM2HhQMYOlLl8OUyA/Jdv6GtBRjYuta3N/t5W/YV1vel0gmnGHC5tyvduaeaGntotk3rfcGfFmGASMm6HZVRS3/l7pDCOWoOwDV6OFIhb5wBucBjCahuEEbofk9grReKd6/jfHVpSQdayDbD0GvzP6UT6Ndz6f1o7yz1d+ILjJ0MyeDIX8pqOqmbJro9MYhjT8ByEbAiryEME+Sus5iZ4fM8K8Q4gXYAM7IXcHLb0v3WH1lDjnyygea8vQCROvvih3QsIcevKGbBpqYsHYPR/jZgYcf7yatH/Qjdthz/O3fT1G08QDnPUpcCdKawYOWU89mL5Mq7Rpk46Y4qDJAmAUK0sZYBZsFcutyh2UBHY3LbvB4FISpktVmg/HHJwEIOYv45evhu+n+sV4Wjq4= Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97fdc2b7-a1a7-4a0d-6bf5-08d6d6c3fa17 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2019 10:24:12.8153 (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: DB3PR0402MB3675 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 --- No change, just resend patch with correct encoding. --- drivers/clk/imx/clk.c | 14 ++++++++++++++ drivers/clk/imx/clk.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 1efed86..6f9bcee 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -6,8 +6,22 @@ #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