From patchwork Sat Jul 22 13:30:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811276 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=Ku29F7VL; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S3W4XjDz20FK for ; Sat, 22 Jul 2023 23:30:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC037863E5; Sat, 22 Jul 2023 15:30:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="Ku29F7VL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33627863D5; Sat, 22 Jul 2023 15:30:20 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 6BB3886281 for ; Sat, 22 Jul 2023 15:30:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=CqmHWzb8uBt0bvwljV64xJr6yFpsX+TyE3WPnb01jOU=; b=Ku29F7VL5r9aNh0tQdD9bQSPQ/6tUIQsrTsdalyBxTzkz6yaXe9VfEV9zsYnQChqz4ej SQrjNQX8dipoxgpI1PfzMaj6KOr44Db91vpm4UfUictgF0uViur0UCGoJSZai3R1RH1/1q 1X+5a12Bjsx3xCtHFodhoo2ItZXr40nCrs4yBu+oHsjCFvSMPd08xR/ORuGlzPCmQGZiG7 /1t4gIcNfQDtRQKDVl4QDny9+VZsQ2UzgERkDqtive3sexpTa4o6IJXkQqPna3FHUqrIoE s93V+MuAQtvr+GcQBI+DZ5Wr9xRwdfZcjlRoDCRwIJM1rT+I7iqJMOA0dK1fQVxg== Received: by filterdrecv-d7bbbc8bf-zf9x9 with SMTP id filterdrecv-d7bbbc8bf-zf9x9-1-64BBD9E7-BC 2023-07-22 13:30:15.806113836 +0000 UTC m=+6270623.603943489 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id E0oEqaCYTni0otb45t6jRg Sat, 22 Jul 2023 13:30:15.621 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 1/9] core: read: add dev_read_addr_size_index_ptr function Date: Sat, 22 Jul 2023 13:30:15 +0000 (UTC) Message-ID: <20230722133012.1838083-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h0nO7hjaGfGrm2a/PnnjOe28jah/7wzdU5JZnfka9l5dDpjnoelCVD1IWzKV794jRDHKVSdKpJTZ3C7JPAIaUStxed/gWolBvNoRuZNo1EE2/jSB3ixd+Hcs67izze2Xkz1FvsgGCTU7gRPOXfkUlS/SNASFxqoVy+n5tP7tWflL To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Add dev_read_addr_size_index_ptr function with the same functionality as dev_read_addr_size_index, but instead a return pointer is given. Use map_sysmem() function as cast for the return. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - Collect r-b tag v2: - New patch drivers/core/read.c | 11 +++++++++++ include/dm/read.h | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/core/read.c b/drivers/core/read.c index 5749473a6cae..49066b59cdaf 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -150,6 +150,17 @@ fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, return devfdt_get_addr_size_index(dev, index, size); } +void *dev_read_addr_size_index_ptr(const struct udevice *dev, int index, + fdt_size_t *size) +{ + fdt_addr_t addr = dev_read_addr_size_index(dev, index, size); + + if (addr == FDT_ADDR_T_NONE) + return NULL; + + return map_sysmem(addr, 0); +} + void *dev_remap_addr_index(const struct udevice *dev, int index) { fdt_addr_t addr = dev_read_addr_index(dev, index); diff --git a/include/dm/read.h b/include/dm/read.h index 137f2a52a298..c2615f72f405 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -246,6 +246,20 @@ void *dev_read_addr_index_ptr(const struct udevice *dev, int index); fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, fdt_size_t *size); +/** + * dev_read_addr_size_index_ptr() - Get the indexed reg property of a device + * as a pointer + * + * @dev: Device to read from + * @index: the 'reg' property can hold a list of pairs + * and @index is used to select which one is required + * @size: place to put size value (on success) + * + * Return: pointer or NULL if not found + */ +void *dev_read_addr_size_index_ptr(const struct udevice *dev, int index, + fdt_size_t *size); + /** * dev_remap_addr_index() - Get the indexed reg property of a device * as a memory-mapped I/O pointer @@ -952,6 +966,13 @@ static inline fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, return devfdt_get_addr_size_index(dev, index, size); } +static inline void *dev_read_addr_size_index_ptr(const struct udevice *dev, + int index, + fdt_size_t *size) +{ + return devfdt_get_addr_size_index_ptr(dev, index, size); +} + static inline fdt_addr_t dev_read_addr_name(const struct udevice *dev, const char *name) { From patchwork Sat Jul 22 13:30:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811278 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=FFctrbb2; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S3x6YGHz20FK for ; Sat, 22 Jul 2023 23:30:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9CA1C8622C; Sat, 22 Jul 2023 15:30:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="FFctrbb2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E5E6865B5; Sat, 22 Jul 2023 15:30:22 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (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 58EC486366 for ; Sat, 22 Jul 2023 15:30:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=L3fJQPE+E+YaQmPQ/imoVetqgJg89351z/dXK0wJifA=; b=FFctrbb25hmJrzjzgHISW/9Zxx4nyszFTGRLKzT1ibw1Hame3XCvtXJDjmCWdW95CCsC t+LxzruWZkyOp3DS/lRSIz71VAqn6v0M0stqHhgowbU1PJEyTL62Gkd6A9kHp5kXQj36KT crDuBRW+HnbcDNOnODsmadLkJzSA+xUgOixw43PVQXiojvWQbQC0UHYw7Hp8AXvgJry7n+ 70KGgxWbb2D25Bejic/Rb9Llxgr/atJ440/gG6cyF0YzJFbB+bwhxsgNjDBzbwKeevn7zZ lt6hIcdUmwS9HRzWBYcIjnB1SYnT/3f5sTRiGbGBAR3f0iyyz6wqJk4EuuA4VBWw== Received: by filterdrecv-d7bbbc8bf-hv8x8 with SMTP id filterdrecv-d7bbbc8bf-hv8x8-1-64BBD9E8-60 2023-07-22 13:30:16.812165284 +0000 UTC m=+6270639.037300618 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id 07TnpiAGT6K5DszTB3V91A Sat, 22 Jul 2023 13:30:16.610 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 2/9] pci: pcie_dw_rockchip: Get config region from reg prop Date: Sat, 22 Jul 2023 13:30:16 +0000 (UTC) Message-ID: <20230722133012.1838083-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h9AExcA8O3xZCWf52hCTj5+I+oZrp0AsFL0ZjtlhCJWR4N9Wn4/2r2JYLtrUcpKjkM7bdoQ52COa2cLBbARYbhUbUi3bSQULrMUdkDaSsjb6D5KyJBrsgl8Q8EDDg4GcRVJ8PxoAGgwvPHYXnD9U1QokhE9IHx03HFlrOtJDs+05 To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Get the config region to use from the reg prop. Also update the referenced region index used in comment. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - No change v2: - Use dev_read_addr_size_index_ptr - Collect r-b tag drivers/pci/pcie_dw_common.c | 10 ++++++---- drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c index 9f8b016d1149..74fb6df412c7 100644 --- a/drivers/pci/pcie_dw_common.c +++ b/drivers/pci/pcie_dw_common.c @@ -141,9 +141,9 @@ static uintptr_t set_cfg_address(struct pcie_dw *pcie, /* * Not accessing root port configuration space? - * Region #0 is used for Outbound CFG space access. + * Region #1 is used for Outbound CFG space access. * Direction = Outbound - * Region Index = 0 + * Region Index = 1 */ d = PCI_MASK_BUS(d); d = PCI_ADD_BUS(bus, d); @@ -328,8 +328,10 @@ void pcie_dw_setup_host(struct pcie_dw *pci) pci->prefetch.bus_start = hose->regions[ret].bus_start; /* PREFETCH_bus_addr */ pci->prefetch.size = hose->regions[ret].size; /* PREFETCH size */ } else if (hose->regions[ret].flags == PCI_REGION_SYS_MEMORY) { - pci->cfg_base = (void *)(pci->io.phys_start - pci->io.size); - pci->cfg_size = pci->io.size; + if (!pci->cfg_base) { + pci->cfg_base = (void *)(pci->io.phys_start - pci->io.size); + pci->cfg_size = pci->io.size; + } } else { dev_err(pci->dev, "invalid flags type!\n"); } diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 6da618055cbe..83737e62bc6a 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -366,6 +366,13 @@ static int rockchip_pcie_parse_dt(struct udevice *dev) dev_dbg(dev, "APB address is 0x%p\n", priv->apb_base); + priv->dw.cfg_base = dev_read_addr_size_index_ptr(dev, 2, + &priv->dw.cfg_size); + if (!priv->dw.cfg_base) + return -EINVAL; + + dev_dbg(dev, "CFG address is 0x%p\n", priv->dw.cfg_base); + ret = gpio_request_by_name(dev, "reset-gpios", 0, &priv->rst_gpio, GPIOD_IS_OUT); if (ret) { From patchwork Sat Jul 22 13:30:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811279 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=eqlKdw6r; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S4940LTz20FK for ; Sat, 22 Jul 2023 23:31:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A52886281; Sat, 22 Jul 2023 15:30:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="eqlKdw6r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3684863B0; Sat, 22 Jul 2023 15:30:22 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (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 17B53863B9 for ; Sat, 22 Jul 2023 15:30:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=r/eru2/FxUdWizN6Ey1Ohhv4pTKMvU1ymc8xTF1i+j8=; b=eqlKdw6rmHGh0VxxDX4/ZRoPoO5cH03ytuoXUHEkqitLx4r/b+z5UT4jWDn3tXEuBAdA TTss8yjzK4GUnOeodlmNI3NmCU6V8zvz40JI52+kqz8e5Z0s1C9K65zK8NtSyVGpTEw5MT VGHXVuOIkiMosKNu+W7duTKU+PSfJ+KzAwcvOj5IyEzEj45HBRADShzeIrFQkI1lcHIw62 xB453YrSw5rEjVKUfl17UslsGgnk15RehB6AmP+6MsEYaV8kpSLBkl+xuVKW+NbAMg6QCl GF9YJh/BYE83ZhLAayYxpjwsQFhizjVqAS3Anpe0voAGn2ptD0I4QRIELoraRCUg== Received: by filterdrecv-84b96456cb-qhzcj with SMTP id filterdrecv-84b96456cb-qhzcj-1-64BBD9E9-64 2023-07-22 13:30:18.017590645 +0000 UTC m=+6270706.156428629 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id vor0-JKoQ7mUf314IFKBhw Sat, 22 Jul 2023 13:30:17.704 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 3/9] pci: pcie_dw_rockchip: Use regulator_set_enable_if_allowed Date: Sat, 22 Jul 2023 13:30:18 +0000 (UTC) Message-ID: <20230722133012.1838083-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h6yMv2ktVXzPXmvz6UJFL/pGB5uuvjIwrYLnTqiX/thJGoDeuS0p8LDSSPTYyYBUKZolt8NqQlnSLTqTcf6zOSkX1fXCB+WDlf75uezud2Y3LvKjg+gJ8vvu0fEolyMCUMo9iUojJQIZ7fISG9iEEk3bdtwiwhvCC0gcL642jEVI To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 The vpcie3v3 regulator is typically a fixed regulator controlled using gpio. Change to use enable and disable calls on the regulator instead of trying to set a voltage value. Also remove the delay to match linux driver, for a fixed regulator the startup-delay-us prop can be used in case a startup delay is needed. Limited testing on ROCK 3A, ROCK 5B, Quartz64, Odroid-M1 has shown that this delay was not needed. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - Collect r-b tag v2: - Update commit message drivers/pci/pcie_dw_rockchip.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 83737e62bc6a..1b8a1409f6df 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -288,21 +288,16 @@ static int rockchip_pcie_init_port(struct udevice *dev) struct rk_pcie *priv = dev_get_priv(dev); /* Set power and maybe external ref clk input */ - if (priv->vpcie3v3) { - ret = regulator_set_value(priv->vpcie3v3, 3300000); - if (ret) { - dev_err(priv->dw.dev, "failed to enable vpcie3v3 (ret=%d)\n", - ret); - return ret; - } + ret = regulator_set_enable_if_allowed(priv->vpcie3v3, true); + if (ret && ret != -ENOSYS) { + dev_err(dev, "failed to enable vpcie3v3 (ret=%d)\n", ret); + return ret; } - udelay(MACRO_US * 1000); - ret = generic_phy_init(&priv->phy); if (ret) { dev_err(dev, "failed to init phy (ret=%d)\n", ret); - return ret; + goto err_disable_regulator; } ret = generic_phy_power_on(&priv->phy); @@ -345,6 +340,8 @@ err_power_off_phy: generic_phy_power_off(&priv->phy); err_exit_phy: generic_phy_exit(&priv->phy); +err_disable_regulator: + regulator_set_enable_if_allowed(priv->vpcie3v3, false); return ret; } From patchwork Sat Jul 22 13:30:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811280 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=IT0RgGs2; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S4N05vjz20FK for ; Sat, 22 Jul 2023 23:31:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 060D2865CA; Sat, 22 Jul 2023 15:30:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="IT0RgGs2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2638B865BC; Sat, 22 Jul 2023 15:30:24 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 568D886281 for ; Sat, 22 Jul 2023 15:30:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=ekV8anDYKcMPhpPODR8b7ZVkQ1AvRPYfZjq9HmoOh1w=; b=IT0RgGs2q3qXmeqLDXrT36/SHSftU+oQt32c4RbqsWkjMN0JfXCJ34JcEgYC3W5rjs/e QLcJOQhkv2802823x7sSSTKC9hLHiapYiJF1pIJPFlYLqLP68WXYlPNPkSDj21b77GCePS wft/m7eRDl1qD2xjBdtJwZR/J5Zkd7j6/vfmzHrkuUCmd9XEcmFQfF5Q8YxAM/KVvmsVVS IlISemhT8+zWaWz0UneBrKrpN2LArZZXTs+YLMvkTlu/y98kzZk0g2aCvWLgmp9qpnz1yN k5Rnwqb3DlSZN+y8D2uOlBQZkE1PO8tamo8zG4zOnfj/Mui+QZ37JqBW1FvRjxEw== Received: by filterdrecv-84b96456cb-qhzcj with SMTP id filterdrecv-84b96456cb-qhzcj-1-64BBD9EA-5D 2023-07-22 13:30:18.981610405 +0000 UTC m=+6270707.120448416 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id KX2vjks4SN-WpDsYfLyauA Sat, 22 Jul 2023 13:30:18.662 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 4/9] pci: pcie_dw_rockchip: Speed up link probe Date: Sat, 22 Jul 2023 13:30:19 +0000 (UTC) Message-ID: <20230722133012.1838083-5-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h73o1/Stlbn+152aaoUITwrcecryGrIo47+wvb+sc1snH51HqN9h9K/rSf1PoUYXbHJsoLsXk9n+1N3oKjJl08uuNa1tnX/oCvcN0vaH8TBPzUDov17YrJ69x6+1i6OmiFnCUe8h3b64JF2Z0thMXX37o30WCnZntBnFLCcDBVJm To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Use a similar pattern and delay values as the linux mainline driver to speed up failing when nothing is connected. Reduce fail speed from around 5+ seconds down to around one second on a Radxa ROCK 3 Model A, where pcie2x1 is probed before pcie3x2 M2 slot. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - Collect r-b tag v2: - No change drivers/pci/pcie_dw_rockchip.c | 68 ++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 1b8a1409f6df..82a8b9c96e2b 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -61,9 +61,6 @@ struct rk_pcie { #define PCIE_CLIENT_DBG_TRANSITION_DATA 0xffff0000 #define PCIE_CLIENT_DBF_EN 0xffff0003 -/* Parameters for the waiting for #perst signal */ -#define MACRO_US 1000 - static int rk_pcie_read(void __iomem *addr, int size, u32 *val) { if ((uintptr_t)addr & (size - 1)) { @@ -242,43 +239,46 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed) /* DW pre link configurations */ rk_pcie_configure(priv, cap_speed); - /* Rest the device */ - if (dm_gpio_is_valid(&priv->rst_gpio)) { - dm_gpio_set_value(&priv->rst_gpio, 0); - /* - * Minimal is 100ms from spec but we see - * some wired devices need much more, such as 600ms. - * Add a enough delay to cover all cases. - */ - udelay(MACRO_US * 1000); - dm_gpio_set_value(&priv->rst_gpio, 1); - } - rk_pcie_disable_ltssm(priv); rk_pcie_link_status_clear(priv); rk_pcie_enable_debug(priv); + /* Reset the device */ + if (dm_gpio_is_valid(&priv->rst_gpio)) + dm_gpio_set_value(&priv->rst_gpio, 0); + /* Enable LTSSM */ rk_pcie_enable_ltssm(priv); - for (retries = 0; retries < 5; retries++) { - if (is_link_up(priv)) { - dev_info(priv->dw.dev, "PCIe Link up, LTSSM is 0x%x\n", - rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS)); - rk_pcie_debug_dump(priv); - return 0; - } - - dev_info(priv->dw.dev, "PCIe Linking... LTSSM is 0x%x\n", - rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS)); - rk_pcie_debug_dump(priv); - udelay(MACRO_US * 1000); + /* + * PCIe requires the refclk to be stable for 100ms prior to releasing + * PERST. See table 2-4 in section 2.6.2 AC Specifications of the PCI + * Express Card Electromechanical Specification, 1.1. However, we don't + * know if the refclk is coming from RC's PHY or external OSC. If it's + * from RC, so enabling LTSSM is the just right place to release #PERST. + */ + mdelay(100); + if (dm_gpio_is_valid(&priv->rst_gpio)) + dm_gpio_set_value(&priv->rst_gpio, 1); + + /* Check if the link is up or not */ + for (retries = 0; retries < 10; retries++) { + if (is_link_up(priv)) + break; + + mdelay(100); + } + + if (retries >= 10) { + dev_err(priv->dw.dev, "PCIe-%d Link Fail\n", + dev_seq(priv->dw.dev)); + return -EIO; } - dev_err(priv->dw.dev, "PCIe-%d Link Fail\n", dev_seq(priv->dw.dev)); - /* Link maybe in Gen switch recovery but we need to wait more 1s */ - udelay(MACRO_US * 1000); - return -EIO; + dev_info(priv->dw.dev, "PCIe Link up, LTSSM is 0x%x\n", + rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS)); + rk_pcie_debug_dump(priv); + return 0; } static int rockchip_pcie_init_port(struct udevice *dev) @@ -287,6 +287,12 @@ static int rockchip_pcie_init_port(struct udevice *dev) u32 val; struct rk_pcie *priv = dev_get_priv(dev); + ret = reset_assert_bulk(&priv->rsts); + if (ret) { + dev_err(dev, "failed to assert resets (ret=%d)\n", ret); + return ret; + } + /* Set power and maybe external ref clk input */ ret = regulator_set_enable_if_allowed(priv->vpcie3v3, true); if (ret && ret != -ENOSYS) { From patchwork Sat Jul 22 13:30:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811281 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=TreKlKAV; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S4b0MsCz20FK for ; Sat, 22 Jul 2023 23:31:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D02E2865DA; Sat, 22 Jul 2023 15:30:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="TreKlKAV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F38C86307; Sat, 22 Jul 2023 15:30:25 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) (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 861C186307 for ; Sat, 22 Jul 2023 15:30:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=Hni0irjHHmbYM4sVJ1yrm3LiVz0H+X0bd9bzvJtI9WM=; b=TreKlKAVUSoFRQ0fCFiy4XmaBZVBR3PQEq4KdZSp3CeJ14Wni5muxeNT8obGMxIW4Ok6 L0cnRR/f4u+d2vzzjqQ8CoLQqUZY1H9ym5Z65TxUl7iONQtBL0c/AdmiqJ3GTBqihNudnw 7w3qzVHdi25SL6+xqeohLrNrFiuVPLERBXVqzgjw2+w2cozDRmFAFe045w8gbIz3Ighf1x 61lhFlgECthGCjMQ6qN68ACooTZgvtacEOPQ1m83MXwUzoREoMrtGajpeA8twfN8hrY2SH 2Nv88R5yX0sHmiWzR+8x0+9cWixMT/T59CbDxr82vemkL95EY5jypanFoKqvvRlQ== Received: by filterdrecv-d7bbbc8bf-wj7z8 with SMTP id filterdrecv-d7bbbc8bf-wj7z8-1-64BBD9EB-8A 2023-07-22 13:30:19.941605988 +0000 UTC m=+6270641.994726059 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id WtmnsDstT2O-Z-Of_zT6AQ Sat, 22 Jul 2023 13:30:19.759 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 5/9] pci: pcie_dw_rockchip: Disable unused BARs of the root complex Date: Sat, 22 Jul 2023 13:30:20 +0000 (UTC) Message-ID: <20230722133012.1838083-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h1BNxuEEKMqu2l2lt68eIf0wN5aBYJGJUJBt3FsJYU3I7VP+1xFb1RNoqr7alHtAZ1Doq52aJyOLAJD2Gurro2GnTUkDTP74urHz+F3IwF5vlOBh/+aRBeELWXY0uF7+UM7KHO0AokqTl5agrgS8hK00DqUNHOCuh4cDt9EO4cLT To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 The Root Complex BARs default to claim the full 1 GiB memory region on RK3568, leaving no space for any attached device. Fix this by disable the unused BAR 0 and BAR 1 of the RC. Signed-off-by: Jon Lin [jonas@kwiboo.se: Move to rk_pcie_configure and use PCI_BASE_ADDRESS_0/1 const] Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - New patch, based on vendor commit 1f4523203c2a ("driver: pci: rockchip: Disable RC BAR0 and BAR1") drivers/pci/pcie_dw_rockchip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 82a8b9c96e2b..1a35fae5c3a8 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -61,6 +61,8 @@ struct rk_pcie { #define PCIE_CLIENT_DBG_TRANSITION_DATA 0xffff0000 #define PCIE_CLIENT_DBF_EN 0xffff0003 +#define PCIE_TYPE0_HDR_DBI2_OFFSET 0x100000 + static int rk_pcie_read(void __iomem *addr, int size, u32 *val) { if ((uintptr_t)addr & (size - 1)) { @@ -158,6 +160,12 @@ static void rk_pcie_configure(struct rk_pcie *pci, u32 cap_speed) { dw_pcie_dbi_write_enable(&pci->dw, true); + /* Disable BAR 0 and BAR 1 */ + writel(0, pci->dw.dbi_base + PCIE_TYPE0_HDR_DBI2_OFFSET + + PCI_BASE_ADDRESS_0); + writel(0, pci->dw.dbi_base + PCIE_TYPE0_HDR_DBI2_OFFSET + + PCI_BASE_ADDRESS_1); + clrsetbits_le32(pci->dw.dbi_base + PCIE_LINK_CAPABILITY, TARGET_LINK_SPEED_MASK, cap_speed); From patchwork Sat Jul 22 13:30:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811282 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=TWMdZnRL; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S4m6zYBz20FK for ; Sat, 22 Jul 2023 23:31:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1388B865ED; Sat, 22 Jul 2023 15:30:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="TWMdZnRL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 15D69863F1; Sat, 22 Jul 2023 15:30:29 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 68D5E863F1 for ; Sat, 22 Jul 2023 15:30:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=Xl4FNF76u3YTlq1DBlAY9gklwUBEJbEd71ZH4eFtMhU=; b=TWMdZnRLutFiOarA2XpM1+boUxvMlFuLbIv/VhX0u2sig5vc9kZJ4/6crZ8zzvEmuUfn /Dbd90lZKRiQGuQ3IXNXJRSzksbPab/OL2pPi/EVyHgoO7NlK1Aq8kiDbMICHED8BpN/Ey ACvL9uxUNwUanqJtiRUCzQIcdcQlswhLT9Zs6exTkquc9RcJk0zILRAhCnfJzQ9W55/8Ud e7cupdaHWy25qy5x46iPC7GAb9B2sHmXloA2GqP1cTZxOh+vp73fr5oNPNSO+YI1jAlAUL uB0rgtkzbBHzrTk2efOPnTrU/1aCO1s+/G4Q+4c87Mxq3lhxZn87Y+aIUHa+A40A== Received: by filterdrecv-66949dbc98-9d8bm with SMTP id filterdrecv-66949dbc98-9d8bm-1-64BBD9EC-B6 2023-07-22 13:30:21.026761181 +0000 UTC m=+6270644.415695826 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id _-wxb9WtS_GpofBOT3vCTg Sat, 22 Jul 2023 13:30:20.846 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 6/9] regulator: fixed: Add support for gpios prop Date: Sat, 22 Jul 2023 13:30:21 +0000 (UTC) Message-ID: <20230722133012.1838083-7-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h9R8ltR7W1hKmQgD7cQnn8McJ9N1jIsLGl4S5GrFL/vQPZXcSx8drbWJjiSEZHdDjTDfp5L6V3F+5GUTPby57NuKWV0j24fM0Lt976UdPhR113NFOUH+aJsuoO3SObtQz/y/egP+7kb5J2nA2jtHppUDi2xOOnJ6Qw0vw+j0sDJW To: Kever Yang , Simon Glass , Philipp Tomsich , Jaehoon Chung Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 The commit 12df2c182ccb ("regulator: dt-bindings: fixed-regulator: allow gpios property") in linux v6.3-rc1 added support for use of either a gpios or gpio prop with a fixed-regulator. This adds support for the new gpios prop to the fixed-regulator driver. gpios prop is used by vcc3v3-pcie-regulator on Radxa ROCK 3 Model A. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - Rebased on master v2: - Update commit message - Collect r-b tag drivers/power/regulator/fixed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c index ad3b4b98d667..f7ddba8b45e4 100644 --- a/drivers/power/regulator/fixed.c +++ b/drivers/power/regulator/fixed.c @@ -25,6 +25,7 @@ static int fixed_regulator_of_to_plat(struct udevice *dev) { struct dm_regulator_uclass_plat *uc_pdata; struct regulator_common_plat *plat; + bool gpios; plat = dev_get_plat(dev); uc_pdata = dev_get_uclass_plat(dev); @@ -33,7 +34,8 @@ static int fixed_regulator_of_to_plat(struct udevice *dev) uc_pdata->type = REGULATOR_TYPE_FIXED; - return regulator_common_of_to_plat(dev, plat, "gpio"); + gpios = dev_read_bool(dev, "gpios"); + return regulator_common_of_to_plat(dev, plat, gpios ? "gpios" : "gpio"); } static int fixed_regulator_get_value(struct udevice *dev) From patchwork Sat Jul 22 13:30:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811284 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=Fc7K4yjL; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S5C2yJxz20FK for ; Sat, 22 Jul 2023 23:31:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 149138666B; Sat, 22 Jul 2023 15:30:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="Fc7K4yjL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3997A863D5; Sat, 22 Jul 2023 15:30:34 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 57448865C1 for ; Sat, 22 Jul 2023 15:30:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=s7iHnMnDToyg7KekO+68TlkrHD3jXrwfiV4W4v860LM=; b=Fc7K4yjL715cgONdGqQajgcXNhldsafLoZaCBYbNaJyimRPF7YtJtBQNHDX+n63t5WEY 58xN/kDHcyG/x10LVgEMPGWmwA+Li7fHRDF4/HgztrkBWEZb9wceaKcL3NKBF8fQ5BgoM6 eWcvNYqw2eOEsacC3qqk71x2d3gypKlb3cGPizLrGTQavAQIBU0QjOzvA+ieGivfE+pu7B MG5N0BiymwCihF5vs7AIlzrRLhkzEZivl4EPp4tpYRXHJw8yCHx6NatuR9anXKQmN94b2D VbhuvYGacdEKIBe8PY0XsQ2oE48xDx9/Ia1kJM7sct+Hw+T2gi7RGtfOa9GiUZ6A== Received: by filterdrecv-8684c58db7-5mfx8 with SMTP id filterdrecv-8684c58db7-5mfx8-1-64BBD9ED-88 2023-07-22 13:30:22.129358214 +0000 UTC m=+6270729.530768518 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id MaQsROSETi69eIN7mKmCGw Sat, 22 Jul 2023 13:30:21.839 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 7/9] rockchip: clk: clk_rk3568: Add CLK_PCIEPHY2_REF support Date: Sat, 22 Jul 2023 13:30:22 +0000 (UTC) Message-ID: <20230722133012.1838083-8-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0hwzByFEjsLpYY+HbwQFSbpN9QxFBRbpgSKIQy1HcFUMTSJ9o3yHLa48fHB3Y19EVajZup60/dEfNyAUJ0Z7Ob5tHEffxNnzug4RVjir0vaOSYFhUpc87JqVbMgiW5eWmbnr5DqrBM4wi+HvIbPonNA/RSPHmj7h8RzjcskNKp7JX To: Kever Yang , Simon Glass , Philipp Tomsich , Lukasz Majewski , Sean Anderson Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Add dummy support for the CLK_PCIEPHY2_REF clock. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - No change v2: - Collect r-b tag drivers/clk/rockchip/clk_rk3568.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/rockchip/clk_rk3568.c b/drivers/clk/rockchip/clk_rk3568.c index 6bdd96f35b5c..0df82f597152 100644 --- a/drivers/clk/rockchip/clk_rk3568.c +++ b/drivers/clk/rockchip/clk_rk3568.c @@ -427,6 +427,7 @@ static ulong rk3568_pmuclk_set_rate(struct clk *clk, ulong rate) break; case CLK_PCIEPHY0_REF: case CLK_PCIEPHY1_REF: + case CLK_PCIEPHY2_REF: return 0; default: return -ENOENT; From patchwork Sat Jul 22 13:30:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811283 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=hQJCrXhn; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S501qJqz20FK for ; Sat, 22 Jul 2023 23:31:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 191A78661B; Sat, 22 Jul 2023 15:30:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="hQJCrXhn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E90F865C2; Sat, 22 Jul 2023 15:30:31 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (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 38E83865C2 for ; Sat, 22 Jul 2023 15:30:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=6PNAPvahCLaRLKeR2EF94YhKHHg+GG4SjgFc8w6/pWE=; b=hQJCrXhn2a0wsSlVp9361cwufqBIOTe489ePywtCqnfZcFDbi6D24Km7adnjIGOgO/gK N5ryZ9X/8DMDqHOZIx3kX+MtgJFXmTzCp6W4Vs1gbTwaHhiX7SgEd+r1E0SeuhtD2n8KmV zk5U+1R3kU9uN0pm7lLn/CWmpaMnAY/dKeAv+PSgmpFrLpJAzag6VPCesd96KHqvHWUhJr XW2Se6a5gyjRL405yx2ErfKVLQYjuD7H5cCY4JfqD7lrGLhYfkau0E74dOBt1+6h4ds6h8 QWDWAFr25YmrvsTHrDrPklhw0mtIiYCmK4WS00zt7XGUXJbeQzbn5OhBrDZnq6WQ== Received: by filterdrecv-84b96456cb-rsmc4 with SMTP id filterdrecv-84b96456cb-rsmc4-1-64BBD9EF-E 2023-07-22 13:30:23.316401406 +0000 UTC m=+6270723.525092854 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id CnR1lp6tQjaE1sgNsUAM-w Sat, 22 Jul 2023 13:30:23.022 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 8/9] rockchip: rk3568-rock-3a: Enable PCIe and NVMe support Date: Sat, 22 Jul 2023 13:30:23 +0000 (UTC) Message-ID: <20230722133012.1838083-9-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0hx4kbTFjER97Mre+0KnZukIvRYotDwo1WNzHV/lqNe5rV5MAfkmpS8KyRGy8TqiMoVLchEz09W5GuTg6w6g7pRtuujblzXrnddn3OPYaerkTaSYWF5WeDxVBE3r9L/rspwB6WpvZX10uiSB82pbIsGY01ITDwKu3CuywXp1PxhlL To: Kever Yang , Simon Glass , Philipp Tomsich , Akash Gajjar Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Add missing pinctrl and defconfig options to enable PCIe and NVMe support on Radxa ROCK 3 Model A. Use of pcie20m1_pins and pcie30x2m1_pins ensure IO mux selection M1. The following pcie_reset_h and pcie3x2_reset_h ensure GPIO func is restored to the perstn pin, a workaround to avoid having to define a new rockchip,pins. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - Drop now unneeded sys freeze workaround - Enable options for AHCI/SCSI v2: - Update commit message - Disable pcie2x1 to work around a possible sys freeze issue arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 14 ++++++++++++++ configs/rock-3a-rk3568_defconfig | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi index bbf54f888fa0..9ee7b494ee25 100644 --- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi @@ -36,8 +36,22 @@ bootph-all; }; +&pcie2x1 { + pinctrl-0 = <&pcie20m1_pins &pcie_reset_h>; +}; + +&pcie3x2 { + pinctrl-0 = <&pcie30x2m1_pins &pcie3x2_reset_h>; +}; + &pinctrl { bootph-all; + + pcie { + pcie3x2_reset_h: pcie3x2-reset-h { + rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &pcfg_pull_none { diff --git a/configs/rock-3a-rk3568_defconfig b/configs/rock-3a-rk3568_defconfig index 753d03914d90..8e3fe0a25e1d 100644 --- a/configs/rock-3a-rk3568_defconfig +++ b/configs/rock-3a-rk3568_defconfig @@ -22,7 +22,9 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI=y CONFIG_SYS_LOAD_ADDR=0xc00800 +CONFIG_PCI=y CONFIG_DEBUG_UART=y +CONFIG_AHCI=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_FIT_SIGNATURE=y @@ -46,6 +48,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y +CONFIG_CMD_PCI=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=y @@ -56,6 +59,8 @@ CONFIG_OF_LIVE=y CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y +CONFIG_SCSI_AHCI=y +CONFIG_AHCI_PCI=y CONFIG_SPL_CLK=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y @@ -70,6 +75,8 @@ CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_XTX=y CONFIG_ETH_DESIGNWARE=y CONFIG_GMAC_ROCKCHIP=y +CONFIG_NVME_PCI=y +CONFIG_PCIE_DW_ROCKCHIP=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y @@ -78,6 +85,8 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y CONFIG_SPL_RAM=y +CONFIG_SCSI=y +CONFIG_DM_SCSI=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550_MEM32=y From patchwork Sat Jul 22 13:30:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1811285 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=E+ADvDIB; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7S5P45Psz20FK for ; Sat, 22 Jul 2023 23:32:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B4DD867CA; Sat, 22 Jul 2023 15:30:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="E+ADvDIB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 005D3863E8; Sat, 22 Jul 2023 15:30:35 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (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 85EB2865D4 for ; Sat, 22 Jul 2023 15:30:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=h8hKoqF5SFc5nnsHJpqOxP20FLj/FR/9S7KDEs8qwkk=; b=E+ADvDIB4CU+SFG7hVjNFkH48J0Fj7lpDXjjA5cPvKHn8s9uveUmoqwjb9MauvRBdxGa bvSajZbkaceuPu1lpNkrI4B321/C/+v0K//5IfvfeelVkOPnZhOihKGw0LctshiDNcADg6 addxpEzrIwKOSChD+jtHbfRJmbb4F+mFtvGHN5C3L3Fgpa6F4EqxsW5fZLVKlkQaXmk+kN SyVnHSkzFYUzk2Zcg3nEuTfpdJPsChoBqG5IEv5UjZdrPtCzwkWvsxNOLiDMlhjHGEJanz QAug7U/ToxLZ+gVR29ww7kT31VN1l8k0YHpNn1IuypntjgfnUnit5X92CFnFIgJQ== Received: by filterdrecv-8684c58db7-5mfx8 with SMTP id filterdrecv-8684c58db7-5mfx8-1-64BBD9F0-12 2023-07-22 13:30:24.35762405 +0000 UTC m=+6270731.759034466 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id _HAddjhOQjKIPhHBfGIr1A Sat, 22 Jul 2023 13:30:24.065 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 9/9] rockchip: rk356x: Update PCIe config, IO and memory regions Date: Sat, 22 Jul 2023 13:30:24 +0000 (UTC) Message-ID: <20230722133012.1838083-10-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722133012.1838083-1-jonas@kwiboo.se> References: <20230722133012.1838083-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h78VjGDL1wD8iXIQMJ4o/ynyz5wb4pruSba7+JNg6FnWyGFb76jDocBmHFiVn89fxtN61ezqYoaIFybtof8rylJdA/+ZKmFJQWFRC42rczqkcMWuvpaP3XlCNTKivMZzPz5gpJdrPuvA6dYGljqrIbCkHKs6OfR67f+M4tREkeIA To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , Jon Lin , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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 Update config, IO and memory regions used based on [1] with pcie3x2 config reg address and reg size corrected. Before this change: PCI Autoconfig: Bus Memory region: [0-3eefffff], PCI Autoconfig: Bus I/O region: [3ef00000-3effffff], After this change: PCI Autoconfig: Bus Memory region: [40000000-7fffffff], PCI Autoconfig: Bus I/O region: [f0100000-f01fffff], [1] https://lore.kernel.org/lkml/20221112114125.1637543-2-aholmes@omnom.net/ Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v4: - No change v3: - No change v2: - Update commit message - Collect r-b tag arch/arm/dts/rk3568.dtsi | 14 ++++++++------ arch/arm/dts/rk356x.dtsi | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/rk3568.dtsi b/arch/arm/dts/rk3568.dtsi index ba67b58f05b7..f1be76a54ceb 100644 --- a/arch/arm/dts/rk3568.dtsi +++ b/arch/arm/dts/rk3568.dtsi @@ -94,9 +94,10 @@ power-domains = <&power RK3568_PD_PIPE>; reg = <0x3 0xc0400000 0x0 0x00400000>, <0x0 0xfe270000 0x0 0x00010000>, - <0x3 0x7f000000 0x0 0x01000000>; - ranges = <0x01000000 0x0 0x3ef00000 0x3 0x7ef00000 0x0 0x00100000>, - <0x02000000 0x0 0x00000000 0x3 0x40000000 0x0 0x3ef00000>; + <0x0 0xf2000000 0x0 0x00100000>; + ranges = <0x01000000 0x0 0xf2100000 0x0 0xf2100000 0x0 0x00100000>, + <0x02000000 0x0 0xf2200000 0x0 0xf2200000 0x0 0x01e00000>, + <0x03000000 0x0 0x40000000 0x3 0x40000000 0x0 0x40000000>; reg-names = "dbi", "apb", "config"; resets = <&cru SRST_PCIE30X1_POWERUP>; reset-names = "pipe"; @@ -146,9 +147,10 @@ power-domains = <&power RK3568_PD_PIPE>; reg = <0x3 0xc0800000 0x0 0x00400000>, <0x0 0xfe280000 0x0 0x00010000>, - <0x3 0xbf000000 0x0 0x01000000>; - ranges = <0x01000000 0x0 0x3ef00000 0x3 0xbef00000 0x0 0x00100000>, - <0x02000000 0x0 0x00000000 0x3 0x80000000 0x0 0x3ef00000>; + <0x0 0xf0000000 0x0 0x00100000>; + ranges = <0x01000000 0x0 0xf0100000 0x0 0xf0100000 0x0 0x00100000>, + <0x02000000 0x0 0xf0200000 0x0 0xf0200000 0x0 0x01e00000>, + <0x03000000 0x0 0x40000000 0x3 0x80000000 0x0 0x40000000>; reg-names = "dbi", "apb", "config"; resets = <&cru SRST_PCIE30X2_POWERUP>; reset-names = "pipe"; diff --git a/arch/arm/dts/rk356x.dtsi b/arch/arm/dts/rk356x.dtsi index 6492ace0de6b..e0591c194bec 100644 --- a/arch/arm/dts/rk356x.dtsi +++ b/arch/arm/dts/rk356x.dtsi @@ -951,7 +951,7 @@ compatible = "rockchip,rk3568-pcie"; reg = <0x3 0xc0000000 0x0 0x00400000>, <0x0 0xfe260000 0x0 0x00010000>, - <0x3 0x3f000000 0x0 0x01000000>; + <0x0 0xf4000000 0x0 0x00100000>; reg-names = "dbi", "apb", "config"; interrupts = , , @@ -980,8 +980,9 @@ phys = <&combphy2 PHY_TYPE_PCIE>; phy-names = "pcie-phy"; power-domains = <&power RK3568_PD_PIPE>; - ranges = <0x01000000 0x0 0x3ef00000 0x3 0x3ef00000 0x0 0x00100000 - 0x02000000 0x0 0x00000000 0x3 0x00000000 0x0 0x3ef00000>; + ranges = <0x01000000 0x0 0xf4100000 0x0 0xf4100000 0x0 0x00100000>, + <0x02000000 0x0 0xf4200000 0x0 0xf4200000 0x0 0x01e00000>, + <0x03000000 0x0 0x40000000 0x3 0x00000000 0x0 0x40000000>; resets = <&cru SRST_PCIE20_POWERUP>; reset-names = "pipe"; #address-cells = <3>;