linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: <linux-pci@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <robh@kernel.org>
Cc: Lizhi Hou <lizhi.hou@amd.com>, <max.zhen@amd.com>,
	<sonal.santan@amd.com>, <stefano.stabellini@xilinx.com>
Subject: [PATCH V9 3/6] PCI: Add PCI quirks to generate device tree node for Xilinx Alveo U50
Date: Thu, 15 Jun 2023 09:50:39 -0700	[thread overview]
Message-ID: <1686847842-33780-4-git-send-email-lizhi.hou@amd.com> (raw)
In-Reply-To: <1686847842-33780-1-git-send-email-lizhi.hou@amd.com>

The Xilinx Alveo U50 PCI card exposes multiple hardware peripherals on
its PCI BAR. The card firmware provides a flattened device tree to
describe the hardware peripherals on its BARs. This allows U50 driver to
load the flattened device tree and generate the device tree node for
hardware peripherals underneath.

To generate device tree node for U50 card, added PCI quirks to call
of_pci_make_dev_node() for U50.

Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/pci/quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index c525867760bf..c8f3acea752d 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6041,3 +6041,14 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a2d, dpc_log_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a2f, dpc_log_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a31, dpc_log_size);
 #endif
+
+/*
+ * For PCI device which have multiple downstream devices, its driver may use
+ * a flattened device tree to describe the downstream devices.
+ * To overlay the flattened device tree, the PCI device and all its ancestor
+ * devices need to have device tree nodes on system base device tree. Thus,
+ * before driver probing, it might need to add a device tree node as the final
+ * fixup.
+ */
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
-- 
2.34.1


  parent reply	other threads:[~2023-06-15 16:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 16:50 [PATCH V9 0/6] Generate device tree node for pci devices Lizhi Hou
2023-06-15 16:50 ` [PATCH V9 1/6] of: dynamic: Add interfaces for creating device node dynamically Lizhi Hou
2023-06-15 16:50 ` [PATCH V9 2/6] PCI: Create device tree node for selected devices Lizhi Hou
2023-06-15 16:50 ` Lizhi Hou [this message]
2023-06-15 16:50 ` [PATCH V9 4/6] PCI: Add ranges property for pci endpoint Lizhi Hou
2023-06-20 22:00   ` Rob Herring
2023-06-20 22:57     ` Lizhi Hou
2023-06-15 16:50 ` [PATCH V9 5/6] of: overlay: Extend of_overlay_fdt_apply() to specify the target node Lizhi Hou
2023-06-15 16:50 ` [PATCH V9 6/6] of: unittest: Add pci_dt_testdrv pci driver Lizhi Hou
2023-06-15 20:58   ` kernel test robot
2023-06-20 22:08 ` [PATCH V9 0/6] Generate device tree node for pci devices Rob Herring
2023-06-21 20:29   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1686847842-33780-4-git-send-email-lizhi.hou@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=max.zhen@amd.com \
    --cc=robh@kernel.org \
    --cc=sonal.santan@amd.com \
    --cc=stefano.stabellini@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).