From patchwork Thu May 19 18:24:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1964 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 375013F067 for ; Thu, 19 May 2022 20:24:28 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id bg7-20020a05600c3c8700b0039468585269sf2354243wmb.3 for ; Thu, 19 May 2022 11:24:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652984667; cv=pass; d=google.com; s=arc-20160816; b=uXYoBjZ6GImdoRg7uoMgyCrFtLnalZ2kPjtrQOIcX0YeMuwAXPrPoL/BA4I/fbkv2V ir3a/O16XdFB7IyDUzhiyP0q2sFSWHNY98OzIHZBVtcF1xYz0TAbC6lt9g8n5++BIbcK cTpOAwBa3EnzXH+b6xRBSCFRJFkqfNoaR9Vu0GYZjDvc/pLLhk+tCXaijQyVFFD8EhzE EU+F7FXwLPQoCcgT5Qy6TVzluWxFWTf58HUky3fTyIxrnxbDCyHWyKK/CJWIuhNP4kJP kQKad0fRnljOdR4OnuzpihTfbHrc2zDA2Yn1bM5o63BvIwgTROPT/FPoZhgS8tr4Fnbs qv+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=2gnyau7Epx24nICUkON6iTxJeGvr1xXuNNcyOHngG54=; b=VA+7I8R/ZnPDCXVmYHU4PeTu38YTl0VM36gmFf0lmzn1Mb/9o6dBLo2+G27pKk1bMQ 7YyKj9uj5gdN42455c5uPAKZ1YIV0cgBH1KTDRfthFCKf7f8c4hBPkWULim5Kw6WxXUo VVoExS8u2/qz5G4+UOEpubtFpWkgDaE2af5GAZYbPMPRzsUTWi8OXW3OOtm8/t7E3fuX AVWRgfNIavvfwiKkSU+O/YzkFO3oXYSfXcjgz9EC2yXJ5JTioiV6MZ0VmEFOiIunTMyK gmIDIa1kVYHlMYW2A+MBTBSLNjw8Dqk+/6V/uIFzOQV8qlXXTZ9UVEFvASKC+4bkAYMr pEAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=V8wIWjQy; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=2gnyau7Epx24nICUkON6iTxJeGvr1xXuNNcyOHngG54=; b=arzqpk9OYoBUnBuPUQiW01uRDRmfjKs3dL8AWhZTG3GvW9sZxGxBFgt0CzXzCimorW 2HSG3buW+yDeYitVUaFvGCGzqE5wr/j1FNXIdP8HfFgwT4uW+Pzvq04gaWPswXhnbu0T aiXtyYQKXPGCnR1vK35oXX45IhjVMWMle+mH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=2gnyau7Epx24nICUkON6iTxJeGvr1xXuNNcyOHngG54=; b=fqHnOL+0IEQ1ehiig/zg6JHwL2HTDBtyIqp7rz962DW0Ym9dx3Bh7RmmiCn+N1ZnTZ VdbvtTl92mXWzD/Yz1Ghyk0nIdIMohPdQ9dM8zItVjvk+Nv0YhXuISepSOnxCGnpjvJr QER7UyzPCXAwnyIC1vEGaG1wwushyB8j9THKgxoKICB2olzVjYP8KqWqxuz6FvzeNWLz tNKN4sLwE4PQ4R4JpvWaHzNTXwQaiKo98QmLfICOrqGJYBqDuq6mWfgj3lYsGadKBvi/ EP4Zb2a3d+miVOlU6vUt0MlP2Lj5P04QGFLlM4w28INuxTQUJiOf0T4QE0yFbH4nT2dT qpPA== X-Gm-Message-State: AOAM530gICBNVA2FZUQ7E42cGq8CmM+Py1EqCO1zAGf+nkf+v+9gU/jO Pd1E1/Mi5XbVsEj3ByyK23t1T6Nz X-Google-Smtp-Source: ABdhPJyMWdTH+/UsIYnXISvf2wR4Ibg0bYJEsnYndgFNTuW4zFlaMgK6uMrkA379PHMioIkrrZPvbw== X-Received: by 2002:adf:e584:0:b0:20d:841:4929 with SMTP id l4-20020adfe584000000b0020d08414929mr5372571wrm.284.1652984667535; Thu, 19 May 2022 11:24:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:64ca:0:b0:20c:bb44:bd7 with SMTP id f10-20020a5d64ca000000b0020cbb440bd7ls5672732wri.0.gmail; Thu, 19 May 2022 11:24:26 -0700 (PDT) X-Received: by 2002:a05:6000:1549:b0:20c:7183:439 with SMTP id 9-20020a056000154900b0020c71830439mr5205451wry.104.1652984666395; Thu, 19 May 2022 11:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652984666; cv=none; d=google.com; s=arc-20160816; b=IrqfgEPzXRy7idR8NOWSpA9b/4DMFXMxBJCqGP1X5iwkHEiNaqsbQ8rtheMamQWjG/ yti7/FaXi0UgwF9grU2i2IgOuUBe36YnmBt+GRiwy66BogDWo+YoTsD7smk6ytLRbsB4 jFKehCjv5QsRmrkY3JyNWCLV9urMZwn6s1bL0boMJDlfR047gmW1EA9OVS6t9ehqIKKv jMnLJ/9oNWewpYl8X6LHH2er5TzzV5018TsZholFwzTLevYZ2n/KFS9OIwT7PBxLid3s YvbvGiw424Dk3v4wFlR2r+ykZsbKZj/r+tS3erPbe6/YwWtyhTmon1B1DC/SAY2q8/YH lnCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=0zXiDiE6F3yYGhahJvZZTWKFFsEbzGr9QORv3wWtDJQ=; b=Vn18drQggDWaHawhdYcfhhp9b1mZ7Ff6mmfbXLxL0kPd63LeM8T4ozFWfvS2AlpPTc rAh7JNu5YFBfc1I39A+4JHiKuWbwi+VE5PoKUioemPHH4AMyJrpoVh46UN6e0KEvOPW/ up2iVnUT9o1P91TH2ABWiprRsKkAui4+W/bbkywgtTPs2n9GVH/gMAXDKe7fqoTHyD95 MQXDbttZ8+A91pXFeDR8aLYAA06MlGx170sUNB3mbYR4klH50Out7thMpv47AL6qHpyf oTM33dlc8tT+/Hgp7g5Qt3hOyHRMo+tqZDlehaSsQe7U7IQwZ+9fVz4xiPO8xdj2R9rZ AA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=V8wIWjQy; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id r11-20020a5d694b000000b0020ada242908sor203224wrw.10.2022.05.19.11.24.26 for (Google Transport Security); Thu, 19 May 2022 11:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a5d:5888:0:b0:20d:270f:6b61 with SMTP id n8-20020a5d5888000000b0020d270f6b61mr5133314wrf.211.1652984666107; Thu, 19 May 2022 11:24:26 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-53-154.cust.vodafonedsl.it. [188.217.53.154]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c17c700b003942a244f45sm183796wmo.30.2022.05.19.11.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 11:24:25 -0700 (PDT) From: Tommaso Merciai To: Cc: tommaso.merciai@amarulasolutions.com, alberto.bianchi@amarulasolutions.com, michael@amarulasolutions.com, linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: phy: DP83822: enable rgmii mode if phy_interface_is_rgmii Date: Thu, 19 May 2022 20:24:23 +0200 Message-Id: <20220519182423.1554379-1-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: tommaso.merciai@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=V8wIWjQy; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , RGMII mode can be enable from dp83822 straps, and also writing bit 9 of register 0x17 - RMII and Status Register (RCSR). When phy_interface_is_rgmii this mode must be enabled References: - https://www.ti.com/lit/gpn/dp83822i p66 Signed-off-by: Tommaso Merciai Co-developed-by: Michael Trimarchi Suggested-by: Alberto Bianchi Tested-by: Tommaso Merciai --- drivers/net/phy/dp83822.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index ce17b2af3218..66fa61fb86db 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -408,6 +408,10 @@ static int dp83822_config_init(struct phy_device *phydev) if (err) return err; } + + /* Enable RGMII Mode */ + phy_set_bits_mmd(phydev, DP83822_DEVADDR, + MII_DP83822_RCSR, BIT(9)); } if (dp83822->fx_enabled) {