Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07736C77B78 for ; Wed, 26 Apr 2023 15:53:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86DFC86374; Wed, 26 Apr 2023 17:53:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com header.b="CaSDCIe+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7BB2B86386; Wed, 26 Apr 2023 17:53:30 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E5A6086068 for ; Wed, 26 Apr 2023 17:53:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from eugen-station.. (unknown [82.76.24.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id C4BD466031F4; Wed, 26 Apr 2023 16:53:25 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1682524406; bh=yRxAXbFj8YQsqjLMGBH2gaqK86MJUSwn4B2t7H1Pw/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaSDCIe+j5uAL+5V4VJeZvKAxaSwjeIIQyb0w626gfRv1o7KBsvjq35fwsz4strTY F1J0wd5pptlHThXoGOhGuPFVS6S1BTk8ovg/q/fNFh/cZ1JI7/BIDOffbN62iUDpAc X8MY5UvrIH/MrIZ3iKwr/BIyKxM5U7a/w6OSM4b1CHBy2DePzz0T6ECdJOWJlMXecw mbb6OzqqcKQmhGZwlfRBpQeYx/lQHFCcw8pq7mwEMQKkhrqlohUZM6jdhgnIuF80PX WSzw1+G8E/NuI8jn5Pdjd1FqD1mZWI+InyDVRQQ8fj6dDLsDs0c+5bJuzKwlRzRx3T +vdQCx1mNboEw== From: Eugen Hristev To: u-boot@lists.denx.de Cc: jonas@kwiboo.se, jagan@edgeble.ai, kever.yang@rock-chips.com, eugen.hristev@collabora.com, Jon Lin Subject: [PATCH v2 2/7] pci: pcie_dw_rockchip: Support max_link_speed dts property Date: Wed, 26 Apr 2023 18:53:14 +0300 Message-Id: <20230426155319.148707-2-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426155319.148707-1-eugen.hristev@collabora.com> References: <20230426155319.148707-1-eugen.hristev@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean From: Jon Lin Add support for max_link_speed specified in the PCI DT binding. Signed-off-by: Jon Lin [eugen.hristev@collabora.com: port to latest API, set default correctly, align to 80 chars] Signed-off-by: Eugen Hristev [jonas@kwiboo.se: switch to dev_read_u32_default] Signed-off-by: Jonas Karlman --- Changes in v2: - move to dev_read_u32_default drivers/pci/pcie_dw_rockchip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index ff121046604a..60c74bea24b2 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -42,6 +42,7 @@ struct rk_pcie { struct clk_bulk clks; struct reset_ctl_bulk rsts; struct gpio_desc rst_gpio; + u32 gen; }; /* Parameters for the waiting for iATU enabled routine */ @@ -331,7 +332,7 @@ static int rockchip_pcie_init_port(struct udevice *dev) rk_pcie_writel_apb(priv, 0x0, 0xf00040); pcie_dw_setup_host(&priv->dw); - ret = rk_pcie_link_up(priv, LINK_SPEED_GEN_3); + ret = rk_pcie_link_up(priv, priv->gen); if (ret < 0) goto err_link_up; @@ -397,6 +398,9 @@ static int rockchip_pcie_parse_dt(struct udevice *dev) goto rockchip_pcie_parse_dt_err_phy_get_by_index; } + priv->gen = dev_read_u32_default(dev, "max-link-speed", + LINK_SPEED_GEN_3); + return 0; rockchip_pcie_parse_dt_err_phy_get_by_index: -- 2.34.1