xref: /openbmc/linux/arch/sparc/include/asm/pbm.h (revision b2441318)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2a439fe51SSam Ravnborg /*
3a439fe51SSam Ravnborg  *
4a439fe51SSam Ravnborg  * pbm.h: PCI bus module pseudo driver software state
5a439fe51SSam Ravnborg  *        Adopted from sparc64 by V. Roganov and G. Raiko
6a439fe51SSam Ravnborg  *
7a439fe51SSam Ravnborg  * Original header:
8a439fe51SSam Ravnborg  * pbm.h: U2P PCI bus module pseudo driver software state.
9a439fe51SSam Ravnborg  *
10a439fe51SSam Ravnborg  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
11a439fe51SSam Ravnborg  *
12a439fe51SSam Ravnborg  * To put things into perspective, consider sparc64 with a few PCI controllers.
13a439fe51SSam Ravnborg  * Each type would have an own structure, with instances related one to one.
14a439fe51SSam Ravnborg  * We have only pcic on sparc, but we want to be compatible with sparc64 pbm.h.
15a439fe51SSam Ravnborg  * All three represent different abstractions.
16a439fe51SSam Ravnborg  *   pci_bus  - Linux PCI subsystem view of a PCI bus (including bridged buses)
17a439fe51SSam Ravnborg  *   pbm      - Arch-specific view of a PCI bus (sparc or sparc64)
18a439fe51SSam Ravnborg  *   pcic     - Chip-specific information for PCIC.
19a439fe51SSam Ravnborg  */
20a439fe51SSam Ravnborg 
21a439fe51SSam Ravnborg #ifndef __SPARC_PBM_H
22a439fe51SSam Ravnborg #define __SPARC_PBM_H
23a439fe51SSam Ravnborg 
24a439fe51SSam Ravnborg #include <linux/pci.h>
25a439fe51SSam Ravnborg #include <asm/oplib.h>
26a439fe51SSam Ravnborg #include <asm/prom.h>
27a439fe51SSam Ravnborg 
28a439fe51SSam Ravnborg struct linux_pbm_info {
29a439fe51SSam Ravnborg 	int		prom_node;
30a439fe51SSam Ravnborg 	char		prom_name[64];
31a439fe51SSam Ravnborg 	/* struct linux_prom_pci_ranges	pbm_ranges[PROMREG_MAX]; */
32a439fe51SSam Ravnborg 	/* int		num_pbm_ranges; */
33a439fe51SSam Ravnborg 
34a439fe51SSam Ravnborg 	/* Now things for the actual PCI bus probes. */
35a439fe51SSam Ravnborg 	unsigned int	pci_first_busno;	/* Can it be nonzero? */
36a439fe51SSam Ravnborg 	struct pci_bus	*pci_bus;		/* Was inline, MJ allocs now */
37a439fe51SSam Ravnborg };
38a439fe51SSam Ravnborg 
39a439fe51SSam Ravnborg /* PCI devices which are not bridges have this placed in their pci_dev
40a439fe51SSam Ravnborg  * sysdata member.  This makes OBP aware PCI device drivers easier to
41a439fe51SSam Ravnborg  * code.
42a439fe51SSam Ravnborg  */
43a439fe51SSam Ravnborg struct pcidev_cookie {
44a439fe51SSam Ravnborg 	struct linux_pbm_info		*pbm;
45a439fe51SSam Ravnborg 	struct device_node		*prom_node;
46a439fe51SSam Ravnborg };
47a439fe51SSam Ravnborg 
48a439fe51SSam Ravnborg #endif /* !(__SPARC_PBM_H) */
49