From patchwork Thu Apr 8 07:50:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1463677 X-Patchwork-Delegate: narmstrong@baylibre.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=mDTQebQ7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4FGD3n4PpDz9sRf for ; Thu, 8 Apr 2021 17:51:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD4CA80C6D; Thu, 8 Apr 2021 09:51:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="mDTQebQ7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89B9480023; Thu, 8 Apr 2021 09:50:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 ADC3380023 for ; Thu, 8 Apr 2021 09:50:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so708574wmj.2 for ; Thu, 08 Apr 2021 00:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T4UK1HGpwacgQnIR66GrbloBcdaZEV/lJ1M+Zn93Zu4=; b=mDTQebQ7ijvs2C6BIUUzZEFt+d6T6LEK+QuqoepbPvbL8ksIQ2oE0OS+J81dwCvOAu L23YkSlySnV9XCfYqPeykd4ToEBOb//7si7+mSXBDSfm3gyPa+UxnBf673XRyTRRu1X6 odD3RSQvRzLOQypzEZQPg06QmkxaHrMAhTheykmeOCV5ZzJHDNx73K3RyQ5ggqQIzI75 UpuuK6qAEFSdnGQ6mr8GGN7cEQDqRwdkvnlLmHzZA0N9mY+14PxHwA+QDVPzLbAEU3k7 i+wsg8dn957maysx8n69nveFfjK6q2j8MNXrvweL9qXwqGByBrD55SlZB1hwFRI+vNHQ DIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T4UK1HGpwacgQnIR66GrbloBcdaZEV/lJ1M+Zn93Zu4=; b=P98MewuxbrJemccu/e6QV3ja+ONenVxckGALLCVbNX+1eb1a9vRkWZsqHtwEsctMBg 0tpZcirtRh6KfBE+UQjZNvOHMDUjFfdS74d9hNFsTU1wIai0JSYjVTefvdE8jABeqP2d ERL8Qt5MPCe+hhdGegacMkulYFXzlnSMZKfyTma9sS5CPGd+tusHJ0oCE0rHpT8Uq4pm z882p91kdzCdZYDJ7pJQsjmNPpoZz2RBlz7Ez9bHb61pZ2FzwVFpU8a9+c/9uMtYQ1OX pBOMUwElncS0AdhJrUSvZp5uXVazo/KG7KNECfKbo7cxHEpSM9mQiGfe/OYv3yih2zvz M96A== X-Gm-Message-State: AOAM531p64CCJxT0j3j41lBe8fP8uqOVL+5G99szEjaDQTgxgIJ7Yiil Zj4YKJgVQIJzvNpaf0JdvolL+jWE8QyejtFI X-Google-Smtp-Source: ABdhPJzRMCJsuUA5gbcFuQ3fKM+X42XXTnyaqIW80k0lrk65HaIa66e82WV1yFjDxrXmsruFrx2Y9g== X-Received: by 2002:a1c:23c7:: with SMTP id j190mr6999415wmj.130.1617868251903; Thu, 08 Apr 2021 00:50:51 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad93:e492:9542:d59a]) by smtp.gmail.com with ESMTPSA id d7sm14954249wrw.63.2021.04.08.00.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 00:50:51 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH 1/5] clk: meson-g12a: add PCIe gates Date: Thu, 8 Apr 2021 09:50:43 +0200 Message-Id: <20210408075047.4076954-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408075047.4076954-1-narmstrong@baylibre.com> References: <20210408075047.4076954-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Add missing gates used for PCIe. Signed-off-by: Neil Armstrong --- drivers/clk/meson/g12a.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index 5058db1a47..e4fed8ddfb 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -120,7 +120,9 @@ static struct meson_gate gates[NUM_CLKS] = { MESON_GATE(CLKID_SD_EMMC_C, HHI_GCLK_MPEG0, 26), MESON_GATE(CLKID_ETH, HHI_GCLK_MPEG1, 3), MESON_GATE(CLKID_UART1, HHI_GCLK_MPEG1, 16), + MESON_GATE(CLKID_PCIE_COMB, HHI_GCLK_MPEG1, 24), MESON_GATE(CLKID_USB, HHI_GCLK_MPEG1, 25), + MESON_GATE(CLKID_PCIE_PHY, HHI_GCLK_MPEG1, 27), MESON_GATE(CLKID_HTX_PCLK, HHI_GCLK_MPEG2, 4), MESON_GATE(CLKID_USB1_DDR_BRIDGE, HHI_GCLK_MPEG2, 8), MESON_GATE(CLKID_VPU_INTR, HHI_GCLK_MPEG2, 25), From patchwork Thu Apr 8 07:50:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1463678 X-Patchwork-Delegate: narmstrong@baylibre.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=j9kDlhiK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4FGD4351kQz9sRf for ; Thu, 8 Apr 2021 17:51:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 945D38179F; Thu, 8 Apr 2021 09:51:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="j9kDlhiK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1653181692; Thu, 8 Apr 2021 09:51:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 C2247805B4 for ; Thu, 8 Apr 2021 09:50:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id g66-20020a1c39450000b0290125d187ba22so93393wma.2 for ; Thu, 08 Apr 2021 00:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tb8M8QOEl257nH/eabm+ltI7boDH6IICiso7Y/HTfJo=; b=j9kDlhiKoniVlKB01rBVA3NcffhPRq8wizcvSdHKW56YU13isov09JKz4rrr6mFnTu 12aaMXFnXC7VyGqwlErPl8K4pOmvgiObEsUVbd1SiYMJf3rXq8dqUyv3TSmeU8rjoeUR Ki6ZVQ/cJVPc4UR/jFapT7WLj/SNxJF/zqykNV8eqqkypIY5Zs62weB0G7cfUoBwwQ02 M7affNWjdD/vd3nxYuBkmkk9jczLIQJ5+U7SZAkZ6JZtQVhxPwIHKJFDvpTPBEUQ4ksS NNGYbI32+17Tu3UYW8tTnLpHy+2ImSkX/e12Hli95Gw1HXGH+aZL5TOnp4cGgwaglC5E L5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tb8M8QOEl257nH/eabm+ltI7boDH6IICiso7Y/HTfJo=; b=RoUtV6QGDWTpdtQzP/M2QhlcJZRsUE+8hYjSJ5aXM4R07VFkqxx3PgiRCipvPKD4C2 PRViXQ9MuJnViMeqf76PhHG6/UYEPFQr960p0zZsA1xTLD6NkdQ3ZY2tbEodJKYhuEYf 6KEfhVCbJhSawsl0kzqCq5XuNpKslStDubWq6InxmZMsN1FxV4kOb5Mw5QjbVnxjsTXm QFx/lgn79FK0r8l0vBMcRcRmlQTQS25ZQUbv+UiRC4X0tcHT13Al1opoeq8YTzV3nrnl njVqmTKXoIM2odTYzmtxNjW5zLruxHWkSeK0vNypZXbAuNTjGBgX/XmDJ8otb06Q7EGE VfIw== X-Gm-Message-State: AOAM530QhjGVa9n+3nB3rVXxGk5Ugm2knFV4imwl++e4ztxuOehN34Es KcSbEBe3CFlMArhinkuqsuCY/qbAlSUa27qw X-Google-Smtp-Source: ABdhPJzOjxEUSNdJzC21DdWWe24rzgqRlY9/N2mB7gqJS0/cFNI84bUgIIKjMzLMuuGN/lz9h+fqpw== X-Received: by 2002:a1c:1d4c:: with SMTP id d73mr6773063wmd.70.1617868252963; Thu, 08 Apr 2021 00:50:52 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad93:e492:9542:d59a]) by smtp.gmail.com with ESMTPSA id d7sm14954249wrw.63.2021.04.08.00.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 00:50:52 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH 2/5] phy: meson-g12a-usb3-pcie: add support for PCIe ops Date: Thu, 8 Apr 2021 09:50:44 +0200 Message-Id: <20210408075047.4076954-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408075047.4076954-1-narmstrong@baylibre.com> References: <20210408075047.4076954-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Add the PCIe part of the G12A USB3 PCIe Combo PHY driver. Signed-off-by: Neil Armstrong --- drivers/phy/meson-g12a-usb3-pcie.c | 81 ++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/drivers/phy/meson-g12a-usb3-pcie.c b/drivers/phy/meson-g12a-usb3-pcie.c index 0433d93474..8f72b5a6a7 100644 --- a/drivers/phy/meson-g12a-usb3-pcie.c +++ b/drivers/phy/meson-g12a-usb3-pcie.c @@ -23,6 +23,9 @@ #include #include +#define PHY_TYPE_PCIE 2 +#define PHY_TYPE_USB3 4 + #define PHY_R0 0x00 #define PHY_R0_PCIE_POWER_STATE GENMASK(4, 0) #define PHY_R0_PCIE_USB3_SWITCH GENMASK(6, 5) @@ -55,6 +58,8 @@ #define PHY_R5_PHY_CR_ACK BIT(16) #define PHY_R5_PHY_BS_OUT BIT(17) +#define PCIE_RESET_DELAY 500 + struct phy_g12a_usb3_pcie_priv { struct regmap *regmap; #if CONFIG_IS_ENABLED(CLK) @@ -202,8 +207,6 @@ static int phy_meson_g12a_usb3_init(struct phy *phy) unsigned int data; int ret; - /* TOFIX Handle PCIE mode */ - ret = reset_assert_bulk(&priv->resets); udelay(1); ret |= reset_deassert_bulk(&priv->resets); @@ -296,9 +299,79 @@ static int phy_meson_g12a_usb3_exit(struct phy *phy) return reset_assert_bulk(&priv->resets); } +static int phy_meson_g12a_usb3_pcie_init(struct phy *phy) +{ + if (phy->id == PHY_TYPE_USB3) + return phy_meson_g12a_usb3_init(phy); + + return 0; +} + +static int phy_meson_g12a_usb3_pcie_exit(struct phy *phy) +{ + if (phy->id == PHY_TYPE_USB3) + return phy_meson_g12a_usb3_exit(phy); + + return 0; +} + +static int phy_meson_g12a_usb3_pcie_power_on(struct phy *phy) +{ + struct phy_g12a_usb3_pcie_priv *priv = dev_get_priv(phy->dev); + + if (phy->id == PHY_TYPE_USB3) + return 0; + + regmap_update_bits(priv->regmap, PHY_R0, + PHY_R0_PCIE_POWER_STATE, + FIELD_PREP(PHY_R0_PCIE_POWER_STATE, 0x1c)); + + return 0; +} + +static int phy_meson_g12a_usb3_pcie_power_off(struct phy *phy) +{ + struct phy_g12a_usb3_pcie_priv *priv = dev_get_priv(phy->dev); + + if (phy->id == PHY_TYPE_USB3) + return 0; + + regmap_update_bits(priv->regmap, PHY_R0, + PHY_R0_PCIE_POWER_STATE, + FIELD_PREP(PHY_R0_PCIE_POWER_STATE, 0x1d)); + + return 0; +} + +static int phy_meson_g12a_usb3_pcie_reset(struct phy *phy) +{ + struct phy_g12a_usb3_pcie_priv *priv = dev_get_priv(phy->dev); + int ret; + + if (phy->id == PHY_TYPE_USB3) + return 0; + + ret = reset_assert_bulk(&priv->resets); + if (ret) + return ret; + + udelay(PCIE_RESET_DELAY); + + ret = reset_deassert_bulk(&priv->resets); + if (ret) + return ret; + + udelay(PCIE_RESET_DELAY); + + return 0; +} + struct phy_ops meson_g12a_usb3_pcie_phy_ops = { - .init = phy_meson_g12a_usb3_init, - .exit = phy_meson_g12a_usb3_exit, + .init = phy_meson_g12a_usb3_pcie_init, + .exit = phy_meson_g12a_usb3_pcie_exit, + .power_on = phy_meson_g12a_usb3_pcie_power_on, + .power_off = phy_meson_g12a_usb3_pcie_power_off, + .reset = phy_meson_g12a_usb3_pcie_reset, }; int meson_g12a_usb3_pcie_phy_probe(struct udevice *dev) From patchwork Thu Apr 8 07:50:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1463680 X-Patchwork-Delegate: narmstrong@baylibre.com 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; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=Cz+mqlgO; 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 4FGD4m08tJz9sRf for ; Thu, 8 Apr 2021 17:52:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 85F3F81CDE; Thu, 8 Apr 2021 09:52:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="Cz+mqlgO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9619281743; Thu, 8 Apr 2021 09:51:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 AC65C80C78 for ; Thu, 8 Apr 2021 09:50:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x330.google.com with SMTP id 5-20020a05600c0245b029011a8273f85eso707398wmj.1 for ; Thu, 08 Apr 2021 00:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jcc0oYrKoBrDbwqyVm5pzOtSyAFTFpTZBjmPgAUYSvU=; b=Cz+mqlgOEPN+C6uV3HjA5QqYSNbtsj4NW4fDbxQBcc+Oyh6jkB1NHzGiUlVpfgPDYY YImcIkBi6wUAZNstLBtyEzz/hgMeU2vx7JMGQgbS9ucBi7aNlT9DOHuj9ipjlRC8UA7e lqu8+h0/nnwStMYzMycjELgS87wX/mox1TMishvEH3s0yIpMhrVoUTnlMLV+12yjU0Jt qh9WJ0WRoJrJlRIoiAalhisTBn7QnaOkzvF43RT8BA7mZCvLJlxKARBfaVOcTCNCXhUW QiMrBvRtdQNRiBsaTrARK1yBW7wKafpI87KBeYWByyyt7dyl7JI7X7gxxl3rlOk6Pfjr 4kyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jcc0oYrKoBrDbwqyVm5pzOtSyAFTFpTZBjmPgAUYSvU=; b=HFCj8cYN/z/v9ZQQAtZf0gMPuEX4HzimnyGQj+hWxKpB1+hZ4DzmVejE0oIpCSK6Sk oaBbIO51U3k0P8npPSxLQZV3kRzMQPklcTBpkpVvz0aWEp7vvM9kXw0mga03ngnaWGR5 U7sj0as5HlzzXG58TROvodTdRubIA1AI3pUBwTsHX4HeDnFryuOnuX66NquHnu1S+WSs tjW2J0EOhitOEJGckhQx7PsiwrKxYaZAFG+NrTjMaIsA3VF8LQLaSD5A/H11UKxG46CN SFjbzYqTYZSsWuRbqDIRXFxAgeCUexnY4pEdFQfFheYOKdsLSsLjfqjxIZi9/FPoE4fy MHTA== X-Gm-Message-State: AOAM532t466ucOhM0/0G0Sw9JHqePrHwJfzHIpPEMt0CcgeV+wiO/LQ7 sqPNQeA8KX5BUWwxd/ZkoDdbtd/FzIVeFSqK X-Google-Smtp-Source: ABdhPJzJZDNODPdDUWY+kOaNFrS9zQ27qOqmccsonIRlnSzGiQZz1QJTo+6E5yBqx/yXOCh+16udFA== X-Received: by 2002:a7b:ca44:: with SMTP id m4mr6944242wml.103.1617868253927; Thu, 08 Apr 2021 00:50:53 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad93:e492:9542:d59a]) by smtp.gmail.com with ESMTPSA id d7sm14954249wrw.63.2021.04.08.00.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 00:50:53 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH 3/5] arm: dts: meson-khadas-vim3: enable PCIe in U-boot Date: Thu, 8 Apr 2021 09:50:45 +0200 Message-Id: <20210408075047.4076954-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408075047.4076954-1-narmstrong@baylibre.com> References: <20210408075047.4076954-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Enable PCIe by default in u-boot, this should eventually be made dynamic in the runtime board config depending on the MCU configuration. Signed-off-by: Neil Armstrong --- arch/arm/dts/meson-khadas-vim3-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi index 81fd5be378..24dbf8ca2c 100644 --- a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi +++ b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi @@ -10,6 +10,10 @@ }; }; +&pcie { + status = "okay"; +}; + &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_4b_pins>, <&emmc_ds_pins>; From patchwork Thu Apr 8 07:50:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1463679 X-Patchwork-Delegate: narmstrong@baylibre.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=XF8QJXt2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4FGD4J563hz9sWH for ; Thu, 8 Apr 2021 17:52:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E219819D9; Thu, 8 Apr 2021 09:51:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="XF8QJXt2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55013805B4; Thu, 8 Apr 2021 09:51:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 008FE80C6D for ; Thu, 8 Apr 2021 09:50:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32a.google.com with SMTP id p19so706395wmq.1 for ; Thu, 08 Apr 2021 00:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nEuhho93fbhyB4BPKtwoFcJAsM3dBY7g76oKAKrkfP8=; b=XF8QJXt2RFN4+/TzDH99baDEsw5H6PSyMMva/llQyrBNwXKMX57nqADq4l6rLbY1xQ bI0LQksoZ0d9cvIVQTlATfQdmQA2gvuB1Zz/Zbh5K4zXWs6nfKIvF4wyYHmZEkVoIOJp 5hwpxDY0DwD9tuquFp7j1GYInC/sOgwFDbp1NTkOZoFE93YaC/QD1IYHWNlUxp+orSRj T6QHkKYJ5jGi9nlIUcsWfowiZeT8b/ONr5u7xo/4Y0ipaA3JdXKeH7fHLqb3/mQBZE+j 5YHOZvXibbr6l7NqMtbzs4usWFNlAOaCyG3wrS+a5RWHAIr1WdkkneAw6m4GHA6umu1R gA/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nEuhho93fbhyB4BPKtwoFcJAsM3dBY7g76oKAKrkfP8=; b=S8y7u2+sUPPFL7Bd6yMcRF8UMnK0bMFRX56z8ea20C4GQbjY3Gp6WBjMPS8frbozpU u61Mcy1Ntik9Ea5hXB+79pyF//njEYGwN1AKD06zEChkYhqEuyl/DFIVEeIlm5mSu83Y IMYJaFB5kd2Bz2mjc+sy29RTnkW1nu6Sa+Yq4f1AG3UEWPUszih91MVWlcWkIP5Kw5hx QyN+ohMKyuhs/Zwbiw6PlvwD121P0T70o52XX3xUlk3lmo9sqYE+p/REO+ecFDYHdwyY Fy7Qs+T6eZF+w3cK2yFv7QpmPHx/Y5aFZoRvVEzVZviN1/XvEf2HAlJYuPk1R9VSlzVD Gd3w== X-Gm-Message-State: AOAM531MNPqdVI4UuQ3MdDe65cEJ4GBYFO1ahVYnSaiZMlhUJEn2NoLE u7D0bPXvIlN5yN862GWGoU0Ng6JBSaHcRix5 X-Google-Smtp-Source: ABdhPJyoHK1pSfLjGxA32VU3ORlU2EtvwQ32QMCl3j3dlZ2+sOAO/O12L+zDfLsn6oobAMctWpWgAw== X-Received: by 2002:a1c:7f84:: with SMTP id a126mr7020720wmd.151.1617868255027; Thu, 08 Apr 2021 00:50:55 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad93:e492:9542:d59a]) by smtp.gmail.com with ESMTPSA id d7sm14954249wrw.63.2021.04.08.00.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 00:50:54 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH 4/5] configs: khadas-vim3: enable PCIe and NVMe Date: Thu, 8 Apr 2021 09:50:46 +0200 Message-Id: <20210408075047.4076954-5-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408075047.4076954-1-narmstrong@baylibre.com> References: <20210408075047.4076954-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Now we have PCIe, let's also enable NVMe to access an eventual NVMe SSDs connected on the M.2 slot. Signed-off-by: Neil Armstrong --- configs/khadas-vim3_defconfig | 5 +++++ configs/khadas-vim3l_defconfig | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/configs/khadas-vim3_defconfig b/configs/khadas-vim3_defconfig index bc17430569..5bf821bd38 100644 --- a/configs/khadas-vim3_defconfig +++ b/configs/khadas-vim3_defconfig @@ -85,3 +85,8 @@ CONFIG_BMP_16BPP=y CONFIG_BMP_24BPP=y CONFIG_BMP_32BPP=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_PCI=y +CONFIG_CMD_PCI=y +CONFIG_DM_PCI=y +CONFIG_PCIE_DW_MESON=y +CONFIG_NVME=y diff --git a/configs/khadas-vim3l_defconfig b/configs/khadas-vim3l_defconfig index c1877922c7..f066eb8c61 100644 --- a/configs/khadas-vim3l_defconfig +++ b/configs/khadas-vim3l_defconfig @@ -85,3 +85,8 @@ CONFIG_BMP_16BPP=y CONFIG_BMP_24BPP=y CONFIG_BMP_32BPP=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_PCI=y +CONFIG_CMD_PCI=y +CONFIG_DM_PCI=y +CONFIG_PCIE_DW_MESON=y +CONFIG_NVME=y From patchwork Thu Apr 8 07:50:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1463681 X-Patchwork-Delegate: narmstrong@baylibre.com 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; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=ikirk24k; 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 4FGD4z0NjNz9sRf for ; Thu, 8 Apr 2021 17:52:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B36C817A5; Thu, 8 Apr 2021 09:52:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="ikirk24k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A4BBF80C78; Thu, 8 Apr 2021 09:51:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 51CDD80021 for ; Thu, 8 Apr 2021 09:50:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wr1-x42e.google.com with SMTP id f6so1011425wrv.12 for ; Thu, 08 Apr 2021 00:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZOH4sgk4Iiaygb2dOblf6xMYF8u5nvROYz0A3bw/hfM=; b=ikirk24kTIKfmsvrC9hyE9mbRz3MXdDz6bWPxeQWsMY7pggKaIE1Dl9AgLtOAWzsy1 /wAO+vMPLR+P/82HUfhLnbz5EcPiHceHLv0Z3j7FNrQPxq9iiLpJJQPqgsdAGewkqmGC txd1RBAhFtr8ZpaZTgMSlSBJS12WfU9qBfgsFb2F7Tf+hPRoJdnx9zuhpRgbCb2wxKYu sPwq2i46glcKkInz2Ksu/nS8C58rZC1ScAYiSBg477DdAjkZicA6phrFq/051HodfZRK Cvi+iZ30jBMwm4rCPnx4EAQ6o91PX8HS4VIvrmal28+kwpGrvwsfAg/KiG+D0XENe/fg flhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZOH4sgk4Iiaygb2dOblf6xMYF8u5nvROYz0A3bw/hfM=; b=nhoLJDRZCmDEHm4ofwo0cuN+BD7K6WTH/6y8/1bvUzmYRny5i8qOu0DKzUOX8VaKX4 D2KOj9LGyQGXXe3iwMiD/cq8mL+JagAgbrWAHM1aDJH81wK2/Qef2MEMr8Wchoo7DyLO /8qwzpBcZAzETr01zhMEzUaj5sXHQLc7OHhcxq/EJNpM3GIsTSBTBOLT/UiyR26oPp8m JTmKOKLxZC3xX71fqKnsqMp854MXb0qErNxW9OOq+Auj0SaLHqnAG3FEkYyYfpsrSY4M pkFtaOKHjx6yIyIcjn0taDTTSWyIWZzupLLAZeLzDst9HK9JNWFugRwOEL1c722snfRu rKiQ== X-Gm-Message-State: AOAM532ULrraSwJ/LQeIxbxRELTIgNeyuY5JaeMIrgqMJVEX5SG3lxaF qv9UQPZwC8U4M9KOKFJxHzUq5mAKltRQjSxB X-Google-Smtp-Source: ABdhPJwM77+2Iby3MiOm5w5CSfg7SScBPFYM1aCU6BN1goS+xdBtvd8bkXCJf0MFDENQNRy94SYLsQ== X-Received: by 2002:a05:6000:1803:: with SMTP id m3mr9467930wrh.258.1617868256523; Thu, 08 Apr 2021 00:50:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad93:e492:9542:d59a]) by smtp.gmail.com with ESMTPSA id d7sm14954249wrw.63.2021.04.08.00.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 00:50:56 -0700 (PDT) From: Neil Armstrong To: u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH 5/5] configs: meson64: add NVME boot target Date: Thu, 8 Apr 2021 09:50:47 +0200 Message-Id: <20210408075047.4076954-6-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408075047.4076954-1-narmstrong@baylibre.com> References: <20210408075047.4076954-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Let's add a boot target for NVMe so we can do a full boot over NVMe. Signed-off-by: Neil Armstrong --- include/configs/meson64.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/configs/meson64.h b/include/configs/meson64.h index 7e97f89052..17ebccd2c4 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -58,6 +58,12 @@ #define BOOT_TARGET_DEVICES_USB(func) #endif +#ifdef CONFIG_CMD_NVME + #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) +#else + #define BOOT_TARGET_NVME(func) +#endif + #ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ @@ -65,6 +71,7 @@ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ BOOT_TARGET_DEVICES_USB(func) \ + BOOT_TARGET_NVME(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) #endif