From 0b5802449d399708068ed7c9a345b4024c2c594d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 4 Jul 2023 12:15:56 +0200 Subject: [PATCH] emulation/{i440fx,q35}: Don't use PCI driver to set root PCI dev ops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This devices is always present so hooking up the ops in devicetree makes more sense. Signed-off-by: Arthur Heymans Change-Id: I369129e365ce8596cad25b97d12168bb08e3ed0e Reviewed-on: https://review.coreboot.org/c/coreboot/+/76241 Reviewed-by: Kyösti Mälkki Reviewed-by: Lean Sheng Tan Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Eric Lai --- src/mainboard/emulation/qemu-i440fx/devicetree.cb | 2 +- src/mainboard/emulation/qemu-i440fx/mainboard.c | 8 +------- src/mainboard/emulation/qemu-q35/devicetree.cb | 2 +- src/mainboard/emulation/qemu-q35/mainboard.c | 8 +------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/mainboard/emulation/qemu-i440fx/devicetree.cb b/src/mainboard/emulation/qemu-i440fx/devicetree.cb index cecba1c82a..3e4475f6f0 100644 --- a/src/mainboard/emulation/qemu-i440fx/devicetree.cb +++ b/src/mainboard/emulation/qemu-i440fx/devicetree.cb @@ -1,7 +1,7 @@ chip mainboard/emulation/qemu-i440fx device cpu_cluster 0 on end device domain 0 on - device pci 0.0 on end # northbridge (i440fx) + device pci 0.0 on ops nb_operations end # northbridge (i440fx) chip southbridge/intel/i82371eb # southbridge device pci 01.0 on end # ISA bridge device pci 01.1 on end # IDE diff --git a/src/mainboard/emulation/qemu-i440fx/mainboard.c b/src/mainboard/emulation/qemu-i440fx/mainboard.c index 50c5c02722..7debf8c308 100644 --- a/src/mainboard/emulation/qemu-i440fx/mainboard.c +++ b/src/mainboard/emulation/qemu-i440fx/mainboard.c @@ -41,15 +41,9 @@ static void qemu_nb_read_resources(struct device *dev) } } -static struct device_operations nb_operations = { +struct device_operations nb_operations = { .read_resources = qemu_nb_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = qemu_nb_init, }; - -static const struct pci_driver nb_driver __pci_driver = { - .ops = &nb_operations, - .vendor = 0x8086, - .device = 0x1237, -}; diff --git a/src/mainboard/emulation/qemu-q35/devicetree.cb b/src/mainboard/emulation/qemu-q35/devicetree.cb index 6bd3d9dc32..063c5e9aba 100644 --- a/src/mainboard/emulation/qemu-q35/devicetree.cb +++ b/src/mainboard/emulation/qemu-q35/devicetree.cb @@ -1,7 +1,7 @@ chip mainboard/emulation/qemu-q35 device cpu_cluster 0 on end device domain 0 on - device pci 0.0 mandatory end # northbridge (q35) + device pci 0.0 mandatory ops nb_operations end # northbridge (q35) chip southbridge/intel/i82801ix # present unconditionally device pci 1f.0 mandatory diff --git a/src/mainboard/emulation/qemu-q35/mainboard.c b/src/mainboard/emulation/qemu-q35/mainboard.c index 7d6707c5a5..1ff4c04d53 100644 --- a/src/mainboard/emulation/qemu-q35/mainboard.c +++ b/src/mainboard/emulation/qemu-q35/mainboard.c @@ -63,15 +63,9 @@ static void qemu_nb_read_resources(struct device *dev) } -static struct device_operations nb_operations = { +struct device_operations nb_operations = { .read_resources = qemu_nb_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = qemu_nb_init, }; - -static const struct pci_driver nb_driver __pci_driver = { - .ops = &nb_operations, - .vendor = 0x8086, - .device = 0x29c0, -};