From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C63B3AFCFE for ; Thu, 13 Aug 2026 22:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786658845; cv=none; b=Xk1kEjpEf6xBag4R0/imHXwEE4QIYqK3MogVh1eprDQszn2caBULVhtxumcyV7e9mB31RkpO1OAe/4sm4j+rc1qW8x417rnWooyhGxKJBkfvAZTXtBAxzMDEcrlT7a/wpGI6GjrlA7pmGAHmycTstBPT96BeIs1/QlRSqKh6GB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786658845; c=relaxed/simple; bh=XxRz6eIi4vrbGSsrtHk1K9sZwlUFzoyA5/RS2yUTgGk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IFd9DY+Ze3wGte14YwusYWy6evP6J4w90i0XzP93rzrL4a9RgHawOnWyXJsBQHSamm5K8lpajh6xaJiv6io/t+RiBTH6XxUvNWFbzRmaS+oMv+vb9G7ppHS/WKshgl3JfzqI96x4bnGE1pjjdQHOV/4e+tmbe/AWCpubc7MZDn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=CvAgzI5P; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="CvAgzI5P" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-92e53581361so22035585a.1 for ; Thu, 13 Aug 2026 15:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1786658841; x=1787263641; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pdj1VPsCLSMdSAO15ZyEARW2To6jf4TLj09ZtMHsVfI=; b=CvAgzI5PTI+Fb9y0PhSxV3zRCu749+La2+ZbVCyR5OjNTPLaJ/t8m/Qn878cHvUO9P TnMr2kUITXhc7zFQPam+nJrdyY7aN7mmZgSAeJIblL2OQL1wbghlQaSM3T5UdIkUL/bi lWqE92uucF75PCHO7UKcsiYPVFfptJBc/7nBaQBJxtkrObGQyjTmWVc9MpIsda/FesqB ku3vhF6+qebx6pxUfL+lPqEsNnbDu2gt7Scq4eU0KnwBlTIiE2u6Uch6FBUXoXpudUrG Sz6dbAoz1trp6W1RCU3SBWSapUBtxXivj9rm/C83gEmMncaYGVyU/NG+i4uRtf4s0XFh Y4sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786658841; x=1787263641; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pdj1VPsCLSMdSAO15ZyEARW2To6jf4TLj09ZtMHsVfI=; b=EuKBeboWRtM1cJKY/T21c9kErCMJXVf7F8p8p0O2UzDl6omvKoQ7z0z2cv5tHqRI6K xIC0B5H6CFvqu88FzK/5eafXw1Zzld2nfxoKSL2KYtqU5CXmj3iJ6IiKeg4X3uBeZ9GH egRAaLrVLAZgGYhMFFr6pXTdB/jy98fydiNIJnttrIf+P2LpZN+2Vb0uJu2J+TlNw+9b Zyu13XAWT48OIyb+PeLh9NZArjxk0swhplOI33q1Rr3j/hQ3Oqhpm6LSRcgQiCGfbGEy s+l2P6/QPrMGrHWyfy4iM+DGI/2TzIcsMTLapXLfn4pPyqu65LMw6SxXXtDXFagE7zAs iiWQ== X-Forwarded-Encrypted: i=1; AHgh+Rr4ZaeWrwadgIWWKvQQ7A670L7XqU5cvzZr/iuAK3YNl4N9tSwapXMmRKxyzWBISIRYutFT7EBFtNjSD0U=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/TakgnlC0/hSyh4Lr5WFMzYDPOVIBszGRWWt/7YOx+66W4WTj rzUClEGFtlo4q5iFUABqVOP81WoS0SMiWar58xJa5nJztSIiFjtqh9rDvHXMIz5y5s4= X-Gm-Gg: AR+sD13p26aBAcm/qAqFuP9EiDotgG0GQXHvuwtcsmagxHARi6PBBXP5IQdkbpgB5wy RtYrM1ioLKh1o6awGdtFLWPoRXE8kWc1k0JlA+NcwfkJttBOcEJv34I39ophXCZKUF6mfYs3ERH F/1y+261tYBC+pDna0Ro5r8jdqKk11fkBezUygGhmJOv1x90/r662NUMDQ2HdzvwUumU+UohXG4 RU7EaRZdxEZ0mDT8bm6S7s5U9/Ksryw0PQ/67p2O1gEUxq3Sk/lNiF0b/fpMXMM8uHsxY/pdw4S SoUCUXhQ57oS9BnYCUpTA3yceXf8744tjwuFnw/0VhaTmgiNUwgASL906+nWdJqvYv93abGqq99 zjQTCXqJp0BuWKGLCGV2KsWJ89Frefdk5YxSuEZsm3pAvdN4PueRjNnT5tjDDM6bw9qdmSHcLnH Bzrg7JDZI4dSyTxyLQhLlRlJ33zCIKrobRUZlV4wB7tq+B3MZH3R7PFbTR1lCb0lX0O72sjF5PB Vg= X-Received: by 2002:a05:620a:6884:b0:936:6c8a:f7aa with SMTP id af79cd13be357-936d1fddbfamr124328085a.4.1786658841069; Thu, 13 Aug 2026 15:07:21 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-936ce22e990sm86776985a.38.2026.08.13.15.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 15:07:20 -0700 (PDT) From: Alex Elder To: bhelgaas@google.com Cc: lizhi.hou@amd.com, herve.codina@bootlin.com, andrea.porta@suse.com, daniel@riscstar.com, mohdayaa@qti.qualcomm.com, lbiancon@qti.qualcomm.com, mani@kernel.org, robh@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] PCI: of: update endpoint ranges dynamically Date: Thu, 13 Aug 2026 17:07:14 -0500 Message-ID: <20260813220717.1394644-1-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A PCI endpoint bus is a devicetree construct that allows a PCI endpoint (function) to have sub-devices defined that are accessible in an SoC via the PCI endpoint's BARs. Such a bus is represented as a devicetree sub-node for a PCI function having the name "pci-ep-bus". There can be one or more pci-ep-bus nodes. A PCI function with a pci-ep-bus devicetree node must also define "#address-cells", "#size-cells", and "ranges" properties, to specify how endpoint bus addresses are translated to the PCI parent bus. An endpoint bus address has three cells; the first indicates which of the function's BARs the address is associated with, and the other two specify a 64-bit (2 cell) offset within the BAR's region. BAR base addresses are determined dynamically by the PCI enumeration process, so generally it's not possible to include them in a static devicetree file. When this addressing scheme was introduced, this was not a problem because the devicetree content was generated dynamically--after booting--based on the information (including BAR addresses) available following PCI enumeration. It is possible (and in some cases, necessary) to define the devicetree nodes that represent PCI devices ahead of time, in a statically-defined devicetree file. In order to support the PCI endpoint bus model in this case it is necessary to dynamically update the static devicetree so that the BAR base addresses assigned during enumeration are reflected in the endpoint's "ranges" property. This series implements that dynamic update, leveraging the same code used to create the "ranges" property when PCI_DYNAMIC_OF_NODES is enabled. The first patch separates the code that dynamically builds the property value into a helper function, and the second arranges for even statically-defined devicetree nodes to have the "ranges" property updated. -Alex Note: this series is built upon these patches: https://lore.kernel.org/lkml/20260812172247.276554-5-elder@riscstar.com/ Alex Elder (2): PCI: of: introduce of_pci_build_prop_ranges() PCI: of: introduce of_pci_update_endpoint_node_ranges() drivers/pci/of.c | 59 ++++++++++++++--- drivers/pci/of_property.c | 129 +++++++++++++++++++++++++------------- drivers/pci/pci.h | 1 + 3 files changed, 139 insertions(+), 50 deletions(-) base-commit: cb0a459e8259a695f4c2d179534b931399e6847f -- 2.53.0