mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
powerpc: Create pci_controller_ops.window_alignment and shim
Add pci_controller_ops.window_alignment, shadowing ppc_md.pcibios_window_alignment. Add a shim, and changes the callsites to use the shim. Here, we use pci_window_alignment, as pcibios_window_alignment is already taken. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
b31e79f8d9
commit
542070baf4
2 changed files with 22 additions and 9 deletions
|
@ -31,6 +31,9 @@ struct pci_controller_ops {
|
||||||
/* Called when pci_enable_device() is called. Returns true to
|
/* Called when pci_enable_device() is called. Returns true to
|
||||||
* allow assignment/enabling of the device. */
|
* allow assignment/enabling of the device. */
|
||||||
bool (*enable_device_hook)(struct pci_dev *);
|
bool (*enable_device_hook)(struct pci_dev *);
|
||||||
|
|
||||||
|
/* Called during PCI resource reassignment */
|
||||||
|
resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -325,5 +328,23 @@ static inline bool pcibios_enable_device_hook(struct pci_dev *dev)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
|
||||||
|
unsigned long type)
|
||||||
|
{
|
||||||
|
struct pci_controller *phb = pci_bus_to_host(bus);
|
||||||
|
|
||||||
|
if (phb->controller_ops.window_alignment)
|
||||||
|
return phb->controller_ops.window_alignment(bus, type);
|
||||||
|
if (ppc_md.pcibios_window_alignment)
|
||||||
|
return ppc_md.pcibios_window_alignment(bus, type);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PCI core will figure out the default
|
||||||
|
* alignment: 4KiB for I/O and 1MiB for
|
||||||
|
* memory window.
|
||||||
|
*/
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
|
#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
|
||||||
|
|
|
@ -109,15 +109,7 @@ void pcibios_free_controller(struct pci_controller *phb)
|
||||||
resource_size_t pcibios_window_alignment(struct pci_bus *bus,
|
resource_size_t pcibios_window_alignment(struct pci_bus *bus,
|
||||||
unsigned long type)
|
unsigned long type)
|
||||||
{
|
{
|
||||||
if (ppc_md.pcibios_window_alignment)
|
return pci_window_alignment(bus, type);
|
||||||
return ppc_md.pcibios_window_alignment(bus, type);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PCI core will figure out the default
|
|
||||||
* alignment: 4KiB for I/O and 1MiB for
|
|
||||||
* memory window.
|
|
||||||
*/
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcibios_reset_secondary_bus(struct pci_dev *dev)
|
void pcibios_reset_secondary_bus(struct pci_dev *dev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue