Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751857AbdFITQj (ORCPT ); Fri, 9 Jun 2017 15:16:39 -0400 Received: from mail-db5eur01on0064.outbound.protection.outlook.com ([104.47.2.64]:34816 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751561AbdFITQh (ORCPT ); Fri, 9 Jun 2017 15:16:37 -0400 From: Han Xu To: Stefan Agner , "shawnguo@kernel.org" , "kernel@pengutronix.de" , "sboyd@codeaurora.org" CC: "A.S. Dong" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "boris.brezillon@free-electrons.com" , "marek.vasut@gmail.com" , "richard@nod.at" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "fabio.estevam@freescale.com" , "LW@KARO-electronics.de" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v6 1/3] clk: imx7d: create clocks behind rawnand clock gate Thread-Topic: [PATCH v6 1/3] clk: imx7d: create clocks behind rawnand clock gate Thread-Index: AQHS4Kd5P2WzXN5I40KXKZmQoW/jH6Ic53IA Date: Fri, 9 Jun 2017 19:16:33 +0000 Message-ID: References: <8b9edf13938e3166081e72ba8fa4ac822035079c.1496961128.git-series.stefan@agner.ch> In-Reply-To: <8b9edf13938e3166081e72ba8fa4ac822035079c.1496961128.git-series.stefan@agner.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: agner.ch; dkim=none (message not signed) header.d=none;agner.ch; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.88.168.49] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DBXPR04MB320;7:15mXdMGSZGiUvn9AD8ewHmkzj0LqFUkpVEVoiqSvJ2zm8/ZSXZ8JK+M3sVQXS2kvWH05Jl2KsEoIbDuF/94fY1iQ36Z/9wOd6kLCQju/gv+IltcCoffykwp8Ukn+8Js3C+VxK2deqBiSo4/r7ETlNQmSwXR8ZHKCLYoTISqtf3oXnfIqMq1tJPmrGTZC7eB/5H69AHBalLv3WfsSOdO2Us+xq77ww4avIIH2ma3LeQumOX8ODbrqxOagZNE4jDRhgevqyMT/QZSlmaY309FYXNaMPdTtw5HuUevlgUNvYSrAvs67bhm9eXBMB+bHpJHjGkpkN/y0a+0O74hiIb37fA== x-ms-traffictypediagnostic: DBXPR04MB320: x-ms-office365-filtering-correlation-id: 423097b4-81ba-4858-f72e-08d4af6c0a75 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:DBXPR04MB320; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DBXPR04MB320;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DBXPR04MB320; x-forefront-prvs: 03333C607F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39850400002)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(24454002)(377454003)(6506006)(81166006)(3280700002)(8936002)(6436002)(54906002)(6512007)(478600001)(2900100001)(14454004)(8676002)(99286003)(53936002)(5660300001)(38730400002)(6246003)(4326008)(6486002)(25786009)(3660700001)(102836003)(3846002)(39060400002)(2906002)(6116002)(53546009)(2201001)(2501003)(5250100002)(7736002)(229853002)(189998001)(86362001)(305945005)(2950100002)(7416002)(36756003)(50986999)(76176999)(54356999)(66066001)(31696002)(31686004)(33646002);DIR:OUT;SFP:1101;SCL:1;SRVR:DBXPR04MB320;H:DBXPR04MB080.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: <11D7CEBF8D29024DB390E98845020F00@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2017 19:16:33.0418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR04MB320 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v59JGgom007700 Content-Length: 3779 Lines: 63 On 06/08/2017 05:34 PM, Stefan Agner wrote: > The rawnand clock gate gates two clocks, NAND_USDHC_BUS_CLK_ROOT > and NAND_CLK_ROOT. However, the gate has been in the chain of the > latter only. This does not allow to use the NAND_USDHC_BUS_CLK_ROOT > only, e.g. as required by APBH-Bridge-DMA. > > Add new clocks which represent the clock after the gate, and use a > shared clock gate to correctly model the hardware. > > Signed-off-by: Stefan Agner > Tested-by: Fabio Estevam Acked-by: Han Xu > --- > drivers/clk/imx/clk-imx7d.c | 6 ++++-- > include/dt-bindings/clock/imx7d-clock.h | 4 +++- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c > index 93b0364..e364060 100644 > --- a/drivers/clk/imx/clk-imx7d.c > +++ b/drivers/clk/imx/clk-imx7d.c > @@ -25,6 +25,7 @@ > static u32 share_count_sai1; > static u32 share_count_sai2; > static u32 share_count_sai3; > +static u32 share_count_nand; > > static struct clk_div_table test_div_table[] = { > { .val = 3, .div = 1, }, > @@ -748,7 +749,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) > clks[IMX7D_ENET2_TIME_ROOT_DIV] = imx_clk_divider2("enet2_time_post_div", "enet2_time_pre_div", base + 0xa880, 0, 6); > clks[IMX7D_ENET_PHY_REF_ROOT_DIV] = imx_clk_divider2("enet_phy_ref_post_div", "enet_phy_ref_pre_div", base + 0xa900, 0, 6); > clks[IMX7D_EIM_ROOT_DIV] = imx_clk_divider2("eim_post_div", "eim_pre_div", base + 0xa980, 0, 6); > - clks[IMX7D_NAND_ROOT_DIV] = imx_clk_divider2("nand_post_div", "nand_pre_div", base + 0xaa00, 0, 6); > + clks[IMX7D_NAND_ROOT_CLK] = imx_clk_divider2("nand_root_clk", "nand_pre_div", base + 0xaa00, 0, 6); > clks[IMX7D_QSPI_ROOT_DIV] = imx_clk_divider2("qspi_post_div", "qspi_pre_div", base + 0xaa80, 0, 6); > clks[IMX7D_USDHC1_ROOT_DIV] = imx_clk_divider2("usdhc1_post_div", "usdhc1_pre_div", base + 0xab00, 0, 6); > clks[IMX7D_USDHC2_ROOT_DIV] = imx_clk_divider2("usdhc2_post_div", "usdhc2_pre_div", base + 0xab80, 0, 6); > @@ -825,7 +826,8 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) > clks[IMX7D_ENET2_TIME_ROOT_CLK] = imx_clk_gate4("enet2_time_root_clk", "enet2_time_post_div", base + 0x4510, 0); > clks[IMX7D_ENET_PHY_REF_ROOT_CLK] = imx_clk_gate4("enet_phy_ref_root_clk", "enet_phy_ref_post_div", base + 0x4520, 0); > clks[IMX7D_EIM_ROOT_CLK] = imx_clk_gate4("eim_root_clk", "eim_post_div", base + 0x4160, 0); > - clks[IMX7D_NAND_ROOT_CLK] = imx_clk_gate4("nand_root_clk", "nand_post_div", base + 0x4140, 0); > + clks[IMX7D_NAND_RAWNAND_CLK] = imx_clk_gate2_shared2("nand_rawnand_clk", "nand_root_clk", base + 0x4140, 0, &share_count_nand); > + clks[IMX7D_NAND_USDHC_BUS_RAWNAND_CLK] = imx_clk_gate2_shared2("nand_usdhc_rawnand_clk", "nand_usdhc_root_clk", base + 0x4140, 0, &share_count_nand); > clks[IMX7D_QSPI_ROOT_CLK] = imx_clk_gate4("qspi_root_clk", "qspi_post_div", base + 0x4150, 0); > clks[IMX7D_USDHC1_ROOT_CLK] = imx_clk_gate4("usdhc1_root_clk", "usdhc1_post_div", base + 0x46c0, 0); > clks[IMX7D_USDHC2_ROOT_CLK] = imx_clk_gate4("usdhc2_root_clk", "usdhc2_post_div", base + 0x46d0, 0); > diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h > index a7a1a50..de62a83 100644 > --- a/include/dt-bindings/clock/imx7d-clock.h > +++ b/include/dt-bindings/clock/imx7d-clock.h > @@ -450,5 +450,7 @@ > #define IMX7D_CLK_ARM 437 > #define IMX7D_CKIL 438 > #define IMX7D_OCOTP_CLK 439 > -#define IMX7D_CLK_END 440 > +#define IMX7D_NAND_RAWNAND_CLK 440 > +#define IMX7D_NAND_USDHC_BUS_RAWNAND_CLK 441 > +#define IMX7D_CLK_END 442 > #endif /* __DT_BINDINGS_CLOCK_IMX7D_H */