162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * pbm.h: PCI bus module pseudo driver software state 562306a36Sopenharmony_ci * Adopted from sparc64 by V. Roganov and G. Raiko 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Original header: 862306a36Sopenharmony_ci * pbm.h: U2P PCI bus module pseudo driver software state. 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 1162306a36Sopenharmony_ci * 1262306a36Sopenharmony_ci * To put things into perspective, consider sparc64 with a few PCI controllers. 1362306a36Sopenharmony_ci * Each type would have an own structure, with instances related one to one. 1462306a36Sopenharmony_ci * We have only pcic on sparc, but we want to be compatible with sparc64 pbm.h. 1562306a36Sopenharmony_ci * All three represent different abstractions. 1662306a36Sopenharmony_ci * pci_bus - Linux PCI subsystem view of a PCI bus (including bridged buses) 1762306a36Sopenharmony_ci * pbm - Arch-specific view of a PCI bus (sparc or sparc64) 1862306a36Sopenharmony_ci * pcic - Chip-specific information for PCIC. 1962306a36Sopenharmony_ci */ 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#ifndef __SPARC_PBM_H 2262306a36Sopenharmony_ci#define __SPARC_PBM_H 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci#include <linux/pci.h> 2562306a36Sopenharmony_ci#include <asm/oplib.h> 2662306a36Sopenharmony_ci#include <asm/prom.h> 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_cistruct linux_pbm_info { 2962306a36Sopenharmony_ci int prom_node; 3062306a36Sopenharmony_ci char prom_name[64]; 3162306a36Sopenharmony_ci /* struct linux_prom_pci_ranges pbm_ranges[PROMREG_MAX]; */ 3262306a36Sopenharmony_ci /* int num_pbm_ranges; */ 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci /* Now things for the actual PCI bus probes. */ 3562306a36Sopenharmony_ci unsigned int pci_first_busno; /* Can it be nonzero? */ 3662306a36Sopenharmony_ci struct pci_bus *pci_bus; /* Was inline, MJ allocs now */ 3762306a36Sopenharmony_ci}; 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci/* PCI devices which are not bridges have this placed in their pci_dev 4062306a36Sopenharmony_ci * sysdata member. This makes OBP aware PCI device drivers easier to 4162306a36Sopenharmony_ci * code. 4262306a36Sopenharmony_ci */ 4362306a36Sopenharmony_cistruct pcidev_cookie { 4462306a36Sopenharmony_ci struct linux_pbm_info *pbm; 4562306a36Sopenharmony_ci struct device_node *prom_node; 4662306a36Sopenharmony_ci}; 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#endif /* !(__SPARC_PBM_H) */ 49