linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "Pali Rohár" <pali@kernel.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 04/10] powerpc/47x: Split ppc47x machine in two
Date: Sat, 18 Feb 2023 10:15:47 +0100	[thread overview]
Message-ID: <f8f90020c09abdeccacf6d24f0c513e9a8ad75be.1676711562.git.christophe.leroy@csgroup.eu> (raw)
In-Reply-To: <6cb9865d916231c38401ba34ad1a98c249fae135.1676711562.git.christophe.leroy@csgroup.eu>

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: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v2: Also update/duplicate machine_{device/arch}_initcall
---
 arch/powerpc/platforms/44x/ppc476.c | 37 ++++++++++++++---------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c
index 7c91ac5a5241..11f939ee98c4 100644
--- a/arch/powerpc/platforms/44x/ppc476.c
+++ b/arch/powerpc/platforms/44x/ppc476.c
@@ -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,24 @@ 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",
+	.probe			= ppc47x_probe,
+	.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",
+define_machine(ppc47x_currituck) {
+	.name			= "PowerPC 47x (currituck)",
+	.compatible		= "ibm,currituck",
 	.probe			= ppc47x_probe,
 	.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,
-- 
2.39.1


  parent reply	other threads:[~2023-02-18  9:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18  9:15 [PATCH v2 01/10] powerpc/machdep: Make machine name const Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 02/10] powerpc/machdep: Define 'compatible' property in ppc_md and use it Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 03/10] powerpc/platforms: Use 'compatible' property for simple cases Christophe Leroy
2023-02-18  9:15 ` Christophe Leroy [this message]
2023-02-18  9:15 ` [PATCH v2 05/10] powerpc/gamecube|wii : Use machine_device_initcall() Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 06/10] powerpc/85xx: Fix function naming for p1023_rdb platform Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 07/10] powerpc: Make generic_calibrate_decr() the default Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 08/10] powerpc: Add ppc_md_progress() Christophe Leroy
2023-02-18  9:15 ` [PATCH v2 09/10] powerpc: Use ppc_md_progress() Christophe Leroy
2023-02-18 14:54   ` Joe Perches
2023-02-20  0:42     ` Michael Ellerman
2023-02-18  9:15 ` [PATCH v2 10/10] powerpc/85xx: Don't check ppc_md.progress in mpc85xx_cds_setup_arch() Christophe Leroy
2023-03-22 12:25 ` (subset) [PATCH v2 01/10] powerpc/machdep: Make machine name const Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8f90020c09abdeccacf6d24f0c513e9a8ad75be.1676711562.git.christophe.leroy@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=pali@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).