Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6486217rdb; Thu, 14 Dec 2023 22:47:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7kJ7Ykl+eXUZtV0Hwob6hjKlr5V7rm/0T59NnB+y5uRCFtvrUPoC1K7a3KNqzsFb1PxIC X-Received: by 2002:a17:90a:f295:b0:28a:e16e:6a85 with SMTP id fs21-20020a17090af29500b0028ae16e6a85mr3017656pjb.68.1702622844004; Thu, 14 Dec 2023 22:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702622843; cv=none; d=google.com; s=arc-20160816; b=vOMFbNk/GWkZ09Kon7rS1YL+oCOo6Re3L4P/E6/9tIdplZLTZZt6VQTYNNns8JzOuA HvlhK8pWmy5n+jNvehaRF1GyiOLEvhA2L3zqgzsQSBjSbnSUH0o1bUPlTomCL2laz2zP nYKmGymAgtpwWpWhgDzyEzv6Y2HU866ef6Q/codEdt5LW6CQ0tdHpzwOk6EAR+AvNlEe ubvoRkfWm5K2bYWq+gEnRXT3uLKwXNcNgVce46ovL81oIhKSo1ZgsAl4SVM11CgQrbbp JZFq93CLDWyU/7NwWVsvtsAe201gof5ArMiLJBWAzQkGRp1vwjoTtndTWwZAq7o4Nvl3 l9yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=mIWuQqhHBuhOz1O66LguwIbjV5+p7phkcD+JP2TpiRI=; fh=kF3G5kIPhTCN3EkFyHot1pZd4Krxh7+QTm+ajvI4YDQ=; b=G44bmLe+4qMNCvZfGBol4/F1jAwxppvK4i6FLlNtnvZ0K9h0UGqtgIWCL2neNZfyDB x5tvvq3SfFo/lYFyf76OF1ITQS6qW/yfV9m2JNSS7Va7ydeRnCmuq6VLfA0B7URo6gVn tdCKYTPdBARrHqErqiv7IKF0eXbpeXMTpEE6JXqduV8Ol/+R8qKCSfqYATljhZVF07JL wkE2yVX+P5Dop/gjO3Sj1e9kEcGhUUHfgRbjYmSRuLJJWK7JhNU82I7iJih5vyt2RJIH 3u+NnlKEhFMPradgr9hf0NgXTNwHi9BCErkEtnxdkwNFAL1ZeqHcQtOij1pIKBVmX20M ZDcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bNYggscu; spf=pass (google.com: domain of linux-kernel+bounces-491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s11-20020a17090aad8b00b0028b0f286487si2017811pjq.157.2023.12.14.22.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 22:47:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bNYggscu; spf=pass (google.com: domain of linux-kernel+bounces-491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A1FD72834AF for ; Fri, 15 Dec 2023 06:47:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5578CD294; Fri, 15 Dec 2023 06:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bNYggscu" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 CD916CA69; Fri, 15 Dec 2023 06:47:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BF2wORq032384; Fri, 15 Dec 2023 06:46:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=mIWuQqhHBuhOz1O66LguwIbjV5+p7phkcD+JP2TpiRI=; b=bN YggscuQmO1JJMxNaOuQqdLl4bRLTr/JaPc4+MwqLssZtuThuAvsp0+hmUEng1Jcp eRDmHKvSGb8BzXS/IwMCe5gymC5TudKKTmT9veTSLiVs7PKrJKJ7LV8hqa2GT2hw /OjFWMslO+Jx37a0/t0w6yS8H/4+my27uW8oLTuWJKRlR4YQfxnYhSHGmO5AasMW b4xCWG1BNwW2F/OiLupKQFWEfPEWa8EzWDFaM/uPg/8ZfsK7iWy77HRDC/8Cyro9 3MNuw7sT0XmUv+301xOJ/w8VygsO2rAYMBC+3wV7fhp0PTASzaKY8kxgEh3gWSHj YvvwI0uaXw8H6J0mulZw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v090u1hdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 06:46:52 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BF6koIW016243 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 06:46:50 GMT Received: from [10.253.13.71] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 14 Dec 2023 22:46:45 -0800 Message-ID: Date: Fri, 15 Dec 2023 14:46:42 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] dt-bindings: net: ipq4019-mdio: Document ipq5332 platform Content-Language: en-US To: Conor Dooley CC: , , , , , , , , , , , , , , , , , , References: <20231212115151.20016-1-quic_luoj@quicinc.com> <20231212115151.20016-6-quic_luoj@quicinc.com> <20231212-caution-improvise-ed3cc6a1d305@spud> <11ffc985-3f2b-46b9-ae0b-911f7abe98d1@quicinc.com> <20231214-outshine-shush-8a11c68607cd@spud> From: Jie Luo In-Reply-To: <20231214-outshine-shush-8a11c68607cd@spud> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YopTV-JPXs1IMIkxAbrW6wVgPtCyc9rw X-Proofpoint-ORIG-GUID: YopTV-JPXs1IMIkxAbrW6wVgPtCyc9rw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150039 On 12/15/2023 1:12 AM, Conor Dooley wrote: > On Wed, Dec 13, 2023 at 04:26:56PM +0800, Jie Luo wrote: >> >> >> On 12/13/2023 12:06 AM, Conor Dooley wrote: >>> On Tue, Dec 12, 2023 at 07:51:50PM +0800, Luo Jie wrote: >>>> Update the yaml file for the new DTS properties. >>>> >>>> 1. cmn-reference-clock for the CMN PLL source clock select. >>>> 2. clock-frequency for MDIO clock frequency config. >>>> 3. add uniphy AHB & SYS GCC clocks. >>>> 4. add reset-gpios for MDIO bus level reset. >>>> >>>> Signed-off-by: Luo Jie >>>> --- >>>> .../bindings/net/qcom,ipq4019-mdio.yaml | 157 +++++++++++++++++- >>>> 1 file changed, 153 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml >>>> index 3407e909e8a7..9546a6ad7841 100644 >>>> --- a/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml >>>> +++ b/Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml >>>> @@ -20,6 +20,8 @@ properties: >>>> - enum: >>>> - qcom,ipq6018-mdio >>>> - qcom,ipq8074-mdio >>>> + - qcom,ipq9574-mdio >>>> + - qcom,ipq5332-mdio >>>> - const: qcom,ipq4019-mdio >>>> "#address-cells": >>>> @@ -30,19 +32,71 @@ properties: >>>> reg: >>>> minItems: 1 >>>> - maxItems: 2 >>>> + maxItems: 5 >>>> description: >>>> - the first Address and length of the register set for the MDIO controller. >>>> - the second Address and length of the register for ethernet LDO, this second >>>> - address range is only required by the platform IPQ50xx. >>>> + the first Address and length of the register set for the MDIO controller, >>>> + the optional second, third and fourth address and length of the register >>>> + for ethernet LDO, these three address range are required by the platform >>>> + IPQ50xx/IPQ5332/IPQ9574, the last address and length is for the CMN clock >>>> + to select the reference clock. >>>> + >>>> + reg-names: >>>> + minItems: 1 >>>> + maxItems: 5 >>>> clocks: >>>> + minItems: 1 >>>> items: >>>> - description: MDIO clock source frequency fixed to 100MHZ >>>> + - description: UNIPHY0 AHB clock source frequency fixed to 100MHZ >>>> + - description: UNIPHY1 AHB clock source frequency fixed to 100MHZ >>>> + - description: UNIPHY0 SYS clock source frequency fixed to 24MHZ >>>> + - description: UNIPHY1 SYS clock source frequency fixed to 24MHZ >>>> clock-names: >>>> + minItems: 1 >>>> items: >>>> - const: gcc_mdio_ahb_clk >>>> + - const: gcc_uniphy0_ahb_clk >>>> + - const: gcc_uniphy1_ahb_clk >>>> + - const: gcc_uniphy0_sys_clk >>>> + - const: gcc_uniphy1_sys_clk >>> >>>> + cmn-reference-clock: >>>> + oneOf: >>>> + - items: >>>> + - enum: >>>> + - 0 # CMN PLL reference internal 48MHZ >>>> + - 1 # CMN PLL reference external 25MHZ >>>> + - 2 # CMN PLL reference external 31250KHZ >>>> + - 3 # CMN PLL reference external 40MHZ >>>> + - 4 # CMN PLL reference external 48MHZ >>>> + - 5 # CMN PLL reference external 50MHZ >>>> + - 6 # CMN PLL reference internal 96MHZ >>> >>> Why is this not represented by an element of the clocks property? >> >> This property is for the reference clock source selection of CMN PLL, >> CMN PLL generates the different clock rates for the different Ethernet >> blocks, this CMN PLL configuration is not located in the GCC, so the >> clock framework can't be used, which is the general hardware register >> instead of RCG register for GCC. > > I don't see how the clock being provided by the "GCC" (whatever that is) > or by some other clock controller or fixed clock makes a difference. > Why can't the other clock provider be represented in the devicetree? > cmn-reference-clock is for selecting the reference clock source for the whole Ethernet block, which is just the standalone configure register. however the clock provider has the logical register distribution, such as for one clock tree, there is RCG, DIVIDER and branch registers in the qcom soc chip. The clock consumer defines the clock IDs of device tree to reference the clocks provided by the clock controller, and these clock IDs are provided by the header file of clock provider. like this, clocks = <&gcc GCC_MDIO_AHB_CLK>, <&gcc GCC_UNIPHY0_AHB_CLK>, <&gcc GCC_UNIPHY1_AHB_CLK>, <&gcc GCC_UNIPHY0_SYS_CLK>, <&gcc GCC_UNIPHY1_SYS_CLK>; gcc is the device node of clock provider, and GCC_MDIO_AHB_CLK is the clock ID. >>>> + clock-frequency: >>>> + oneOf: >>>> + - items: >>>> + - enum: >>>> + - 12500000 >>>> + - 6250000 >>>> + - 3125000 >>>> + - 1562500 >>>> + - 781250 >>>> + - 390625 >>>> + description: >>>> + The MDIO bus clock that must be output by the MDIO bus hardware, >>>> + only the listed frequecies above can be configured, other frequency >>>> + will cause malfunction. If absent, the default hardware value is used. >>> >>> Likewise. >>> >>> Your commit message contains a bullet point list of what you are doing, >>> but there's no explanation here for why custom properties are required >>> to provide clock information. > >> This property clock-frequency is optional to configure the MDIO working >> clock rate, and this is the MDIO general DT property, since the hardware >> default clock rate is 390625HZ, there is requirement for higher clock rate >> in the normal working case, i will update this information in the >> next patch set. > > I'm just realising that this particular one is not a custom property, > the unusual `oneOf: - items: - enum:` structure here threw me. This can > just be > clock-frequency: > enum: > - 12500000 > - 6250000 > - 3125000 > - 1562500 > - 781250 > - 390625 > > but you're missing a default, given your commit about the last element > in that list being one. > > Thanks, > Conor. Ok, will update this in the next patch set, thanks for the comments.