Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8741268rwd; Tue, 20 Jun 2023 20:46:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66mu5sf8ZWMXRGFByjxUkQI+HMzQb2lTwyvKwzXNcn6pZ8ufkCtdL8SCEMV7tUkYQvJ2IY X-Received: by 2002:a05:6a21:6d96:b0:123:3ec2:361b with SMTP id wl22-20020a056a216d9600b001233ec2361bmr392993pzb.56.1687319213505; Tue, 20 Jun 2023 20:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687319213; cv=none; d=google.com; s=arc-20160816; b=s44pWP5gaYvjcpwMQPdtR9kjs9c1QynRZ7XgG+aDa9TDzC7xHuhx81tAlE5G8Jo2BF xDaQrUdRork9isyjqF83UvcqSdLgOF96RZkZ+Bi7kwqthicL1gkOu/HhH+y7orl/WY1Z 1Uu84ne6UoWOQUzGmvP8wvEWD0kg3YQ/3Nho1XnmhdWyjm7gDHc6Vskv8bUmhlp6Ae2q iSTDj+pU9QY4VPWwxyEHqB/1SK2RcwzNb4MeM6893tYw/Yf6vamEWleUupkms/+kiubP iP2T5Z9sg75o9uNW5ijnCydivbDx6Xtxwi38Mfdak37Iw9alsPhZjeB683nxiIFN/v3R 17Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=EO5ZfzjUE4DBlSBN6avNGeDZ3bF2TzaON5JVuBM8YqU=; b=QTRpFJ8JEolqPTcFfxF8tlFXy+abPNMzvwa9N1MIA1AbQ3JNao3i8t8ODvZ3+Z36HW DAoGVWaIm4u3skx1vGHBIpo2nklA/t0x1h5ixUAr0mIXl+csPT8/8qOkQyOQXmF7fd8v O39+mpQ9bVNsB799zbcUh7r2A99qxeNKm2Vef4IzhTxCQFEcYL4BYec+Mu2phC2IzTvD Q7adxPZcI8DZdqTOpF4uCiWgIIAizuAjDNSS4T/ESo3Ojy4+zvn6sB+S5HagPI8c79k3 StnecvAKmx0ePpcrL/xDNUkSODhI8PGoe129mAHXXXlD03tMEZVoZk5Klm99cGU8/sek uPRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a62cf07000000b00666982292a2si3083173pfg.166.2023.06.20.20.46.39; Tue, 20 Jun 2023 20:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbjFUD3O convert rfc822-to-8bit (ORCPT + 99 others); Tue, 20 Jun 2023 23:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjFUD3J (ORCPT ); Tue, 20 Jun 2023 23:29:09 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80E31985; Tue, 20 Jun 2023 20:29:03 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 93F4C7FC9; Wed, 21 Jun 2023 11:29:01 +0800 (CST) Received: from EXMBX062.cuchost.com (172.16.6.62) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 21 Jun 2023 11:29:01 +0800 Received: from [192.168.120.43] (171.223.208.138) by EXMBX062.cuchost.com (172.16.6.62) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 21 Jun 2023 11:29:00 +0800 Message-ID: <8e2a50b2-a9ab-e164-a3c2-b7bc11ccdb53@starfivetech.com> Date: Wed, 21 Jun 2023 11:28:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg Content-Language: en-US To: Andrew Lunn CC: Conor Dooley , , , , Peter Geis , Frank , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Yanhong Wang References: <20230526090502.29835-1-samin.guo@starfivetech.com> <20230526090502.29835-2-samin.guo@starfivetech.com> <20230526-glutinous-pristine-fed571235b80@spud> <1dbf113c-7592-68bd-6aaf-05ff1d8c538c@starfivetech.com> <15eb4ffe-ea12-9a2c-ae9d-c34860384b60@starfivetech.com> From: Guo Samin In-Reply-To: Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX062.cuchost.com (172.16.6.62) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Re: [PATCH v3 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg From: Andrew Lunn to: Guo Samin data: 2023/6/20 >> I just got the detailed data of Driver Strength(DS) from Motorcomm , >> which applies to both rx_clk and rx_data. >> >> |----------------------| >> | ds map table | >> |----------------------| >> | DS(3b) | Current (mA)| >> |--------|-------------| >> | 000 | 1.20 | >> | 001 | 2.10 | >> | 010 | 2.70 | >> | 011 | 2.91 | >> | 100 | 3.11 | >> | 101 | 3.60 | >> | 110 | 3.97 | >> | 111 | 4.35 | >> |--------|-------------| >> >> Since these currents are not integer values > > Integers is not a problem. Simply use uA. > >> and have no regularity, it is not very good to use in the drive/dts >> in my opinion. > > I think they are fine to use. Add a lookup table, microamps to > register value. Return -EINVAL if the requested value is not in the > table. List the valid values in the schema, so the checker tool might > point out problems. > > Andrew Thanks Andrew, I'll use a lookup table to try. Another thing we need to deal with DS under different IO voltages(1.8V/2.5V/3.3V). The IO voltage can be configured via a hardware pull-up resistor (visionfive 2 is configured to 1.8V by default), and then the IO voltage can be obtained or set through the register(0xA001) Chip_Config (EXT_0xA001) |Bit |Symbol |Access |Default |Description | |5:4 |Cfg_ldo |RW |0x0 |Rgmii ldo voltage and RGMII/MDC/MDIO PAD's level shifter control. Depends on strapping.| |2'b11: 1.8v 2'b10: 1.8v 2'b01: 2.5v 2'b00: 3.3v | |----------------------| | ds map table(1.8V) | |----------------------| | DS(3b) | Current (mA)| | 000 | 1.20 | | 001 | 2.10 | | 010 | 2.70 | | 011 | 2.91 | | 100 | 3.11 | | 101 | 3.60 | | 110 | 3.97 | | 111 | 4.35 | |--------|-------------| |----------------------| | ds map table(3.3V) | |----------------------| | DS(3b) | Current (mA)| | 000 | 3.07 | | 001 | 4.08 | | 010 | 4.37 | | 011 | 4.68 | | 100 | 5.02 | | 101 | 5.45 | | 110 | 5.74 | | 111 | 6.14 | |--------|-------------| (The current value of 2.5V is not available to us now) When we need to deal with current values at different voltages, using register values in drives may be simpler, comparing the current value. Of course, I will also follow your suggestion and use the current value + lookup table to implement a solution. Thanks! Best regards, Samin