[From nobody Thu Jun 25 05:54:40 2020
Received: from mail-ve1eur03on0602.outbound.protection.outlook.com
 ([2a01:111:f400:fe09::602]
 helo=EUR03-VE1-obe.outbound.protection.outlook.com)
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fNjol-0004jQ-8N
 for openwrt-devel@lists.openwrt.org; Tue, 29 May 2018 18:58:10 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=darbyshire-bryant.me.uk; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IdvQS/veoSUSx79klUg/AmGMRkReQUtSNhZcR0a+d6I=;
 b=q4tsVdH+cg1BbpznW2pfg6VVwCzZ5PLcN1OpwssrzmRxYrcvZf8LHrHrsIihcJrRjbikPoYD7KAIHhJFY0JtxCa60nwavD3ykQ9m6pOu77B0O6qD2swg/ox8VQqk28O49ss4cl2WppiqipU9ZtIBQ+3pk10ncfOqB7viRYaKZoA=
Received: from VI1PR07MB4254.eurprd07.prod.outlook.com (20.176.6.147) by
 VI1PR07MB4414.eurprd07.prod.outlook.com (20.176.7.139) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id
 15.20.797.5; Tue, 29 May 2018 18:57:42 +0000
Received: from VI1PR07MB4254.eurprd07.prod.outlook.com
 ([fe80::2d37:3474:cf1e:b21c]) by VI1PR07MB4254.eurprd07.prod.outlook.com
 ([fe80::2d37:3474:cf1e:b21c%3]) with mapi id 15.20.0797.011; Tue, 29 May 2018
 18:57:42 +0000
From: Kevin Darbyshire-Bryant &lt;kevin@darbyshire-bryant.me.uk&gt;
To: Linus Walleij &lt;linus.walleij@linaro.org&gt;
CC: Andrew Lunn &lt;andrew@lunn.ch&gt;, netdev &lt;netdev@vger.kernel.org&gt;, Florian
 Fainelli &lt;f.fainelli@gmail.com&gt;, LEDE Development List
 &lt;openwrt-devel@lists.openwrt.org&gt;, Vivien Didelot
 &lt;vivien.didelot@savoirfairelinux.com&gt;
Subject: Re: [OpenWrt-Devel] [PATCH 0/4 RFCv2] Realtek SMI RTL836x DSA driver
Thread-Topic: [OpenWrt-Devel] [PATCH 0/4 RFCv2] Realtek SMI RTL836x DSA driver
Thread-Index: AQHT9qxrIfvGiYbFK0ePOsn83432r6RFc82AgADy1wCAADv4AIAAaXKAgAAEbgA=
Date: Tue, 29 May 2018 18:57:42 +0000
Message-ID: &lt;6FB2D569-87D4-47A9-AB6D-51B85720B6DA@darbyshire-bryant.me.uk&gt;
References: &lt;20180528174752.6806-1-linus.walleij@linaro.org&gt;
 &lt;20180528182037.GC27177@lunn.ch&gt;
 &lt;CACRpkdbnO4vhGHTodkMkP+Zgrr71jp2pGuyXCg03YzjK1D1NTw@mail.gmail.com&gt;
 &lt;20180529122424.GC10919@lunn.ch&gt;
 &lt;CACRpkdbem_jTe6cQwTeTi9Uhk2B88rGENePZvjbsq38mfvcs0A@mail.gmail.com&gt;
In-Reply-To: &lt;CACRpkdbem_jTe6cQwTeTi9Uhk2B88rGENePZvjbsq38mfvcs0A@mail.gmail.com&gt;
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=kevin@darbyshire-bryant.me.uk; 
x-originating-ip: [2a02:c7f:1231:2000::dc83]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR07MB4414;
 7:W/ut3kwtURbz1BRKwBSoOadcG/j6idwmamJBErerLXtMYMy/4317Js6VBNNDB7qEFqqnltZ6BYwUEbZQbKRUpii3Di4a68AHnw61hoY6RuZ6DT4EJKD9a4qoiNTIdoADFKTNIR4oUssF0lA5as//J5xWm0zecJuAC91gEhV2yy4A9Wo3VIsPJtYOU4oxsrG9n9S66VlEfioSYnKDgjBdHdIpn//qQv4BvpPEUnCQfi1C+/NoL053YXujp7ep7wFs
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-microsoft-antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(49563074)(7193020);
 SRVR:VI1PR07MB4414; 
x-ms-traffictypediagnostic: VI1PR07MB4414:
x-microsoft-antispam-prvs: &lt;VI1PR07MB44143AF5C397E409C4A385F8A56D0@VI1PR07MB4414.eurprd07.prod.outlook.com&gt;
x-exchange-antispam-report-test: UriScan:;
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
 RULEID:(102415395)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(2016111802025)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6043046)(6072148)(201708071742011)(7699016);
 SRVR:VI1PR07MB4414; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB4414; 
x-forefront-prvs: 0687389FB0
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(366004)(396003)(39830400003)(376002)(346002)(39380400002)(199004)(189003)(86362001)(97736004)(99936001)(486006)(6512007)(6306002)(476003)(6506007)(105586002)(106356001)(25786009)(83716003)(4326008)(2616005)(7736002)(5250100002)(446003)(11346002)(81156014)(81166006)(8676002)(74482002)(966005)(6246003)(68736007)(305945005)(46003)(6116002)(6436002)(478600001)(53936002)(93886005)(39060400002)(3280700002)(186003)(3660700001)(14454004)(33656002)(2900100001)(36756003)(5660300001)(102836004)(316002)(6916009)(53546011)(8936002)(59450400001)(54906003)(76176011)(99286004)(2906002)(229853002)(82746002)(6486002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR07MB4414;
 H:VI1PR07MB4254.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; MX:3; 
received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not
 designate permitted sender hosts)
x-microsoft-antispam-message-info: ObPqbx92CNQHcVTCA4x0vybC2IRGG00FdTyTn0Tw7trHZvu6YVVCr86vMzFdSIZE4ITSM0JKzyFsUpyRlT4I7bkJtviZdo6KuOFlVY9FcsJuMnWv8L5a4UveR/xuU4EOhI405mxxGZByp9Zxc9FJ0me6mRmd7OHoRrrWizALmBW1Sdq3r1evOCHa5Maxt90G
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/signed;
 boundary=&quot;Apple-Mail=_628A51B3-63A5-4F9C-81B3-A871A5F7BECF&quot;;
 protocol=&quot;application/pgp-signature&quot;; micalg=pgp-sha256
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: 789fa636-9c24-4a75-2e68-08d5c5960eae
X-OriginatorOrg: darbyshire-bryant.me.uk
X-MS-Exchange-CrossTenant-Network-Message-Id: 789fa636-9c24-4a75-2e68-08d5c5960eae
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2018 18:57:42.3605 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB4414
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180529_115759_507366_77208406 
X-CRM114-Status: GOOD (  19.98  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [2a01:111:f400:fe09:0:0:0:602 listed in] [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid

--Apple-Mail=_628A51B3-63A5-4F9C-81B3-A871A5F7BECF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



&gt; On 29 May 2018, at 19:41, Linus Walleij &lt;linus.walleij@linaro.org&gt; =
wrote:
&gt;=20
&gt; On Tue, May 29, 2018 at 2:24 PM, Andrew Lunn &lt;andrew@lunn.ch&gt; wrote:
&gt;=20
&gt;&gt; Did you look at the switch end? I found a datasheet for the
&gt;&gt; 8366/8369. Register at 0x0050, P8GCR. It has two bits for RGMII
&gt;&gt; delays.
&gt;=20
&gt; Unfortunately this datasheet is not applicable to RTL8366RB.
&gt;=20
&gt; RTL documentation and model numbers are a complete mess
&gt; around the time when this chip came out, unfortunately... I even
&gt; started to implement using that datasheet and had to toss a bunch
&gt; of stuff away.
&gt;=20
&gt; There might not even be a proper datasheet for RTL8366RB,
&gt; I'm afraid. The best we have is different (3 different AFAICT)
&gt; vendor code drops. Here is one drop over at DD-WRT:
&gt; =
https://svn.dd-wrt.com//browser/src/linux/universal/linux-3.2/drivers/net/=
ethernet/raeth/rb
&gt;=20
&gt; As you can see, the RTL8366RB vendor driver consists of
&gt; a hacked version of their RTL8368S driver, so apparently those
&gt; two ASICs are similar, they even kept the same filenames.
&gt;=20
&gt; For example the register defintions:
&gt; =
https://svn.dd-wrt.com/browser/src/linux/universal/linux-3.2/drivers/net/e=
thernet/raeth/rb/rtl8368s_reg.h
&gt;=20
&gt;&gt; With RGMII delays, you have 3 'choices'.
&gt;&gt;=20
&gt;&gt; 1) The hardware design includes the delay, by zig-zagging the clock
&gt;&gt; line to make it longer.
&gt;&gt; 2) The 'MAC' side does the delay.
&gt;&gt; 3) The 'PHY' side does the delay.
&gt;&gt;=20
&gt;&gt; I normally recommend the PHY side doing it, because that's what most
&gt;&gt; board do. Gives us some consistency. But it does not really
&gt;&gt; matter. Just make sure one side, and only once side is inserting the
&gt;&gt; delays.
&gt;=20
&gt; Makes sense! But I haven't found anything applicable in the
&gt; RTL8366RB registers.
&gt;=20
&gt; There are some jam tables with magic values written all over
&gt; the place that have no documentation, I fear this is one of the
&gt; settings poked around with there.
&gt;=20
&gt; However, even if this router did not come with any code for
&gt; the RTL8366RB driver, I disassembled the binary to verify
&gt; that they use the same magic jam table, so the ASIC is
&gt; initialized in the same way.
&gt;=20
&gt; Yours,
&gt; Linus Walleij
&gt;=20
&gt; _______________________________________________
&gt; openwrt-devel mailing list
&gt; openwrt-devel@lists.openwrt.org
&gt; https://lists.openwrt.org/listinfo/openwrt-devel

Oh lordy, that horrible device as exhibited in the netgear DGN3500.  =
Talk about magic values =
https://git.openwrt.org/?p=3Dopenwrt/openwrt.git;a=3Dcommit;h=3D42120bd7f3=
23ff7170b32a5fd4674babd8b184bc

Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A


--Apple-Mail=_628A51B3-63A5-4F9C-81B3-A871A5F7BECF
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEASyssijGxT6XdZEjs6I4m53iM0oFAlsNoqQACgkQs6I4m53i
M0pJNA/+Od2eT3vru2ww8uwxLGEc0n4TPEnWufIVHaX83WqWS5HkH6W+aezT/vpV
unct87I0p8w+wYuIP0ckXXIU9LyFwKtcqW6qcHvAwJ98JpX6fXqXSvP4R79zjNBx
mKI1jqTgaNubAiF7mjbmTxzftYZTsbDv5W8YysK9MBbWfWgu469RtJ24kqCyG9z2
00/CA1y8fcFQ3k7Yc2UD4Vsv8eiIplwmFySGsfps+rbVUrsWWlsAZxoDyDaQueKi
LSFmGdAhCYTGUZPb5NJifcQZvpFrx99xKJVWBDOmWntnzucptbS7mlIED3peRfrg
ypwRJMzqWTx8o4tqAaGBXDbYb9M6V1d+B/0d5DNxyXIhqI5oXzyvWQ0Grtywt7k7
wSoVtpQafuBFR2gZYWdhEB444mKWVvTGkB1kDbfXkd4IwtRGQ2n/Iev+gteDVzTn
XRHDqbqM9XMjvlGrrKf2KHsWav2ndELZXSwqn33EArK+c5ruAEhDDfrrhovW5ayE
N5mFdDrBcr1lmr45dcxZ6uN16zbwnwCYMII7X26VWL8mgPnxHBpPdNCIKSIfXjkm
XUqn4vNSB4oHkvvd4LZe5CZSbsnxiIpWdUvA5tzQu2vKg/sj4tZojg1/8u4abf7i
ZDQeOYFGJT4w/0iXr57yy7nBPC5XF4NV5DvxqCuFV54aBGmMRVw=
=jI5V
-----END PGP SIGNATURE-----

--Apple-Mail=_628A51B3-63A5-4F9C-81B3-A871A5F7BECF--

]