18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * pbm.h: PCI bus module pseudo driver software state 58c2ecf20Sopenharmony_ci * Adopted from sparc64 by V. Roganov and G. Raiko 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Original header: 88c2ecf20Sopenharmony_ci * pbm.h: U2P PCI bus module pseudo driver software state. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * To put things into perspective, consider sparc64 with a few PCI controllers. 138c2ecf20Sopenharmony_ci * Each type would have an own structure, with instances related one to one. 148c2ecf20Sopenharmony_ci * We have only pcic on sparc, but we want to be compatible with sparc64 pbm.h. 158c2ecf20Sopenharmony_ci * All three represent different abstractions. 168c2ecf20Sopenharmony_ci * pci_bus - Linux PCI subsystem view of a PCI bus (including bridged buses) 178c2ecf20Sopenharmony_ci * pbm - Arch-specific view of a PCI bus (sparc or sparc64) 188c2ecf20Sopenharmony_ci * pcic - Chip-specific information for PCIC. 198c2ecf20Sopenharmony_ci */ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#ifndef __SPARC_PBM_H 228c2ecf20Sopenharmony_ci#define __SPARC_PBM_H 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#include <linux/pci.h> 258c2ecf20Sopenharmony_ci#include <asm/oplib.h> 268c2ecf20Sopenharmony_ci#include <asm/prom.h> 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_cistruct linux_pbm_info { 298c2ecf20Sopenharmony_ci int prom_node; 308c2ecf20Sopenharmony_ci char prom_name[64]; 318c2ecf20Sopenharmony_ci /* struct linux_prom_pci_ranges pbm_ranges[PROMREG_MAX]; */ 328c2ecf20Sopenharmony_ci /* int num_pbm_ranges; */ 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci /* Now things for the actual PCI bus probes. */ 358c2ecf20Sopenharmony_ci unsigned int pci_first_busno; /* Can it be nonzero? */ 368c2ecf20Sopenharmony_ci struct pci_bus *pci_bus; /* Was inline, MJ allocs now */ 378c2ecf20Sopenharmony_ci}; 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* PCI devices which are not bridges have this placed in their pci_dev 408c2ecf20Sopenharmony_ci * sysdata member. This makes OBP aware PCI device drivers easier to 418c2ecf20Sopenharmony_ci * code. 428c2ecf20Sopenharmony_ci */ 438c2ecf20Sopenharmony_cistruct pcidev_cookie { 448c2ecf20Sopenharmony_ci struct linux_pbm_info *pbm; 458c2ecf20Sopenharmony_ci struct device_node *prom_node; 468c2ecf20Sopenharmony_ci}; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#endif /* !(__SPARC_PBM_H) */ 49