preparation for sharing PCIe host bridge drivers between arm64 and riscv64.
ok mpi@, mlarkin@, patrick@
-/* $OpenBSD: acpi_machdep.c,v 1.14 2021/03/16 18:31:16 patrick Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.15 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis
*
int (*func)(void *), void *arg, const char *name)
{
struct interrupt_controller *ic;
- struct arm_intr_handle *aih;
+ struct machine_intr_handle *aih;
uint32_t interrupt[3];
void *cookie;
void
acpi_intr_disestablish(void *cookie)
{
- struct arm_intr_handle *aih = cookie;
+ struct machine_intr_handle *aih = cookie;
struct interrupt_controller *ic = aih->ih_ic;
ic->ic_disestablish(aih->ih_ih);
-/* $OpenBSD: intr.c,v 1.22 2021/05/15 11:30:27 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.23 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
struct interrupt_controller *ic;
int i, len, ncells, extended = 1;
uint32_t *cell, *cells, phandle;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
void *val = NULL;
len = OF_getproplen(node, "interrupts-extended");
struct cpu_info *ci, int (*func)(void *), void *cookie, char *name)
{
struct interrupt_controller *ic;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
uint32_t *cell;
uint32_t map_mask[4], *map;
int len, acells, ncells;
char *name)
{
struct interrupt_controller *ic;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
uint32_t phandle;
void *val = NULL;
void
arm_intr_disestablish_fdt(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_disestablish(ih->ih_ih);
void
arm_intr_enable(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
KASSERT(ic->ic_enable != NULL);
void
arm_intr_disable(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
KASSERT(ic->ic_disable != NULL);
struct cpu_info *ci, int (*func)(void *), void *arg, char *name)
{
struct interrupt_controller *ic = cookie;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
uint32_t phandle;
void *val;
void
arm_intr_parent_disestablish_fdt(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_disestablish(ih->ih_ih);
void
arm_intr_route(void *cookie, int enable, struct cpu_info *ci)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
if (ic->ic_route)
void
intr_barrier(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_barrier(ih->ih_ih);
-/* $OpenBSD: acpipci.c,v 1.28 2021/03/22 20:30:21 patrick Exp $ */
+/* $OpenBSD: acpipci.c,v 1.29 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis
*
bus_space_tag_t am_iot;
bus_space_handle_t am_ioh;
- struct arm64_pci_chipset am_pc;
+ struct machine_pci_chipset am_pc;
};
struct acpipci_trans {
};
struct acpipci_intr_handle {
- struct arm_intr_handle aih_ih;
- bus_dma_tag_t aih_dmat;
- bus_dmamap_t aih_map;
+ struct machine_intr_handle aih_ih;
+ bus_dma_tag_t aih_dmat;
+ bus_dmamap_t aih_map;
};
int acpipci_match(struct device *, void *, void *);
{
}
-struct arm64_pci_chipset acpipci_dummy_chipset = {
+struct machine_pci_chipset acpipci_dummy_chipset = {
.pc_attach_hook = acpipci_attach_hook,
.pc_bus_maxdevs = acpipci_bus_maxdevs,
.pc_make_tag = acpipci_make_tag,
-/* $OpenBSD: aplpcie.c,v 1.1 2021/02/26 11:09:23 kettenis Exp $ */
+/* $OpenBSD: aplpcie.c,v 1.2 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
*
struct bus_space sc_bus_iot;
struct bus_space sc_bus_memt;
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
struct extent *sc_busex;
struct extent *sc_memex;
struct extent *sc_pmemex;
-/* $OpenBSD: pciecam.c,v 1.14 2021/03/22 20:30:21 patrick Exp $ */
+/* $OpenBSD: pciecam.c,v 1.15 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2013,2017 Patrick Wildt <patrick@blueri.se>
*
struct extent *sc_memex;
char sc_ioex_name[32];
char sc_memex_name[32];
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
};
struct pciecam_intr_handle {
- struct arm_intr_handle pih_ih;
- bus_dma_tag_t pih_dmat;
- bus_dmamap_t pih_map;
+ struct machine_intr_handle pih_ih;
+ bus_dma_tag_t pih_dmat;
+ bus_dmamap_t pih_map;
};
int pciecam_match(struct device *, void *, void *);
-/* $OpenBSD: intr.h,v 1.17 2021/02/17 12:11:45 kettenis Exp $ */
+/* $OpenBSD: intr.h,v 1.18 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void arm_set_intr_handler(int (*)(int), int (*)(int), void (*)(int),
void (*)(int), void (*)(void *), void (*)(void *));
-struct arm_intr_handle {
+struct machine_intr_handle {
struct interrupt_controller *ih_ic;
void *ih_ih;
};
-/* $OpenBSD: pci_machdep.h,v 1.9 2021/03/22 20:30:21 patrick Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.10 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
*/
-typedef struct arm64_pci_chipset *pci_chipset_tag_t;
+typedef struct machine_pci_chipset *pci_chipset_tag_t;
typedef u_long pcitag_t;
/* Supported interrupt types. */
struct pci_attach_args;
/*
- * arm64-specific PCI structure and type definitions.
+ * Machine-specific PCI structure and type definitions.
* NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
*/
-struct arm64_pci_chipset {
+struct machine_pci_chipset {
void *pc_conf_v;
void (*pc_attach_hook)(struct device *,
struct device *, struct pcibus_attach_args *);
-/* $OpenBSD: bcm2711_pcie.c,v 1.5 2021/02/25 23:07:49 patrick Exp $ */
+/* $OpenBSD: bcm2711_pcie.c,v 1.6 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
struct bus_space sc_bus_iot;
struct bus_space sc_bus_memt;
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
int sc_bus;
};
-/* $OpenBSD: dwpcie.c,v 1.28 2021/03/22 20:30:21 patrick Exp $ */
+/* $OpenBSD: dwpcie.c,v 1.29 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
struct bus_space sc_bus_iot;
struct bus_space sc_bus_memt;
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
int sc_bus;
int sc_num_viewport;
};
struct dwpcie_intr_handle {
- struct arm_intr_handle pih_ih;
- bus_dma_tag_t pih_dmat;
- bus_dmamap_t pih_map;
+ struct machine_intr_handle pih_ih;
+ bus_dma_tag_t pih_dmat;
+ bus_dmamap_t pih_map;
};
int dwpcie_match(struct device *, void *, void *);
-/* $OpenBSD: mvgicp.c,v 1.3 2020/07/17 08:07:34 patrick Exp $ */
+/* $OpenBSD: mvgicp.c,v 1.4 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2019 Patrick Wildt <patrick@blueri.se>
*
{
struct mvgicp_softc *sc = (struct mvgicp_softc *)self;
struct interrupt_controller *ic = sc->sc_parent_ic;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
uint32_t interrupt[3];
uint32_t flags;
void *cookie;
void
mvgicp_intr_disestablish(void *cookie)
{
- struct arm_intr_handle *ih = *(void **)cookie;
+ struct machine_intr_handle *ih = *(void **)cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_disestablish(ih->ih_ih);
void
mvgicp_intr_barrier(void *cookie)
{
- struct arm_intr_handle *ih = *(void **)cookie;
+ struct machine_intr_handle *ih = *(void **)cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_barrier(ih->ih_ih);
-/* $OpenBSD: mvicu.c,v 1.6 2020/07/17 08:07:34 patrick Exp $ */
+/* $OpenBSD: mvicu.c,v 1.7 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
struct mvicu_subnode *sn = cookie;
struct mvicu_softc *sc = sn->sn_sc;
struct interrupt_controller *ic = sn->sn_parent_ic;
- struct arm_intr_handle *ih;
+ struct machine_intr_handle *ih;
uint32_t idx, flags;
uint64_t addr, data;
int edge = 0;
void
mvicu_intr_barrier(void *cookie)
{
- struct arm_intr_handle *ih = cookie;
+ struct machine_intr_handle *ih = cookie;
struct interrupt_controller *ic = ih->ih_ic;
ic->ic_barrier(ih->ih_ih);
-/* $OpenBSD: mvkpcie.c,v 1.9 2021/02/25 23:07:49 patrick Exp $ */
+/* $OpenBSD: mvkpcie.c,v 1.10 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
struct bus_space sc_bus_iot;
struct bus_space sc_bus_memt;
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
int sc_bus;
uint32_t sc_bridge_command;
-/* $OpenBSD: rkpcie.c,v 1.13 2021/03/01 20:49:20 patrick Exp $ */
+/* $OpenBSD: rkpcie.c,v 1.14 2021/05/17 17:25:13 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
int sc_node;
int sc_phy_node;
- struct arm64_pci_chipset sc_pc;
+ struct machine_pci_chipset sc_pc;
struct extent *sc_busex;
struct extent *sc_memex;
struct extent *sc_ioex;