Skip to content

Commit 023b13a

Browse files
ozbenhmpe
authored andcommitted
powerpc/powernv: Add support for direct mapped LPC on POWER9
Use 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 Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent b3c711a commit 023b13a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

arch/powerpc/kernel/legacy_serial.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ static int __init add_legacy_isa_port(struct device_node *np,
233233
*
234234
* Note: Don't even try on P8 lpc, we know it's not directly mapped
235235
*/
236-
if (!of_device_is_compatible(isa_brg, "ibm,power8-lpc")) {
236+
if (!of_device_is_compatible(isa_brg, "ibm,power8-lpc") ||
237+
of_get_property(isa_brg, "ranges", NULL)) {
237238
taddr = of_translate_address(np, reg);
238239
if (taddr == OF_BAD_ADDR)
239240
taddr = 0;

arch/powerpc/platforms/powernv/opal-lpc.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,17 @@ void opal_lpc_init(void)
407407
if (opal_lpc_chip_id < 0)
408408
return;
409409

410-
/* Setup special IO ops */
411-
ppc_pci_io = opal_lpc_io;
412-
isa_io_special = true;
413-
414-
pr_info("OPAL: Power8 LPC bus found, chip ID %d\n", opal_lpc_chip_id);
410+
/* Does it support direct mapping ? */
411+
if (of_get_property(np, "ranges", NULL)) {
412+
pr_info("OPAL: Found memory mapped LPC bus on chip %d\n",
413+
opal_lpc_chip_id);
414+
isa_bridge_init_non_pci(np);
415+
} else {
416+
pr_info("OPAL: Found non-mapped LPC bus on chip %d\n",
417+
opal_lpc_chip_id);
418+
419+
/* Setup special IO ops */
420+
ppc_pci_io = opal_lpc_io;
421+
isa_io_special = true;
422+
}
415423
}

0 commit comments

Comments
 (0)