Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp949049rwb; Fri, 18 Nov 2022 10:21:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QsKGnlaNb1kAAO11FD/BOwga+kXDy90LLSAug7tBQ5+qZzRkRQun3yuEx05A7J2xS8Ila X-Received: by 2002:a05:6a00:140c:b0:56b:b520:3751 with SMTP id l12-20020a056a00140c00b0056bb5203751mr8955225pfu.29.1668795661114; Fri, 18 Nov 2022 10:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668795661; cv=none; d=google.com; s=arc-20160816; b=KerwjitPdNtkf5KTamjkFWYbFIc1FxAyg8IKMI/8bV+FMOuezezFCn8uaXMYX0KUhA eg2RhpFaC2BzMdKp5tdaIuKAHXqBltjvVF/sFM3D/T6xI8oHcW+umLKBGhuVOnmvv3yr rYvplm2P94wbvi7VDuO0BLId0fK6E2PowawySZJNXFLMRjakSrp5xd3cinUxROihYg30 e7KzwPjLhB7pMs1YsaWxwvqSPE2QeB0LnHWuUGET1ccQuuCJrAGduId6tsOHgJSWxdBC dnrKflerpswQFYY8n/UylPLSEDfDYQ0GbVOipwf0XbIb4OmSuJYOJ4vFJ402s3pRyndf 9e0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kwXpWHa6FKMsiVUpTzBEVcezafSgFw7qVXGPI1PvE5U=; b=Avxs/nRk20tdiMXMY7L2AmDZYHlRx9Y9P7JTavprXIH2UmI+kJCXndMDl3tr/MC+EE MB0jPhukkwI4EhLIakU/ZcDNwi69l/+tmVLYuPk/YY1Rgx9Edn28aCCBAtgBPFvJHiOQ oL+CMI4YJd1gfhJbn7eNwe21PI5pNmLQ4Wgr5LE/aBzHOApU34Ebd5eW0pSlpMAUH+ap NCKitNYLlCJvQtyyVM4ipDPtsAWnXT/oLXGnFYPvszDrUbU2A2sW9U3rGkFLdTvcgylF 4vrXeN0triam/X96D2uZ1oSfQzW5Bf0n/rt8Q4xyMBNF9beyVRioCQcTrEY4Zq+U3WV5 c0zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F8adC3rg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a62ce01000000b00542c772d478si4286602pfg.247.2022.11.18.10.20.48; Fri, 18 Nov 2022 10:21:01 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F8adC3rg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235421AbiKRSN6 (ORCPT + 90 others); Fri, 18 Nov 2022 13:13:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232926AbiKRSN4 (ORCPT ); Fri, 18 Nov 2022 13:13:56 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4DC97AF6B; Fri, 18 Nov 2022 10:13:54 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso8144656wme.5; Fri, 18 Nov 2022 10:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kwXpWHa6FKMsiVUpTzBEVcezafSgFw7qVXGPI1PvE5U=; b=F8adC3rgd5ZZBX8LOJzEVxPFpYCL3cyBxeyrmnqjYQovrdGhmaVcUNf8tT3AoU9BWR KKRjopWoMN6vQc3MTqhJKVQYX3bmX57ElyLlHe4btKjVF5VEwolAV0AP7uf+ShT1l+Sw JxR7fFhjqk7xsgfyqUSEHTAxf0ThLkvKzbGWJhGbDDKUzr2RAUeXNE7SEYsnNELfJxMg Qa1pYIVgRlktE+6D/WJrBSymjfCrZc119LBFmK75Hp1jr7WmauEAlNjVibPgeen0C2HV qvqeeFWxOEZBYPJOFJC6eAvktyxGY4theb/syatWuLbdA/nOwfuEcSzPhE52ozE7tcJy 71Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kwXpWHa6FKMsiVUpTzBEVcezafSgFw7qVXGPI1PvE5U=; b=5W4fWnQY/AN1gPQ9Ofmv0hvdFvhyAAFsJMUx2UkNMgtuchT7iL0M63zZwgI7RZauEa QV1Ol39au7bgSUA7xR0PL64eRpVPZL009BWd2Z6VXgMkwl+Ez0lNCFi5d4s7t7TJFr6Q VpN8VfaJy6/Kmad/2qNzXKXDJSm1u+af2tO6pMmLYLZjzET46F1AJKLZCaVDI2lJv0iT Ul7VXaRPbTubEDZFqhHI4aKSSqts3wxWOfoImF9nbilSE0gIRAjiem1Nu4y+sOuHCXm3 96XUTCfUUvVi6AOMaWRveD3xdtWLQxUtplvuFBJSvO0XM+eWoxRY1yx6Rrm0HfZhvujb OrOg== X-Gm-Message-State: ANoB5plFf1/wzzGsk2tNEYbD9MqCLH6yUcl+E+rbBbGqCCUULjP+I58z a0qDFSlEivjp9vfMlx3eSXnL8SdpmVhiVNrMAdc= X-Received: by 2002:a7b:c00a:0:b0:3cf:e8f0:ad11 with SMTP id c10-20020a7bc00a000000b003cfe8f0ad11mr9492684wmb.65.1668795233073; Fri, 18 Nov 2022 10:13:53 -0800 (PST) MIME-Version: 1.0 References: <20221116200150.4657-1-linux.amoon@gmail.com> <20221116200150.4657-2-linux.amoon@gmail.com> In-Reply-To: From: Peter Geis Date: Fri, 18 Nov 2022 13:13:41 -0500 Message-ID: Subject: Re: [linux-next-v2 1/5] arm64: dts: rockchip: Fix gmac phy mode to rgmii on Rock 3A SBC. To: Anand Moon Cc: Michael Riesch , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Chukun Pan , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Fri, Nov 18, 2022 at 4:35 AM Anand Moon wrote: > > Hi Michael, > > On Fri, 18 Nov 2022 at 12:33, Michael Riesch > wrote: > > > > Hi Anand, > > > > On 11/16/22 21:01, Anand Moon wrote: > > > On rk356x ethernet phy support reduced media independent interface (RMII) > > > and reduced gigabit media independent interface (RGMII). > > > So set the phy mode to rgmii to support clock delay, also > > > add TX and RX delay for phy-mode. > > > > Based on this commit message I still don't understand what you are > > actually trying to fix here. If you encounter network problems/stability > > issues, please let me know what test triggers the faulty behavior. > > Please describe the problem you are facing in detail here or in the > > cover letter. > > > > Ok, Ethernet does not work on my Radxa 3A see boot logs. > > [0] https://gist.github.com/moonlinux/bb56c787031226fbb9f69121564e76a2 > > Please find this updated commit message. > > As per the schematic and datasheet PHY mode is RGMII > Use 2ns clock delay to RXC for RXD and TXC for TXD latching. rgmii-id mode does exactly this in the phy (your realtek chip). By setting the mode to rgmii, you're telling the phy that delays are set elsewhere, either in hardware or in the controller. You're then handling them in the controller. While the delays aren't documented in the TRM, I've long suspected that the defaults of 0x30 and 0x10 equate to the standard 2ns delay. So you're setting the delays much higher than the default means you need to add *more* than the standard 2ns delay for your device to work. This is why I've been asking if you have tested these. You need to set each value and find the lowest and highest possible values that work, then take the median value between those two. > > > > Fix the following warning > > > > > > [ 7.365215] rk_gmac-dwmac fe010000.ethernet: Can not read property: tx_delay. > > > [ 7.365219] rk_gmac-dwmac fe010000.ethernet: set tx_delay to 0x30 > > > [ 7.365224] rk_gmac-dwmac fe010000.ethernet: Can not read property: rx_delay. > > > [ 7.365228] rk_gmac-dwmac fe010000.ethernet: set rx_delay to 0x10 > > > > If the only purpose of this patch is to get rid of this warnings, it may > > No, the intent is to fix the PHY mode to RGMII and fix the delay. > [ 7.066357] rk_gmac-dwmac fe010000.ethernet: init for RGMII_ID > > > make sense to set them to dev_dbg as Peter pointed out. > > > Ok, will update this in the next version. > > > Best regards, > > Michael > > > Thanks > -Anand