From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: b53 tags on bpi-r1 (bcm53125) Date: Fri, 29 Dec 2017 19:22:22 -0800 Message-ID: References: <7c533a63-72e5-de68-99ff-8595492993a8@scram.de> <86b7ba4c-e632-f35b-647b-fdba93f2e0ed@gmail.com> <20171122000755.Horde.TwGdUCPMaJtOjf5NBNmIJXz@webmail.scram.de> <032d2ae0-0a57-6ba5-c0a0-704bd0885202@scram.de> <20171123201445.Horde.3FbuUT5FWgWtZrA-KljDJ7W@webmail.scram.de> <514a187b-cd3d-a15c-cd28-60b0b2d49dcd@scram.de> <41ee1d36-a939-b1f0-4274-f799a96c8a2c@gmail.com> <1552ddff-4c48-689f-d941-15d5b0a52f47@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org To: Jochen Friedrich Return-path: Received: from mail-oi0-f47.google.com ([209.85.218.47]:33929 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbdL3DW0 (ORCPT ); Fri, 29 Dec 2017 22:22:26 -0500 Received: by mail-oi0-f47.google.com with SMTP id u193so29698213oie.1 for ; Fri, 29 Dec 2017 19:22:25 -0800 (PST) In-Reply-To: <1552ddff-4c48-689f-d941-15d5b0a52f47@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Le 12/29/17 à 13:56, Florian Fainelli a écrit : > Le 12/29/17 à 12:21, Florian Fainelli a écrit : >> Hi Jochen, >> >> Le 12/18/17 à 02:44, Jochen Friedrich a écrit : >>> Hi Florian, >>> >>> unfortunately, this doesn't make any difference. >>> >>> Just out of curiosity, BPI-R1 has pull-down resistors on LED6 and 7 >>> (MII_MODE0/1). However, the public available 53125U sheet doesn't >>> document these pins: >>> >>> LED[6] IMP_MODE[0] Pull-up Active low (since IMP Mode is not used) >>> LED[7] IMP_MODE[1] Pull-up Active low (since IMP Mode is not used) >>> >>> Is this MII mode maybe incompatible with Broadcom tags? >> >> AFAICT, it should not, this is largely independent from enabling >> Broadcom tags. >> >> I have now reproduced this on my BPI-R1 as well and am looking at what >> might be going wrong. > > OK, so I have been able to find out what was going on. On BCM53125 and > earlier switches, we need to do a couple of things for Broadcom tags to > be usable: > > - turn on managed mode (SM_SW_FWD_MODE) > - configure Port 8 for IMP mode (B53_GLOBAL_CONFIG, setting bit > GC_FRM_MGMT_PORT_MII) > > After doing that, I can now see the correct outgoing packets on my host, > however, the replies don't seem to be delivered to the per-port DSA > network devices, and I suspect it's because of stmmac, so I am > investigating this now. > So stmmac was indeed part of the problem. I had to clear the GMAC_CONTROL_ACS bit in GMAC_CORE_INIT in order to allow stmmac to properly receive packets, otherwise, packets were truncated to 8 bytes on reception which I assume is because the Broadcom tags may look like some sort of weird LLC/SNAP packet which was confusing the hardware. This is all working correctly now after a bunch of changes that I will submit in the next few days. Preliminary patches available here: https://github.com/ffainelli/linux/commits/stmmac-fixes Thank you very much for your patience! -- Florian