lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Feb 2019 08:07:45 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>
CC:     netdev@...r.kernel.org,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Mylène Josserand <mylene.josserand@...tlin.com>
Subject: Re: Handling an Extra Signal at PHY Reset



On February 19, 2019 1:14:20 AM PST, Paul Kocialkowski <paul.kocialkowski@...tlin.com> wrote:
>Hi,
>
>We are dealing with an Ethernet PHY (Marvell 88E1512) that comes with a
>CONFIG pin that must be connected to one of the other pins of the PHY
>to configure the LSB of the PHY address as well as I/O voltages (see
>section 2.18.1 Hardware Configuration of the datasheet). It must be
>connected "soon after reset" for the PHY to be correctly configured.

Even voltage? What guarantees do you have that you are not reducing the lifetime of your pads if e.g.: you are configured for 3.3V while the other end is 1.8/2.5V? Is there some kind of embedded voltage comparator that can be used to help making the right decision?


>
>We have a switch for connecting the CONFIG pin to the other pin (LED0),
>which needs to be controlled by Linux. The CONFIG pin seems to be used
>for a PTP clock the rest of the time.
>
>So we are wondering how to properly represent this case, especially on
>the device-tree side.
>
>The trick here is that this step is necessary before the PHY can be
>discovered on the MDIO bus (and thus the PHY driver selected) so we
>can't rely on the PHY driver to do this. Basically, it looks like we
>need to handle this like the reset pin and describe it at the MDIO bus
>level.
>
>Here are some ideas for potential solutions:
>- Allowing more than a single GPIO to be passed to the MDIO bus' reset-
>gpios via device-tree and toggling all the passed GPIOs at once;

That would be a mis-representstion of the HW though, since the reset line is tied to the PHY package. Making use of the current implementation details to put a second reset line does not sound great.

>
>- Adding a new optional GPIO for the MDIO bus dedicated to controlling 
>switches for such config switching, perhaps called "config-gpios"
>(quite a narrow solution);

Indeed, and still has the same design flaw as 1) outline above.

>
>- Adding a broader power sequence description to the MDIO bus (a bit
>like it's done with the mmc pwrseq descriptions) which would allow
>specifying the toggle order/delays of various GPIOs (would probably be
>the most extensive solution);

That one looks the most compelling and future proof although I do wonder how many people would make use of that.

>
>- Adding the extra GPIO control to the MAC description and toggling it
>through bus->reset (probably the less invasive solution for the core
>but not very satisfying from the description perspective, since this is
>definitely not MAC-specific).
>
>What do you think about how we could solve this issue?
>Do you see other options that I missed here?

You could explore having the MDIO bus layer scan its children nodes (PHY nodes) and handle properties in there before registering devices, so for insurance your PHY DT nodes can have an arbitrary number of reset lines, power sequencing properties etc. and the MDIO bus layer knowing it's internal implementation does make sure that it makes use of these properties in order to make PHY devices functional.

Does that make sense? One possible caveat is that the CONFIG pin also dictates the address on the bus, so what do we do with the PHY's "reg" property, is it it's actual address or is it the desired one that we should configure through reset?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ