Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e47ff1c authored by Rob Herring's avatar Rob Herring
Browse files

powerpc: rename ppc_pci_*_flags to pci_*_flags



This renames pci flags functions and enums in preparation for creating
generic version in asm-generic/pci-bridge.h. The following search and
replace is done:

s/ppc_pci_/pci_/
s/PPC_PCI_/PCI_/

Direct accesses to ppc_pci_flag variable are replaced with helper
functions.

Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
parent fe0d4220
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -17,45 +17,45 @@ enum {
	/* Force re-assigning all resources (ignore firmware
	 * setup completely)
	 */
	PPC_PCI_REASSIGN_ALL_RSRC	= 0x00000001,
	PCI_REASSIGN_ALL_RSRC	= 0x00000001,

	/* Re-assign all bus numbers */
	PPC_PCI_REASSIGN_ALL_BUS	= 0x00000002,
	PCI_REASSIGN_ALL_BUS	= 0x00000002,

	/* Do not try to assign, just use existing setup */
	PPC_PCI_PROBE_ONLY		= 0x00000004,
	PCI_PROBE_ONLY		= 0x00000004,

	/* Don't bother with ISA alignment unless the bridge has
	 * ISA forwarding enabled
	 */
	PPC_PCI_CAN_SKIP_ISA_ALIGN	= 0x00000008,
	PCI_CAN_SKIP_ISA_ALIGN	= 0x00000008,

	/* Enable domain numbers in /proc */
	PPC_PCI_ENABLE_PROC_DOMAINS	= 0x00000010,
	PCI_ENABLE_PROC_DOMAINS	= 0x00000010,
	/* ... except for domain 0 */
	PPC_PCI_COMPAT_DOMAIN_0		= 0x00000020,
	PCI_COMPAT_DOMAIN_0		= 0x00000020,
};
#ifdef CONFIG_PCI
extern unsigned int ppc_pci_flags;
extern unsigned int pci_flags;

static inline void ppc_pci_set_flags(int flags)
static inline void pci_set_flags(int flags)
{
	ppc_pci_flags = flags;
	pci_flags = flags;
}

static inline void ppc_pci_add_flags(int flags)
static inline void pci_add_flags(int flags)
{
	ppc_pci_flags |= flags;
	pci_flags |= flags;
}

static inline int ppc_pci_has_flag(int flag)
static inline int pci_has_flag(int flag)
{
	return (ppc_pci_flags & flag);
	return (pci_flags & flag);
}
#else
static inline void ppc_pci_set_flags(int flags) { }
static inline void ppc_pci_add_flags(int flags) { }
static inline int ppc_pci_has_flag(int flag)
static inline void pci_set_flags(int flags) { }
static inline void pci_add_flags(int flags) { }
static inline int pci_has_flag(int flag)
{
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ struct pci_dev;
 * bus numbers (don't do that on ppc64 yet !)
 */
#define pcibios_assign_all_busses() \
	(ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS))
	(pci_has_flag(PCI_REASSIGN_ALL_BUS))

static inline void pcibios_set_master(struct pci_dev *dev)
{
+11 −11
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ static int global_phb_number; /* Global phb counter */
resource_size_t isa_mem_base;

/* Default PCI flags is 0 on ppc32, modified at boot on ppc64 */
unsigned int ppc_pci_flags = 0;
unsigned int pci_flags = 0;


static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
@@ -842,9 +842,9 @@ int pci_proc_domain(struct pci_bus *bus)
{
	struct pci_controller *hose = pci_bus_to_host(bus);

	if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
	if (!pci_has_flag(PCI_ENABLE_PROC_DOMAINS))
		return 0;
	if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
	if (pci_has_flag(PCI_COMPAT_DOMAIN_0))
		return hose->global_number != 0;
	return 1;
}
@@ -920,13 +920,13 @@ static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
		struct resource *res = dev->resource + i;
		if (!res->flags)
			continue;
		/* On platforms that have PPC_PCI_PROBE_ONLY set, we don't
		/* On platforms that have PCI_PROBE_ONLY set, we don't
		 * consider 0 as an unassigned BAR value. It's technically
		 * a valid value, but linux doesn't like it... so when we can
		 * re-assign things, we do so, but if we can't, we keep it
		 * around and hope for the best...
		 */
		if (res->start == 0 && !(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
		if (res->start == 0 && !pci_has_flag(PCI_PROBE_ONLY)) {
			pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
				 pci_name(dev), i,
				 (unsigned long long)res->start,
@@ -973,7 +973,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
	int i;

	/* We don't do anything if PCI_PROBE_ONLY is set */
	if (ppc_pci_flags & PPC_PCI_PROBE_ONLY)
	if (pci_has_flag(PCI_PROBE_ONLY))
		return 0;

	/* Job is a bit different between memory and IO */
@@ -1146,7 +1146,7 @@ void __devinit pci_fixup_cardbus(struct pci_bus *bus)

static int skip_isa_ioresource_align(struct pci_dev *dev)
{
	if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
	if (pci_has_flag(PCI_CAN_SKIP_ISA_ALIGN) &&
	    !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA))
		return 1;
	return 0;
@@ -1274,7 +1274,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
			 * and as such ensure proper re-allocation
			 * later.
			 */
			if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)
			if (pci_has_flag(PCI_REASSIGN_ALL_RSRC))
				goto clear_resource;
			pr = pci_find_parent_resource(bus->self, res);
			if (pr == res) {
@@ -1459,7 +1459,7 @@ void __init pcibios_resource_survey(void)
	list_for_each_entry(b, &pci_root_buses, node)
		pcibios_allocate_bus_resources(b);

	if (!(ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)) {
	if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC)) {
		pcibios_allocate_resources(0);
		pcibios_allocate_resources(1);
	}
@@ -1468,7 +1468,7 @@ void __init pcibios_resource_survey(void)
	 * the low IO area and the VGA memory area if they intersect the
	 * bus available resources to avoid allocating things on top of them
	 */
	if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
	if (!pci_has_flag(PCI_PROBE_ONLY)) {
		list_for_each_entry(b, &pci_root_buses, node)
			pcibios_reserve_legacy_regions(b);
	}
@@ -1476,7 +1476,7 @@ void __init pcibios_resource_survey(void)
	/* Now, if the platform didn't decide to blindly trust the firmware,
	 * we proceed to assigning things that were left unassigned
	 */
	if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
	if (!pci_has_flag(PCI_PROBE_ONLY)) {
		pr_debug("PCI: Assigning unassigned resources...\n");
		pci_assign_unassigned_resources();
	}
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ static int __init pcibios_init(void)

	printk(KERN_INFO "PCI: Probing PCI hardware\n");

	if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
	if (pci_has_flag(PCI_REASSIGN_ALL_BUS))
		pci_assign_all_buses = 1;

	/* Scan all of the recorded PCI controllers.  */
+2 −2
Original line number Diff line number Diff line
@@ -55,12 +55,12 @@ static int __init pcibios_init(void)
	ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;

	if (pci_probe_only)
		ppc_pci_flags |= PPC_PCI_PROBE_ONLY;
		pci_add_flags(PCI_PROBE_ONLY);

	/* On ppc64, we always enable PCI domains and we keep domain 0
	 * backward compatible in /proc for video cards
	 */
	ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
	pci_add_flags(PCI_ENABLE_PROC_DOMAINS | PCI_COMPAT_DOMAIN_0);

	/* Scan all of the recorded PCI controllers.  */
	list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
Loading