[From nobody Thu Jun 25 05:55:21 2020
Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244])
 by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux))
 id 1i5YSb-0008UP-K1
 for openwrt-devel@lists.openwrt.org; Wed, 04 Sep 2019 16:48:47 +0000
Received: by mail-oi1-x244.google.com with SMTP id h4so13012449oih.8
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Wed, 04 Sep 2019 09:48:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=boWnuJPwwzsfwj6VFUfPaO28/0mtpHrR9anNcV271RM=;
 b=Emjc9EIW+3T519pw3aQliJh5Pd6B76mcd+uisBPkxn88sh0uDR/YX3sdFiWzjLlYFL
 XOpeUcltllgx9hN+w/13xBnf9GkApuuZsWboOCoC6JWMSwJyP2L5qkF+JYS6a9NQBKxo
 YeOmUKPhmO1jre4f87y/d+CmcdeijveRas8+3JPIF0wRxupG8o/91cAGUk8G0AAivb3u
 NYC1eONrI2V29Gc1vK/Xr+uNbKboS40Q09TVKUghzNxZZZQIkdVzr/uf3Y/oIBlLlh+r
 SWkxwbsEwGNQ+d9mzs+H0foK+LGTlpoOxgG9xrjrJCeYfjcLxm31Ar8Fr9E4s1KSGios
 XwKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=boWnuJPwwzsfwj6VFUfPaO28/0mtpHrR9anNcV271RM=;
 b=CUV1asxfx3jqfbx37QP2wtiKuZJJH63HprRzeI2njCgdCWXPlWjIiDvl2NqiShKM1Z
 u3bVUIIymij/zqYRm+s5GU8zdLzRV17sEbQLGmIa53H1GmbmrmnVSJM0+Pxod6Q5u8Ep
 CB/yLwxU+tL20VtXh11ekuuv0kxFlEYTdxlNh35DJ5Bt/c3HQ4OnCfAsn04B22YLv+TT
 VStcKW/ZOn3tJpbJD0GP83bUE6WLys7SUEO6DuITIVkUNpIlzQT0mmc79reuKs039DA6
 sKSfySH1dRoWm6YUVQ20zME9wl3JLcCFtWFwJUZ4OUBhG1/HuTS+c3l5VHe7ZXccQIGh
 otdA==
X-Gm-Message-State: APjAAAVxydM2ZkdF99PIC8gpOie6SQeZejtxoPl86NpYSU+Ns39wYcGl
 ef+saxH51TR8t5yHPP1bHcudJjjJ1oYyaGVKYbw=
X-Google-Smtp-Source: APXvYqwIhW2NXzroIR3aP2pQBBlLVoJ7DCXDqx9jbinP4ned1D7PVLRUtk3bbxGgEI6hNuwOsMxFlqKXz2gQLqc4lkQ=
X-Received: by 2002:a05:6808:b14:: with SMTP id
 s20mr4118244oij.15.1567615724064; 
 Wed, 04 Sep 2019 09:48:44 -0700 (PDT)
MIME-Version: 1.0
References: &lt;alpine.LNX.2.21.99999.352.1909020530360.2689@localhost.localdomain&gt;
 &lt;alpine.LNX.2.21.99999.352.1909020624220.2925@localhost.localdomain&gt;
 &lt;919fe9ff-bdf6-e3a4-1dfc-ca53284b5986@hauke-m.de&gt;
 &lt;alpine.LNX.2.21.99999.352.1909041159540.3532@localhost.localdomain&gt;
In-Reply-To: &lt;alpine.LNX.2.21.99999.352.1909041159540.3532@localhost.localdomain&gt;
From: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Date: Wed, 4 Sep 2019 18:48:33 +0200
Message-ID: &lt;CAFBinCD1ttRRxw0NBcGyk0TzJxuPH+o3fh=sqMgjO9STbXx6HA@mail.gmail.com&gt;
Subject: Re: [OpenWrt-Devel] AR10 GPHYs (WAS: Re: [lantiq] general help on
 AR10 platform)
To: Enrico Mioso &lt;mrkiko.rs@gmail.com&gt;
Cc: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;, openwrt-devel@lists.openwrt.org
Content-Type: text/plain; charset=&quot;UTF-8&quot;
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20190904_094845_687066_71D112AC 
X-CRM114-Status: GOOD (  12.68  )
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:244 listed in]
 [list.dnswl.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (martin.blumenstingl[at]googlemail.com)
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid

Hi Enrico,

On Wed, Sep 4, 2019 at 12:07 PM Enrico Mioso &lt;mrkiko.rs@gmail.com&gt; wrote:
&gt;
&gt; Hi there!
&gt;
&gt; So I am trying to get ethernet working on this AR10 device.
&gt; It has 3 GPHYs:
&gt;
&gt;                         gphy0: gphy@20 {
&gt;                                 compatible = &quot;lantiq,xrx300-gphy&quot;;
&gt;                                 reg = &lt;0x20 0x4&gt;;
&gt;
&gt;                                 resets = &lt;&amp;reset0 31 30&gt;, &lt;&amp;reset1 7 7&gt;;
&gt;                                 reset-names = &quot;gphy&quot;, &quot;gphy2&quot;;
&gt;                         };
&gt;
&gt;                         gphy1: gphy@58 {
&gt;                                 compatible = &quot;lantiq,xrx300-gphy&quot;;
&gt;                                 reg = &lt;0x58 0x4&gt;;
&gt;
&gt;                                 resets = &lt;&amp;reset0 29 28&gt;, &lt;&amp;reset1 6 6&gt;;
&gt;                                 reset-names = &quot;gphy&quot;, &quot;gphy2&quot;;
&gt;                         };
&gt;
&gt;                         gphy2: gphy@ac {
&gt;                                 compatible = &quot;lantiq,xrx300-gphy&quot;;
&gt;                                 reg = &lt;0xac 0x4&gt;;
&gt;                                 resets = &lt;&amp;reset0 27 26&gt;, &lt;&amp;reset1 5 5&gt;;
&gt;                                 reset-names = &quot;gphy&quot;, &quot;gphy2&quot;;
&gt;                         };
&gt;
&gt; And firmware load addresses for GPHYs are correct as per the vendor code:
&gt; #define IFX_RCU_GPHY0_FW_ADDR                   ((volatile u32*)(IFX_RCU + 0x0020))
&gt; #define IFX_RCU_GPHY1_FW_ADDR                   ((volatile u32*)(IFX_RCU + 0x0058))
&gt; #define IFX_RCU_GPHY2_FW_ADDR                   ((volatile u32*)(IFX_RCU + 0x00AC))
the register part of your .dts looks fine based on this

&gt; But driver was failing to initialize due to missing clock gates.
&gt; In sysctrl.c, we have:
&gt; clkdev_add_pmu(&quot;1f203020.gphy&quot;, NULL, 1, 0, PMU_GPHY); // OK for GPHY0
&gt; clkdev_add_pmu(&quot;1f203068.gphy&quot;, NULL, 1, 0, PMU_GPHY); //problem for GPHY1
&gt;
&gt; And GPHY2?
the UGW kernel documents all the PMUs in
drivers/char/ifxmips_pmu_SOC.h, in your case that is:
drivers/char/ifxmips_pmu_ar10.h [0]
I don't remember how to translate that file to an English sentence but
you can figure it out on your own (for example by comparing the vr9
sysctrl.c code with

resets are found in the same directory but a different file: ifxmips_rcu_ar10.h

(sorry for the short answer but I have to leave in a few minutes)


happy hacking!
Martin


[0] https://github.com/uwehermann/easybox-904-xdsl-firmware/blob/master/linux/linux-2.6.32.32/drivers/char/ifxmips_pmu_ar10.h

]