From patchwork Mon Mar 15 12:16:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 402417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23CC8C433E6 for ; Mon, 15 Mar 2021 12:17:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA86864EE3 for ; Mon, 15 Mar 2021 12:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbhCOMRL (ORCPT ); Mon, 15 Mar 2021 08:17:11 -0400 Received: from mail-eopbgr130048.outbound.protection.outlook.com ([40.107.13.48]:2245 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229734AbhCOMQo (ORCPT ); Mon, 15 Mar 2021 08:16:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WaoUb8Vzo7Mf3kSJGmwk44gHX8woAMZ85DN/ffvZMx18ZUKKdmjK2YgUcwE+4BDFXJdMrnsIOo+r+DuhJAJdujFGGZiLfkLRQnlYtqYbRnjuXZLYvLbfFhDXJJ8ndAwwd9HJkcazuGDh5Ya/y+nfxtIOaPZeo+LVRG9oOEst/pLZ8FIXiL9ME0yO2bH8OG6x7urtg7XEHAKAGLRi8KqUottoAoNt3bldiZ4JEc+STWTp5D54Izd2L4DjY2p0s5A4wwgegM1dXsvkgFIYnORXSonJKQecsiVPcBV8yNXiDOlaNOtSvOkHg+shuhvn+Jv54skb7ilEjmbKArv5ltnmfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7t8mYXiuwJc5jYSNU6glW6vSUoEroNnuHeB+oIbyJUY=; b=I60XrEhiKPQY5xszIxHZlFR2bQhCRbBkn3VHLaKzmDNLKRj4b2deY5xL9V+rgb8u4hWfA1QWkzxUPx0uuvhNpA64xvGwEZIwyMGpwB3oWBREvn/Gi0J6TVL1TCrGN49nUS+0pXGqNwLKzGcKwJSPjVrwu2pFsHMKtfMWqUlF2L+t5/Of+D/4NbSWjY9UYKw1VC2Y4zLzudakepki4UByncNXSpUqf8jAM+x9pZmZLrvDCdku2UI+ZH1uDceZ/4S0k3sLJItC0jyjrM7gGShNI0dNYsFI1pAz2LbVtNS6nl47E6ZXNoTg5Zu7nrj3rs1YNcRyzIDyLz1xEUDMGIE7Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none 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=7t8mYXiuwJc5jYSNU6glW6vSUoEroNnuHeB+oIbyJUY=; b=h5REsJ4atDoXYLLq10QHH3Ox/FygDpLgz+qlUT3jKlzuh3LV8qJQtxdrk1Ol9SCl7SzH5GNTYbp7KwRbmJyMaJRArqjtu1dkiPTE3fg71D5E2pASnvIOmR6U1E9YLz4BtcD9QZnQPID2wbZnjLzgruUZXn4Y/4qZowWK5iKkbRg= Authentication-Results: st.com; dkim=none (message not signed) header.d=none;st.com; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB6PR04MB3206.eurprd04.prod.outlook.com (2603:10a6:6:d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Mon, 15 Mar 2021 12:16:39 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::7d13:2d65:d6f7:b978]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::7d13:2d65:d6f7:b978%4]) with mapi id 15.20.3933.032; Mon, 15 Mar 2021 12:16:39 +0000 From: Joakim Zhang To: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, f.fainelli@gmail.com, andrew@lunn.ch Cc: netdev@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V3 repost net-next 0/3] net: stmmac: implement clocks management Date: Mon, 15 Mar 2021 20:16:45 +0800 Message-Id: <20210315121648.10408-1-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK0PR01CA0058.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::22) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by HK0PR01CA0058.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Mon, 15 Mar 2021 12:16:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea525ef2-cc8d-4e5d-6265-08d8e7ac2f3c X-MS-TrafficTypeDiagnostic: DB6PR04MB3206: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zMp0qUpQZ0tyumkBdacowJb2WNmWjliCZMsXhZDihL4FTZ2uTrXuQoZ675QccrIXT0YzJHk2NeOajSdHc21bDwbAydRt4oeuVu8zTcOb5riiIpOG3+s63WFwgEGu8DrNpZnG9qhvXqVCb1q9/PUw1OwrUWX2wulcaiwO7NvovIHGXVK29bMsT1GMtkTHgeKWrI8au0O08Arc7zohEXnxU2xoYULISi1Zp7hwciyk+VJlk7U/LpR5mjLp+hOeWQga/KFMRw1p8zyM0OcN0HKcaQ+3gVlj79WGAPoodvkvKzRADFqFBXsxsarcZlEVVeyh3jC0UdYgsQF/uYDJomu/Z9tkKAAB+GmHNFpU/CH2MKxmblF3WQisWZPxSD7974vE59FJSIKEqbkcLxCyD4+c7mdZk3QadDKyzHo54WJoL4zVsXhj+/EN+nLtlxRLpXvi950liS1QtQcGUoncRX8Dsv0rBfBWb559noqPxzGDP16jmaVufcx5Md+EFBmAx2IqnDRVF68zsRcRcGyYnQII89IqkBtW8xIXWPAoYYch6lts2eC/gC9M+tvnUAcg7UCxoBNWYjKqeukOr+aLwcb6hJkYdk8fdnb6jJRJ3wfudZUR7NlymB4NaEw1bVBcIbjO X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(346002)(376002)(396003)(4326008)(316002)(6486002)(2616005)(5660300002)(8936002)(1076003)(186003)(2906002)(16526019)(6506007)(6512007)(8676002)(478600001)(26005)(956004)(52116002)(66476007)(36756003)(86362001)(83380400001)(66946007)(66556008)(6666004)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CfGKi1/ZFP/bvTF0EyFhvBFhuuOMJeBHAHgWpmk2Av0N9RxN40hyw6bCqmMD/dt+fab20Z3Z/PFH58hfKyy4NXDV4eN3XEKXRtzC+VVTFAS3E1o5ksIleFKnIEznd3T8fM1aq54KsK15qgDCTAP4MqwXDSzr1TsjdII8nEItkWod3yk9OlUUDUJ/276PW//i+b53ysPPVm3QEDXsxOEQqkHW7a4s6Tn58Lpj3rj47Ix9HEjWUpUs/btqCU/eMue9dPiT/iDa5eVmH3tyQOpLrPrOJ/syWs0oHLO1eVVC/G/FiDfu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea525ef2-cc8d-4e5d-6265-08d8e7ac2f3c X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2021 12:16:38.9606 (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-CrossTenant-UserPrincipalName: 2AhQNuzcwmOSyG5HH1UyVYytk3RHgv7E1yF5cceWcwUaDCrliWHxsmh4RCNNOcP1dE1admgRuKv3zh0OnFjRVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3206 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch set tries to implement clocks management, and takes i.MX platform as an example. --- ChangeLogs: V1->V2: * change to pm runtime mechanism. * rename function: _enable() -> _config() * take MDIO bus into account, it needs clocks when interface is closed. * reverse Christmass tree. V2->V3: * slightly simple the code according to Andrew's suggesstion and also add tag: Reviewed-by: Andrew Lunn Joakim Zhang (3): net: stmmac: add clocks management for gmac driver net: stmmac: add platform level clocks management net: stmmac: dwmac-imx: add platform level clocks management for i.MX .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 60 ++++++---- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 85 ++++++++++++-- .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 111 ++++++++++++++---- .../ethernet/stmicro/stmmac/stmmac_platform.c | 24 +++- include/linux/stmmac.h | 1 + 6 files changed, 221 insertions(+), 61 deletions(-)