Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp254567lqf; Fri, 26 Apr 2024 06:03:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsQWpHjgE1jAkUZxHm6n1gqMFKlkWXoHOaJpGtwB8gZ6o/prudeXUB31HRWU5rRJbrp9H4IcKOnQJN1J4oMUuW+6ixOrHXd5ck77F20g== X-Google-Smtp-Source: AGHT+IH9IHGXAEzzHYLR4MXeIKJG48OVNlfN5e3RTTOq29pQZwur8/mjCCYcXTLixQT2cDvKM4c9 X-Received: by 2002:a05:6a20:daa7:b0:1a9:5ba1:3b1b with SMTP id iy39-20020a056a20daa700b001a95ba13b1bmr3320617pzb.9.1714136600567; Fri, 26 Apr 2024 06:03:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714136600; cv=pass; d=google.com; s=arc-20160816; b=a5PQMDCDOHP6iW9kAoRVbmevxoP5KrTmyx9u/7J75JOzHyYfL6pnRc3tkYVxx06GK8 VkSAOQXuDffmOK2O5JdCzjMw5SzuDJRk4sWXzgxbWLIp0p6T7woaHgOhq3gP8M3CfCJt 9+Ll7oOEKTIcQC0znzjxb+o6VIQwo47XXCl0QLBAbLG7vEJH/qU6N2TcRa02Qjq1BM5j ao952u39DoRV9Wull1PD2P1h36SxxKZV+g0nBe0tybojBXQJ83eD4d4/jhcYgazda89J bdtFKrVUdBiF4nq2g3Rh5tuFJF3IfEoAvDMGRuxskaT36opbtV9f5Yjfo1uZNxz4sZDd rhNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uuBIq6cHzNUvhFpuSfaSyR7YS5Ocw91Cd4jDm9etaIM=; fh=PNVS6hneBIB5DuUKcqXTZxY2dQy/qm89zdYDxH+oLxc=; b=Fk+6Xz8YJTKd6gzq+dhEKxzGj1IjovwSt02WLr+cYYUR5uThpvi9KjWIUCMEYCZ6r2 RTkWV5TQQu3Tcl1KBEqs7KlNm78plaLLeTtkicUMYHJ7oBPOw+uhgeS6Fb0RxNdJvF4x LyfMxNKnMzmQwj6WsBErHVgEz49CeIzntuCGiXYlJJqKJlFyPZ2B81EkvD6eUe2SQjlX 2Yy7X0W3vd5vwtVeXzudSAuR58HCmMCEUckRiRvWRm5FAVLZepB5/I6m3PjPhr/zDR3g VABWLYsRFPRV3TmIXIX5mNX3I4o/oZQA4KW8Bb6lRb/vhWsehLp46Ekox6Glzl2wkTIi nS0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=5DxkakyA; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-160016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d23-20020a637357000000b005dc49182879si15050487pgn.409.2024.04.26.06.03.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 06:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=5DxkakyA; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-160016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2698FB23842 for ; Fri, 26 Apr 2024 13:02:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE12D147C64; Fri, 26 Apr 2024 13:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="5DxkakyA" Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EC40146A90; Fri, 26 Apr 2024 13:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.132.182.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714136456; cv=none; b=p9SoZuJxy3YveGnQKUp90G8fWCCS6egTLXhL6OrmUTiCUo5IrxTiG/qojeZKjbcXURxwmXBh+C5wJ5ajjF5TD/q6vCz7IMbk+4Wbglr+ES9dfoHfhb9f+aU3inF/Jr2CD4lNNvRXAPZWtiRs6kNUBLjmoE1lgYCnxw1J3hIcgCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714136456; c=relaxed/simple; bh=JJn4j2sPWA2KJhvaonjCd4MXhJ+Qkrb9cH+dDZasf/0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rvOAsL2NV3fWUPvKi0yeNOGEa+W+bUaSK00K6u4higoELvsv+Lux3PPz0zUFD1G7++cPpBtp0sxguWf1Tzb33FtnNJoAYg46TLGCFSdn0JsqaRcUCwBTot0fMOPYz8+A5JyJO4uJJIsIuiafvry52HG7T5Ro7Aay29NT+SoDWv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=5DxkakyA; arc=none smtp.client-ip=185.132.182.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43Q9YPXr012219; Fri, 26 Apr 2024 15:00:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=uuBIq6cHzNUvhFpuSfaSyR7YS5Ocw91Cd4jDm9etaIM=; b=5D xkakyAdNPlcR8YNWS2TYpWw/B0himF5P5h7MQzR0iq6IXyoCR83PqSziABJV8PPV 2mvBpQHAK5nDjpDhimdcMG+LbGMgiN7ZGct3NNmxU23CWKhJHI091Oafv+MnxaAD 8XLYCRYr8eowHyuitgXXbZy2iOB3LxDvj2V/w+tO8AUCPBsc/ZfLXJ4YkY/EAUrd N6LuVlmEURM0pyV4aYBBJhen5ELdORO2vorkjaPNoEcl3MIV/by/5at8VE1GuPxO g3xxpUkWxq5XCo1FvZiZYhbbljTeXSmL5I5Q5AaRuaeA6qSI8KP++6zZReYnW22l V6MtTb9TsBr8YIWBQArw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3xmq9108g9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Apr 2024 15:00:34 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2F75740044; Fri, 26 Apr 2024 15:00:30 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4A666222CB0; Fri, 26 Apr 2024 14:59:17 +0200 (CEST) Received: from localhost (10.252.17.191) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 26 Apr 2024 14:59:16 +0200 From: Christophe Roullier To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Christophe Roullier , Marek Vasut CC: , , , , Subject: [PATCH v2 05/11] net: stmmac: dwmac-stm32: update config management for phy wo cristal Date: Fri, 26 Apr 2024 14:57:01 +0200 Message-ID: <20240426125707.585269-6-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240426125707.585269-1-christophe.roullier@foss.st.com> References: <20240426125707.585269-1-christophe.roullier@foss.st.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-26_12,2024-04-26_02,2023-05-22_02 Some cleaning because some Ethernet PHY configs do not need to add st,ext-phyclk property. Change print info message "No phy clock provided" only when debug. Signed-off-by: Christophe Roullier --- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 7529a8d15492..e648c4e790a7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -55,17 +55,17 @@ *| | | 25MHz | 50MHz | | * --------------------------------------------------------------------------- *| MII | - | eth-ck | n/a | n/a | - *| | | st,ext-phyclk | | | + *| | | | | | * --------------------------------------------------------------------------- *| GMII | - | eth-ck | n/a | n/a | - *| | | st,ext-phyclk | | | + *| | | | | | * --------------------------------------------------------------------------- *| RGMII | - | eth-ck | n/a | eth-ck | - *| | | st,ext-phyclk | | st,eth-clk-sel or| + *| | | | | st,eth-clk-sel or| *| | | | | st,ext-phyclk | * --------------------------------------------------------------------------- *| RMII | - | eth-ck | eth-ck | n/a | - *| | | st,ext-phyclk | st,eth-ref-clk-sel | | + *| | | | st,eth-ref-clk-sel | | *| | | | or st,ext-phyclk | | * --------------------------------------------------------------------------- * @@ -174,23 +174,22 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) dwmac->enable_eth_ck = false; switch (plat_dat->mac_interface) { case PHY_INTERFACE_MODE_MII: - if (clk_rate == ETH_CK_F_25M && dwmac->ext_phyclk) + if (clk_rate == ETH_CK_F_25M) dwmac->enable_eth_ck = true; val = dwmac->ops->pmcsetr.eth1_selmii; pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); break; case PHY_INTERFACE_MODE_GMII: val = SYSCFG_PMCR_ETH_SEL_GMII; - if (clk_rate == ETH_CK_F_25M && - (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk)) { + if (clk_rate == ETH_CK_F_25M) dwmac->enable_eth_ck = true; - val |= dwmac->ops->pmcsetr.eth1_clk_sel; - } pr_debug("SYSCFG init : PHY_INTERFACE_MODE_GMII\n"); break; case PHY_INTERFACE_MODE_RMII: val = dwmac->ops->pmcsetr.eth1_sel_rmii | dwmac->ops->pmcsetr.eth2_sel_rmii; - if ((clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_50M) && + if (clk_rate == ETH_CK_F_25M) + dwmac->enable_eth_ck = true; + if (clk_rate == ETH_CK_F_50M && (dwmac->eth_ref_clk_sel_reg || dwmac->ext_phyclk)) { dwmac->enable_eth_ck = true; val |= dwmac->ops->pmcsetr.eth1_ref_clk_sel; @@ -203,7 +202,9 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) case PHY_INTERFACE_MODE_RGMII_RXID: case PHY_INTERFACE_MODE_RGMII_TXID: val = dwmac->ops->pmcsetr.eth1_sel_rgmii | dwmac->ops->pmcsetr.eth2_sel_rgmii; - if ((clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_125M) && + if (clk_rate == ETH_CK_F_25M) + dwmac->enable_eth_ck = true; + if (clk_rate == ETH_CK_F_125M && (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk)) { dwmac->enable_eth_ck = true; val |= dwmac->ops->pmcsetr.eth1_clk_sel; @@ -219,7 +220,7 @@ static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) } /* Need to update PMCCLRR (clear register) */ - regmap_write(dwmac->regmap, reg + dwmac->ops->syscfg_clr_off, + regmap_write(dwmac->regmap, dwmac->ops->syscfg_clr_off, dwmac->mode_mask); /* Update PMCSETR (set register) */ @@ -328,7 +329,7 @@ static int stm32mp1_parse_data(struct stm32_dwmac *dwmac, /* Get ETH_CLK clocks */ dwmac->clk_eth_ck = devm_clk_get(dev, "eth-ck"); if (IS_ERR(dwmac->clk_eth_ck)) { - dev_info(dev, "No phy clock provided...\n"); + dev_dbg(dev, "No phy clock provided...\n"); dwmac->clk_eth_ck = NULL; } -- 2.25.1