powerpc: Move isa bridge definitions to separate include
PATCH 1/3 powerpc: Move isa bridge definitions to separate include
We'll be adding non-PCI isa bridge support so let's not have all the definition in pci-bridge.h
--- arch/powerpc/include/asm/isa-bridge.h | 28 ++++++++++++++++++++++++++++ arch/powerpc/include/asm/pci-bridge.h | 18 ------------------ arch/powerpc/kernel/iomap.c | 1 + arch/powerpc/kernel/isa-bridge.c | 1 + arch/powerpc/platforms/maple/pci.c | 1 + arch/powerpc/platforms/powernv/opal-lpc.c | 1 + arch/powerpc/platforms/pseries/setup.c | 1 + 7 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 arch/powerpc/include/asm/isa-bridge.h
arch/powerpc/include/asm/isa-bridge.h new file +28 -0
@@ -0,0 +1,28 @@ +#ifndef __ISA_BRIDGE_H +#define __ISA_BRIDGE_H + +#ifdef CONFIG_PPC64 + +extern void isa_bridge_find_early (struct pci_controller *hose); + +static inline int isa_vaddr_is_ioport (void __iomem *address) +{ +/* Check if address hits the reserved legacy IO range */ +unsigned long ea = (unsigned long )address; +return ea >=ISA_IO_BASE && ea <ISA_IO_END ; +} + +#else + +static inline int isa_vaddr_is_ioport (void __iomem *address) +{ +/* No specific ISA handling on ppc32 at this stage, it +* all goes through PCI +*/ +return 0 ; +} + +#endif + +#endif /* __ISA_BRIDGE_H */ +
arch/powerpc/include/asm/pci-bridge.h +0 -18
@@ -174,14 +174,6 @@ extern int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn);extern void pci_create_OF_bus_map (void ); -static inline int isa_vaddr_is_ioport (void __iomem *address) -{ -/* No specific ISA handling on ppc32 at this stage, it -* all goes through PCI -*/ -return 0 ; -} -#else /* CONFIG_PPC64 */ /*
@@ -269,16 +261,6 @@ extern void pci_hp_remove_devices(struct pci_bus *bus);/** Discover new pci devices under this bus, and add them */ extern void pci_hp_add_devices (struct pci_bus *bus); - -extern void isa_bridge_find_early (struct pci_controller *hose); - -static inline int isa_vaddr_is_ioport (void __iomem *address) -{ -/* Check if address hits the reserved legacy IO range */ -unsigned long ea = (unsigned long )address; -return ea >=ISA_IO_BASE && ea <ISA_IO_END ; -} -extern int pcibios_unmap_io_space (struct pci_bus *bus);extern int pcibios_map_io_space (struct pci_bus *bus);
arch/powerpc/kernel/iomap.c +1 -0
@@ -8,6 +8,7 @@#include <linux/export.h> #include <asm/io.h> #include <asm/pci-bridge.h> +#include <asm/isa-bridge.h> /* * Here comes the ppc64 implementation of the IOMAP
arch/powerpc/kernel/isa-bridge.c +1 -0
@@ -29,6 +29,7 @@#include <asm/pci-bridge.h> #include <asm/machdep.h> #include <asm/ppc-pci.h> +#include <asm/isa-bridge.h> unsigned long isa_io_base;/* NULL if no ISA bus */ EXPORT_SYMBOL (isa_io_base);
arch/powerpc/platforms/maple/pci.c +1 -0
@@ -24,6 +24,7 @@#include <asm/machdep.h> #include <asm/iommu.h> #include <asm/ppc-pci.h> +#include <asm/isa-bridge.h> #include "maple.h"
arch/powerpc/platforms/powernv/opal-lpc.c +1 -0
@@ -23,6 +23,7 @@#include <asm/prom.h> #include <linux/uaccess.h> #include <asm/debug.h> +#include <asm/isa-bridge.h> static int opal_lpc_chip_id =-1 ;
arch/powerpc/platforms/pseries/setup.c +1 -0
@@ -66,6 +66,7 @@#include <asm/reg.h> #include <asm/plpar_wrappers.h> #include <asm/kexec.h> +#include <asm/isa-bridge.h> #include "pseries.h"
Signature · 1 line
2.9.3
PATCH 2/3 powerpc: Add support for non-PCI ISA bridges
The POWER9 chip supports an LPC bus that isn't hanging off a PCI bus, so let's add support for that, mapping it to the reserved space at ISA_IO_BASE
--- arch/powerpc/include/asm/isa-bridge.h | 1 + arch/powerpc/kernel/isa-bridge.c | 91 +++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+)
arch/powerpc/include/asm/isa-bridge.h +1 -0
@@ -4,6 +4,7 @@#ifdef CONFIG_PPC64 extern void isa_bridge_find_early (struct pci_controller *hose); +extern void isa_bridge_init_non_pci (struct device_node *np);static inline int isa_vaddr_is_ioport (void __iomem *address) {
arch/powerpc/kernel/isa-bridge.c +91 -0
97 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 3/3 powerpc/powernv: Add support for direct mapped LPC on POWER9
In reply to Benjamin HerrenschmidtUse the new non-PCI ISA bridge support to expose the POWER9 LPC bus as direct mapped via the ISA IO port range. This enables direct access via drivers such as 8250
--- arch/powerpc/kernel/legacy_serial.c | 3 ++- arch/powerpc/platforms/powernv/opal-lpc.c | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-)
arch/powerpc/kernel/legacy_serial.c +2 -1
@@ -233,7 +233,8 @@ static int __init add_legacy_isa_port(struct device_node *np,* * Note: Don't even try on P8 lpc, we know it's not directly mapped */ -if (!of_device_is_compatible (isa_brg,"ibm,power8-lpc" )) { +if (!of_device_is_compatible (isa_brg,"ibm,power8-lpc" ) || +of_get_property (isa_brg,"ranges" ,NULL )) { taddr =of_translate_address (np, reg);if (taddr ==OF_BAD_ADDR ) taddr =0 ;
arch/powerpc/platforms/powernv/opal-lpc.c +13 -5
@@ -407,9 +407,17 @@ void opal_lpc_init(void)if (opal_lpc_chip_id <0 )return ; -/* Setup special IO ops */ - ppc_pci_io = opal_lpc_io; - isa_io_special = true; - -pr_info ("OPAL: Power8 LPC bus found, chip ID %d\n" , opal_lpc_chip_id); +/* Does it support direct mapping ? */ +if (of_get_property (np,"ranges" ,NULL )) { +pr_info ("OPAL: Found memory mapped LPC bus on chip %d\n" , + opal_lpc_chip_id); +isa_bridge_init_non_pci (np); + }else { +pr_info ("OPAL: Found non-mapped LPC bus on chip %d\n" , + opal_lpc_chip_id); + +/* Setup special IO ops */ + ppc_pci_io = opal_lpc_io; + isa_io_special = true; + } }
Signature · 1 line
2.9.3
Quoted 4 lines · Benjamin Herrenschmidt
We'll be adding non-PCI isa bridge support so let's not have all the definition in
pci-bridge.hSigned-off-by Benjamin Herrenschmidt <[email protected]>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/38e9d36bc149932964dcd25818c7f7
cheers