public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/3] pci: pci-uclass: Add board_pci_fixup_dev for DM_PCI
Date: Fri, 16 Apr 2021 14:53:47 -0700	[thread overview]
Message-ID: <20210416215348.15277-2-tharvey@gateworks.com> (raw)
In-Reply-To: <20210416215348.15277-1-tharvey@gateworks.com>

Add a board_pci_fixup_dev weak function to allow PCI device fixups
during enumeration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/pci/pci-uclass.c | 6 ++++++
 include/pci.h            | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index f463ef3550..22a033e632 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -790,6 +790,10 @@ error:
 	return ret;
 }
 
+__weak extern void board_pci_fixup_dev(struct udevice *bus, struct udevice *dev)
+{
+}
+
 int pci_bind_bus_devices(struct udevice *bus)
 {
 	ulong vendor, device;
@@ -895,6 +899,8 @@ int pci_bind_bus_devices(struct udevice *bus)
 				}
 			}
 		}
+
+		board_pci_fixup_dev(bus, dev);
 	}
 
 	return 0;
diff --git a/include/pci.h b/include/pci.h
index 5f36537b72..2353cebb2a 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -1690,6 +1690,14 @@ int sandbox_pci_get_emul(const struct udevice *bus, pci_dev_t find_devfn,
  */
 int sandbox_pci_get_client(struct udevice *emul, struct udevice **devp);
 
+/**
+ * board_pci_fixup_dev() - Board callback for PCI device fixups
+ *
+ * @bus:	PCI bus
+ * @dev:	PCI device
+ */
+extern void board_pci_fixup_dev(struct udevice *bus, struct udevice *dev);
+
 #endif /* CONFIG_DM_PCI */
 
 /**
-- 
2.17.1

  reply	other threads:[~2021-04-16 21:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 21:53 [PATCH 1/3] pci: Update the highest subordinate bus number for bridge setup Tim Harvey
2021-04-16 21:53 ` Tim Harvey [this message]
2021-05-02 11:42   ` [PATCH 2/3] pci: pci-uclass: Add board_pci_fixup_dev for DM_PCI stefano.babic at babic.homelinux.org
2021-04-16 21:53 ` [PATCH 3/3] imx: ventana: enable dm support for PCI and FEC ethernet Tim Harvey
2021-05-02 11:38   ` Stefano Babic
2021-05-03 18:21   ` [PATCH] " Tim Harvey
2021-05-29  1:22     ` Tim Harvey
2021-06-09 13:44     ` sbabic
2021-04-16 22:30 ` [PATCH 1/3] pci: Update the highest subordinate bus number for bridge setup Masami Hiramatsu
2021-04-16 22:35   ` Tim Harvey
2021-04-16 23:19     ` Masami Hiramatsu
2021-05-02 11:43 ` stefano.babic at babic.homelinux.org

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=20210416215348.15277-2-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /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