[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 13/41] Add BCM2838 PCIE Root Complex
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v6 13/41] Add BCM2838 PCIE Root Complex |
Date: |
Mon, 26 Feb 2024 14:25:55 +0100 |
User-agent: |
Mozilla Thunderbird |
Hi Sergey,
On 26/2/24 01:02, Sergey Kambalin wrote:
Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
---
hw/arm/bcm2838_pcie.c | 82 +++++++++++++++++++++++++++++++++++
hw/arm/meson.build | 5 ++-
include/hw/arm/bcm2838_pcie.h | 53 ++++++++++++++++++++++
3 files changed, 139 insertions(+), 1 deletion(-)
create mode 100644 hw/arm/bcm2838_pcie.c
create mode 100644 include/hw/arm/bcm2838_pcie.h
+static void bcm2838_pcie_root_init(Object *obj)
+{
+ PCIBridge *br = PCI_BRIDGE(obj);
+ br->bus_name = "pcie.1";
Shouldn't we set the bridge name using pci_bridge_map_irq()?
+}
+
+static void bcm2838_pcie_root_class_init(ObjectClass *class, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(class);
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(class);
+ ResettableClass *rc = RESETTABLE_CLASS(class);
+ PCIERootPortClass *rpc = PCIE_ROOT_PORT_CLASS(class);
+
+ dc->desc = "BCM2711 PCIe Bridge";
+ /*
+ * PCI-facing part of the host bridge, not usable without the host-facing
+ * part, which can't be device_add'ed.
This is the host-facing part; you add the PCI-facing one in
the next patch.
+ */
+
+ resettable_class_set_parent_phases(rc, NULL,
+ bcm2838_pcie_root_port_reset_hold,
+ NULL, &rpc->parent_phases);
+
+ dc->user_creatable = false;
+ k->vendor_id = BCM2838_PCIE_VENDOR_ID;
+ k->device_id = BCM2838_PCIE_DEVICE_ID;
+ k->revision = BCM2838_PCIE_REVISION;
+
+ rpc->exp_offset = BCM2838_PCIE_EXP_CAP_OFFSET;
+ rpc->aer_offset = BCM2838_PCIE_AER_CAP_OFFSET;
+}
+
+static const TypeInfo bcm2838_pcie_root_info = {
+ .name = TYPE_BCM2838_PCIE_ROOT,
+ .parent = TYPE_PCIE_ROOT_PORT,
+ .instance_size = sizeof(BCM2838PcieRootState),
+ .instance_init = bcm2838_pcie_root_init,
+ .class_init = bcm2838_pcie_root_class_init,
+};
+
+static void bcm2838_pcie_register(void)
+{
+ type_register_static(&bcm2838_pcie_root_info);
+}
Please use the DEFINE_TYPES() if you have to respin.
- [PATCH v6 08/41] Connect SD controller to BCM2838 GPIO, (continued)
- [PATCH v6 08/41] Connect SD controller to BCM2838 GPIO, Sergey Kambalin, 2024/02/25
- [PATCH v6 02/41] Split out common part of peripherals, Sergey Kambalin, 2024/02/25
- [PATCH v6 04/41] Introduce BCM2838 SoC, Sergey Kambalin, 2024/02/25
- [PATCH v6 06/41] Add BCM2838 GPIO stub, Sergey Kambalin, 2024/02/25
- [PATCH v6 09/41] Add GPIO and SD to BCM2838 periph, Sergey Kambalin, 2024/02/25
- [PATCH v6 12/41] Add memory region for BCM2837 RPiVid ASB, Sergey Kambalin, 2024/02/25
- [PATCH v6 14/41] Add BCM2838 PCIE host, Sergey Kambalin, 2024/02/25
- [PATCH v6 10/41] Introduce Raspberry PI 4 machine, Sergey Kambalin, 2024/02/25
- [PATCH v6 13/41] Add BCM2838 PCIE Root Complex, Sergey Kambalin, 2024/02/25
- Re: [PATCH v6 13/41] Add BCM2838 PCIE Root Complex,
Philippe Mathieu-Daudé <=
- [PATCH v6 15/41] Enable BCM2838 PCIE, Sergey Kambalin, 2024/02/25
- [PATCH v6 16/41] Add RPi4 RNG200, Sergey Kambalin, 2024/02/25
- [PATCH v6 05/41] Add GIC-400 to BCM2838 SoC, Sergey Kambalin, 2024/02/25
- [PATCH v6 17/41] Implement BCM2838 thermal sensor, Sergey Kambalin, 2024/02/25
- [PATCH v6 03/41] Split out raspi machine common part, Sergey Kambalin, 2024/02/25
- [PATCH v6 20/41] Add GENET register structs. Part 1, Sergey Kambalin, 2024/02/25
- [PATCH v6 18/41] Add clock_isp stub, Sergey Kambalin, 2024/02/25
- [PATCH v6 19/41] Add GENET stub, Sergey Kambalin, 2024/02/25