Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2579736ybi; Sun, 9 Jun 2019 15:31:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLq7MMgojITCjTO1lGV1iAWHLOgO7LKBDGXbLqBer1Fa2d/xQImD81xi3kJCD/6X4Fi6N3 X-Received: by 2002:a65:5203:: with SMTP id o3mr12942859pgp.379.1560119470425; Sun, 09 Jun 2019 15:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560119470; cv=none; d=google.com; s=arc-20160816; b=UNrNKHwTsJ4Aalrrb1S3UnBYuCRDTat6dPmH/7EVKPCn46olreA/2ViwlgAFZrr1j/ zaOuvKZ3ylPyWcHbb8J4xecBA8nQE5NERI3stsQBEto0EqMQxhrObGix1JsYVButiiNf 1piYMAMmcRVrPrEB35FQURH3UTa/4nkXwZgDH0u6SJ819xMQarq3oqLstbmFerOM5t0H XzKnahbGGn/bQ4SznwVBlhMybGoP1NOMBGvgIdwX8PDP6HryrmHZRT+U+DSmZiYQffhf sZR14ZmwRLIYgvm2Da4fLrhb+PPlcsDyRysqMo7E1skFyGREgnrL7mbizQo/3g0TC4Dv mLEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sePl1BxoH8M2Ag9hWKHMM9PC7HT35mw+FBXMYc8ap6c=; b=TnqshbZiY1CN9s5K2tui6kjS62ATkg7J7yH2rPaAA4c99bOpER5KhxSfluEYAzq0bW g1RHQ3IxujGQ3/tBKdVTQambv8NAgTtjQw9r49MsQ1iOfHIc/9Ni44myHC/eEZytG9bs G2WGeWM4WjYqK9eQj0NNBkTkMurrVeYyGPeYHSnsDl5CY5Cvr4NqCLmNVS5UOHERx84B ZWHVxjOpVLpwurNnO98RghkkYYFtmi5HWokkAimBkZB02R/GT+7WacDmFGJM8lZAq/0T fl1S7Xiqe7yYTYz+gs2fRCToJKdobAoy6nlRUlQmwUS4K/pHnJilR2rB4bfZLkZd9x4o MHwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=Yw5lxz2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si536772pgj.573.2019.06.09.15.30.43; Sun, 09 Jun 2019 15:31:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=Yw5lxz2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729777AbfFIW3D (ORCPT + 99 others); Sun, 9 Jun 2019 18:29:03 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:35462 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729529AbfFIW3C (ORCPT ); Sun, 9 Jun 2019 18:29:02 -0400 Received: by mail-ot1-f66.google.com with SMTP id j19so6630701otq.2; Sun, 09 Jun 2019 15:29:02 -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=sePl1BxoH8M2Ag9hWKHMM9PC7HT35mw+FBXMYc8ap6c=; b=Yw5lxz2MiGWV6OwbaX63dQW+cirM/W4o6b7Xia0ej4yEhpRzVI0DltV0GAL7UAgwaM 91vcaOnjNUJVMHrChqbrsdrWY1l2Pa5hrSha6gqLWFmHolBLQThdwquKORq0rFPGJTEn gZn4TkcAPDzh40IsgK0PORqVgyrCwVi4/QyzPw03MCCouiZZuHfzu16PhSjZnuX7pkA7 eJ0xRRqfgEK1OJNXktIsRvAD4kIC/8m+yQgBfYmzQnLkefvqmaESBfZ+7XJoqqfzlx87 i0dDU/jG2ZRsV61cQKa9bl8ip8+MV72DncqyaXYNGoJxCZHJLUbY0n7nRGhZ/GjAfjKk ZZ5w== 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=sePl1BxoH8M2Ag9hWKHMM9PC7HT35mw+FBXMYc8ap6c=; b=cR80pgrn0UQWgQDdgj8MjyJmrz/5D/5MVj0MVFZVX8HowBATlpqGds+JGdeqKlHiYk 0vQJj+i7W3sHI6PfCFDk7sFPE20kIsIUmV81XlLo7RigPpZIi77/ZH2VKn0sdx/4eaGU hkTn5CS0pvZmmm7Sun1XmUQ7DR1VTU6Utnf0m8xiAVwZBuGN0HF6bOE2wOKHzVNqde98 +uNBu3bfU0zvoAbwYXRlsVAgdzw9efu6/SiEuNPupu48qb535mh0V35HU8TazAPMlizy LDrylnZDkyTbiDME0P5pRnrJJUsyE9I/wt4P1jtzoF0xofotUiZjsvZ/9JR8geWODFlb fUdA== X-Gm-Message-State: APjAAAWGcNpDgAAeW+QGYH3vQxwL6PDjFi6XyV5izyqN1rwBI8lsU7/n kB4NoZxbDhV2eGyWK0mSj1gFp46zhrijnVcGdW4= X-Received: by 2002:a9d:6405:: with SMTP id h5mr16693612otl.42.1560119341436; Sun, 09 Jun 2019 15:29:01 -0700 (PDT) MIME-Version: 1.0 References: <20190609180621.7607-1-martin.blumenstingl@googlemail.com> <20190609180621.7607-6-martin.blumenstingl@googlemail.com> In-Reply-To: From: Martin Blumenstingl Date: Mon, 10 Jun 2019 00:28:50 +0200 Message-ID: Subject: Re: [RFC next v1 5/5] arm64: dts: meson: g12a: x96-max: fix the Ethernet PHY reset line To: Linus Walleij Cc: netdev , "open list:GPIO SUBSYSTEM" , "open list:ARM/Amlogic Meson..." , Bartosz Golaszewski , Giuseppe CAVALLARO , Alexandre TORGUE , Jose Abreu , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "David S. Miller" , Linux ARM , "linux-kernel@vger.kernel.org" , Kevin Hilman , Neil Armstrong Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On Mon, Jun 10, 2019 at 12:06 AM Linus Walleij wrote: > > On Sun, Jun 9, 2019 at 11:36 PM Martin Blumenstingl > wrote: > > > > If "snps,reset-active-low" was set it results in the sequence 1, 0, 1 > > > if it is not set it results in the sequence 0, 1, 0. > > > > I'm changing this logic with earlier patches of this series. > > can you please look at these as well because GPIO_OPEN_SOURCE doesn't > > work with the old version of stmmac_mdio_reset() that you are showing. > > OK but the logic is the same, just that the polarity handling is moved > into gpiolib. > > > > The high (reset) is asserted by switching the pin into high-z open drain > > > mode, which happens by switching the line into input mode in some > > > cases. > > > > > > I think the real reason it works now is that reset is actually active high. > > > > let me write down what I definitely know so far > > > > the RTL8211F PHY wants the reset line to be LOW for a few milliseconds > > to put it into reset mode. > > driving the reset line HIGH again takes it out of reset. > > > > Odroid-N2's schematics [0] (page 30) shows that there's a pull-up for > > the PHYRSTB pin, which is also connected to the NRST signal which is > > GPIOZ_15 > > Looks correct, R143 is indeed a pull up indicating that the line is > open drain, active low. good so far > > > It makes a lot of sense, since if it resets the device when set as input > > > (open drain) it holds all devices on that line in reset, which is likely > > > what you want as most GPIOs come up as inputs (open drain). > > > A pull-up resistor will ascertain that the devices are in reset. > > > > my understanding is that the pull-up resistor holds it out of reset > > driving GPIOZ_15's (open drain) output LOW pulls the signal to ground > > and asserts the reset > > Yep that seems correct. > > Oh I guess it is this: > > amlogic,tx-delay-ns = <2>; > - snps,reset-gpio = <&gpio GPIOZ_14 0>; > + snps,reset-gpio = <&gpio GPIOZ_15 GPIO_OPEN_SOURCE>; > snps,reset-delays-us = <0 10000 1000000>; > - snps,reset-active-low; > > Can you try: > snps,reset-gpio = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; > ? I tried it and it works! > Open source is nominally (and rarely) used for lines that are active high. > For lines that are active low, we want to use open drain combined > with active low. thank you for the explanation - I'll take your version for v2 :) Martin