Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp855910ybe; Wed, 11 Sep 2019 05:55:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPhLmVA0Q0pag6r9bq8lM5vSSDyY7+DNcoABvG+KCrIBBpviriyzKdumw1aHN4IB+ECEhT X-Received: by 2002:a05:6402:1606:: with SMTP id f6mr29105067edv.92.1568206509189; Wed, 11 Sep 2019 05:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568206509; cv=none; d=google.com; s=arc-20160816; b=JF5Q6weJUF+P58026ZHTgZPWcbEvf4RaRxbBOatoUa8gOb14LwExdKXLKXhth4Ea5A 68D0d7/mApDIcGTjgEojCFLM9UhBrdKxzVz+Y/EpjTypRWvC0Smy9D6DvAz/GVGNpEUE PxcGAbm7xUMwfsR3AcxmQsajrO0IETs9UAgwCp4O6cSKMrhXqLsFBm7P79BaVeKWYr9l BPJcQ8+g9HDyHSG8PIeF2dwuIZzH/dsGsz7OKQtavP3k8TIle6AC8XpD16UAzNd+52kD tv5aHNr4QdfvH7fZgfM6K7sxiGrcgp03DjNkGqEDyt27NoYlAklZkCaU1Z3xPxguY/rt VjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=k6CWW6Ih86mSt3Oz4gKpJoOtvVw3rFoyeiGTPyVnipw=; b=yXxOA5zv+GY5rRdS74TRGlL7YbWOPDcPDaYFe/1rw9AgLFEY+L9dcgepcx6rAfHyfN NXKzfflf53L1klQ5P1TicAobF5EV9Pz102QEaZmJTDoBPUf9Jr6tSmHCQUbD5Us5arHJ ctM3j8yOCPFoVJdMW7t7gFVbVBG0jtzOpFB4iyzFyEi6xERiMgDpD4SUeJJNY2xDg6OR nY9fhPRlZaRmG2o7aC6OhCS+PNO6X3I39KgQRaMaeMQGrnRw6l6KXQGz18iLeEasVyTu hhByMOABNzt9H2dTgm/mHVPY8TjsN+dhXkMFjbkdeauDe5f25u6JfBgiFcDJ30R3l/Vt ZYQg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33si12120322edz.314.2019.09.11.05.54.44; Wed, 11 Sep 2019 05:55:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbfIKMuj (ORCPT + 99 others); Wed, 11 Sep 2019 08:50:39 -0400 Received: from foss.arm.com ([217.140.110.172]:47004 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727093AbfIKMuj (ORCPT ); Wed, 11 Sep 2019 08:50:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B50C1000; Wed, 11 Sep 2019 05:50:38 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 021F23F59C; Wed, 11 Sep 2019 05:50:37 -0700 (PDT) Date: Wed, 11 Sep 2019 13:50:36 +0100 From: Andrew Murray To: Neil Armstrong Cc: khilman@baylibre.com, bhelgaas@google.com, lorenzo.pieralisi@arm.com, yue.wang@Amlogic.com, kishon@ti.com, repk@triplefau.lt, maz@kernel.org, linux-amlogic@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] arm64: dts: khadas-vim3: add commented support for PCIe Message-ID: <20190911125035.GU9720@e119886-lin.cambridge.arm.com> References: <1567950178-4466-1-git-send-email-narmstrong@baylibre.com> <1567950178-4466-7-git-send-email-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1567950178-4466-7-git-send-email-narmstrong@baylibre.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 08, 2019 at 01:42:58PM +0000, Neil Armstrong wrote: > The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential > lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between > an USB3.0 Type A connector and a M.2 Key M slot. > The PHY driving these differential lines is shared between > the USB3.0 controller and the PCIe Controller, thus only > a single controller can use it. > > The needed DT configuration when the MCU is configured to mux > the PCIe/USB3.0 differential lines to the M.2 Key M slot is > added commented and may uncommented to disable USB3.0 from the *and may be* > USB Complex and enable the PCIe controller. > > Signed-off-by: Neil Armstrong > --- > .../amlogic/meson-g12b-a311d-khadas-vim3.dts | 22 +++++++++++++++++++ > .../amlogic/meson-g12b-s922x-khadas-vim3.dts | 22 +++++++++++++++++++ > .../boot/dts/amlogic/meson-khadas-vim3.dtsi | 4 ++++ > .../dts/amlogic/meson-sm1-khadas-vim3l.dts | 22 +++++++++++++++++++ > 4 files changed, 70 insertions(+) > > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dts > index 3a6a1e0c1e32..0577b1435cbb 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dts > +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dts > @@ -14,3 +14,25 @@ > / { > compatible = "khadas,vim3", "amlogic,a311d", "amlogic,g12b"; > }; > + > +/* > + * The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential > + * lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between > + * an USB3.0 Type A connector and a M.2 Key M slot. > + * The PHY driving these differential lines is shared between > + * the USB3.0 controller and the PCIe Controller, thus only > + * a single controller can use it. > + * If the MCU is configured to mux the PCIe/USB3.0 differential lines > + * to the M.2 Key M slot, uncomment the following block to disable > + * USB3.0 from the USB Complex and enable the PCIe controller. > + */ > +/* > +&pcie { > + status = "okay"; > +}; > + > +&usb { > + phys = <&usb2_phy0>, <&usb2_phy1>; > + phy-names = "usb2-phy0", "usb2-phy1"; > +}; I assume there is no way other way to determine from the hardware which way the mux is set? Otherwise phy_g12a_usb3_pcie_xlate could determine the hardware mode, and reject the phy instance with the wrong mode. Thus resulting in either the PCI or USB to fail their probe. And avoiding the need to modify the DT on boot. Thanks, Andrew Murray > + */ > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-khadas-vim3.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-khadas-vim3.dts > index b73deb282120..1ef5c2f04f67 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-khadas-vim3.dts > +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x-khadas-vim3.dts > @@ -14,3 +14,25 @@ > / { > compatible = "khadas,vim3", "amlogic,s922x", "amlogic,g12b"; > }; > + > +/* > + * The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential > + * lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between > + * an USB3.0 Type A connector and a M.2 Key M slot. > + * The PHY driving these differential lines is shared between > + * the USB3.0 controller and the PCIe Controller, thus only > + * a single controller can use it. > + * If the MCU is configured to mux the PCIe/USB3.0 differential lines > + * to the M.2 Key M slot, uncomment the following block to disable > + * USB3.0 from the USB Complex and enable the PCIe controller. > + */ > +/* > +&pcie { > + status = "okay"; > +}; > + > +&usb { > + phys = <&usb2_phy0>, <&usb2_phy1>; > + phy-names = "usb2-phy0", "usb2-phy1"; > +}; > + */ > diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi > index 8647da7d6609..eac5720dc15f 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi > +++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi > @@ -246,6 +246,10 @@ > linux,rc-map-name = "rc-khadas"; > }; > > +&pcie { > + reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>; > +}; > + > &pwm_ef { > status = "okay"; > pinctrl-0 = <&pwm_e_pins>; > diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts > index 5233bd7cacfb..d9c7cbedce53 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts > +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts > @@ -68,3 +68,25 @@ > clock-names = "clkin1"; > status = "okay"; > }; > + > +/* > + * The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential > + * lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between > + * an USB3.0 Type A connector and a M.2 Key M slot. > + * The PHY driving these differential lines is shared between > + * the USB3.0 controller and the PCIe Controller, thus only > + * a single controller can use it. > + * If the MCU is configured to mux the PCIe/USB3.0 differential lines > + * to the M.2 Key M slot, uncomment the following block to disable > + * USB3.0 from the USB Complex and enable the PCIe controller. > + */ > +/* > +&pcie { > + status = "okay"; > +}; > + > +&usb { > + phys = <&usb2_phy0>, <&usb2_phy1>; > + phy-names = "usb2-phy0", "usb2-phy1"; > +}; > + */ > -- > 2.17.1 >