All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg via B4 Relay <devnull+sam.ravnborg.org@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	 Arnd Bergmann <arnd@kernel.org>,
	Andreas Larsson <andreas@gaisler.com>
Cc: Helge Deller <deller@gmx.de>,
	Randy Dunlap <rdunlap@infradead.org>,
	 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	 Kjetil Oftedal <oftedal@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Alan Stern <stern@rowland.harvard.edu>,
	Jaroslav Kysela <perex@perex.cz>,  Takashi Iwai <tiwai@suse.com>,
	sparclinux@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org,  linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,  linux-sound@vger.kernel.org,
	Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH v2 24/28] sparc32: Drop unused trampoline code
Date: Sat, 09 Mar 2024 19:15:45 +0100	[thread overview]
Message-ID: <20240309-sunset-v2-24-f09912574d2c@ravnborg.org> (raw)
In-Reply-To: <20240309-sunset-v2-0-f09912574d2c@ravnborg.org>

From: Sam Ravnborg <sam@ravnborg.org>

Drop the sun4m and sun4d code from trampoline_32

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Arnd Bergmann <arnd@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Andreas Larsson <andreas@gaisler.com>
---
 arch/sparc/kernel/kernel.h        |   3 +-
 arch/sparc/kernel/trampoline_32.S | 127 +-------------------------------------
 2 files changed, 3 insertions(+), 127 deletions(-)

diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h
index c2aaddedf097..2c57677770ff 100644
--- a/arch/sparc/kernel/kernel.h
+++ b/arch/sparc/kernel/kernel.h
@@ -112,8 +112,7 @@ extern unsigned int real_irq_entry[];
 extern unsigned int smp4d_ticker[];
 
 /* trampoline_32.S */
-extern unsigned long sun4m_cpu_startup;
-extern unsigned long sun4d_cpu_startup;
+void leon_smp_cpu_startup(int boot_cpu);
 
 /* signal_32.c */
 asmlinkage void do_sigreturn(struct pt_regs *regs);
diff --git a/arch/sparc/kernel/trampoline_32.S b/arch/sparc/kernel/trampoline_32.S
index 82fafeeb3a62..685b20923f6b 100644
--- a/arch/sparc/kernel/trampoline_32.S
+++ b/arch/sparc/kernel/trampoline_32.S
@@ -15,136 +15,12 @@
 #include <asm/contregs.h>
 #include <asm/thread_info.h>
 
-	.globl sun4m_cpu_startup
-	.globl sun4d_cpu_startup
-
-	.align 4
-
 /* When we start up a cpu for the first time it enters this routine.
  * This initializes the chip from whatever state the prom left it
  * in and sets PIL in %psr to 15, no irqs.
  */
-
-sun4m_cpu_startup:
-cpu1_startup:
-	sethi	%hi(trapbase_cpu1), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu1), %g3
-
-cpu2_startup:
-	sethi	%hi(trapbase_cpu2), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu2), %g3
-
-cpu3_startup:
-	sethi	%hi(trapbase_cpu3), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu3), %g3
-
-1:
-	/* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
-	set	(PSR_PIL | PSR_S | PSR_PS), %g1
-	wr	%g1, 0x0, %psr		! traps off though
-	WRITE_PAUSE
-
-	/* Our %wim is one behind CWP */
-	mov	2, %g1
-	wr	%g1, 0x0, %wim
-	WRITE_PAUSE
-
-	/* This identifies "this cpu". */
-	wr	%g3, 0x0, %tbr
-	WRITE_PAUSE
-
-	/* Give ourselves a stack and curptr. */
-	set	current_set, %g5
-	srl	%g3, 10, %g4
-	and	%g4, 0xc, %g4
-	ld	[%g5 + %g4], %g6
-
-	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
-	add	%g6, %sp, %sp
-
-	/* Turn on traps (PSR_ET). */
-	rd	%psr, %g1
-	wr	%g1, PSR_ET, %psr	! traps on
-	WRITE_PAUSE
-
-	/* Init our caches, etc. */
-	set	poke_srmmu, %g5
-	ld	[%g5], %g5
-	call	%g5
-	 nop
-
-	/* Start this processor. */
-	call	smp_callin
-	 nop
-
-	b,a	smp_panic
-
 	.text
 	.align	4
-
-smp_panic:
-	call	cpu_panic
-	 nop
-
-/* CPUID in bootbus can be found at PA 0xff0140000 */
-#define SUN4D_BOOTBUS_CPUID	0xf0140000
-
-	.align	4
-
-sun4d_cpu_startup:
-	/* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
-	set	(PSR_PIL | PSR_S | PSR_PS), %g1
-	wr	%g1, 0x0, %psr		! traps off though
-	WRITE_PAUSE
-
-	/* Our %wim is one behind CWP */
-	mov	2, %g1
-	wr	%g1, 0x0, %wim
-	WRITE_PAUSE
-
-	/* Set tbr - we use just one trap table. */
-	set	trapbase, %g1
-	wr	%g1, 0x0, %tbr
-	WRITE_PAUSE
-
-	/* Get our CPU id out of bootbus */
-	set	SUN4D_BOOTBUS_CPUID, %g3
-	lduba	[%g3] ASI_M_CTL, %g3
-	and	%g3, 0xf8, %g3
-	srl	%g3, 3, %g1
-	sta	%g1, [%g0] ASI_M_VIKING_TMP1
-
-	/* Give ourselves a stack and curptr. */
-	set	current_set, %g5
-	srl	%g3, 1, %g4
-	ld	[%g5 + %g4], %g6
-
-	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
-	add	%g6, %sp, %sp
-
-	/* Turn on traps (PSR_ET). */
-	rd	%psr, %g1
-	wr	%g1, PSR_ET, %psr	! traps on
-	WRITE_PAUSE
-
-	/* Init our caches, etc. */
-	set	poke_srmmu, %g5
-	ld	[%g5], %g5
-	call	%g5
-	 nop
-
-	/* Start this processor. */
-	call	smp_callin
-	 nop
-
-	b,a	smp_panic
-
-	.align	4
         .global leon_smp_cpu_startup, smp_penguin_ctable
 
 leon_smp_cpu_startup:
@@ -198,4 +74,5 @@ leon_smp_cpu_startup:
 	call	smp_callin
 	 nop
 
-	b,a	smp_panic
+	b,a	cpu_panic
+	 nop

-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: "David S. Miller" <davem@davemloft.net>,
	 Arnd Bergmann <arnd@kernel.org>,
	Andreas Larsson <andreas@gaisler.com>
Cc: Helge Deller <deller@gmx.de>,
	Randy Dunlap <rdunlap@infradead.org>,
	 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	 Kjetil Oftedal <oftedal@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Alan Stern <stern@rowland.harvard.edu>,
	Jaroslav Kysela <perex@perex.cz>,  Takashi Iwai <tiwai@suse.com>,
	sparclinux@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org,  linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,  linux-sound@vger.kernel.org,
	Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH v2 24/28] sparc32: Drop unused trampoline code
Date: Sat, 09 Mar 2024 19:15:45 +0100	[thread overview]
Message-ID: <20240309-sunset-v2-24-f09912574d2c@ravnborg.org> (raw)
In-Reply-To: <20240309-sunset-v2-0-f09912574d2c@ravnborg.org>

Drop the sun4m and sun4d code from trampoline_32

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Arnd Bergmann <arnd@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Andreas Larsson <andreas@gaisler.com>
---
 arch/sparc/kernel/kernel.h        |   3 +-
 arch/sparc/kernel/trampoline_32.S | 127 +-------------------------------------
 2 files changed, 3 insertions(+), 127 deletions(-)

diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h
index c2aaddedf097..2c57677770ff 100644
--- a/arch/sparc/kernel/kernel.h
+++ b/arch/sparc/kernel/kernel.h
@@ -112,8 +112,7 @@ extern unsigned int real_irq_entry[];
 extern unsigned int smp4d_ticker[];
 
 /* trampoline_32.S */
-extern unsigned long sun4m_cpu_startup;
-extern unsigned long sun4d_cpu_startup;
+void leon_smp_cpu_startup(int boot_cpu);
 
 /* signal_32.c */
 asmlinkage void do_sigreturn(struct pt_regs *regs);
diff --git a/arch/sparc/kernel/trampoline_32.S b/arch/sparc/kernel/trampoline_32.S
index 82fafeeb3a62..685b20923f6b 100644
--- a/arch/sparc/kernel/trampoline_32.S
+++ b/arch/sparc/kernel/trampoline_32.S
@@ -15,136 +15,12 @@
 #include <asm/contregs.h>
 #include <asm/thread_info.h>
 
-	.globl sun4m_cpu_startup
-	.globl sun4d_cpu_startup
-
-	.align 4
-
 /* When we start up a cpu for the first time it enters this routine.
  * This initializes the chip from whatever state the prom left it
  * in and sets PIL in %psr to 15, no irqs.
  */
-
-sun4m_cpu_startup:
-cpu1_startup:
-	sethi	%hi(trapbase_cpu1), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu1), %g3
-
-cpu2_startup:
-	sethi	%hi(trapbase_cpu2), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu2), %g3
-
-cpu3_startup:
-	sethi	%hi(trapbase_cpu3), %g3
-	b	1f
-	 or	%g3, %lo(trapbase_cpu3), %g3
-
-1:
-	/* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
-	set	(PSR_PIL | PSR_S | PSR_PS), %g1
-	wr	%g1, 0x0, %psr		! traps off though
-	WRITE_PAUSE
-
-	/* Our %wim is one behind CWP */
-	mov	2, %g1
-	wr	%g1, 0x0, %wim
-	WRITE_PAUSE
-
-	/* This identifies "this cpu". */
-	wr	%g3, 0x0, %tbr
-	WRITE_PAUSE
-
-	/* Give ourselves a stack and curptr. */
-	set	current_set, %g5
-	srl	%g3, 10, %g4
-	and	%g4, 0xc, %g4
-	ld	[%g5 + %g4], %g6
-
-	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
-	add	%g6, %sp, %sp
-
-	/* Turn on traps (PSR_ET). */
-	rd	%psr, %g1
-	wr	%g1, PSR_ET, %psr	! traps on
-	WRITE_PAUSE
-
-	/* Init our caches, etc. */
-	set	poke_srmmu, %g5
-	ld	[%g5], %g5
-	call	%g5
-	 nop
-
-	/* Start this processor. */
-	call	smp_callin
-	 nop
-
-	b,a	smp_panic
-
 	.text
 	.align	4
-
-smp_panic:
-	call	cpu_panic
-	 nop
-
-/* CPUID in bootbus can be found at PA 0xff0140000 */
-#define SUN4D_BOOTBUS_CPUID	0xf0140000
-
-	.align	4
-
-sun4d_cpu_startup:
-	/* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
-	set	(PSR_PIL | PSR_S | PSR_PS), %g1
-	wr	%g1, 0x0, %psr		! traps off though
-	WRITE_PAUSE
-
-	/* Our %wim is one behind CWP */
-	mov	2, %g1
-	wr	%g1, 0x0, %wim
-	WRITE_PAUSE
-
-	/* Set tbr - we use just one trap table. */
-	set	trapbase, %g1
-	wr	%g1, 0x0, %tbr
-	WRITE_PAUSE
-
-	/* Get our CPU id out of bootbus */
-	set	SUN4D_BOOTBUS_CPUID, %g3
-	lduba	[%g3] ASI_M_CTL, %g3
-	and	%g3, 0xf8, %g3
-	srl	%g3, 3, %g1
-	sta	%g1, [%g0] ASI_M_VIKING_TMP1
-
-	/* Give ourselves a stack and curptr. */
-	set	current_set, %g5
-	srl	%g3, 1, %g4
-	ld	[%g5 + %g4], %g6
-
-	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
-	add	%g6, %sp, %sp
-
-	/* Turn on traps (PSR_ET). */
-	rd	%psr, %g1
-	wr	%g1, PSR_ET, %psr	! traps on
-	WRITE_PAUSE
-
-	/* Init our caches, etc. */
-	set	poke_srmmu, %g5
-	ld	[%g5], %g5
-	call	%g5
-	 nop
-
-	/* Start this processor. */
-	call	smp_callin
-	 nop
-
-	b,a	smp_panic
-
-	.align	4
         .global leon_smp_cpu_startup, smp_penguin_ctable
 
 leon_smp_cpu_startup:
@@ -198,4 +74,5 @@ leon_smp_cpu_startup:
 	call	smp_callin
 	 nop
 
-	b,a	smp_panic
+	b,a	cpu_panic
+	 nop

-- 
2.34.1


  parent reply	other threads:[~2024-03-09 18:15 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 18:15 [PATCH v2 00/28] sparc32: sunset sun4m and sun4d Sam Ravnborg via B4 Relay
2024-03-09 18:15 ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 01/28] sparc32: Update defconfig to LEON SMP Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 02/28] sparc32: Drop sun4m/sun4d support from head_32.S Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 03/28] sparc32: Drop floppy support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 04/28] sparc32: Drop sun4m specific led driver Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 05/28] sparc32: Drop sun specific power management drivers Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 06/28] sparc32: Drop auxio support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 07/28] sparc32: Drop run-time patching of ipi trap Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 08/28] sparc32: Drop patching of interrupt vector Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 09/28] sparc32: Drop sun4m/sun4d specific irq handling Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 10/28] sparc32: Drop sun4d/sun4m smp support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 11/28] sparc32: Drop pcic support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 12/28] sparc32: Drop mbus support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 13/28] sparc32: Drop unused function __get_{phys,iospace} Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 14/28] sparc32: Drop unused mmu models Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-10 10:37   ` kernel test robot
2024-03-10 12:34     ` Sam Ravnborg
2024-03-11 17:31       ` [PATCH v3 " Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 15/28] sparc32: Drop check for sparc_model Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 16/28] sparc32: Drop use of sparc_config Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 17/28] sparc32: Drop run-time cpuid patching Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 18/28] sparc32: Drop run-time patching of ASI instructions Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 19/28] sparc32: Drop support for 7 register windows Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 20/28] sparc32: Drop additional sun4d bits Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 21/28] sparc32: Drop unused prom ranges support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 22/28] sparc32: Drop unused sbus iommu support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 23/28] sparc32: Drop sun4m irq support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` Sam Ravnborg via B4 Relay [this message]
2024-03-09 18:15   ` [PATCH v2 24/28] sparc32: Drop unused trampoline code Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 25/28] sparc32: Drop config SPARC_LEON Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 26/28] sparc32: Drop sbus support Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 27/28] sbus: char: Drop now unused uctrl driver Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-09 18:15 ` [PATCH v2 28/28] fbdev/p9100: Drop now unused driver p9100 Sam Ravnborg via B4 Relay
2024-03-09 18:15   ` Sam Ravnborg
2024-03-11 14:05   ` Arnd Bergmann
2024-03-11 17:47     ` Sam Ravnborg
2024-04-23 18:02 ` [PATCH v2 00/28] sparc32: sunset sun4m and sun4d Sam Ravnborg
2024-04-26 16:31   ` Andreas Larsson
2024-04-26 16:53     ` Sam Ravnborg

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=20240309-sunset-v2-24-f09912574d2c@ravnborg.org \
    --to=devnull+sam.ravnborg.org@kernel.org \
    --cc=andreas@gaisler.com \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=oftedal@gmail.com \
    --cc=perex@perex.cz \
    --cc=rdunlap@infradead.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tiwai@suse.com \
    --cc=tzimmermann@suse.de \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.