Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34614 )
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
device/pci_ops: Make PCI_BDF() available in all stages
Caller needs to take into account that bus numbers may have not been assigned yet. Same issue existed before with early ramstage and mostly does not cause problems when used with static devices on bus 0.
Change-Id: I4865b4277dbc858c8c2ffd2052defcaa1a92173c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/device/pci_device.c M src/device/pci_ops.c M src/include/device/pci_ops.h 3 files changed, 21 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/34614/1
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 7786043..5765529 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -630,11 +630,6 @@ pci_write_config16(dev, PCI_COMMAND, command); }
-void __noreturn pcidev_die(void) -{ - die("PCI: dev is NULL!\n"); -} - void pci_bus_enable_resources(struct device *dev) { u16 ctrl; diff --git a/src/device/pci_ops.c b/src/device/pci_ops.c index 9613315..6f42978 100644 --- a/src/device/pci_ops.c +++ b/src/device/pci_ops.c @@ -14,6 +14,7 @@ #define __SIMPLE_DEVICE__
#include <stdint.h> +#include <console/console.h> #include <device/pci.h> #include <device/pci_def.h> #include <device/pci_ops.h> @@ -85,3 +86,8 @@ { return pci_s_find_next_capability(dev, cap, 0); } + +void __noreturn pcidev_die(void) +{ + die("PCI: dev is NULL!\n"); +} diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index 9a9c575..af5ca08 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -20,25 +20,10 @@
#include <stdint.h> #include <device/device.h> +#include <device/pci.h> #include <device/pci_type.h> #include <arch/pci_ops.h>
-#ifdef __SIMPLE_DEVICE__ - -/* Avoid name collisions as different stages have different signature - * for these functions. The _s_ stands for simple, fundamental IO or - * MMIO variant. - */ -#define pci_read_config8 pci_s_read_config8 -#define pci_read_config16 pci_s_read_config16 -#define pci_read_config32 pci_s_read_config32 -#define pci_write_config8 pci_s_write_config8 -#define pci_write_config16 pci_s_write_config16 -#define pci_write_config32 pci_s_write_config32 -#else - -#include <device/pci.h> - void __noreturn pcidev_die(void);
static __always_inline pci_devfn_t pcidev_bdf(const struct device *dev) @@ -53,6 +38,20 @@ return pcidev_bdf(dev); }
+#ifdef __SIMPLE_DEVICE__ + +/* Avoid name collisions as different stages have different signature + * for these functions. The _s_ stands for simple, fundamental IO or + * MMIO variant. + */ +#define pci_read_config8 pci_s_read_config8 +#define pci_read_config16 pci_s_read_config16 +#define pci_read_config32 pci_s_read_config32 +#define pci_write_config8 pci_s_write_config8 +#define pci_write_config16 pci_s_write_config16 +#define pci_write_config32 pci_s_write_config32 +#else + static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg) {
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34614
to look at the new patch set (#2).
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
device/pci_ops: Make PCI_BDF() available in all stages
Caller needs to take into account that bus numbers may have not been assigned yet. Same issue existed before with early ramstage and mostly does not cause problems when used with static devices on bus 0.
Change-Id: I4865b4277dbc858c8c2ffd2052defcaa1a92173c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/device/pci_device.c M src/device/pci_ops.c M src/include/device/pci_ops.h 3 files changed, 22 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/34614/2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34614 )
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
Patch Set 2: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34614 )
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
Patch Set 3: Code-Review+2
Aamir Bohra has uploaded a new patch set (#4) to the change originally created by Kyösti Mälkki. ( https://review.coreboot.org/c/coreboot/+/34614 )
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
device/pci_ops: Make PCI_BDF() available in all stages
Caller needs to take into account that bus numbers may have not been assigned yet. Same issue existed before with early ramstage and mostly does not cause problems when used with static devices on bus 0.
Change-Id: I4865b4277dbc858c8c2ffd2052defcaa1a92173c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/device/pci_device.c M src/device/pci_ops.c M src/include/device/pci_ops.h 3 files changed, 22 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/34614/4
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34614 )
Change subject: device/pci_ops: Make PCI_BDF() available in all stages ......................................................................
device/pci_ops: Make PCI_BDF() available in all stages
Caller needs to take into account that bus numbers may have not been assigned yet. Same issue existed before with early ramstage and mostly does not cause problems when used with static devices on bus 0.
Change-Id: I4865b4277dbc858c8c2ffd2052defcaa1a92173c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34614 Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/device/pci_device.c M src/device/pci_ops.c M src/include/device/pci_ops.h 3 files changed, 22 insertions(+), 21 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Furquan Shaikh: Looks good to me, approved
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 7786043..5765529 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -630,11 +630,6 @@ pci_write_config16(dev, PCI_COMMAND, command); }
-void __noreturn pcidev_die(void) -{ - die("PCI: dev is NULL!\n"); -} - void pci_bus_enable_resources(struct device *dev) { u16 ctrl; diff --git a/src/device/pci_ops.c b/src/device/pci_ops.c index 9613315..6f42978 100644 --- a/src/device/pci_ops.c +++ b/src/device/pci_ops.c @@ -14,6 +14,7 @@ #define __SIMPLE_DEVICE__
#include <stdint.h> +#include <console/console.h> #include <device/pci.h> #include <device/pci_def.h> #include <device/pci_ops.h> @@ -85,3 +86,8 @@ { return pci_s_find_next_capability(dev, cap, 0); } + +void __noreturn pcidev_die(void) +{ + die("PCI: dev is NULL!\n"); +} diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index 9a9c575..5cc803c 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -23,22 +23,7 @@ #include <device/pci_type.h> #include <arch/pci_ops.h>
-#ifdef __SIMPLE_DEVICE__ - -/* Avoid name collisions as different stages have different signature - * for these functions. The _s_ stands for simple, fundamental IO or - * MMIO variant. - */ -#define pci_read_config8 pci_s_read_config8 -#define pci_read_config16 pci_s_read_config16 -#define pci_read_config32 pci_s_read_config32 -#define pci_write_config8 pci_s_write_config8 -#define pci_write_config16 pci_s_write_config16 -#define pci_write_config32 pci_s_write_config32 -#else - -#include <device/pci.h> - +#ifndef __ROMCC__ void __noreturn pcidev_die(void);
static __always_inline pci_devfn_t pcidev_bdf(const struct device *dev) @@ -52,6 +37,21 @@ pcidev_die(); return pcidev_bdf(dev); } +#endif + +#ifdef __SIMPLE_DEVICE__ + +/* Avoid name collisions as different stages have different signature + * for these functions. The _s_ stands for simple, fundamental IO or + * MMIO variant. + */ +#define pci_read_config8 pci_s_read_config8 +#define pci_read_config16 pci_s_read_config16 +#define pci_read_config32 pci_s_read_config32 +#define pci_write_config8 pci_s_write_config8 +#define pci_write_config16 pci_s_write_config16 +#define pci_write_config32 pci_s_write_config32 +#else
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)