Skip to contentSkip to conversation

sparc32: sunset sun4m and sun4d

RFC PATCH In review Sam Ravnborg 10 participants 31 messages Dec 18, 2020 – Dec 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover sparc32: sunset sun4m and sun4d

The sun4m and sun4d based SPARC machines was very popular in the 90'ties and was then replaced by the more powerful sparc64 class of machines.
Today there is only Gentoo that to my best knowledge supports sparc32 and people have moved on to more capable HW.

Cobham Gaisler have variants of the LEON processer that runs sparc32 - and they are in production today.

With this patchset I propose to sunset sun4m and sun4d and move focus to a more streamlined support for LEON.

One downside is that qemu supports sun4m - and we may loose some testing possibilities when sun4m is dropped. qemu supports LEON to some degree - I have not yet tried it out.

Andreas from Gaisler have indicated that they may be more active upstream on sparc32 - and this will only be easier with a kernel where the legacy stuff is dropped.

I decided to divide up the patches to make it possible to review the set as some of the patches touches assembler and these parts could use some extra eyes if we move forward with this.

For now it builds with the configurations I have tried.

Looking forward for feedback if sunsetting is a good idea or not.

Sam

Sam Ravnborg (13):
sparc32: Drop sun4m/sun4d support from head_32.S
sparc32: Drop floppy support
sparc32: Drop sun4m specific led driver
sparc32: Drop auxio support
sparc32: Drop run-time patching of ipi trap
sparc32: Drop patching of interrupt vector
sparc32: Drop sun4m/sun4d specific irq handling
sparc32: Drop sun4d/sun4m smp support
sparc32: Drop pcic support
sparc32: Drop mbus support
sparc32: Drop unused mmu models
sparc32: drop check for sparc_model
sparc32: drop use of sparc_config

Note: I dunno why git does not see floppy_64.h=>floppy.h as a rename??

 arch/sparc/Kconfig                  |  16 +-
 arch/sparc/include/asm/auxio_32.h   |  73 +---
 arch/sparc/include/asm/cpu_type.h   |  18 -
 arch/sparc/include/asm/elf_32.h     |   2 -
 arch/sparc/include/asm/floppy.h     | 786 ++++++++++++++++++++++++++++++++-
 arch/sparc/include/asm/floppy_32.h  | 393 -----------------
 arch/sparc/include/asm/floppy_64.h  | 779 ---------------------------------
 arch/sparc/include/asm/io_32.h      |   4 +-
 arch/sparc/include/asm/irq_32.h     |   1 -
 arch/sparc/include/asm/mbus.h       |  97 -----
 arch/sparc/include/asm/mxcc.h       | 138 ------
 arch/sparc/include/asm/pcic.h       | 130 ------
 arch/sparc/include/asm/pgtable_32.h |  24 -
 arch/sparc/include/asm/ross.h       | 192 --------
 arch/sparc/include/asm/swift.h      | 107 -----
 arch/sparc/include/asm/timer_32.h   |   1 +
 arch/sparc/include/asm/tsunami.h    |  65 ---
 arch/sparc/include/asm/viking.h     | 255 -----------
 arch/sparc/kernel/Makefile          |   8 +-
 arch/sparc/kernel/apc.c             |  14 -
 arch/sparc/kernel/auxio_32.c        | 140 ------
 arch/sparc/kernel/cpu.c             |   1 -
 arch/sparc/kernel/devices.c         |  10 +-
 arch/sparc/kernel/entry.S           | 354 +--------------
 arch/sparc/kernel/head_32.S         | 190 +-------
 arch/sparc/kernel/ioport.c          |   6 +-
 arch/sparc/kernel/irq.h             |  35 +-
 arch/sparc/kernel/irq_32.c          | 127 +-----
 arch/sparc/kernel/kernel.h          |  28 --
 arch/sparc/kernel/led.c             | 146 -------
 arch/sparc/kernel/leon_kernel.c     |  43 +-
 arch/sparc/kernel/leon_pmc.c        |  14 +-
 arch/sparc/kernel/leon_smp.c        |   3 -
 arch/sparc/kernel/of_device_32.c    |   4 +-
 arch/sparc/kernel/pcic.c            | 841 ------------------------------------
 arch/sparc/kernel/pmc.c             |  10 -
 arch/sparc/kernel/process_32.c      |  10 -
 arch/sparc/kernel/setup_32.c        |  80 +---
 arch/sparc/kernel/smp_32.c          | 102 +----
 arch/sparc/kernel/sun4d_irq.c       | 519 ----------------------
 arch/sparc/kernel/sun4d_smp.c       | 413 ------------------
 arch/sparc/kernel/sun4m_irq.c       | 240 ----------
 arch/sparc/kernel/sun4m_smp.c       | 273 ------------
 arch/sparc/kernel/time_32.c         | 114 +++--
 arch/sparc/kernel/ttable_32.S       |   9 +-
 arch/sparc/mm/Makefile              |   1 -
 arch/sparc/mm/hypersparc.S          | 414 ------------------
 arch/sparc/mm/io-unit.c             |   3 -
 arch/sparc/mm/iommu.c               |  49 +--
 arch/sparc/mm/mm_32.h               |   1 -
 arch/sparc/mm/srmmu.c               | 834 +----------------------------------
 arch/sparc/mm/swift.S               | 256 -----------
 arch/sparc/mm/tsunami.S             | 132 ------
 arch/sparc/mm/viking.S              | 284 ------------
 arch/sparc/prom/misc_32.c           |   2 -
 55 files changed, 905 insertions(+), 7886 deletions(-)
#1 lore raw

PATCH 1/13 sparc32: Drop sun4m/sun4d support from head_32.S

Remove the most obvious parts of sun4* support from head_32.S. Use a single print if a sun4* machine is detected thus restricting boots to LEON machines.

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Will Deacon <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/kernel/head_32.S | 190 ++----------------------------------
 1 file changed, 9 insertions(+), 181 deletions(-)
arch/sparc/kernel/head_32.S +9 -181
index be30c8d4cc73..b7b14250cbe0 100644
@@ -45,11 +45,7 @@ cputypvar:
 	.align 4
 
 notsup:
-	.asciz	"Sparc-Linux sun4/sun4c or MMU-less not supported\n\n"
-	.align 4
-
-sun4e_notsup:
-        .asciz  "Sparc-Linux sun4e support does not exist\n\n"
+	.asciz	"Sparc-Linux sun4* or MMU-less not supported\n\n"
 	.align 4
 
 /* The trap-table - located in the __HEAD section */
@@ -215,114 +211,10 @@ not_a_sun4:
 		be	leon_remap		/* It is a LEON - jump */
 		 nop
 
-		/* Sanity-check, is MMU enabled */
-		lda	[%g0] ASI_M_MMUREGS, %g1
-		andcc	%g1, 1, %g0
-		be	halt_notsup
-		 nop
-
-		/* Check for a viking (TI) module. */
-		cmp	%g3, PSR_IMPL_TI
-		bne	srmmu_not_viking
-		 nop
-
-		/* Figure out what kind of viking we are on.
-		 * We need to know if we have to play with the
-		 * AC bit and disable traps or not.
-		 */
-
-		/* I've only seen MicroSparc's on SparcClassics with this
-		 * bit set.
-		 */
-		set	0x800, %g2
-		lda	[%g0] ASI_M_MMUREGS, %g3	! peek in the control reg
-		and	%g2, %g3, %g3
-		subcc	%g3, 0x0, %g0
-		bnz	srmmu_not_viking			! is in mbus mode
-		 nop
-
-		rd	%psr, %g3			! DO NOT TOUCH %g3
-		andn	%g3, PSR_ET, %g2
-		wr	%g2, 0x0, %psr
-		WRITE_PAUSE
-
-		/* Get context table pointer, then convert to
-		 * a physical address, which is 36 bits.
-		 */
-		set	AC_M_CTPR, %g4
-		lda	[%g4] ASI_M_MMUREGS, %g4
-		sll	%g4, 0x4, %g4			! We use this below
-							! DO NOT TOUCH %g4
-
-		/* Set the AC bit in the Viking's MMU control reg. */
-		lda	[%g0] ASI_M_MMUREGS, %g5	! DO NOT TOUCH %g5
-		set	0x8000, %g6			! AC bit mask
-		or	%g5, %g6, %g6			! Or it in...
-		sta	%g6, [%g0] ASI_M_MMUREGS	! Close your eyes...
-
-		/* Grrr, why does it seem like every other load/store
-		 * on the sun4m is in some ASI space...
-		 * Fine with me, let's get the pointer to the level 1
-		 * page table directory and fetch its entry.
-		 */
-		lda	[%g4] ASI_M_BYPASS, %o1		! This is a level 1 ptr
-		srl	%o1, 0x4, %o1			! Clear low 4 bits
-		sll	%o1, 0x8, %o1			! Make physical
-
-		/* Ok, pull in the PTD. */
-		lda	[%o1] ASI_M_BYPASS, %o2		! This is the 0x0 16MB pgd
-
-		/* Calculate to KERNBASE entry. */
-		add	%o1, KERNBASE >> (PGDIR_SHIFT - 2), %o3
-
-		/* Poke the entry into the calculated address. */
-		sta	%o2, [%o3] ASI_M_BYPASS
-
-		/* I don't get it Sun, if you engineered all these
-		 * boot loaders and the PROM (thank you for the debugging
-		 * features btw) why did you not have them load kernel
-		 * images up in high address space, since this is necessary
-		 * for ABI compliance anyways?  Does this low-mapping provide
-		 * enhanced interoperability?
-		 *
-		 * "The PROM is the computer."
-		 */
-
-		/* Ok, restore the MMU control register we saved in %g5 */
-		sta	%g5, [%g0] ASI_M_MMUREGS	! POW... ouch
-
-		/* Turn traps back on.  We saved it in %g3 earlier. */
-		wr	%g3, 0x0, %psr			! tick tock, tick tock
-
-		/* Now we burn precious CPU cycles due to bad engineering. */
-		WRITE_PAUSE
-
-		/* Wow, all that just to move a 32-bit value from one
-		 * place to another...  Jump to high memory.
-		 */
-		b	go_to_highmem
+		/* Not LEON - halt */
+		ba	halt_notsup
 		 nop
 
-srmmu_not_viking:
-		/* This works on viking's in Mbus mode and all
-		 * other MBUS modules.  It is virtually the same as
-		 * the above madness sans turning traps off and flipping
-		 * the AC bit.
-		 */
-		set	AC_M_CTPR, %g1
-		lda	[%g1] ASI_M_MMUREGS, %g1	! get ctx table ptr
-		sll	%g1, 0x4, %g1			! make physical addr
-		lda	[%g1] ASI_M_BYPASS, %g1		! ptr to level 1 pg_table
-		srl	%g1, 0x4, %g1
-		sll	%g1, 0x8, %g1			! make phys addr for l1 tbl
-
-		lda	[%g1] ASI_M_BYPASS, %g2		! get level1 entry for 0x0
-		add	%g1, KERNBASE >> (PGDIR_SHIFT - 2), %g3
-		sta	%g2, [%g3] ASI_M_BYPASS		! place at KERNBASE entry
-		b	go_to_highmem
-		 nop					! wheee....
-
-
 leon_remap:
 		/* Sanity-check, is MMU enabled */
 		lda	[%g0] ASI_LEON_MMUREGS, %g1
@@ -343,8 +235,6 @@ leon_remap:
 		lda	[%g1] ASI_M_BYPASS, %g2		! get level1 entry for 0x0
 		add	%g1, KERNBASE >> (PGDIR_SHIFT - 2), %g3
 		sta	%g2, [%g3] ASI_M_BYPASS		! place at KERNBASE entry
-		b	go_to_highmem
-		 nop					! wheee....
 
 /* Now do a non-relative jump so that PC is in high-memory */
 go_to_highmem:
@@ -413,13 +303,13 @@ execute_in_high_mem:
 		ldub	[%o2 + 0x4], %l1
 
 		cmp	%l1, 'm'
-		be	sun4m_init
+		be	no_sun4_here		! sun4m
 		 cmp	%l1, 's'
-		be	sun4m_init
+		be	no_sun4_here		! sun4m
 		 cmp	%l1, 'd'
-		be	sun4d_init
+		be	no_sun4_here		! sun4d
 		 cmp	%l1, 'e'
-		be	no_sun4e_here		! Could be a sun4e.
+		be	no_sun4_here		! Could be a sun4e.
 		 nop
 		b	no_sun4u_here		! AIEEE, a V9 sun4u... Get our BIG BROTHER kernel :))
 		 nop
@@ -441,68 +331,6 @@ leon_init:
 		/* Update boot_cpu_id only on boot cpu */
 		stub	%g1, [%g2 + %lo(boot_cpu_id)]
 
-		ba continue_boot
-		 nop
-
-/* CPUID in bootbus can be found at PA 0xff0140000 */
-#define SUN4D_BOOTBUS_CPUID     0xf0140000
-
-sun4d_init:
-	/* Need to patch call to handler_irq */
-	set	patch_handler_irq, %g4
-	set	sun4d_handler_irq, %g5
-	sethi	%hi(0x40000000), %g3		! call
-	sub	%g5, %g4, %g5
-	srl	%g5, 2, %g5
-	or	%g5, %g3, %g5
-	st	%g5, [%g4]
-
-#ifdef CONFIG_SMP
-	/* 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, %g4
-	sta     %g4, [%g0] ASI_M_VIKING_TMP1
-	sethi	%hi(boot_cpu_id), %g5
-	stb	%g4, [%g5 + %lo(boot_cpu_id)]
-#endif
-
-	/* Fall through to sun4m_init */
-
-sun4m_init:
-/* Ok, the PROM could have done funny things and apple cider could still
- * be sitting in the fault status/address registers.  Read them all to
- * clear them so we don't get magic faults later on.
- */
-/* This sucks, apparently this makes Vikings call prom panic, will fix later */
-2:
-		rd	%psr, %o1
-		srl	%o1, PSR_IMPL_SHIFT, %o1	! Get a type of the CPU
-
-		subcc	%o1, PSR_IMPL_TI, %g0		! TI: Viking or MicroSPARC
-		be	continue_boot
-		 nop
-
-		set	AC_M_SFSR, %o0
-		lda	[%o0] ASI_M_MMUREGS, %g0
-		set	AC_M_SFAR, %o0
-		lda	[%o0] ASI_M_MMUREGS, %g0
-
-		/* Fujitsu MicroSPARC-II has no asynchronous flavors of FARs */
-		subcc	%o1, 0, %g0
-		be	continue_boot
-		 nop
-
-		set	AC_M_AFSR, %o0
-		lda	[%o0] ASI_M_MMUREGS, %g0
-		set	AC_M_AFAR, %o0
-		lda	[%o0] ASI_M_MMUREGS, %g0
-		 nop
-
-
-continue_boot:
-
 /* Aieee, now set PC and nPC, enable traps, give ourselves a stack and it's
  * show-time!
  */
@@ -670,9 +498,9 @@ continue_boot:
 		call	halt_me
 		 nop
 
-no_sun4e_here:
+no_sun4_here:
 		ld	[%g7 + 0x68], %o1
-		set	sun4e_notsup, %o0
+		set	notsup, %o0
 		call	%o1
 		 nop
 		b	halt_me
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH v1 01/13] sparc32: Drop sun4m/sun4d support from head_32.S

Quoted 8 lines · Sam Ravnborg

notsup:

arch/sparc/kernel/head_32.S +1 -5
-	.asciz	"Sparc-Linux sun4/sun4c or MMU-less not supported\n\n"
-	.align 4
-
-sun4e_notsup:
-        .asciz  "Sparc-Linux sun4e support does not exist\n\n"
+	.asciz	"Sparc-Linux sun4* or MMU-less not supported\n\n"

.align 4

The asterisk may lead to a moment of bewilderment; sun4u/sun4v are still supported.

#3 lore raw

Re: [PATCH v1 01/13] sparc32: Drop sun4m/sun4d support from head_32.S

Hi Jan,

Quoted 13 lines · Jan Engelhardt
Quoted 8 lines · Sam Ravnborg

notsup:

arch/sparc/kernel/head_32.S +1 -5
-	.asciz	"Sparc-Linux sun4/sun4c or MMU-less not supported\n\n"
-	.align 4
-
-sun4e_notsup:
-        .asciz  "Sparc-Linux sun4e support does not exist\n\n"
+	.asciz	"Sparc-Linux sun4* or MMU-less not supported\n\n"

.align 4

The asterisk may lead to a moment of bewilderment; sun4u/sun4v are still supported.

Noted, I will come up with something better.

Sam

#4 lore raw

PATCH 2/13 sparc32: Drop floppy support

In reply to Sam Ravnborg

LEON do not have floppy support so we can drop it

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Denis Efremov <[email protected]>
Cc Willy Tarreau <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/Kconfig                 |   2 +-
 arch/sparc/include/asm/floppy.h    | 786 ++++++++++++++++++++++++++++-
 arch/sparc/include/asm/floppy_32.h | 393 ---------------
 arch/sparc/include/asm/floppy_64.h | 779 ----------------------------
 arch/sparc/kernel/entry.S          | 137 -----
 arch/sparc/kernel/irq.h            |   3 -
 arch/sparc/kernel/irq_32.c         |  93 ----
 arch/sparc/kernel/kernel.h         |   2 -
 8 files changed, 779 insertions(+), 1416 deletions(-)
 delete mode 100644 arch/sparc/include/asm/floppy_32.h
 delete mode 100644 arch/sparc/include/asm/floppy_64.h
arch/sparc/Kconfig +1 -1
index c9c34dc52b7d..2c6d8d834f9a 100644
@@ -200,7 +200,7 @@ config GENERIC_CALIBRATE_DELAY
 
 config ARCH_MAY_HAVE_PC_FDC
 	bool
-	default y
+	default y if SPARC64
 
 config EMULATED_CMPXCHG
 	bool
arch/sparc/include/asm/floppy.h +777 -8

786 lines not on this page · raw message

arch/sparc/include/asm/floppy_32.h deleted +0 -393

393 lines not on this page · raw message

arch/sparc/include/asm/floppy_64.h deleted +0 -778

778 lines not on this page · raw message

arch/sparc/kernel/entry.S +0 -137

143 lines not on this page · raw message

arch/sparc/kernel/irq.h +0 -3
index b02026ad6e34..0d9b740725b4 100644
@@ -83,9 +83,6 @@ void handler_irq(unsigned int pil, struct pt_regs *regs);
 
 unsigned long leon_get_irqmask(unsigned int irq);
 
-/* irq_32.c */
-void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs);
-
 /* sun4m_irq.c */
 void sun4m_nmi(struct pt_regs *regs);
 
arch/sparc/kernel/irq_32.c +0 -93

99 lines not on this page · raw message

arch/sparc/kernel/kernel.h +0 -2
index 9cd09a3ef35f..c76e49032273 100644
@@ -152,8 +152,6 @@ extern unsigned int real_irq_entry[];
 extern unsigned int smp4d_ticker[];
 extern unsigned int patchme_maybe_smp_msg[];
 
-void floppy_hardint(void);
-
 /* trampoline_32.S */
 extern unsigned long sun4m_cpu_startup;
 extern unsigned long sun4d_cpu_startup;
Signature · 1 line
2.27.0
#5 lore raw

Re: [PATCH v1 02/13] sparc32: Drop floppy support

Quoted 14 lines · Sam Ravnborg

LEON do not have floppy support so we can drop it

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Denis Efremov <[email protected]>
Cc Willy Tarreau <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
Quoted 5 lines
---
 arch/sparc/Kconfig                 |   2 +-
 arch/sparc/include/asm/floppy.h    | 786 ++++++++++++++++++++++++++++-
 arch/sparc/include/asm/floppy_32.h | 393 ---------------
 arch/sparc/include/asm/floppy_64.h | 779 ----------------------------

Rather than renaming the floppy_64.h to floppy.h, it might be easier to just remove the #else from floppy.h, similar to what asm/adi.h does.

This might be helpful in the (unlikely) case that someone has patches for this file and wants to rebase them.

Arnd

#6 lore raw

Re: [PATCH v1 02/13] sparc32: Drop floppy support

Quoted 21 lines · Arnd Bergmann
Quoted 14 lines · Sam Ravnborg

LEON do not have floppy support so we can drop it

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Denis Efremov <[email protected]>
Cc Willy Tarreau <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
Quoted 5 lines
---
 arch/sparc/Kconfig                 |   2 +-
 arch/sparc/include/asm/floppy.h    | 786 ++++++++++++++++++++++++++++-
 arch/sparc/include/asm/floppy_32.h | 393 ---------------
 arch/sparc/include/asm/floppy_64.h | 779 ----------------------------
Quoted 2 lines

Rather than renaming the floppy_64.h to floppy.h, it might be easier to just remove the #else from floppy.h, similar to what asm/adi.h does.

That is what I had first but then thought it pointless with a wrapper file. I will revert back to use floppy_64.h for now - we can always consolidate header files later.

Sam

#7 lore raw

Re: [PATCH v1 02/13] sparc32: Drop floppy support

In reply to Sam Ravnborg
I love your patch! Perhaps something to improve:

Hi Sam,

I love your patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on sparc/master v5.10 next-20201218] [cannot apply to sparc-next/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/sparc32-sunset-sun4m-and-sun4d/20201219-025354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/00216b8cb055593d3f761d58e2f167ef4b425871
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sam-Ravnborg/sparc32-sunset-sun4m-and-sun4d/20201219-025354 git checkout 00216b8cb055593d3f761d58e2f167ef4b425871
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

In file included from drivers/block/floppy.c:251:

>> arch/sparc/include/asm/floppy.h:200:13: warning: no previous prototype for 'sparc_floppy_irq' [-Wmissing-prototypes]
     200 | irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie)
         |             ^~~~~~~~~~~~~~~~
   In file included from drivers/block/floppy.c:251:
>> arch/sparc/include/asm/floppy.h:437:6: warning: no previous prototype for 'sun_pci_fd_dma_callback' [-Wmissing-prototypes]

437 | void sun_pci_fd_dma_callback(struct ebus_dma_info *p, int event, void *cookie)
| ^~~~~~~~~~~~~~~~~~~~~~~

vim +/sparc_floppy_irq +200 arch/sparc/include/asm/floppy.h

199

 > 200	irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie)

201 {
202 if (likely(doing_pdma)) {
203 void __iomem *stat = (void __iomem *) fdc_status;
204 unsigned char *vaddr = pdma_vaddr;
205 unsigned long size = pdma_size;
206 u8 val;
207
208 while (size) {
209 val = readb(stat);
210 if (unlikely(!(val & 0x80))) {
211 pdma_vaddr = vaddr;
212 pdma_size = size;
213 return IRQ_HANDLED;
214 }
215 if (unlikely(!(val & 0x20))) {
216 pdma_vaddr = vaddr;
217 pdma_size = size;
218 doing_pdma = 0;
219 goto main_interrupt;
220 }
221 if (val & 0x40) {
222 /* read */
223 *vaddr++ = readb(stat + 1);
224 } else {
225 unsigned char data = *vaddr++;
226
227 /* write */
228 writeb(data, stat + 1);
229 }
230 size--;
231 }
232
233 pdma_vaddr = vaddr;
234 pdma_size = size;
235
236 /* Send Terminal Count pulse to floppy controller. */
237 val = readb(auxio_register);
238 val |= AUXIO_AUX1_FTCNT;
239 writeb(val, auxio_register);
240 val &= ~AUXIO_AUX1_FTCNT;
241 writeb(val, auxio_register);
242
243 doing_pdma = 0;
244 }
245
246 main_interrupt:
247 return floppy_interrupt(irq, dev_cookie);
248 }
249

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#8 lore raw

PATCH 3/13 sparc32: Drop sun4m specific led driver

In reply to Sam Ravnborg

The led driver is only relevant for the sun4m machines.

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Alexey Dobriyan <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/Kconfig         |   9 ---
 arch/sparc/kernel/Makefile |   1 -
 arch/sparc/kernel/led.c    | 146 -------------------------------------
 3 files changed, 156 deletions(-)
 delete mode 100644 arch/sparc/kernel/led.c
arch/sparc/Kconfig +0 -9
index 2c6d8d834f9a..8447f5b7bb90 100644
@@ -337,15 +337,6 @@ config SUN_PM
 	  Enable power management and CPU standby features on supported
 	  SPARC platforms.
 
-config SPARC_LED
-	tristate "Sun4m LED driver"
-	depends on SPARC32
-	help
-	  This driver toggles the front-panel LED on sun4m systems
-	  in a user-specifiable manner.  Its state can be probed
-	  by reading /proc/led and its blinking mode can be changed
-	  via writes to /proc/led
-
 config SERIAL_CONSOLE
 	bool
 	depends on SPARC32
arch/sparc/kernel/Makefile +0 -1
index d3a0e072ebe8..b6c9ca1d6c66 100644
@@ -89,7 +89,6 @@ obj-$(CONFIG_SUN_PM)      += apc.o pmc.o
 
 obj-$(CONFIG_MODULES)     += module.o
 obj-$(CONFIG_MODULES)     += sparc_ksyms.o
-obj-$(CONFIG_SPARC_LED)   += led.o
 obj-$(CONFIG_KGDB)        += kgdb_$(BITS).o
 
 
arch/sparc/kernel/led.c deleted +0 -146

146 lines not on this page · raw message

Signature · 1 line
2.27.0
#9 lore raw

PATCH 4/13 sparc32: Drop auxio support

In reply to Sam Ravnborg

auxio is not supported by LEON - so drop it.

Cc Sam Ravnborg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Al Viro <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/auxio_32.h |  73 +---------------
 arch/sparc/kernel/Makefile        |   2 +-
 arch/sparc/kernel/apc.c           |  14 ---
 arch/sparc/kernel/auxio_32.c      | 140 ------------------------------
 arch/sparc/kernel/devices.c       |   3 -
 arch/sparc/kernel/kernel.h        |   4 -
 arch/sparc/kernel/pmc.c           |  10 ---
 arch/sparc/kernel/process_32.c    |  10 ---
 arch/sparc/prom/misc_32.c         |   2 -
 9 files changed, 3 insertions(+), 255 deletions(-)
 delete mode 100644 arch/sparc/kernel/auxio_32.c
arch/sparc/include/asm/auxio_32.h +2 -71
index 852457c7a265..e2335ddd359d 100644
@@ -1,43 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * auxio.h:  Definitions and code for the Auxiliary I/O register.
+ * Dummy definitions for the Auxiliary I/O register.
  *
  * Copyright (C) 1995 David S. Miller ([email protected])
  */
 #ifndef _SPARC_AUXIO_H
 #define _SPARC_AUXIO_H
 
-#include <asm/vaddrs.h>
-
-/* This register is an unsigned char in IO space.  It does two things.
- * First, it is used to control the front panel LED light on machines
- * that have it (good for testing entry points to trap handlers and irq's)
- * Secondly, it controls various floppy drive parameters.
- */
-#define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
-#define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
-#define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
-#define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
-#define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
-#define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
-#define AUXIO_LINK_TEST   0x08    /* sun4m - On means TPE Carrier detect. */
-
-/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
-#define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
-
-/* Set the following to zero to eject the floppy. */
-#define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
-#define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
-
-#ifndef __ASSEMBLY__
-
-/*
- * NOTE: these routines are implementation dependent--
- * understand the hardware you are querying!
- */
-void set_auxio(unsigned char bits_on, unsigned char bits_off);
-unsigned char get_auxio(void); /* .../asm/floppy.h */
-
 /*
  * The following routines are provided for driver-compatibility
  * with sparc64 (primarily sunlance.c)
@@ -46,44 +15,6 @@ unsigned char get_auxio(void); /* .../asm/floppy.h */
 #define AUXIO_LTE_ON    1
 #define AUXIO_LTE_OFF   0
 
-/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
- *
- * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
- */
-#define auxio_set_lte(on) \
-do { \
-	if(on) { \
-		set_auxio(AUXIO_LINK_TEST, 0); \
-	} else { \
-		set_auxio(0, AUXIO_LINK_TEST); \
-	} \
-} while (0)
-
-#define AUXIO_LED_ON    1
-#define AUXIO_LED_OFF   0
-
-/* auxio_set_led - Set system front panel LED
- *
- * on - AUXIO_LED_ON or AUXIO_LED_OFF
- */
-#define auxio_set_led(on) \
-do { \
-	if(on) { \
-		set_auxio(AUXIO_LED, 0); \
-	} else { \
-		set_auxio(0, AUXIO_LED); \
-	} \
-} while (0)
-
-#endif /* !(__ASSEMBLY__) */
-
-
-/* AUXIO2 (Power Off Control) */
-extern volatile u8 __iomem *auxio_power_register;
-
-#define	AUXIO_POWER_DETECT_FAILURE	32
-#define	AUXIO_POWER_CLEAR_FAILURE	2
-#define	AUXIO_POWER_OFF			1
-
+#define auxio_set_lte(on)
 
 #endif /* !(_SPARC_AUXIO_H) */
arch/sparc/kernel/Makefile +1 -1
index b6c9ca1d6c66..b2735fb29c89 100644
@@ -84,7 +84,7 @@ obj-$(CONFIG_SMP)         += trampoline_$(BITS).o smp_$(BITS).o
 obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
 obj-$(CONFIG_SPARC64_SMP) += hvtramp.o
 
-obj-y                     += auxio_$(BITS).o
+obj-$(CONFIG_SPARC64)     += auxio_64.o
 obj-$(CONFIG_SUN_PM)      += apc.o pmc.o
 
 obj-$(CONFIG_MODULES)     += module.o
arch/sparc/kernel/apc.c +0 -14
index ecd05bc0a104..93f5934bbbe1 100644
@@ -19,15 +19,9 @@
 #include <asm/io.h>
 #include <asm/oplib.h>
 #include <linux/uaccess.h>
-#include <asm/auxio.h>
 #include <asm/apc.h>
 #include <asm/processor.h>
 
-/* Debugging
- * 
- * #define APC_DEBUG_LED
- */
-
 #define APC_MINOR	MISC_DYNAMIC_MINOR
 #define APC_OBPNAME	"power-management"
 #define APC_DEVNAME "apc"
@@ -60,15 +54,7 @@ __setup("apc=", apc_setup);
  */
 static void apc_swift_idle(void)
 {
-#ifdef APC_DEBUG_LED
-	set_auxio(0x00, AUXIO_LED); 
-#endif
-
 	apc_writeb(apc_readb(APC_IDLE_REG) | APC_IDLE_ON, APC_IDLE_REG);
-
-#ifdef APC_DEBUG_LED
-	set_auxio(AUXIO_LED, 0x00); 
-#endif
 } 
 
 static inline void apc_free(struct platform_device *op)
arch/sparc/kernel/auxio_32.c deleted +0 -139

139 lines not on this page · raw message

arch/sparc/kernel/devices.c +0 -3
index 23b6e50d4ada..b3c2d51b22c4 100644
@@ -132,7 +132,4 @@ void __init device_scan(void)
 							    0);
 	}
 #endif /* !CONFIG_SMP */
-
-	auxio_probe();
-	auxio_power_probe();
 }
arch/sparc/kernel/kernel.h +0 -4
index c76e49032273..7328d13875e4 100644
@@ -175,10 +175,6 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
 /* windows.c */
 void try_to_clear_window_buffer(struct pt_regs *regs, int who);
 
-/* auxio_32.c */
-void __init auxio_probe(void);
-void __init auxio_power_probe(void);
-
 /* pcic.c */
 extern void __iomem *pcic_regs;
 void pcic_nmi(unsigned int pend, struct pt_regs *regs);
arch/sparc/kernel/pmc.c +0 -10
index b5c1eb33b951..441b9fbc27f1 100644
@@ -17,12 +17,10 @@
 #include <asm/io.h>
 #include <asm/oplib.h>
 #include <linux/uaccess.h>
-#include <asm/auxio.h>
 #include <asm/processor.h>
 
 /* Debug
  *
- * #define PMC_DEBUG_LED
  * #define PMC_NO_IDLE
  */
 
@@ -43,15 +41,7 @@ static u8 __iomem *regs;
  */
 static void pmc_swift_idle(void)
 {
-#ifdef PMC_DEBUG_LED
-	set_auxio(0x00, AUXIO_LED);
-#endif
-
 	pmc_writeb(pmc_readb(PMC_IDLE_REG) | PMC_IDLE_ON, PMC_IDLE_REG);
-
-#ifdef PMC_DEBUG_LED
-	set_auxio(AUXIO_LED, 0x00);
-#endif
 }
 
 static int pmc_probe(struct platform_device *op)
arch/sparc/kernel/process_32.c +0 -10
index a02363735915..cf9ef387c6d5 100644
@@ -30,7 +30,6 @@
 #include <linux/slab.h>
 #include <linux/cpu.h>
 
-#include <asm/auxio.h>
 #include <asm/oplib.h>
 #include <linux/uaccess.h>
 #include <asm/page.h>
@@ -52,8 +51,6 @@ void (*sparc_idle)(void);
 
 /* 
  * Power-off handler instantiation for pm.h compliance
- * This is done via auxio, but could be used as a fallback
- * handler when auxio is not present-- unused for now...
  */
 void (*pm_power_off)(void) = machine_power_off;
 EXPORT_SYMBOL(pm_power_off);
@@ -107,13 +104,6 @@ void machine_restart(char * cmd)
 
 void machine_power_off(void)
 {
-	if (auxio_power_register &&
-	    (!of_node_is_type(of_console_device, "serial") || scons_pwroff)) {
-		u8 power_register = sbus_readb(auxio_power_register);
-		power_register |= AUXIO_POWER_OFF;
-		sbus_writeb(power_register, auxio_power_register);
-	}
-
 	machine_halt();
 }
 
arch/sparc/prom/misc_32.c +0 -2
index 625750924860..78dde6bfbf0f 100644
@@ -13,7 +13,6 @@
 
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <asm/auxio.h>
 
 extern void restore_current(void);
 
@@ -60,7 +59,6 @@ prom_cmdline(void)
 	(*(romvec->pv_abort))();
 	restore_current();
 	spin_unlock_irqrestore(&prom_lock, flags);
-	set_auxio(AUXIO_LED, 0);
 }
 
 /* Drop into the prom, but completely terminate the program.
Signature · 1 line
2.27.0
#10 lore raw

PATCH 5/13 sparc32: Drop run-time patching of ipi trap

In reply to Sam Ravnborg

There is no longer any need for the run-time patching of the ipi trap with the removal of sun4m and sun4d. Remove the patching and drop the ipi implementation for the two machines.

The patch includes removal of patching from pcic as this was needed to fix the build. pcic will be removed in a later commit.

Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Christian Brauner <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/kernel/entry.S     | 70 ++---------------------------------
 arch/sparc/kernel/kernel.h    |  4 --
 arch/sparc/kernel/leon_smp.c  |  3 --
 arch/sparc/kernel/pcic.c      | 11 ------
 arch/sparc/kernel/sun4d_smp.c |  3 --
 arch/sparc/kernel/ttable_32.S |  9 ++---
 6 files changed, 7 insertions(+), 93 deletions(-)
arch/sparc/kernel/entry.S +3 -67
index 9985b08a3467..1a2e20a7e584 100644
@@ -174,32 +174,6 @@ maybe_smp4m_msg_check_resched:
 maybe_smp4m_msg_out:
 	RESTORE_ALL
 
-	.align	4
-	.globl	linux_trap_ipi15_sun4m
-linux_trap_ipi15_sun4m:
-	SAVE_ALL
-	sethi	%hi(0x80000000), %o2
-	GET_PROCESSOR4M_ID(o0)
-	sethi	%hi(sun4m_irq_percpu), %l5
-	or	%l5, %lo(sun4m_irq_percpu), %o5
-	sll	%o0, 2, %o0
-	ld	[%o5 + %o0], %o5
-	ld	[%o5 + 0x00], %o3	! sun4m_irq_percpu[cpu]->pending
-	andcc	%o3, %o2, %g0
-	be	sun4m_nmi_error		! Must be an NMI async memory error
-	 st	%o2, [%o5 + 0x04]	! sun4m_irq_percpu[cpu]->clear=0x80000000
-	WRITE_PAUSE
-	ld	[%o5 + 0x00], %g0	! sun4m_irq_percpu[cpu]->pending
-	WRITE_PAUSE
-	or	%l0, PSR_PIL, %l4
-	wr	%l4, 0x0, %psr
-	WRITE_PAUSE
-	wr	%l4, PSR_ET, %psr
-	WRITE_PAUSE
-	call	smp4m_cross_call_irq
-	 nop
-	b	ret_trap_lockless_ipi
-	 clr	%l6
 
 	.globl	smp4d_ticker
 	/* SMP per-cpu ticker interrupts are handled specially. */
@@ -220,44 +194,6 @@ smp4d_ticker:
 	WRITE_PAUSE
 	RESTORE_ALL
 
-	.align	4
-	.globl	linux_trap_ipi15_sun4d
-linux_trap_ipi15_sun4d:
-	SAVE_ALL
-	sethi	%hi(CC_BASE), %o4
-	sethi	%hi(MXCC_ERR_ME|MXCC_ERR_PEW|MXCC_ERR_ASE|MXCC_ERR_PEE), %o2
-	or	%o4, (CC_EREG - CC_BASE), %o0
-	ldda	[%o0] ASI_M_MXCC, %o0
-	andcc	%o0, %o2, %g0
-	bne	1f
-	 sethi	%hi(BB_STAT2), %o2
-	lduba	[%o2] ASI_M_CTL, %o2
-	andcc	%o2, BB_STAT2_MASK, %g0
-	bne	2f
-	 or	%o4, (CC_ICLR - CC_BASE), %o0
-	sethi	%hi(1 << 15), %o1
-	stha	%o1, [%o0] ASI_M_MXCC	/* Clear PIL 15 in MXCC's ICLR */
-	or	%l0, PSR_PIL, %l4
-	wr	%l4, 0x0, %psr
-	WRITE_PAUSE
-	wr	%l4, PSR_ET, %psr
-	WRITE_PAUSE
-	call	smp4d_cross_call_irq
-	 nop
-	b	ret_trap_lockless_ipi
-	 clr	%l6
-
-1:	/* MXCC error */
-2:	/* BB error */
-	/* Disable PIL 15 */
-	set	CC_IMSK, %l4
-	lduha	[%l4] ASI_M_MXCC, %l5
-	sethi	%hi(1 << 15), %l7
-	or	%l5, %l7, %l5
-	stha	%l5, [%l4] ASI_M_MXCC
-	/* FIXME */
-1:	b,a	1b
-
 	.globl	smpleon_ipi
 	.extern leon_ipi_interrupt
 	/* SMP per-cpu IPI interrupts are handled specially. */
@@ -618,11 +554,11 @@ sun4m_nmi_error:
 
 #ifndef CONFIG_SMP
 	.align	4
-	.globl	linux_trap_ipi15_sun4m
-linux_trap_ipi15_sun4m:
+	.globl	linux_trap_ipi15_leon
+linux_trap_ipi15_leon:
 	SAVE_ALL
 
-	ba	sun4m_nmi_error
+	ba      sun4m_nmi_error
 	 nop
 #endif /* CONFIG_SMP */
 
arch/sparc/kernel/kernel.h +0 -4
index 7328d13875e4..c9e1b13d955f 100644
@@ -135,10 +135,6 @@ void leonsmp_ipi_interrupt(void);
 void leon_cross_call_irq(void);
 
 /* head_32.S */
-extern unsigned int t_nmi[];
-extern unsigned int linux_trap_ipi15_sun4d[];
-extern unsigned int linux_trap_ipi15_sun4m[];
-
 extern struct tt_entry trapbase;
 extern struct tt_entry trapbase_cpu1;
 extern struct tt_entry trapbase_cpu2;
arch/sparc/kernel/leon_smp.c +0 -3
index 1eed26d423fb..b0d75783d337 100644
@@ -461,8 +461,5 @@ static const struct sparc32_ipi_ops leon_ipi_ops = {
 
 void __init leon_init_smp(void)
 {
-	/* Patch ipi15 trap table */
-	t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_leon - linux_trap_ipi15_sun4m);
-
 	sparc32_ipi_ops = &leon_ipi_ops;
 }
arch/sparc/kernel/pcic.c +0 -11
index ee4c9a9a171c..87bdcb16019b 100644
@@ -354,17 +354,6 @@ int __init pcic_probe(void)
 	prom_getstring(node, "name", namebuf, 63);  namebuf[63] = 0;
 	strcpy(pbm->prom_name, namebuf);
 
-	{
-		extern int pcic_nmi_trap_patch[4];
-
-		t_nmi[0] = pcic_nmi_trap_patch[0];
-		t_nmi[1] = pcic_nmi_trap_patch[1];
-		t_nmi[2] = pcic_nmi_trap_patch[2];
-		t_nmi[3] = pcic_nmi_trap_patch[3];
-		swift_flush_dcache();
-		pcic_regs = pcic->pcic_regs;
-	}
-
 	prom_getstring(prom_root_node, "name", namebuf, 63);  namebuf[63] = 0;
 	{
 		struct pcic_sn2list *p;
arch/sparc/kernel/sun4d_smp.c +0 -3
index ff30f03beb7c..cecdda746baa 100644
@@ -401,9 +401,6 @@ void __init sun4d_init_smp(void)
 {
 	int i;
 
-	/* Patch ipi15 trap table */
-	t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
-
 	sparc32_ipi_ops = &sun4d_ipi_ops;
 
 	for (i = 0; i < NR_CPUS; i++) {
arch/sparc/kernel/ttable_32.S +4 -5
index e79fd786fbbb..78bbf2548e1f 100644
@@ -43,8 +43,7 @@ t_irq12:TRAP_ENTRY_INTERRUPT(12)            /* IRQ Zilog serial chip         */
 t_irq13:TRAP_ENTRY_INTERRUPT(13)            /* IRQ Audio Intr.               */
 t_irq14:TRAP_ENTRY_INTERRUPT(14)            /* IRQ Timer #2                  */
 
-	.globl	t_nmi
-t_nmi:	TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
+t_nmi:	TRAP_ENTRY(0x1f, linux_trap_ipi15_leon)
 
 t_racc:	TRAP_ENTRY(0x20, do_reg_access)     /* General Register Access Error */
 t_iacce:BAD_TRAP(0x21)                      /* Instr Access Error            */
@@ -146,7 +145,7 @@ trapbase_cpu1:
 	TRAP_ENTRY_INTERRUPT(9) TRAP_ENTRY_INTERRUPT(10)
 	TRAP_ENTRY_INTERRUPT(11) TRAP_ENTRY_INTERRUPT(12)
 	TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14)
-	TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
+	TRAP_ENTRY(0x1f, linux_trap_ipi15_leon)
 	TRAP_ENTRY(0x20, do_reg_access)
 	BAD_TRAP(0x21)
 	BAD_TRAP(0x22)
@@ -245,7 +244,7 @@ trapbase_cpu2:
 	TRAP_ENTRY_INTERRUPT(12)
 	TRAP_ENTRY_INTERRUPT(13)
 	TRAP_ENTRY_INTERRUPT(14)
-	TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
+	TRAP_ENTRY(0x1f, linux_trap_ipi15_leon)
 	TRAP_ENTRY(0x20, do_reg_access)
 	BAD_TRAP(0x21)
 	BAD_TRAP(0x22)
@@ -345,7 +344,7 @@ trapbase_cpu3:
 	TRAP_ENTRY_INTERRUPT(12)
 	TRAP_ENTRY_INTERRUPT(13)
 	TRAP_ENTRY_INTERRUPT(14)
-	TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
+	TRAP_ENTRY(0x1f, linux_trap_ipi15_leon)
 	TRAP_ENTRY(0x20, do_reg_access)
 	BAD_TRAP(0x21)
 	BAD_TRAP(0x22)
Signature · 1 line
2.27.0
#11 lore raw

PATCH 6/13 sparc32: Drop patching of interrupt vector

In reply to Sam Ravnborg

Drop the sun4m specific handling and the patching that takes place in sun4d and LEON.

Cc Sam Ravnborg <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Christian Brauner <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/kernel/entry.S       | 98 ---------------------------------
 arch/sparc/kernel/kernel.h      |  1 -
 arch/sparc/kernel/leon_kernel.c | 16 ------
 arch/sparc/kernel/sun4d_irq.c   | 25 ---------
 4 files changed, 140 deletions(-)
arch/sparc/kernel/entry.S +0 -98
index 1a2e20a7e584..e7cf5013aa40 100644
@@ -79,15 +79,6 @@ bad_trap_handler:
 real_irq_entry:
 	SAVE_ALL
 
-#ifdef CONFIG_SMP
-	.globl	patchme_maybe_smp_msg
-
-	cmp	%l7, 11
-patchme_maybe_smp_msg:
-	bgu	maybe_smp4m_msg
-	 nop
-#endif
-
 real_irq_continue:
 	or	%l0, PSR_PIL, %g2
 	wr	%g2, 0x0, %psr
@@ -105,95 +96,6 @@ patch_handler_irq:
 	RESTORE_ALL
 
 #ifdef CONFIG_SMP
-	/* SMP per-cpu ticker interrupts are handled specially. */
-smp4m_ticker:
-	bne	real_irq_continue+4
-	 or	%l0, PSR_PIL, %g2
-	wr	%g2, 0x0, %psr
-	WRITE_PAUSE
-	wr	%g2, PSR_ET, %psr
-	WRITE_PAUSE
-	call	smp4m_percpu_timer_interrupt
-	 add	%sp, STACKFRAME_SZ, %o0
-	wr	%l0, PSR_ET, %psr
-	WRITE_PAUSE
-	RESTORE_ALL
-
-#define GET_PROCESSOR4M_ID(reg)	\
-	rd	%tbr, %reg;	\
-	srl	%reg, 12, %reg;	\
-	and	%reg, 3, %reg;
-
-	/* Here is where we check for possible SMP IPI passed to us
-	 * on some level other than 15 which is the NMI and only used
-	 * for cross calls.  That has a separate entry point below.
-	 *
-	 * IPIs are sent on Level 12, 13 and 14. See IRQ_IPI_*.
-	 */
-maybe_smp4m_msg:
-	GET_PROCESSOR4M_ID(o3)
-	sethi	%hi(sun4m_irq_percpu), %l5
-	sll	%o3, 2, %o3
-	or	%l5, %lo(sun4m_irq_percpu), %o5
-	sethi	%hi(0x70000000), %o2	! Check all soft-IRQs
-	ld	[%o5 + %o3], %o1
-	ld	[%o1 + 0x00], %o3	! sun4m_irq_percpu[cpu]->pending
-	andcc	%o3, %o2, %g0
-	be,a	smp4m_ticker
-	 cmp	%l7, 14
-	/* Soft-IRQ IPI */
-	st	%o2, [%o1 + 0x04]	! sun4m_irq_percpu[cpu]->clear=0x70000000
-	WRITE_PAUSE
-	ld	[%o1 + 0x00], %g0	! sun4m_irq_percpu[cpu]->pending
-	WRITE_PAUSE
-	or	%l0, PSR_PIL, %l4
-	wr	%l4, 0x0, %psr
-	WRITE_PAUSE
-	wr	%l4, PSR_ET, %psr
-	WRITE_PAUSE
-	srl	%o3, 28, %o2		! shift for simpler checks below
-maybe_smp4m_msg_check_single:
-	andcc	%o2, 0x1, %g0
-	beq,a	maybe_smp4m_msg_check_mask
-	 andcc	%o2, 0x2, %g0
-	call	smp_call_function_single_interrupt
-	 nop
-	andcc	%o2, 0x2, %g0
-maybe_smp4m_msg_check_mask:
-	beq,a	maybe_smp4m_msg_check_resched
-	 andcc	%o2, 0x4, %g0
-	call	smp_call_function_interrupt
-	 nop
-	andcc	%o2, 0x4, %g0
-maybe_smp4m_msg_check_resched:
-	/* rescheduling is done in RESTORE_ALL regardless, but incr stats */
-	beq,a	maybe_smp4m_msg_out
-	 nop
-	call	smp_resched_interrupt
-	 nop
-maybe_smp4m_msg_out:
-	RESTORE_ALL
-
-
-	.globl	smp4d_ticker
-	/* SMP per-cpu ticker interrupts are handled specially. */
-smp4d_ticker:
-	SAVE_ALL
-	or	%l0, PSR_PIL, %g2
-	sethi	%hi(CC_ICLR), %o0
-	sethi	%hi(1 << 14), %o1
-	or	%o0, %lo(CC_ICLR), %o0
-	stha	%o1, [%o0] ASI_M_MXCC	/* Clear PIL 14 in MXCC's ICLR */
-	wr	%g2, 0x0, %psr
-	WRITE_PAUSE
-	wr	%g2, PSR_ET, %psr
-	WRITE_PAUSE
-	call	smp4d_percpu_timer_interrupt
-	 add	%sp, STACKFRAME_SZ, %o0
-	wr	%l0, PSR_ET, %psr
-	WRITE_PAUSE
-	RESTORE_ALL
-
 	.globl	smpleon_ipi
 	.extern leon_ipi_interrupt
 	/* SMP per-cpu IPI interrupts are handled specially. */
arch/sparc/kernel/kernel.h +0 -1
index c9e1b13d955f..e313d2e15ba9 100644
@@ -146,7 +146,6 @@ extern char cputypval[];
 extern unsigned long lvl14_save[4];
 extern unsigned int real_irq_entry[];
 extern unsigned int smp4d_ticker[];
-extern unsigned int patchme_maybe_smp_msg[];
 
 /* trampoline_32.S */
 extern unsigned long sun4m_cpu_startup;
arch/sparc/kernel/leon_kernel.c +0 -16
index 39229940d725..49b37a0dcc2b 100644
@@ -423,22 +423,6 @@ void __init leon_init_timers(void)
 	if (eirq != 0)
 		leon_eirq_setup(eirq);
 
-#ifdef CONFIG_SMP
-	{
-		unsigned long flags;
-
-		/*
-		 * In SMP, sun4m adds a IPI handler to IRQ trap handler that
-		 * LEON never must take, sun4d and LEON overwrites the branch
-		 * with a NOP.
-		 */
-		local_irq_save(flags);
-		patchme_maybe_smp_msg[0] = 0x01000000; /* NOP out the branch */
-		local_ops->cache_all();
-		local_irq_restore(flags);
-	}
-#endif
-
 	config = LEON3_BYPASS_LOAD_PA(&leon3_gptimer_regs->config);
 	if (config & (1 << LEON3_GPTIMER_SEPIRQ))
 		leon3_gptimer_irq += leon3_gptimer_idx;
arch/sparc/kernel/sun4d_irq.c +0 -25
index 9a137c70e8d1..7140cff04b54 100644
@@ -391,30 +391,6 @@ static unsigned int sun4d_build_timer_irq(unsigned int board,
 }
 
 
-static void __init sun4d_fixup_trap_table(void)
-{
-#ifdef CONFIG_SMP
-	unsigned long flags;
-	struct tt_entry *trap_table = &sparc_ttable[SP_TRAP_IRQ1 + (14 - 1)];
-
-	/* Adjust so that we jump directly to smp4d_ticker */
-	lvl14_save[2] += smp4d_ticker - real_irq_entry;
-
-	/* For SMP we use the level 14 ticker, however the bootup code
-	 * has copied the firmware's level 14 vector into the boot cpu's
-	 * trap table, we must fix this now or we get squashed.
-	 */
-	local_irq_save(flags);
-	patchme_maybe_smp_msg[0] = 0x01000000; /* NOP out the branch */
-	trap_table->inst_one = lvl14_save[0];
-	trap_table->inst_two = lvl14_save[1];
-	trap_table->inst_three = lvl14_save[2];
-	trap_table->inst_four = lvl14_save[3];
-	local_ops->cache_all();
-	local_irq_restore(flags);
-#endif
-}
-
 static void __init sun4d_init_timers(void)
 {
 	struct device_node *dp;
@@ -478,7 +454,6 @@ static void __init sun4d_init_timers(void)
 		prom_halt();
 	}
 	sun4d_load_profile_irqs();
-	sun4d_fixup_trap_table();
 }
 
 void __init sun4d_init_sbi_irq(void)
Signature · 1 line
2.27.0
#12 lore raw

PATCH 7/13 sparc32: Drop sun4m/sun4d specific irq handling

In reply to Sam Ravnborg

Some of the sun4m irq infrastructure is used by LEON too, so keep that and drop the rest.

Cc Sam Ravnborg <[email protected]>
Cc Christian Brauner <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/irq_32.h |   1 -
 arch/sparc/kernel/Makefile      |   2 +-
 arch/sparc/kernel/irq_32.c      |  30 +-
 arch/sparc/kernel/kernel.h      |  13 -
 arch/sparc/kernel/sun4d_irq.c   | 494 --------------------------------
 arch/sparc/kernel/sun4m_irq.c   | 240 ----------------
 arch/sparc/mm/io-unit.c         |   2 -
 7 files changed, 2 insertions(+), 780 deletions(-)
 delete mode 100644 arch/sparc/kernel/sun4d_irq.c
arch/sparc/include/asm/irq_32.h +0 -1
index 43ec2609b811..c820a6e967ae 100644
@@ -18,7 +18,6 @@
 #define irq_canonicalize(irq)	(irq)
 
 void __init init_IRQ(void);
-void __init sun4d_init_sbi_irq(void);
 
 #define NO_IRQ		0xffffffff
 
arch/sparc/kernel/Makefile +1 -1
index b2735fb29c89..92a9fdbba0a5 100644
@@ -30,7 +30,7 @@ obj-y                   += traps_$(BITS).o
 
 # IRQ
 obj-y                   += irq_$(BITS).o
-obj-$(CONFIG_SPARC32)   += sun4m_irq.o sun4d_irq.o
+obj-$(CONFIG_SPARC32)   += sun4m_irq.o
 
 obj-y                   += process_$(BITS).o
 obj-y                   += process.o
arch/sparc/kernel/irq_32.c +1 -29
index 510184c3aa17..135170f362c1 100644
@@ -235,36 +235,8 @@ void handler_irq(unsigned int pil, struct pt_regs *regs)
 	set_irq_regs(old_regs);
 }
 
-/* djhr
- * This could probably be made indirect too and assigned in the CPU
- * bits of the code. That would be much nicer I think and would also
- * fit in with the idea of being able to tune your kernel for your machine
- * by removing unrequired machine and device support.
- *
- */
-
 void __init init_IRQ(void)
 {
-	switch (sparc_cpu_model) {
-	case sun4m:
-		pcic_probe();
-		if (pcic_present())
-			sun4m_pci_init_IRQ();
-		else
-			sun4m_init_IRQ();
-		break;
-
-	case sun4d:
-		sun4d_init_IRQ();
-		break;
-
-	case sparc_leon:
-		leon_init_IRQ();
-		break;
-
-	default:
-		prom_printf("Cannot initialize IRQs on this Sun machine...");
-		break;
-	}
+	leon_init_IRQ();
 }
 
arch/sparc/kernel/kernel.h +0 -13
index e313d2e15ba9..8b7cc8899122 100644
@@ -94,7 +94,6 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
 void init_IRQ(void);
 
 /* sun4m_irq.c */
-void sun4m_init_IRQ(void);
 void sun4m_unmask_profile_irq(void);
 void sun4m_clear_profile_irq(int cpu);
 
@@ -107,18 +106,6 @@ void __init smp4m_smp_done(void);
 void smp4m_cross_call_irq(void);
 void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
 
-/* sun4d_irq.c */
-extern spinlock_t sun4d_imsk_lock;
-
-void sun4d_init_IRQ(void);
-int sun4d_request_irq(unsigned int irq,
-                      irq_handler_t handler,
-                      unsigned long irqflags,
-                      const char *devname, void *dev_id);
-int show_sun4d_interrupts(struct seq_file *, void *);
-void sun4d_distribute_irqs(void);
-void sun4d_free_irq(unsigned int irq, void *dev_id);
-
 /* sun4d_smp.c */
 void sun4d_cpu_pre_starting(void *arg);
 void sun4d_cpu_pre_online(void *arg);
arch/sparc/kernel/sun4d_irq.c deleted +0 -494

494 lines not on this page · raw message

arch/sparc/kernel/sun4m_irq.c +0 -240

255 lines not on this page · raw message

arch/sparc/mm/io-unit.c +0 -2
index bf3e6d2fe5d9..49ded623995f 100644
@@ -85,8 +85,6 @@ static int __init iounit_init(void)
 		of_propagate_archdata(op);
 	}
 
-	sun4d_init_sbi_irq();
-
 	return 0;
 }
 
Signature · 1 line
2.27.0
#13 lore raw

PATCH 8/13 sparc32: Drop sun4d/sun4m smp support

In reply to Sam Ravnborg

Drop the sun4m and sun4d smp support code.

The sparc32 kernel will not boot unless this is a LEON system, so drop checks for other systems as they will not trigger.

Cc Sam Ravnborg <[email protected]>
Cc Christian Brauner <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Will Deacon <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/kernel/Makefile    |   2 +-
 arch/sparc/kernel/smp_32.c    | 102 +--------
 arch/sparc/kernel/sun4d_smp.c | 410 ----------------------------------
 arch/sparc/kernel/sun4m_smp.c | 273 ----------------------
 arch/sparc/mm/srmmu.c         |  10 +-
 5 files changed, 8 insertions(+), 789 deletions(-)
 delete mode 100644 arch/sparc/kernel/sun4d_smp.c
 delete mode 100644 arch/sparc/kernel/sun4m_smp.c
arch/sparc/kernel/Makefile +1 -1
index 92a9fdbba0a5..5ddc11cfd84a 100644
@@ -81,7 +81,7 @@ obj-$(CONFIG_SPARC_GRPCI2)+= leon_pci_grpci2.o
 obj-$(CONFIG_SPARC_GRPCI1)+= leon_pci_grpci1.o
 
 obj-$(CONFIG_SMP)         += trampoline_$(BITS).o smp_$(BITS).o
-obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
+obj-$(CONFIG_SPARC32_SMP) += leon_smp.o
 obj-$(CONFIG_SPARC64_SMP) += hvtramp.o
 
 obj-$(CONFIG_SPARC64)     += auxio_64.o
arch/sparc/kernel/smp_32.c +5 -97

132 lines not on this page · raw message

arch/sparc/kernel/sun4d_smp.c deleted +0 -410

410 lines not on this page · raw message

arch/sparc/kernel/sun4m_smp.c deleted +0 -273

273 lines not on this page · raw message

arch/sparc/mm/srmmu.c +2 -8
index a03caa5f6628..d82cec45023a 100644
@@ -1818,14 +1818,8 @@ void __init load_mmu(void)
 		&smp_cachetlb_ops;
 #endif
 
-	if (sparc_cpu_model != sun4d)
-		ld_mmu_iommu();
+	ld_mmu_iommu();
 #ifdef CONFIG_SMP
-	if (sparc_cpu_model = sun4d)
-		sun4d_init_smp();
-	else if (sparc_cpu_model = sparc_leon)
-		leon_init_smp();
-	else
-		sun4m_init_smp();
+	leon_init_smp();
 #endif
 }
Signature · 1 line
2.27.0
#14 lore raw

PATCH 9/13 sparc32: Drop pcic support

In reply to Sam Ravnborg

pcic is only used by MicroSPARC-IIep and not relevant for LEON.

Cc "David S. Miller" <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/Kconfig            |   5 -
 arch/sparc/include/asm/pcic.h | 130 ------
 arch/sparc/kernel/Makefile    |   1 -
 arch/sparc/kernel/entry.S     |  48 --
 arch/sparc/kernel/irq_32.c    |   1 -
 arch/sparc/kernel/kernel.h    |   4 -
 arch/sparc/kernel/pcic.c      | 830 ----------------------------------
 arch/sparc/kernel/time_32.c   |   6 +-
 8 files changed, 1 insertion(+), 1024 deletions(-)
 delete mode 100644 arch/sparc/include/asm/pcic.h
 delete mode 100644 arch/sparc/kernel/pcic.c
arch/sparc/Kconfig +0 -5
index 8447f5b7bb90..a22b55024a46 100644
@@ -427,11 +427,6 @@ config SUN_LDOMS
 	  Say Y here is you want to support virtual devices via
 	  Logical Domains.
 
-config PCIC_PCI
-	bool
-	depends on PCI && SPARC32 && !SPARC_LEON
-	default y
-
 config LEON_PCI
 	bool
 	depends on PCI && SPARC_LEON
arch/sparc/include/asm/pcic.h deleted +0 -130

130 lines not on this page · raw message

arch/sparc/kernel/Makefile +0 -1
index 5ddc11cfd84a..ffdfb64f1d02 100644
@@ -75,7 +75,6 @@ obj-$(CONFIG_SPARC64)	+= pcr.o
 obj-$(CONFIG_SPARC64)	+= nmi.o
 obj-$(CONFIG_SPARC64_SMP) += cpumap.o
 
-obj-$(CONFIG_PCIC_PCI)    += pcic.o
 obj-$(CONFIG_LEON_PCI)    += leon_pci.o
 obj-$(CONFIG_SPARC_GRPCI2)+= leon_pci_grpci2.o
 obj-$(CONFIG_SPARC_GRPCI1)+= leon_pci_grpci1.o
arch/sparc/kernel/entry.S +0 -48

54 lines not on this page · raw message

arch/sparc/kernel/irq_32.c +0 -1
index 135170f362c1..a6af08fce796 100644
@@ -19,7 +19,6 @@
 #include <asm/cacheflush.h>
 #include <asm/cpudata.h>
 #include <asm/setup.h>
-#include <asm/pcic.h>
 #include <asm/leon.h>
 
 #include "kernel.h"
arch/sparc/kernel/kernel.h +0 -4
index 8b7cc8899122..15cab96caf14 100644
@@ -157,10 +157,6 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
 /* windows.c */
 void try_to_clear_window_buffer(struct pt_regs *regs, int who);
 
-/* pcic.c */
-extern void __iomem *pcic_regs;
-void pcic_nmi(unsigned int pend, struct pt_regs *regs);
-
 /* time_32.c */
 void __init time_init(void);
 
arch/sparc/kernel/pcic.c deleted +0 -826

826 lines not on this page · raw message

arch/sparc/kernel/time_32.c +1 -5
index 8a08830e4a65..0093cf4ecb06 100644
@@ -44,7 +44,6 @@
 #include <asm/io.h>
 #include <asm/idprom.h>
 #include <asm/page.h>
-#include <asm/pcic.h>
 #include <asm/irq_regs.h>
 #include <asm/setup.h>
 
@@ -348,9 +347,6 @@ void __init time_init(void)
 	sparc_config.features = 0;
 	late_time_init = sparc32_late_time_init;
 
-	if (pcic_present())
-		pci_time_init();
-	else
-		sbus_time_init();
+	sbus_time_init();
 }
 
Signature · 1 line
2.27.0
#15 lore raw

PATCH 10/13 sparc32: Drop mbus support

In reply to Sam Ravnborg

Only used by older SAPRC HW, not used by LEON.

Cc Sam Ravnborg <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Arvind Sankar <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Ira Weiny <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Will Deacon <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/elf_32.h |  2 -
 arch/sparc/include/asm/mbus.h   | 97 ---------------------------------
 arch/sparc/kernel/cpu.c         |  1 -
 arch/sparc/kernel/setup_32.c    |  1 -
 arch/sparc/mm/iommu.c           | 18 +-----
 arch/sparc/mm/srmmu.c           | 48 ----------------
 6 files changed, 3 insertions(+), 164 deletions(-)
 delete mode 100644 arch/sparc/include/asm/mbus.h
arch/sparc/include/asm/elf_32.h +0 -2
index 37a6016c9ccd..b2cca9be55c2 100644
@@ -91,8 +91,6 @@ typedef struct {
 	unsigned int	pr_q[64];
 } elf_fpregset_t;
 
-#include <asm/mbus.h>
-
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
arch/sparc/include/asm/mbus.h deleted +0 -97

97 lines not on this page · raw message

arch/sparc/kernel/cpu.c +0 -1
index 79cd6ccfeac0..cca7de051593 100644
@@ -19,7 +19,6 @@
 #include <asm/page.h>
 #include <asm/head.h>
 #include <asm/psr.h>
-#include <asm/mbus.h>
 #include <asm/cpudata.h>
 
 #include "kernel.h"
arch/sparc/kernel/setup_32.c +0 -1
index eea43a1aef1b..b6fd87928c73 100644
@@ -42,7 +42,6 @@
 #include <asm/page.h>
 #include <asm/traps.h>
 #include <asm/vaddrs.h>
-#include <asm/mbus.h>
 #include <asm/idprom.h>
 #include <asm/cpudata.h>
 #include <asm/setup.h>
arch/sparc/mm/iommu.c +3 -15
index 0c0342e5b10d..125a3e96e3d2 100644
@@ -18,7 +18,6 @@
 
 #include <asm/io.h>
 #include <asm/mxcc.h>
-#include <asm/mbus.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/bitext.h>
@@ -116,13 +115,7 @@ static void __init sbus_iommu_init(struct platform_device *op)
 		prom_halt();
 	}
 	bit_map_init(&iommu->usemap, bitmap, IOMMU_NPTES);
-	/* To be coherent on HyperSparc, the page color of DVMA
-	 * and physical addresses must match.
-	 */
-	if (srmmu_modtype = HyperSparc)
-		iommu->usemap.num_colors = vac_cache_size >> PAGE_SHIFT;
-	else
-		iommu->usemap.num_colors = 1;
+	iommu->usemap.num_colors = 1;
 
 	printk(KERN_INFO "IOMMU: impl %d vers %d table 0x%p[%d B] map [%d b]\n",
 	       impl, vers, iommu->page_table,
@@ -444,11 +437,6 @@ static const struct dma_map_ops sbus_iommu_dma_pflush_ops = {
 
 void __init ld_mmu_iommu(void)
 {
-	if (viking_mxcc_present || srmmu_modtype = HyperSparc) {
-		dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV);
-		ioperm_noc = IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID;
-	} else {
-		dvma_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV);
-		ioperm_noc = IOPTE_WRITE | IOPTE_VALID;
-	}
+	dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV);
+	ioperm_noc = IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID;
 }
arch/sparc/mm/srmmu.c +0 -48

90 lines not on this page · raw message

Signature · 1 line
2.27.0
#16 lore raw

PATCH 11/13 sparc32: Drop unused mmu models

In reply to Sam Ravnborg

Drop mmu models not used by LEON, including their header files. This includes removal of unused includes in various files to fix the build.

Cc Sam Ravnborg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Will Deacon <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/mxcc.h    | 138 ------
 arch/sparc/include/asm/ross.h    | 192 --------
 arch/sparc/include/asm/swift.h   | 107 -----
 arch/sparc/include/asm/tsunami.h |  65 ---
 arch/sparc/include/asm/viking.h  | 255 ----------
 arch/sparc/kernel/entry.S        |   1 -
 arch/sparc/mm/Makefile           |   1 -
 arch/sparc/mm/hypersparc.S       | 414 -----------------
 arch/sparc/mm/io-unit.c          |   1 -
 arch/sparc/mm/iommu.c            |  31 +-
 arch/sparc/mm/mm_32.h            |   1 -
 arch/sparc/mm/srmmu.c            | 776 +------------------------------
 arch/sparc/mm/swift.S            | 256 ----------
 arch/sparc/mm/tsunami.S          | 132 ------
 arch/sparc/mm/viking.S           | 284 -----------
 15 files changed, 21 insertions(+), 2633 deletions(-)
 delete mode 100644 arch/sparc/include/asm/mxcc.h
 delete mode 100644 arch/sparc/include/asm/ross.h
 delete mode 100644 arch/sparc/include/asm/swift.h
 delete mode 100644 arch/sparc/include/asm/tsunami.h
 delete mode 100644 arch/sparc/include/asm/viking.h
 delete mode 100644 arch/sparc/mm/hypersparc.S
 delete mode 100644 arch/sparc/mm/swift.S
 delete mode 100644 arch/sparc/mm/tsunami.S
 delete mode 100644 arch/sparc/mm/viking.S
arch/sparc/include/asm/mxcc.h deleted +0 -138
deleted file mode 100644
index 3a2561bea4dd..000000000000
@@ -1,138 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * mxcc.h:  Definitions of the Viking MXCC registers
- *
- * Copyright (C) 1995 David S. Miller ([email protected])
- */
-
-#ifndef _SPARC_MXCC_H
-#define _SPARC_MXCC_H
-
-/* These registers are accessed through ASI 0x2. */
-#define MXCC_DATSTREAM       0x1C00000  /* Data stream register */
-#define MXCC_SRCSTREAM       0x1C00100  /* Source stream register */
-#define MXCC_DESSTREAM       0x1C00200  /* Destination stream register */
-#define MXCC_RMCOUNT         0x1C00300  /* Count of references and misses */
-#define MXCC_STEST           0x1C00804  /* Internal self-test */
-#define MXCC_CREG            0x1C00A04  /* Control register */
-#define MXCC_SREG            0x1C00B00  /* Status register */
-#define MXCC_RREG            0x1C00C04  /* Reset register */
-#define MXCC_EREG            0x1C00E00  /* Error code register */
-#define MXCC_PREG            0x1C00F04  /* Address port register */
-
-/* Some MXCC constants. */
-#define MXCC_STREAM_SIZE     0x20       /* Size in bytes of one stream r/w */
-
-/* The MXCC Control Register:
- *
- * ----------------------------------------------------------------------
- * |                                   | RRC | RSV |PRE|MCE|PARE|ECE|RSV|
- * ----------------------------------------------------------------------
- *  31                              10    9    8-6   5   4    3   2  1-0
- *
- * RRC: Controls what you read from MXCC_RMCOUNT reg.
- *      0=Misses 1=References
- * PRE: Prefetch enable
- * MCE: Multiple Command Enable
- * PARE: Parity enable
- * ECE: External cache enable
- */
-
-#define MXCC_CTL_RRC   0x00000200
-#define MXCC_CTL_PRE   0x00000020
-#define MXCC_CTL_MCE   0x00000010
-#define MXCC_CTL_PARE  0x00000008
-#define MXCC_CTL_ECE   0x00000004
-
-/* The MXCC Error Register:
- *
- * --------------------------------------------------------
- * |ME| RSV|CE|PEW|PEE|ASE|EIV| MOPC|ECODE|PRIV|RSV|HPADDR|
- * --------------------------------------------------------
- *  31   30 29  28  27  26  25 24-15  14-7   6  5-3   2-0
- *
- * ME: Multiple Errors have occurred
- * CE: Cache consistency Error
- * PEW: Parity Error during a Write operation
- * PEE: Parity Error involving the External cache
- * ASE: ASynchronous Error
- * EIV: This register is toast
- * MOPC: MXCC Operation Code for instance causing error
- * ECODE: The Error CODE
- * PRIV: A privileged mode error? 0=no 1=yes
- * HPADDR: High PhysicalADDRess bits (35-32)
- */
-
-#define MXCC_ERR_ME     0x80000000
-#define MXCC_ERR_CE     0x20000000
-#define MXCC_ERR_PEW    0x10000000
-#define MXCC_ERR_PEE    0x08000000
-#define MXCC_ERR_ASE    0x04000000
-#define MXCC_ERR_EIV    0x02000000
-#define MXCC_ERR_MOPC   0x01FF8000
-#define MXCC_ERR_ECODE  0x00007F80
-#define MXCC_ERR_PRIV   0x00000040
-#define MXCC_ERR_HPADDR 0x0000000f
-
-/* The MXCC Port register:
- *
- * -----------------------------------------------------
- * |                | MID |                            |
- * -----------------------------------------------------
- *  31            21 20-18 17                         0
- *
- * MID: The moduleID of the cpu your read this from.
- */
-
-#ifndef __ASSEMBLY__
-
-static inline void mxcc_set_stream_src(unsigned long *paddr)
-{
-	unsigned long data0 = paddr[0];
-	unsigned long data1 = paddr[1];
-
-	__asm__ __volatile__ ("or %%g0, %0, %%g2\n\t"
-			      "or %%g0, %1, %%g3\n\t"
-			      "stda %%g2, [%2] %3\n\t" : :
-			      "r" (data0), "r" (data1),
-			      "r" (MXCC_SRCSTREAM),
-			      "i" (ASI_M_MXCC) : "g2", "g3");
-}
-
-static inline void mxcc_set_stream_dst(unsigned long *paddr)
-{
-	unsigned long data0 = paddr[0];
-	unsigned long data1 = paddr[1];
-
-	__asm__ __volatile__ ("or %%g0, %0, %%g2\n\t"
-			      "or %%g0, %1, %%g3\n\t"
-			      "stda %%g2, [%2] %3\n\t" : :
-			      "r" (data0), "r" (data1),
-			      "r" (MXCC_DESSTREAM),
-			      "i" (ASI_M_MXCC) : "g2", "g3");
-}
-
-static inline unsigned long mxcc_get_creg(void)
-{
-	unsigned long mxcc_control;
-
-	__asm__ __volatile__("set 0xffffffff, %%g2\n\t"
-			     "set 0xffffffff, %%g3\n\t"
-			     "stda %%g2, [%1] %2\n\t"
-			     "lda [%3] %2, %0\n\t" :
-			     "=r" (mxcc_control) :
-			     "r" (MXCC_EREG), "i" (ASI_M_MXCC),
-			     "r" (MXCC_CREG) : "g2", "g3");
-	return mxcc_control;
-}
-
-static inline void mxcc_set_creg(unsigned long mxcc_control)
-{
-	__asm__ __volatile__("sta %0, [%1] %2\n\t" : :
-			     "r" (mxcc_control), "r" (MXCC_CREG),
-			     "i" (ASI_M_MXCC));
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* !(_SPARC_MXCC_H) */
arch/sparc/include/asm/ross.h deleted +0 -192

192 lines not on this page · raw message

arch/sparc/include/asm/swift.h deleted +0 -107

107 lines not on this page · raw message

arch/sparc/include/asm/tsunami.h deleted +0 -65

65 lines not on this page · raw message

arch/sparc/include/asm/viking.h deleted +0 -255

255 lines not on this page · raw message

arch/sparc/kernel/entry.S +0 -1
index 451eaae85760..a24dcfa44e19 100644
@@ -24,7 +24,6 @@
 #include <asm/winmacro.h>
 #include <asm/signal.h>
 #include <asm/obio.h>
-#include <asm/mxcc.h>
 #include <asm/thread_info.h>
 #include <asm/param.h>
 #include <asm/unistd.h>
arch/sparc/mm/Makefile +0 -1
index 68db1f859b02..087d35e81e7b 100644
@@ -10,7 +10,6 @@ obj-y                   += fault_$(BITS).o
 obj-y                   += init_$(BITS).o
 obj-$(CONFIG_SPARC32)   += extable.o srmmu.o iommu.o io-unit.o
 obj-$(CONFIG_SPARC32)   += srmmu_access.o
-obj-$(CONFIG_SPARC32)   += hypersparc.o viking.o tsunami.o swift.o
 obj-$(CONFIG_SPARC32)   += leon_mm.o
 
 # Only used by sparc64
arch/sparc/mm/hypersparc.S deleted +0 -414

414 lines not on this page · raw message

arch/sparc/mm/io-unit.c +0 -1
index 49ded623995f..779bc9384989 100644
@@ -17,7 +17,6 @@
 
 #include <asm/io.h>
 #include <asm/io-unit.h>
-#include <asm/mxcc.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/dma.h>
arch/sparc/mm/iommu.c +4 -27
index 125a3e96e3d2..1df742119ac5 100644
@@ -17,7 +17,6 @@
 #include <linux/of_device.h>
 
 #include <asm/io.h>
-#include <asm/mxcc.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/bitext.h>
@@ -36,11 +35,6 @@
 #define IOMMU_NPTES	(IOMMU_WINSIZE/PAGE_SIZE)	/* 64K PTEs, 256KB */
 #define IOMMU_ORDER	6				/* 4096 * (1<<6) */
 
-static int viking_flush;
-/* viking.S */
-extern void viking_flush_page(unsigned long page);
-extern void viking_mxcc_flush_page(unsigned long page);
-
 /*
  * Values precomputed according to CPU type.
  */
@@ -155,21 +149,9 @@ static void iommu_flush_iotlb(iopte_t *iopte, unsigned int niopte)
 	start = (unsigned long)iopte;
 	end = PAGE_ALIGN(start + niopte*sizeof(iopte_t));
 	start &= PAGE_MASK;
-	if (viking_mxcc_present) {
-		while(start < end) {
-			viking_mxcc_flush_page(start);
-			start += PAGE_SIZE;
-		}
-	} else if (viking_flush) {
-		while(start < end) {
-			viking_flush_page(start);
-			start += PAGE_SIZE;
-		}
-	} else {
-		while(start < end) {
-			__flush_page_to_ram(start);
-			start += PAGE_SIZE;
-		}
+	while(start < end) {
+		__flush_page_to_ram(start);
+		start += PAGE_SIZE;
 	}
 }
 
@@ -343,12 +325,7 @@ static void *sbus_iommu_alloc(struct device *dev, size_t len,
 			pmd_t *pmdp;
 			pte_t *ptep;
 
-			if (viking_mxcc_present)
-				viking_mxcc_flush_page(page);
-			else if (viking_flush)
-				viking_flush_page(page);
-			else
-				__flush_page_to_ram(page);
+			__flush_page_to_ram(page);
 
 			pmdp = pmd_off_k(addr);
 			ptep = pte_offset_map(pmdp, addr);
arch/sparc/mm/mm_32.h +0 -1
index ce750a99eea9..759d6f7de798 100644
@@ -11,7 +11,6 @@ void window_ret_fault(struct pt_regs *regs);
 
 /* srmmu.c */
 extern char *srmmu_name;
-extern int viking_mxcc_present;
 extern int flush_page_for_dma_global;
 
 extern void (*poke_srmmu)(void);
arch/sparc/mm/srmmu.c +17 -759

848 lines not on this page · raw message

arch/sparc/mm/swift.S deleted +0 -256

256 lines not on this page · raw message

arch/sparc/mm/tsunami.S deleted +0 -132

132 lines not on this page · raw message

arch/sparc/mm/viking.S deleted +0 -284

284 lines not on this page · raw message

Signature · 1 line
2.27.0
#17 lore raw

Re: [PATCH v1 11/13] sparc32: Drop unused mmu models

I love your patch! Perhaps something to improve:

Hi Sam,

I love your patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on sparc/master v5.11-rc1 next-20201223] [cannot apply to sparc-next/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/sparc32-sunset-sun4m-and-sun4d/20201219-025354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: sparc-randconfig-c004-20201229 (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate

"coccinelle warnings: (new ones prefixed by >>)"

>> arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0
>> arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#18 lore raw

[PATCH] sparc32: fix badzero.cocci warnings

In reply to Sam Ravnborg
arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0 arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0

From: kernel test robot <[email protected]>

arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0 arch/sparc/mm/srmmu.c:317:42-43: WARNING comparing pointer to 0

Compare pointer-typed values to NULL rather than 0

Semantic patch information:
This makes an effort to choose between !x and x == NULL. !x is used if it has previously been used with the function used to initialize x. This relies on type information. More type information can be obtained using the option -all_includes and the option -I to specify an include path.

Generated by: scripts/coccinelle/null/badzero.cocci

---

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/sparc32-sunset-sun4m-and-sun4d/20201219-025354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
 srmmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/mm/srmmu.c +1 -1
@@ -314,7 +314,7 @@ pgtable_t pte_alloc_one(struct mm_struct
 	pte_t *ptep;
 	struct page *page;
 
-	if ((ptep = pte_alloc_one_kernel(mm)) == 0)
+	if ((ptep = pte_alloc_one_kernel(mm)) == NULL)
 		return NULL;
 	page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
 	spin_lock(&mm->page_table_lock);
#19 lore raw

PATCH 12/13 sparc32: drop check for sparc_model

In reply to Sam Ravnborg

sparc32 is always LEON, so no need to check for the model.

Cc Sam Ravnborg <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Will Deacon <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Arvind Sankar <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/cpu_type.h   | 18 -------
 arch/sparc/include/asm/io_32.h      |  4 +-
 arch/sparc/include/asm/pgtable_32.h | 24 ---------
 arch/sparc/kernel/devices.c         |  7 +--
 arch/sparc/kernel/ioport.c          |  6 +--
 arch/sparc/kernel/leon_pmc.c        | 14 +++--
 arch/sparc/kernel/setup_32.c        | 79 +----------------------------
 7 files changed, 12 insertions(+), 140 deletions(-)
arch/sparc/include/asm/cpu_type.h +0 -18
index 2b59799859d1..3e0154c3f41d 100644
@@ -2,28 +2,10 @@
 #ifndef __ASM_CPU_TYPE_H
 #define __ASM_CPU_TYPE_H
 
-/*
- * Sparc (general) CPU types
- */
-enum sparc_cpu {
-  sun4m       = 0x00,
-  sun4d       = 0x01,
-  sun4e       = 0x02,
-  sun4u       = 0x03, /* V8 ploos ploos */
-  sun_unknown = 0x04,
-  ap1000      = 0x05, /* almost a sun4m */
-  sparc_leon  = 0x06, /* Leon SoC */
-};
-
 #ifdef CONFIG_SPARC32
-extern enum sparc_cpu sparc_cpu_model;
 
 #define SUN4M_NCPUS            4              /* Architectural limit of sun4m. */
 
-#else
-
-#define sparc_cpu_model sun4u
-
 #endif
 
 #endif /* __ASM_CPU_TYPE_H */
arch/sparc/include/asm/io_32.h +2 -2
index 549f0a72280d..83abe709d120 100644
@@ -138,11 +138,11 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *);
 
 static inline int sbus_can_dma_64bit(void)
 {
-	return 0; /* actually, sparc_cpu_model=sun4d */
+	return 0;
 }
 static inline int sbus_can_burst64(void)
 {
-	return 0; /* actually, sparc_cpu_model=sun4d */
+	return 0;
 }
 struct device;
 void sbus_set_sbus64(struct device *, int);
arch/sparc/include/asm/pgtable_32.h +0 -24
index 632cdb959542..9c4da6ed81ef 100644
@@ -356,30 +356,6 @@ static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset)
 #define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)		((pte_t) { (x).val })
 
-static inline unsigned long
-__get_phys (unsigned long addr)
-{
-	switch (sparc_cpu_model){
-	case sun4m:
-	case sun4d:
-		return ((srmmu_get_pte (addr) & 0xffffff00) << 4);
-	default:
-		return 0;
-	}
-}
-
-static inline int
-__get_iospace (unsigned long addr)
-{
-	switch (sparc_cpu_model){
-	case sun4m:
-	case sun4d:
-		return (srmmu_get_pte (addr) >> 28);
-	default:
-		return -1;
-	}
-}
-
 extern unsigned long *sparc_valid_addr_bitmap;
 
 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
arch/sparc/kernel/devices.c +1 -6
index b3c2d51b22c4..2963e89611a3 100644
@@ -26,8 +26,6 @@
 
 static char *cpu_mid_prop(void)
 {
-	if (sparc_cpu_model = sun4d)
-		return "cpu-id";
 	return "mid";
 }
 
@@ -40,8 +38,6 @@ static int check_cpu_node(phandle nd, int *cur_inst,
 			*prom_node = nd;
 		if (mid) {
 			*mid = prom_getintdefault(nd, cpu_mid_prop(), 0);
-			if (sparc_cpu_model = sun4m)
-				*mid &= 3;
 		}
 		return 0;
 	}
@@ -92,8 +88,7 @@ static int cpu_mid_compare(phandle nd, int instance, void *_arg)
 	int this_mid;
 
 	this_mid = prom_getintdefault(nd, cpu_mid_prop(), 0);
-	if (this_mid = desired_mid
-	    || (sparc_cpu_model = sun4m && (this_mid & 3) = desired_mid))
+	if (this_mid = desired_mid)
 		return 0;
 	return -ENODEV;
 }
arch/sparc/kernel/ioport.c +2 -4
index 8e1d72a16759..50fb0a8431aa 100644
@@ -57,10 +57,8 @@
  */
 static inline void dma_make_coherent(unsigned long pa, unsigned long len)
 {
-	if (sparc_cpu_model = sparc_leon) {
-		if (!sparc_leon3_snooping_enabled())
-			leon_flush_dcache_all();
-	}
+	if (!sparc_leon3_snooping_enabled())
+		leon_flush_dcache_all();
 }
 
 static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
arch/sparc/kernel/leon_pmc.c +6 -8
index 396f46bca52e..625924dd0e5b 100644
@@ -75,15 +75,13 @@ static void pmc_leon_idle(void)
 /* Install LEON Power Down function */
 static int __init leon_pmc_install(void)
 {
-	if (sparc_cpu_model = sparc_leon) {
-		/* Assign power management IDLE handler */
-		if (pmc_leon_need_fixup())
-			sparc_idle = pmc_leon_idle_fixup;
-		else
-			sparc_idle = pmc_leon_idle;
+	/* Assign power management IDLE handler */
+	if (pmc_leon_need_fixup())
+		sparc_idle = pmc_leon_idle_fixup;
+	else
+		sparc_idle = pmc_leon_idle;
 
-		printk(KERN_INFO "leon: power management initialized\n");
-	}
+	printk(KERN_INFO "leon: power management initialized\n");
 
 	return 0;
 }
arch/sparc/kernel/setup_32.c +1 -78

111 lines not on this page · raw message

Signature · 1 line
2.27.0
#20 lore raw

PATCH 13/13 sparc32: drop use of sparc_config

In reply to Sam Ravnborg

sparc_config were used to handle the differences between the machines. With only LEON supported sparc_config is no longer required.

This has the added benefit that we get rid of a rw variable with several function pointers thus reducing our attack surface.

Cc Sam Ravnborg <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andreas Larsson <[email protected]>
---
 arch/sparc/include/asm/timer_32.h |   1 +
 arch/sparc/kernel/irq.h           |  32 ++-------
 arch/sparc/kernel/irq_32.c        |   3 -
 arch/sparc/kernel/leon_kernel.c   |  27 ++------
 arch/sparc/kernel/of_device_32.c  |   4 +-
 arch/sparc/kernel/time_32.c       | 110 +++++++++++++-----------------
 6 files changed, 61 insertions(+), 116 deletions(-)
arch/sparc/include/asm/timer_32.h +1 -0
index eecd2696922d..1cd89a99966f 100644
@@ -17,6 +17,7 @@
 #include <asm/cpu_type.h>  /* For SUN4M_NCPUS */
 
 #define SBUS_CLOCK_RATE   2000000 /* 2MHz */
+#define LEON_CLOCK_RATE   1000000
 #define TIMER_VALUE_SHIFT 9
 #define TIMER_VALUE_MASK  0x3fffff
 #define TIMER_LIMIT_BIT   (1 << 31)  /* Bit 31 in Counter-Timer register */
arch/sparc/kernel/irq.h +5 -27
index 0d9b740725b4..ba0db1e4df6f 100644
@@ -49,33 +49,6 @@ extern struct sun4m_irq_global __iomem *sun4m_irq_global;
 #define FEAT_L10_CLOCKEVENT  (1 << 1) /* L10 timer is used as a clockevent */
 #define FEAT_L14_ONESHOT     (1 << 2) /* L14 timer clockevent can oneshot */
 
-/*
- * Platform specific configuration
- * The individual platforms assign their platform
- * specifics in their init functions.
- */
-struct sparc_config {
-	void (*init_timers)(void);
-	unsigned int (*build_device_irq)(struct platform_device *op,
-	                                 unsigned int real_irq);
-
-	/* generic clockevent features - see FEAT_* above */
-	int features;
-
-	/* clock rate used for clock event timer */
-	int clock_rate;
-
-	/* one period for clock source timer */
-	unsigned int cs_period;
-
-	/* function to obtain offsett for cs period */
-	unsigned int (*get_cycles_offset)(void);
-
-	void (*clear_clock_irq)(void);
-	void (*load_profile_irq)(int cpu, unsigned int limit);
-};
-extern struct sparc_config sparc_config;
-
 unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
 void irq_link(unsigned int irq);
 void irq_unlink(unsigned int irq);
@@ -89,6 +62,11 @@ void sun4m_nmi(struct pt_regs *regs);
 /* sun4d_irq.c */
 void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs);
 
+/* leon_kernel.c */
+void leon_clear_clock_irq(void);
+void leon_load_profile_irq(int cpu, unsigned int limit);
+u32 leon_cycles_offset(void);
+
 #ifdef CONFIG_SMP
 
 /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
arch/sparc/kernel/irq_32.c +0 -3
index a6af08fce796..f76f57073323 100644
@@ -24,9 +24,6 @@
 #include "kernel.h"
 #include "irq.h"
 
-/* platform specific irq setup */
-struct sparc_config sparc_config;
-
 unsigned long arch_local_irq_save(void)
 {
 	unsigned long retval;
arch/sparc/kernel/leon_kernel.c +4 -23
index 49b37a0dcc2b..491dff89f52c 100644
@@ -239,12 +239,6 @@ unsigned int leon_build_device_irq(unsigned int real_irq,
 	return irq;
 }
 
-static unsigned int _leon_build_device_irq(struct platform_device *op,
-					   unsigned int real_irq)
-{
-	return leon_build_device_irq(real_irq, handle_simple_irq, "edge", 0);
-}
-
 void leon_update_virq_handling(unsigned int virq,
 			      irq_flow_handler_t flow_handler,
 			      const char *name, int do_ack)
@@ -260,7 +254,7 @@ void leon_update_virq_handling(unsigned int virq,
 	irq_set_chip_data(virq, (void *)mask);
 }
 
-static u32 leon_cycles_offset(void)
+u32 leon_cycles_offset(void)
 {
 	u32 rld, val, ctrl, off;
 
@@ -314,14 +308,6 @@ void __init leon_init_timers(void)
 	u32 config;
 	u32 ctrl;
 
-	sparc_config.get_cycles_offset = leon_cycles_offset;
-	sparc_config.cs_period = 1000000 / HZ;
-	sparc_config.features |= FEAT_L10_CLOCKSOURCE;
-
-#ifndef CONFIG_SMP
-	sparc_config.features |= FEAT_L10_CLOCKEVENT;
-#endif
-
 	leondebug_irq_disable = 0;
 	leon_debug_irqout = 0;
 	master_l10_counter = (u32 __iomem *)&dummy_master_l10_counter;
@@ -436,7 +422,7 @@ void __init leon_init_timers(void)
 	err = request_irq(irq, leon_percpu_timer_ce_interrupt,
 			  IRQF_PERCPU | IRQF_TIMER, "timer", NULL);
 #else
-	irq = _leon_build_device_irq(NULL, leon3_gptimer_irq);
+	irq = leon_build_device_irq(leon3_gptimer_irq, handle_simple_irq, "edge", 0);
 	err = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", NULL);
 #endif
 	if (err) {
@@ -455,7 +441,7 @@ void __init leon_init_timers(void)
 	return;
 }
 
-static void leon_clear_clock_irq(void)
+void leon_clear_clock_irq(void)
 {
 	u32 ctrl;
 
@@ -464,7 +450,7 @@ static void leon_clear_clock_irq(void)
 			      ctrl & leon3_gptimer_ackmask);
 }
 
-static void leon_load_profile_irq(int cpu, unsigned int limit)
+void leon_load_profile_irq(int cpu, unsigned int limit)
 {
 }
 
@@ -487,9 +473,4 @@ void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu)
 
 void __init leon_init_IRQ(void)
 {
-	sparc_config.init_timers      = leon_init_timers;
-	sparc_config.build_device_irq = _leon_build_device_irq;
-	sparc_config.clock_rate       = 1000000;
-	sparc_config.clear_clock_irq  = leon_clear_clock_irq;
-	sparc_config.load_profile_irq = leon_load_profile_irq;
 }
arch/sparc/kernel/of_device_32.c +2 -0
index 4ebf51e6e78e..c846acdb4455 100644
@@ -358,7 +358,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		op->archdata.num_irqs = len / sizeof(struct linux_prom_irqs);
 		for (i = 0; i < op->archdata.num_irqs; i++)
 			op->archdata.irqs[i] -			    sparc_config.build_device_irq(op, intr[i].pri);
+			    leon_build_device_irq(intr[i].pri, handle_simple_irq, "edge", 0);
 	} else {
 		const unsigned int *irq  			of_get_property(dp, "interrupts", &len);
@@ -367,7 +367,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 			op->archdata.num_irqs = len / sizeof(unsigned int);
 			for (i = 0; i < op->archdata.num_irqs; i++)
 				op->archdata.irqs[i] -				    sparc_config.build_device_irq(op, irq[i]);
+				    leon_build_device_irq(irq[i], handle_simple_irq, "edge", 0);
 		} else {
 			op->archdata.num_irqs = 0;
 		}
arch/sparc/kernel/time_32.c +49 -61

196 lines not on this page · raw message

Signature · 1 line
2.27.0
#21 lore raw
In reply to Sam Ravnborg
Quoted 21 lines · Sam Ravnborg

The sun4m and sun4d based SPARC machines was very popular in the 90'ties and was then replaced by the more powerful sparc64 class of machines.
Today there is only Gentoo that to my best knowledge supports sparc32 and people have moved on to more capable HW.

Cobham Gaisler have variants of the LEON processer that runs sparc32 - and they are in production today.

With this patchset I propose to sunset sun4m and sun4d and move focus to a more streamlined support for LEON.

One downside is that qemu supports sun4m - and we may loose some testing possibilities when sun4m is dropped. qemu supports LEON to some degree - I have not yet tried it out.

Andreas from Gaisler have indicated that they may be more active upstream on sparc32 - and this will only be easier with a kernel where the legacy stuff is dropped.

Quoted 5 lines

I decided to divide up the patches to make it possible to review the set as some of the patches touches assembler and these parts could use some extra eyes if we move forward with this.

For now it builds with the configurations I have tried.

Thank you for doing this, it looks like a very nice cleanup.

Quoted 1 line

Looking forward for feedback if sunsetting is a good idea or not.

I have no insight on whether there are any users left that would miss it, but I'm fairly sure that there are lots of people that would rather see it gone.

Quoted 1 line

Note: I dunno why git does not see floppy_64.h=>floppy.h as a rename??

It doesn't do that if the old name existed already.

Arnd

#22 lore raw
In reply to Sam Ravnborg
Quoted 12 lines · Sam Ravnborg

The sun4m and sun4d based SPARC machines was very popular in the 90'ties and was then replaced by the more powerful sparc64 class of machines.
Today there is only Gentoo that to my best knowledge supports sparc32 and people have moved on to more capable HW.

Cobham Gaisler have variants of the LEON processer that runs sparc32 - and they are in production today.

With this patchset I propose to sunset sun4m and sun4d and move focus to a more streamlined support for LEON.

Quoted 8 lines

One downside is that qemu supports sun4m - and we may loose some testing possibilities when sun4m is dropped. qemu supports LEON to some degree - I have not yet tried it out.

Andreas from Gaisler have indicated that they may be more active upstream on sparc32 - and this will only be easier with a kernel where the legacy stuff is dropped.

This makes me a bit sad. But I guess I haven't had any time to put into the sparc32 port
for many years, so I guess it is time to let go.

But I do believe that by doing this we should make sure we are not putting ourselves
in a position where the sparc kernel-developers don't have access to any real sparc32
hardware.

SUN machines were at least plentiful. The LEON-family of processors being targeted
towards the rad-hardened market are not so much available.

Maybe Gaisler can contribute some systems, or make some available remotely?

Best regards,
Kjetil Oftedal

#23 lore raw
In reply to Sam Ravnborg

Hi all,

Quoted 3 lines · Sam Ravnborg

The sun4m and sun4d based SPARC machines was very popular in the 90'ties and was then replaced by the more powerful sparc64 class of machines.

I have received a couple of mails in private.
One said it was better to sunset now when it is actually working, so there is a working state to return to.
Another said that it would be a shame to sunset sun4m and sun4d because there are so many machines around, and netbsd is also active on the sparc32 area.

The second mail also re-reminded me of an interesting project implementing SPARC V8 and the sun4m platform in VHDL. See https://temlib.org - the author posted a new blog post a few months ago.

temlib is, to my best knowledge, an impressive one-man project. And this is not enough to keep sun4m around as this would require real users that cannot just stay at their current kernel but who need to follow upstream.

Please keep the inputs coming independent if you are pro or not for the sunset of sun4m and sun4d.

Sam

#24 lore raw
Quoted 2 lines · Sam Ravnborg

Please keep the inputs coming independent if you are pro or not for the sunset of sun4m and sun4d.

I would personally be in favor of keeping it and I should finally get my SPARCstation 5 up and running again.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#25 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Sam Ravnborg

Another said that it would be a shame to sunset sun4m and sun4d because there are so many machines around, and netbsd is also active on the sparc32 area.

Yes, those were plentiful back in the day and there's still quite a few around.

Quoted 2 lines

The second mail also re-reminded me of an interesting project implementing SPARC V8 and the sun4m platform in VHDL.

There's also new hardware being developed for SBus systems :-)
<https://github.com/rdolbeau/SBusFPGA>
(disclaimer: work-in-progress and shameless self-promotion here!).

If there's still a distribution willing to build for Sparc v8, then I believe the kernel
should try to keep support of the relevant machine architectures if at all possible...

Cordially,

Signature · 1 line
Romain Dolbeau
#26 lore raw

Hi Romain, Sam,

Quoted 7 lines · Romain Dolbeau
Quoted 3 lines · Sam Ravnborg

Another said that it would be a shame to sunset sun4m and sun4d because there are so many machines around, and netbsd is also active on the sparc32 area.

Yes, those were plentiful back in the day and there's still quite a few around.

I have three: two SparcStation 10s and a SparcStation LX.

If I want to run them, assuming the hardware still works, I need to netboot them as I cannot find working, compatible HDDs for them as everything has switched to SATA or SAS.

Then there's the issue of finding a monitor as they're not electrically compatible with VGA and I'm pretty sure none of the VGA compatible monitors I have or can lay hands on works with their specific sync frequencies.

Ultimately it's one of those things where there's enough "stuff" in the way that booting one up for fun is simply impractical and they're old and slow enough that they're not useful for anything else.

Then we get to the not-so-significant issue of software...

Quoted 6 lines
Quoted 2 lines

The second mail also re-reminded me of an interesting project implementing SPARC V8 and the sun4m platform in VHDL.

There's also new hardware being developed for SBus systems :-)
<https://github.com/rdolbeau/SBusFPGA>
(disclaimer: work-in-progress and shameless self-promotion here!).

Interesting project!

Amusingly enough you're not the first to hook an FPGA up to sBus. I had a card that was some form of high-speed sampling thing which was effectively some electrically isolated front-end hooked to a Xylinx FPGA. I ended up trashing it as it had no markings and I couldn't find out anything about it.

Quoted 4 lines

If there's still a distribution willing to build for Sparc v8, then I believe the kernel
should try to keep support of the relevant machine architectures if at all possible...

And here's where the problem lies. The last (official) version of Debian to support Sparc32 was Etch and I believe it was one of the last ones to drop support.

I believe that Gentoo is architecture-neutral enough that it'd work, but I believe that you'll have to compile everything - there'll be no pre-built anything for sparc32 - and as it's fairly slow hardware by today's standards, that's going to take a long time, however you could probably use distcc and cross-compilers to speed it up.

Long painful story short, it's difficult to get the hardware running, there's practically no Linux distros that support it, and the kernel code has probably bitrotted due to lack of testing.

As much as it pains me to say this, I think this code's time has come and it's time to get rid of it.

If there were more people using it or more testing, or more distros supporting it - not just (theoretically?) working on it - then I'd be fighting to keep it.

But there isn't.

I think it's time for it to go.

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
Quoted 24 lines · Romain Dolbeau
Quoted 3 lines · Sam Ravnborg

Another said that it would be a shame to sunset sun4m and sun4d because there are so many machines around, and netbsd is also active on the sparc32 area.

Yes, those were plentiful back in the day and there's still quite a few around.

Quoted 2 lines

The second mail also re-reminded me of an interesting project implementing SPARC V8 and the sun4m platform in VHDL.

There's also new hardware being developed for SBus systems :-)
<https://github.com/rdolbeau/SBusFPGA>
(disclaimer: work-in-progress and shameless self-promotion here!).

If there's still a distribution willing to build for Sparc v8, then I believe the kernel
should try to keep support of the relevant machine architectures if at all possible...

Cordially,

--
Romain Dolbeau

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#27 lore raw
Quoted 3 lines · Julian Calaby

If I want to run them, assuming the hardware still works, I need to netboot them as I cannot find working, compatible HDDs for them as everything has switched to SATA or SAS.

SCSI2SD (<http://www.codesrc.com/mediawiki/index.php/SCSI2SD>)
are a bit expensive, but solve that problem (I own both a V5 and a V6, both work well in my SPARCstations, tried sun4c and sun4m). As it takes micro-sd cards, it's quite easy to keep multiple OSes on hand.

Quoted 2 lines

Then there's the issue of finding a monitor as they're not electrically compatible with VGA

Huh? There is Sun's 13W3-to-vga adapters and cables, and many monitors will sync to Sun's frequency (though not the most recent LCDs whose analog circuitry is pathetic compared to old-school CRTs). Some framebuffers will output 1280x1024 (rarer than for 1152x900), and some can be coerced to do almost anything with some Forth knowledge (see e.g.
<https://github.com/rdolbeau/SunTurboGX>, again blowing my own horn here sorry...).

Quoted 1 line

(...) booting one up for fun is simply impractical

An SCSI2SD and either a null-modem serial cable or a Sun keyboard/13w3 cable/17"LCD combo and you're good to go. You might need another unix-like box to netboot the system.

Quoted 3 lines

I believe that Gentoo is architecture-neutral enough that it'd work, but I believe that you'll have to compile everything - there'll be no pre-built anything for sparc32

Trying gentoo is on my todo list... has been for a long time :-(

Quoted 3 lines

and as it's fairly slow hardware by
today's standards, that's going to take a long time, however you could probably use distcc and cross-compilers to speed it up.

Isn't that what Qemu is for ? :-) I've managed to recompile LLVM and clang in NetBSD 9 for my SS20, one by cross-compiling (LLVM requires too much memory), the other in QEmu. Unfortunately, Qemu doesn't yet support mt-tcg (multithreaded emulation) for sparc so single-core only - still faster than the HW, mostly because of incomparably faster I/O.

Quoted 3 lines

If there were more people using it or more testing, or more distros supporting it - not just (theoretically?) working on it - then I'd be fighting to keep it.

I wish I had some arguments for that point... I will just re-mention Qemu, as it makes testing quite easy and reasonably not-too-slow.

Cordially,

Signature · 1 line
Romain Dolbeau
#28 lore raw

Hi Romain,

Quoted 11 lines · Romain Dolbeau
Quoted 3 lines · Julian Calaby

If I want to run them, assuming the hardware still works, I need to netboot them as I cannot find working, compatible HDDs for them as everything has switched to SATA or SAS.

SCSI2SD (<http://www.codesrc.com/mediawiki/index.php/SCSI2SD>)
are a bit expensive, but solve that problem (I own both a V5 and a V6, both work well in my SPARCstations, tried sun4c and sun4m). As it takes micro-sd cards, it's quite easy to keep multiple OSes on hand.

I'd forgotten about that. Fair point =)

Quoted 11 lines
Quoted 2 lines

Then there's the issue of finding a monitor as they're not electrically compatible with VGA

Huh? There is Sun's 13W3-to-vga adapters and cables, and many monitors will sync to Sun's frequency (though not the most recent LCDs whose analog circuitry is pathetic compared to old-school CRTs). Some framebuffers will output 1280x1024 (rarer than for 1152x900), and some can be coerced to do almost anything with some Forth knowledge (see e.g.
<https://github.com/rdolbeau/SunTurboGX>, again blowing my own horn here sorry...).

Yeah, my issue is that I have no CRTs anymore - all my monitors are LCDs and none of them sync to the frequencies SUNs use.

So yeah, you can make adapters (i have home-made adapters to convert both ways) however out of the 4 monitors I own with VGA ports, none of them sync to Sun frequencies.

Quoted 5 lines
Quoted 1 line

(...) booting one up for fun is simply impractical

An SCSI2SD and either a null-modem serial cable or a Sun keyboard/13w3 cable/17"LCD combo and you're good to go. You might need another unix-like box to netboot the system.

That's almost exactly what I was planning to do, but I'd still be lacking a Linux distro to run.

Quoted 5 lines
Quoted 3 lines

I believe that Gentoo is architecture-neutral enough that it'd work, but I believe that you'll have to compile everything - there'll be no pre-built anything for sparc32

Trying gentoo is on my todo list... has been for a long time :-(

Same.

IIRC there's some ancient versions that have the bits to netboot a SparcStation so you can then do the necessary stuff to install the minimal binaries and stuff, at which point you can do the various configurations, pull in the latest portage tree and emerge world, however the last time I tried this, the disk I was using - my last one
- failed somewhere in the middle of that process.

Quoted 10 lines
Quoted 3 lines

and as it's fairly slow hardware by
today's standards, that's going to take a long time, however you could probably use distcc and cross-compilers to speed it up.

Isn't that what Qemu is for ? :-) I've managed to recompile LLVM and clang in NetBSD 9 for my SS20, one by cross-compiling (LLVM requires too much memory), the other in QEmu. Unfortunately, Qemu doesn't yet support mt-tcg (multithreaded emulation) for sparc so single-core only - still faster than the HW, mostly because of incomparably faster I/O.

My distcc plan was to have it talk to a cross compiler on my x86 desktop. I never got to the point where it would have actually used it.

Quoted 6 lines
Quoted 3 lines

If there were more people using it or more testing, or more distros supporting it - not just (theoretically?) working on it - then I'd be fighting to keep it.

I wish I had some arguments for that point... I will just re-mention Qemu, as it makes testing quite easy and reasonably not-too-slow.

QEMU is somewhat slow and never _exactly_ the same as real hardware, so I can see why distros might not use it as a build machine or whatever. And if they do build for QEMU and it doesn't work on real hardware, then we have a distro that's only for virtual hardware and that seems pointless.

You're right that with the right bits and pieces resurrecting a Sparc32 machine is relatively "easy", however there's still no modern distros supporting this ancient hardware so the upstream kernel has most likely bitrotted.

I still don't think it's worth saving.

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#29 lore raw
In reply to Julian Calaby

RnJvbTogSnVsaWFuIENhbGFieQ0KPiBTZW50OiAyMCBEZWNlbWJlciAyMDIwIDA4OjU1DQo+IA0K PiBPbiBTdW4sIERlYyAyMCwgMjAyMCBhdCA2OjQ2IFBNIFJvbWFpbiBEb2xiZWF1IDxyb21haW5A ZG9sYmVhdS5vcmc+IHdyb3RlOg0KPiA+DQo+ID4gTGUgc2FtLiAxOSBkw6ljLiAyMDIwIMOgIDIy OjQxLCBTYW0gUmF2bmJvcmcgPHNhbUByYXZuYm9yZy5vcmc+IGEgw6ljcml0IDoNCj4gPiA+IEFu b3RoZXIgc2FpZCB0aGF0IGl0IHdvdWxkIGJlIGEgc2hhbWUgdG8gc3Vuc2V0IHN1bjRtIGFuZCBz dW40ZCBiZWNhdXNlDQo+ID4gPiB0aGVyZSBhcmUgc28gbWFueSBtYWNoaW5lcyBhcm91bmQsIGFu ZCBuZXRic2QgaXMgYWxzbyBhY3RpdmUgb24gdGhlDQo+ID4gPiBzcGFyYzMyIGFyZWEuDQoNClRo ZSBhZHZhbnRhZ2Ugb2YgbmV0YnNkIGlzIHRoYXQgdGhlIGJ1aWxkIGdpdmVzIHlvdSBhIGtlcm5l bCBhbmQgdXNlcnNwYWNlDQpmcm9tIHRoZSBzYW1lIHNvdXJjZSB0cmVlIGFuZCBpdCBpcyBkZXNp Z25lZCB0byBjcm9zcyBidWlsZC4NCkV2ZW4gdGhlIGNvbXBpbGVycyBnZXQgYnVpbHQgLSBzbyBh bGwgeW91IG5lZWQgaXMgYSBuYXRpdmUgY29tcGlsZXINCnRoYXQgd2lsbCBjb21waWxlIHRoZSAo cHJvYmFibHkgc2xpZ2h0bHkgb2xkZXIpIHZlcnNpb24gb2YgZ2NjLg0KVGhpcyB1c2VkIHRvIGJl IHByb2JsZW1hdGljIGJlY2F1c2UgZ2NjIHNvdXJjZXMgdGVuZGVkIHRvIHVzZSBnY2Mtb25seQ0K ZmVhdHVyZXMgKHdoaWNoIGhhdmUgYmVlbiBkZXByZWNhdGVkKS4NCg0KVGhlIHVzZXJzcGFjZSB3 aWxsIGFsc28gYmUgYSBsb3QgbGVzcyBibG9hdGVkIHRoYW4gYSB0eXBpY2FsIExpbnV4LA0KYnV0 IG1vcmUgY29tcGxldGUgdGhhbiB0aGUgJ2J1c3lib3gnIHRvb2xzIG9mdGVuIHVzZWQgb24gc21h bGwvZW1iZWRkZWQNCkxpbnV4IHN5c3RlbXMuDQoNCj4gPiBZZXMsIHRob3NlIHdlcmUgcGxlbnRp ZnVsIGJhY2sgaW4gdGhlIGRheSBhbmQgdGhlcmUncyBzdGlsbCBxdWl0ZSBhIGZldyBhcm91bmQu DQo+IA0KPiBJIGhhdmUgdGhyZWU6IHR3byBTcGFyY1N0YXRpb24gMTBzIGFuZCBhIFNwYXJjU3Rh dGlvbiBMWC4NCj4gDQo+IElmIEkgd2FudCB0byBydW4gdGhlbSwgYXNzdW1pbmcgdGhlIGhhcmR3 YXJlIHN0aWxsIHdvcmtzLCBJIG5lZWQgdG8NCj4gbmV0Ym9vdCB0aGVtIGFzIEkgY2Fubm90IGZp bmQgd29ya2luZywgY29tcGF0aWJsZSBIRERzIGZvciB0aGVtIGFzDQo+IGV2ZXJ5dGhpbmcgaGFz IHN3aXRjaGVkIHRvIFNBVEEgb3IgU0FTLg0KDQpJIHRyYXNoZWQgdGhlIFBTVSBvbiBteSBzdW4z IHRyeWluZyB0byBnZXQgbmV0Ym9vdCB0byB3b3JrLg0KVGhlIG1haW4gcHJvYmxlbSBzZWVtZWQg dG8gYmUgdGhhdCB0aGUgc3dpdGNoaW5nIGZldCB3YXNuJ3QNCmFjdHVhbGx5IHJhdGVkIGZvciAy NDB2IGlucHV0ISAobmVlZHMgdG8gYmUgYSA0MDB2IGRldmljZSkuDQoNCkkgbmV2ZXIgZGlkIGdl dCBhcm91bmQgdG8gY29ubmVjdGluZyBhbiBBVFggcHN1IHVwIHRvIHRoZSBjb25uZWN0b3IuDQoN CglEYXZpZA0KDQotDQpSZWdpc3RlcmVkIEFkZHJlc3MgTGFrZXNpZGUsIEJyYW1sZXkgUm9hZCwg TW91bnQgRmFybSwgTWlsdG9uIEtleW5lcywgTUsxIDFQVCwgVUsNClJlZ2lzdHJhdGlvbiBObzog MTM5NzM4NiAoV2FsZXMpDQo

#30 lore raw
In reply to Sam Ravnborg

From Experience... The best way to go about Gentoo for 32bit sparcs is in a chroot on a faster 64bit Sparc system, you could probably also run a faster than realtime QEMU but that's a bit more of a hassle if you have fast Sun hardware. Last time I did this was on a T2000, I have been meaning to retrace my steps on a T4.

I did run into a bug with portage or python... it would be nice to fix that so those could be used on Slower systems. I'd also like at some point to compile a list of software in the vein of suckless.org (perhaps a bit less masochistic though), that is usable on old machines, the one I really want to dogfood is pcb-rnd and corelEDA on a sparcstation to see how well it could compete with KiCad.

Weird thing about the LCDs not syncing... all the LCDs I have that are 1280x1024 or greater work. The problem is that sometimes the default resolution also has a sync rate of a few hz higher than some LCDs can handle, most of my LCDs are older higher end models (1600x1200 etc...) so also happen to support those rates. You can get most commodity LCDs to sync by choosing a display mode via serial port that plays nice with standard VGA resolutions and rates.