From patchwork Tue Jan 28 17:11:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Jardim X-Patchwork-Id: 1230450 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bDxItFEq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 486Y711PG1z9sNx for ; Wed, 29 Jan 2020 04:11:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB5FC81AA3; Tue, 28 Jan 2020 18:11:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bDxItFEq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A6FD81AAF; Tue, 28 Jan 2020 18:11:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2AFC28194E for ; Tue, 28 Jan 2020 18:11:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jardim.c.pedro@gmail.com Received: by mail-vs1-xe30.google.com with SMTP id r18so8556892vso.5 for ; Tue, 28 Jan 2020 09:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=IsyhraZD/lU/DIZybXBXQxilzjzlEpBuZGSRA33eB18=; b=bDxItFEqsYpLkRgrCIFLL1K9dGOUJWhlXIZv1XkkvqSuYJTkO3Wa00zh37GTuPelvn ObGVjCeR9GSZjYB1JnImPjzcFNc+ymv9SPq+wJlmU68WgZs72GPy99n2DJVssC2UIuNB 3N7iclnMvL8Y2krcNKAyAvuJ466Ig1HBYIb3eIxJH+4hN5Oh6B8+mjQ3WcdjNF2npS2M ZBZVi3M3ZvcEozt/Xa82RKXDNsTWtc3jQZQaOSvtDJT3bKHM00X3RC5vfpMPa1ADwdAq aGt6Vg5Zhv3PtsSUR7ry5uo6WUMojiFjJvsiIQeMRdmHm2Ly/EK5y6Zb4Y8bhUk+eYWQ kPmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=IsyhraZD/lU/DIZybXBXQxilzjzlEpBuZGSRA33eB18=; b=uKetMtd+QqF1bCLIUcQglgufcpbXWCdGetNb5irsFylTHc/28cQgYQscdVeZJwN9Fd mkXEV3W9WexnAyGHuiPT4LZNo4zTMYD0bsojCrR0LJCKTjc+Juh/e4kHXGmE3kbkA9cy rrWzrd90OKRKEALEEe4tjvJY7MeLrZzjrBf3EvZEz5/tPYl62lHwMmlqFbjv4DdBrwan GSzsGXSLCHFN6MAm/WO0ttlM1SlPxYs8vVR9QGsKDRKyI7ETO+jZjKmT51IOxvz+MosV vZuuJCpAvRCqX7Z35awOA4Ok2I62UQwzbu6wrf37kG054cXGSZQ7/jRyAuYoWLnvuYpY 6Y1Q== X-Gm-Message-State: APjAAAUu6xsJy1/B4FRKlQioIBYhzc69iW2f6NR477FfwHQpfMbgvmOf 2h3hZ4aBa3JjKkXVbulLnJKHr3tey+R89QB1DFk= X-Google-Smtp-Source: APXvYqw0cAietAHnPtCOTHH2TEuYX+Tb+pVH/KgjEY6qc+5z0buTkQvfwaPd2s8jV6TwWq9OP/7coCoyAmWMr+c5moA= X-Received: by 2002:a05:6102:3034:: with SMTP id v20mr15341769vsa.28.1580231474625; Tue, 28 Jan 2020 09:11:14 -0800 (PST) MIME-Version: 1.0 From: Pedro Jardim Date: Tue, 28 Jan 2020 14:11:52 -0300 Message-ID: Subject: U-Boot PCI driver for mx6sxsabresd To: marex@denx.de X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Hi Marek, I saw your commit c5773ccdca8a ("pci: imx: Add iMX6SX compatible") and I've been trying to convert the PCI driver to DM_PCI on a mx6sxsabresd board. I did the following changes: --git a/arch/arm/dts/imx6sx-sdb.dtsi b/arch/arm/dts/imx6sx-sdb.dtsi index da815527a7..f5b0e9ee3f 100644 Which obtained the following output: => pci enum => pci 0 No such bus => pci 1 No such bus Before the DM conversion. Do you have any suggestions as to why the PCI device is not detected after the DM_PCI conversion? Are you able to get i.MX6SX to detect PCI devices when using DM_PCI? Thank you in advance, Pedro Jardim. --- a/arch/arm/dts/imx6sx-sdb.dtsi +++ b/arch/arm/dts/imx6sx-sdb.dtsi @@ -78,6 +78,17 @@ enable-active-high; }; + reg_pcie_gpio: regulator-pcie-gpio { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie_reg>; + regulator-name = "MPCIE_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + reg_usb_otg2_vbus: regulator@2 { compatible = "regulator-fixed"; reg = <2>; @@ -154,6 +165,14 @@ status = "okay"; }; +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie>; + reset-gpio = <&gpio2 0 GPIO_ACTIVE_LOW>; + vpcie-supply = <®_pcie_gpio>; + status = "okay"; +}; + &fec1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet1>; @@ -453,6 +472,18 @@ >; }; + pinctrl_pcie: pciegrp { + fsl,pins = < + MX6SX_PAD_ENET1_COL__GPIO2_IO_0 0x10b0 + >; + }; + + pinctrl_pcie_reg: pciereggrp { + fsl,pins = < + MX6SX_PAD_ENET1_CRS__GPIO2_IO_1 0x10b0 + >; + }; + pinctrl_peri_3v3: peri3v3grp { fsl,pins = < MX6SX_PAD_QSPI1A_DATA0__GPIO4_IO_16 0x80000000 diff --git a/configs/mx6sxsabresd_defconfig b/configs/mx6sxsabresd_defconfig index 5150e3a837..6ce7e01b5f 100644 --- a/configs/mx6sxsabresd_defconfig +++ b/configs/mx6sxsabresd_defconfig @@ -68,3 +68,4 @@ CONFIG_USB_STORAGE=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_VIDEO=y +CONFIG_DM_PCI=y diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 55aace1c6e..52aaa82fbc 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -166,12 +166,10 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #endif -#ifdef CONFIG_CMD_PCI #define CONFIG_PCI_SCAN_SHOW #define CONFIG_PCIE_IMX #define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 0) #define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 1) -#endif #define CONFIG_IMX_THERMAL