mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: <linux-kernel@vger.kernel.org>, <geert@linux-m68k.org>, <arnd@arndb.de>
Subject: [RFC PATCH 02/10] powerpc/chrp: Remove various dead code
Date: Fri, 15 Nov 2024 00:11:05 +1100	[thread overview]
Message-ID: <20241114131114.602234-2-mpe@ellerman.id.au> (raw)
In-Reply-To: <20241114131114.602234-1-mpe@ellerman.id.au>

Remove various bits of code that are dead now that PPC_CHRP has been
removed.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/Kconfig                 |  5 +--
 arch/powerpc/boot/Makefile           |  1 -
 arch/powerpc/include/asm/processor.h |  6 ---
 arch/powerpc/kernel/head_book3s_32.S | 12 ------
 arch/powerpc/kernel/pci_32.c         |  2 +-
 arch/powerpc/kernel/prom_init.c      | 56 ----------------------------
 6 files changed, 3 insertions(+), 79 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a9dd4c39ec00..f79e28f47dea 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -418,11 +418,10 @@ config PPC_DCR
 config PPC_PCI_OF_BUS_MAP
 	bool "Use pci_to_OF_bus_map (deprecated)"
 	depends on PPC32
-	depends on PPC_PMAC || PPC_CHRP
+	depends on PPC_PMAC
 	help
 	  This option uses pci_to_OF_bus_map to map OF nodes to PCI devices, which
-	  restricts the system to only having 256 PCI buses. On CHRP it also causes
-	  the "pci-OF-bus-map" property to be created in the device tree.
+	  restricts the system to only having 256 PCI buses.
 
 	  If unsure, say "N".
 
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1ff6ad4f6cd2..8a0fb044e885 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -278,7 +278,6 @@ image-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
 image-$(CONFIG_PPC_POWERNV)		+= zImage.pseries
 image-$(CONFIG_PPC_IBM_CELL_BLADE)	+= zImage.pseries
 image-$(CONFIG_PPC_PS3)			+= dtbImage.ps3
-image-$(CONFIG_PPC_CHRP)		+= zImage.chrp
 image-$(CONFIG_PPC_EFIKA)		+= zImage.chrp
 image-$(CONFIG_PPC_PMAC)		+= zImage.pmac
 image-$(CONFIG_PPC_HOLLY)		+= dtbImage.holly
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 6b94de17201c..b00b5ae2cfef 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -53,12 +53,6 @@
 #define _PREP_IBM	0x00	/* ibm prep */
 #define _PREP_Bull	0x03	/* bull prep */
 
-/* CHRP sub-platform types. These are arbitrary */
-#define _CHRP_Motorola	0x04	/* motorola chrp, the cobra */
-#define _CHRP_IBM	0x05	/* IBM chrp, the longtrail and longtrail 2 */
-#define _CHRP_Pegasos	0x06	/* Genesi/bplan's Pegasos and Pegasos2 */
-#define _CHRP_briq	0x07	/* TotalImpact's briQ */
-
 #if defined(__KERNEL__) && defined(CONFIG_PPC32)
 
 extern int _chrp_type;
diff --git a/arch/powerpc/kernel/head_book3s_32.S b/arch/powerpc/kernel/head_book3s_32.S
index cb2bca76be53..c6e297fd36e2 100644
--- a/arch/powerpc/kernel/head_book3s_32.S
+++ b/arch/powerpc/kernel/head_book3s_32.S
@@ -256,20 +256,8 @@ __secondary_hold_acknowledge:
  */
 	START_EXCEPTION(INTERRUPT_MACHINE_CHECK, MachineCheck)
 	EXCEPTION_PROLOG_0
-#ifdef CONFIG_PPC_CHRP
-	mtspr	SPRN_SPRG_SCRATCH2,r1
-	mfspr	r1, SPRN_SPRG_THREAD
-	lwz	r1, RTAS_SP(r1)
-	cmpwi	cr1, r1, 0
-	bne	cr1, 7f
-	mfspr	r1, SPRN_SPRG_SCRATCH2
-#endif /* CONFIG_PPC_CHRP */
 	EXCEPTION_PROLOG_1
 7:	EXCEPTION_PROLOG_2 0x200 MachineCheck
-#ifdef CONFIG_PPC_CHRP
-	beq	cr1, 1f
-	twi	31, 0, 0
-#endif
 1:	prepare_transfer_to_handler
 	bl	machine_check_exception
 	b	interrupt_return
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index ce0c8623e563..461e1a7f4fc2 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -277,7 +277,7 @@ static int __init pcibios_init(void)
 #endif
 	}
 
-#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_CHRP)
+#ifdef CONFIG_PPC_PMAC
 #ifdef CONFIG_PPC_PCI_OF_BUS_MAP
 	pci_bus_count = next_busno;
 
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 73210e5bcfa7..94ffc52440bd 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2792,61 +2792,6 @@ static void __init flatten_device_tree(void)
 		    dt_struct_start, dt_struct_end);
 }
 
-#ifdef CONFIG_PPC_CHRP
-/*
- * Pegasos and BriQ lacks the "ranges" property in the isa node
- * Pegasos needs decimal IRQ 14/15, not hexadecimal
- * Pegasos has the IDE configured in legacy mode, but advertised as native
- */
-static void __init fixup_device_tree_chrp(void)
-{
-	phandle ph;
-	u32 prop[6];
-	u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
-	char *name;
-	int rc;
-
-	name = "/pci@80000000/isa@c";
-	ph = call_prom("finddevice", 1, 1, ADDR(name));
-	if (!PHANDLE_VALID(ph)) {
-		name = "/pci@ff500000/isa@6";
-		ph = call_prom("finddevice", 1, 1, ADDR(name));
-		rloc = 0x01003000; /* IO space; PCI device = 6 */
-	}
-	if (PHANDLE_VALID(ph)) {
-		rc = prom_getproplen(ph, "ranges");
-		if (rc == 0 || rc == PROM_ERROR) {
-			prom_printf("Fixing up missing ISA range on Pegasos...\n");
-
-			prop[0] = 0x1;
-			prop[1] = 0x0;
-			prop[2] = rloc;
-			prop[3] = 0x0;
-			prop[4] = 0x0;
-			prop[5] = 0x00010000;
-			prom_setprop(ph, name, "ranges", prop, sizeof(prop));
-		}
-	}
-
-	name = "/pci@80000000/ide@C,1";
-	ph = call_prom("finddevice", 1, 1, ADDR(name));
-	if (PHANDLE_VALID(ph)) {
-		prom_printf("Fixing up IDE interrupt on Pegasos...\n");
-		prop[0] = 14;
-		prop[1] = 0x0;
-		prom_setprop(ph, name, "interrupts", prop, 2*sizeof(u32));
-		prom_printf("Fixing up IDE class-code on Pegasos...\n");
-		rc = prom_getprop(ph, "class-code", prop, sizeof(u32));
-		if (rc == sizeof(u32)) {
-			prop[0] &= ~0x5;
-			prom_setprop(ph, name, "class-code", prop, sizeof(u32));
-		}
-	}
-}
-#else
-#define fixup_device_tree_chrp()
-#endif
-
 #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
 static void __init fixup_device_tree_pmac(void)
 {
@@ -3109,7 +3054,6 @@ static inline void fixup_device_tree_pasemi(void) { }
 
 static void __init fixup_device_tree(void)
 {
-	fixup_device_tree_chrp();
 	fixup_device_tree_pmac();
 	fixup_device_tree_efika();
 	fixup_device_tree_pasemi();
-- 
2.47.0


  reply	other threads:[~2024-11-14 13:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 13:11 [RFC PATCH 01/10] powerpc/chrp: Remove CHRP support Michael Ellerman
2024-11-14 13:11 ` Michael Ellerman [this message]
2024-11-16 16:15   ` [RFC PATCH 02/10] powerpc/chrp: Remove various dead code Christophe Leroy
2024-11-19  3:27     ` Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 03/10] powerpc/chrp: Remove PPC_CHRP from defconfigs Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 04/10] powerpc/powermac: Remove machine_is(chrp) test Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 05/10] powerpc/rtasd: Remove machine_is(chrp) tests Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 06/10] powerpc: Remove prom_init longtrail work arounds Michael Ellerman
2024-11-14 14:33   ` Geert Uytterhoeven
2024-11-14 13:11 ` [RFC PATCH 07/10] powerpc: Remove CONFIG_ISA Michael Ellerman
2024-11-14 14:34   ` Geert Uytterhoeven
2024-11-14 13:11 ` [RFC PATCH 08/10] macintosh: Remove ADB_MACIO Michael Ellerman
2024-11-14 14:35   ` Geert Uytterhoeven
2024-11-14 15:42   ` Arnd Bergmann
2024-11-14 16:35     ` Geert Uytterhoeven
2024-11-16 16:00   ` Christophe Leroy
2024-11-17 11:29     ` Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 09/10] i2c: Remove I2C_HYDRA Michael Ellerman
2024-11-14 14:37   ` Geert Uytterhoeven
2024-11-14 14:57     ` Wolfram Sang
2024-11-14 14:47   ` Geert Uytterhoeven
2024-11-19 23:11     ` Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 10/10] i2c: Drop reference to PPC_CHRP Michael Ellerman
2024-11-14 14:31 ` [RFC PATCH 01/10] powerpc/chrp: Remove CHRP support Geert Uytterhoeven
2024-11-14 15:43   ` Arnd Bergmann
2024-11-14 21:04 ` Segher Boessenkool
2024-11-26  3:49   ` Michael Ellerman
2024-11-27 20:10     ` Segher Boessenkool
2024-11-17 20:36 ` Gerhard Pircher
2024-11-18  6:07   ` Michael Ellerman
2024-11-21  8:41     ` John Paul Adrian Glaubitz
2024-11-22 18:31       ` Segher Boessenkool
2024-11-21  8:38 ` John Paul Adrian Glaubitz
2024-11-26  3:27   ` Michael Ellerman
2024-11-26 13:27     ` John Paul Adrian Glaubitz
2024-12-12  9:50       ` John Paul Adrian Glaubitz

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=20241114131114.602234-2-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=arnd@arndb.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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

all inboxes | Powered by JetHome®