Commit 357f8239 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/47x: Split ppc47x machine in two

This machine matches two compatibles and sets .pci_irq_fixup
on one of them.

Split it into two machines, then the probe function can be dropped.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Drop references to ppc47x_probe() to fix build]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/6cb9865d916231c38401ba34ad1a98c249fae135.1676711562.git.christophe.leroy@csgroup.eu
parent 1c96fcde
......@@ -114,7 +114,8 @@ static int __init ppc47x_device_probe(void)
return 0;
}
machine_device_initcall(ppc47x, ppc47x_device_probe);
machine_device_initcall(ppc47x_akebono, ppc47x_device_probe);
machine_device_initcall(ppc47x_currituck, ppc47x_device_probe);
static void __init ppc47x_init_irq(void)
{
......@@ -249,7 +250,8 @@ static int __init ppc47x_get_board_rev(void)
pr_info("%s: Unable to find board revision\n", __func__);
return 0;
}
machine_arch_initcall(ppc47x, ppc47x_get_board_rev);
machine_arch_initcall(ppc47x_akebono, ppc47x_get_board_rev);
machine_arch_initcall(ppc47x_currituck, ppc47x_get_board_rev);
/* Use USB controller should have been hardware swizzled but it wasn't :( */
static void ppc47x_pci_irq_fixup(struct pci_dev *dev)
......@@ -268,27 +270,22 @@ static void ppc47x_pci_irq_fixup(struct pci_dev *dev)
}
}
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init ppc47x_probe(void)
{
if (of_machine_is_compatible("ibm,akebono"))
return 1;
if (of_machine_is_compatible("ibm,currituck")) {
ppc_md.pci_irq_fixup = ppc47x_pci_irq_fixup;
return 1;
}
return 0;
}
define_machine(ppc47x_akebono) {
.name = "PowerPC 47x (akebono)",
.compatible = "ibm,akebono",
.progress = udbg_progress,
.init_IRQ = ppc47x_init_irq,
.setup_arch = ppc47x_setup_arch,
.restart = ppc4xx_reset_system,
.calibrate_decr = generic_calibrate_decr,
};
define_machine(ppc47x) {
.name = "PowerPC 47x",
.probe = ppc47x_probe,
define_machine(ppc47x_currituck) {
.name = "PowerPC 47x (currituck)",
.compatible = "ibm,currituck",
.progress = udbg_progress,
.init_IRQ = ppc47x_init_irq,
.pci_irq_fixup = ppc47x_pci_irq_fixup,
.setup_arch = ppc47x_setup_arch,
.restart = ppc4xx_reset_system,
.calibrate_decr = generic_calibrate_decr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment