Skip to contentSkip to conversation

sparc32: Remove cypress cpu support.

PATCH In review David Miller 6 participants 14 messages May 15, 2012 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 sparc32: Remove cypress cpu support.

It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

---

I'm tempted to push this.

Sam, what's your take on it?

 arch/sparc/include/asm/cypress.h |   79 ---------
 arch/sparc/include/asm/elf_32.h  |   12 +-
 arch/sparc/include/asm/mbus.h    |    4 -
 arch/sparc/kernel/head_32.S      |   15 --
 arch/sparc/kernel/irq_32.c       |   11 --
 arch/sparc/mm/srmmu.c            |  333 +-------------------------------------
 6 files changed, 5 insertions(+), 449 deletions(-)
 delete mode 100644 arch/sparc/include/asm/cypress.h
arch/sparc/include/asm/cypress.h deleted +0 -79
deleted file mode 100644
index 95e9772..0000000
@@ -1,79 +0,0 @@
-/*
- * cypress.h: Cypress module specific definitions and defines.
- *
- * Copyright (C) 1995 David S. Miller ([email protected])
- */
-
-#ifndef _SPARC_CYPRESS_H
-#define _SPARC_CYPRESS_H
-
-/* Cypress chips have %psr 'impl' of '0001' and 'vers' of '0001'. */
-
-/* The MMU control register fields on the Sparc Cypress 604/605 MMU's.
- *
- * ---------------------------------------------------------------
- * |implvers| MCA | MCM |MV| MID |BM| C|RSV|MR|CM|CL|CE|RSV|NF|ME|
- * ---------------------------------------------------------------
- *  31    24 23-22 21-20 19 18-15 14 13  12 11 10  9  8 7-2  1  0
- *
- * MCA: MultiChip Access -- Used for configuration of multiple
- *      CY7C604/605 cache units.
- * MCM: MultiChip Mask -- Again, for multiple cache unit config.
- * MV: MultiChip Valid -- Indicates MCM and MCA have valid settings.
- * MID: ModuleID -- Unique processor ID for MBus transactions. (605 only)
- * BM: Boot Mode -- 0 = not in boot mode, 1 = in boot mode
- * C: Cacheable -- Indicates whether accesses are cacheable while
- *    the MMU is off.  0=no 1=yes
- * MR: MemoryReflection -- Indicates whether the bus attached to the
- *     MBus supports memory reflection. 0=no 1=yes (605 only)
- * CM: CacheMode -- Indicates whether the cache is operating in write
- *     through or copy-back mode. 0=write-through 1=copy-back
- * CL: CacheLock -- Indicates if the entire cache is locked or not.
- *     0=not-locked 1=locked  (604 only)
- * CE: CacheEnable -- Is the virtual cache on? 0=no 1=yes
- * NF: NoFault -- Do faults generate traps? 0=yes 1=no
- * ME: MmuEnable -- Is the MMU doing translations? 0=no 1=yes
- */
-
-#define CYPRESS_MCA       0x00c00000
-#define CYPRESS_MCM       0x00300000
-#define CYPRESS_MVALID    0x00080000
-#define CYPRESS_MIDMASK   0x00078000   /* Only on 605 */
-#define CYPRESS_BMODE     0x00004000
-#define CYPRESS_ACENABLE  0x00002000
-#define CYPRESS_MRFLCT    0x00000800   /* Only on 605 */
-#define CYPRESS_CMODE     0x00000400
-#define CYPRESS_CLOCK     0x00000200   /* Only on 604 */
-#define CYPRESS_CENABLE   0x00000100
-#define CYPRESS_NFAULT    0x00000002
-#define CYPRESS_MENABLE   0x00000001
-
-static inline void cypress_flush_page(unsigned long page)
-{
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (page), "i" (ASI_M_FLUSH_PAGE));
-}
-
-static inline void cypress_flush_segment(unsigned long addr)
-{
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_FLUSH_SEG));
-}
-
-static inline void cypress_flush_region(unsigned long addr)
-{
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_FLUSH_REGION));
-}
-
-static inline void cypress_flush_context(void)
-{
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_FLUSH_CTX));
-}
-
-/* XXX Displacement flushes for buggy chips and initial testing
- * XXX go here.
- */
-
-#endif /* !(_SPARC_CYPRESS_H) */
arch/sparc/include/asm/elf_32.h +3 -9
index b5beb11..2d4d755 100644
@@ -118,15 +118,9 @@ typedef struct {
    instruction set this cpu supports.  This can NOT be done in userspace
    on Sparc.  */
 
-/* Most sun4m's have them all.
- * XXX This is gross, set some global variable at boot time. -DaveM
- */
-#define ELF_HWCAP	((HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
-			  HWCAP_SPARC_SWAP | \
-			  ((srmmu_modtype != Cypress && \
-			    srmmu_modtype != Cypress_vE && \
-			    srmmu_modtype != Cypress_vD) ? \
-			   HWCAP_SPARC_MULDIV : 0)))
+/* Most sun4m's have them all.  */
+#define ELF_HWCAP	(HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
+			 HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV)
 
 /* This yields a string that ld.so will use to load implementation
    specific libraries for optimization.  This is more specific in
arch/sparc/include/asm/mbus.h +0 -4
index 69f07a0..14128bc 100644
@@ -8,14 +8,10 @@
 #define _SPARC_MBUS_H
 
 #include <asm/ross.h>    /* HyperSparc stuff */
-#include <asm/cypress.h> /* Cypress Chips */
 #include <asm/viking.h>  /* Ugh, bug city... */
 
 enum mbus_module {
 	HyperSparc        = 0,
-	Cypress           = 1,
-	Cypress_vE        = 2,
-	Cypress_vD        = 3,
 	Swift_ok          = 4,
 	Swift_bad_c       = 5,
 	Swift_lots_o_bugs = 6,
arch/sparc/kernel/head_32.S +0 -15
index 9b2d43d..6c95e9f 100644
@@ -746,21 +746,6 @@ sun4d_init:
 	/* Fall through to sun4m_init */
 
 sun4m_init:
-	/* XXX Fucking Cypress... */
-	lda	[%g0] ASI_M_MMUREGS, %g5
-	srl	%g5, 28, %g4
-
-	cmp	%g4, 1
-	bne	1f
-	 srl	%g5, 24, %g4
-
-	and	%g4, 0xf, %g4
-	cmp	%g4, 7		/* This would be a HyperSparc. */
-
-	bne	2f
-	 nop
-
-1:
 
 #define PATCH_IT(dst, src)	\
 	set	(dst), %g5;	\
arch/sparc/kernel/irq_32.c +0 -11
index a33009f..ae04914 100644
@@ -23,14 +23,6 @@
 #include "kernel.h"
 #include "irq.h"
 
-#ifdef CONFIG_SMP
-#define SMP_NOP2 "nop; nop;\n\t"
-#define SMP_NOP3 "nop; nop; nop;\n\t"
-#else
-#define SMP_NOP2
-#define SMP_NOP3
-#endif /* SMP */
-
 /* platform specific irq setup */
 struct sparc_config sparc_config;
 
@@ -41,7 +33,6 @@ unsigned long arch_local_irq_save(void)
 
 	__asm__ __volatile__(
 		"rd	%%psr, %0\n\t"
-		SMP_NOP3	/* Sun4m + Cypress + SMP bug */
 		"or	%0, %2, %1\n\t"
 		"wr	%1, 0, %%psr\n\t"
 		"nop; nop; nop\n"
@@ -59,7 +50,6 @@ void arch_local_irq_enable(void)
 
 	__asm__ __volatile__(
 		"rd	%%psr, %0\n\t"
-		SMP_NOP3	/* Sun4m + Cypress + SMP bug */
 		"andn	%0, %1, %0\n\t"
 		"wr	%0, 0, %%psr\n\t"
 		"nop; nop; nop\n"
@@ -76,7 +66,6 @@ void arch_local_irq_restore(unsigned long old_psr)
 	__asm__ __volatile__(
 		"rd	%%psr, %0\n\t"
 		"and	%2, %1, %2\n\t"
-		SMP_NOP2	/* Sun4m + Cypress + SMP bug */
 		"andn	%0, %1, %0\n\t"
 		"wr	%0, %2, %%psr\n\t"
 		"nop; nop; nop\n"
arch/sparc/mm/srmmu.c +2 -331

358 lines not on this page · raw message

Signature · 1 line
1.7.10
#1 lore raw

Hi David,

Quoted 9 lines · David Miller

It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

---

I'm tempted to push this.

I would be too.

I was thinking of adding a Kconfig variable for Cypress CPU support since it's status first came up and linking this to the CFLAGS so that we would only generate v7 code if it's enabled, but I haven't had the time.

But I suppose that if nobody we know has one, why keep it?

Quoted 17 lines
arch/sparc/mm/srmmu.c +0 -0
index 765b1a5..4875fcd 100644
@@ -1912,22 +1590,15 @@ static void __init get_srmmu_type(void)
                        break;

               case 0:
               case 2:
-                       /* Uniprocessor Cypress */
-                       init_cypress_604();
-                       break;
               case 10:
               case 11:
               case 12:
-                       /* _REALLY OLD_ Cypress MP chips... */ case 13:
               case 14:

Quoted 8 lines

               case 15:
-                       /* MP Cypress mmu/cache-controller */
-                       init_cypress_605(mod_rev);
-                       break;
               default:
-                       /* Some other Cypress revision, assume a 605. */
-                       init_cypress_605(mod_rev);
+                       prom_printf("Sparc-Linux Cypress support does not longer exit.\n");

*exists

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#2 lore raw
In reply to David Miller

LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMQ0KDQpFbCBUdWUs IDE1IE1heSAyMDEyIDAxOjA5OjQ0IC0wNDAwIChFRFQpDQpEYXZpZCBNaWxsZXIgPGRhdmVtQGRh dmVtbG9mdC5uZXQ+IGVzY3JpYmnDszoNCj4gKwkJCXByb21fcHJpbnRmKCJTcGFyYy1MaW51eCBD eXByZXNzIHN1cHBvcnQNCj4gZG9lcyBub3QgbG9uZ2VyIGV4aXQuXG4iKTsNCg0KbWF5YmUgdGhh dCBzaG91bGQgc2F5DQoiU3BhcmMtTGludXggQ3lwcmVzcyBzdXBwb3J0IG5vIGxvbmdlciBleGlz dHMuXG4iDQoNCkRlbm5pcw0KLS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NClZlcnNpb246 IEdudVBHIHYyLjAuMTggKEdOVS9MaW51eCkNCg0KaUVZRUFSRUNBQVlGQWsreUFyNEFDZ2tRa1N4 bTQ3QmFXZmRBblFDZmU4bjk1ZVFmRHBWV1JoQzR0MStDMENnYQ0KZmU4QW9KaXpaeHc0dk9NSlBI OWplTFMzWDh4QVcvYncNCj1kV3g2DQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg=

#3 lore raw
In reply to David Miller
Quoted 7 lines · Dennis Gilmore
Quoted 2 lines · El Tue, 15 May 2012 01:09:44 -0400 (EDT) David Miller <[email protected]>…
(quoted diff) +1 -0
+			prom_printf("Sparc-Linux Cypress support

does not longer exit.\n");

maybe that should say
"Sparc-Linux Cypress support no longer exists.\n"

Or "You actually run a Cypress SPARC? Please mail [email protected]\n"

Signature · 1 line
     2. That which causes joy or happiness.
#4 lore raw
In reply to David Miller

Hi,

Quoted 10 lines · Josip Rodin
Quoted 7 lines · Dennis Gilmore
Quoted 2 lines · El Tue, 15 May 2012 01:09:44 -0400 (EDT) David Miller <[email protected]>…

+                   prom_printf("Sparc-Linux Cypress support does not longer exit.\n");

maybe that should say
"Sparc-Linux Cypress support no longer exists.\n"

Or "You actually run a Cypress SPARC? Please mail [email protected]\n"

I think that's a much better message =)

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
Acked-by on v1 1/1
#5 lore raw
In reply to David Miller
Quoted 11 lines · David Miller

It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

---

I'm tempted to push this.

Sam, what's your take on it?

I do not know of anyone using a working sun4m box with Cypress, but then I do not know that many with SUN hw anyway.

We have started to get rid of the ancient sparc32 stuff and I am in favour of also killing support for Cypress. The message is then simple:
- we have dropped support for sun4c and the old Cypress based SPARC chips.

My take is that we shall try to adapt the kernel to the latest chip revisions / platfroms.
And then keep support for the relevant older platfroms, while not sacrifying the hackability of the kernel.

In other words the prime chip / platform is LEON, and the older platform we shall support is sun4d and sun4m.

Regarding hackability what we did the last week helped a lot!

Quoted 7 lines
 arch/sparc/include/asm/cypress.h |   79 ---------
 arch/sparc/include/asm/elf_32.h  |   12 +-
 arch/sparc/include/asm/mbus.h    |    4 -
 arch/sparc/kernel/head_32.S      |   15 --
 arch/sparc/kernel/irq_32.c       |   11 --
 arch/sparc/mm/srmmu.c            |  333 +-------------------------------------
 6 files changed, 5 insertions(+), 449 deletions(-)

I had hoped to see more code gone with Cypress.
- kernel/muldiv.c
- lib/mul.S/umul.S etc.
- PATCH_IT() stuff in head_32.S
- "-mcpu=v8" in top-level Makefile

Partly on the todo list I assume.
Other parts may not be Cypress specific?

Anyway - you can add my:

Sam

#6 lore raw
In reply to David Miller
Quoted 11 lines · Julian Calaby

Hi David,

Quoted 8 lines · David Miller

It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

---

Quoted 8 lines
Quoted 1 line

I'm tempted to push this.

I would be too.

I was thinking of adding a Kconfig variable for Cypress CPU support since it's status first came up and linking this to the CFLAGS so that we would only generate v7 code if it's enabled, but I haven't had the time.

If we started doing this we would still have to maintain Cypress support. The whole purpose is to trim down the sparc32 kernel to
the more relevant parts while making the kernel easier to maintain.

Sam

#7 lore raw
In reply to David Miller
Quoted 11 lines · David Miller

It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

---

I'm tempted to push this.

Sam, what's your take on it?

I'm not Sam, but for what its worth, I say push it. In all the years that Aurora maintained a sparc32 build, I never once saw one or had a user report using one (and we had people trying to run Aurora on Javastations).

~tom

=
Fedora Project

author maintainer
#8 lore raw
In reply to David Miller

From: Dennis Gilmore <[email protected]>
Date: Tue, 15 May 2012 02:16:08 -0500

Quoted 10 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · El Tue, 15 May 2012 01:09:44 -0400 (EDT) David Miller <[email protected]>…
(quoted diff) +1 -0
+			prom_printf("Sparc-Linux Cypress support

does not longer exit.\n");

maybe that should say
"Sparc-Linux Cypress support no longer exists.\n"

I made it match the language used by the sun4/sun4c message for consistency.

author maintainer
#9 lore raw
In reply to David Miller

From: Julian Calaby <[email protected]>
Date: Tue, 15 May 2012 20:01:01 +1000

Quoted 9 lines

Hi,

Quoted 6 lines · Josip Rodin
Quoted 5 lines · Dennis Gilmore
Quoted 2 lines · El Tue, 15 May 2012 01:09:44 -0400 (EDT) David Miller <[email protected]>…

+                   prom_printf("Sparc-Linux Cypress support does not longer exit.\n");

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

maybe that should say
"Sparc-Linux Cypress support no longer exists.\n"

Or "You actually run a Cypress SPARC? Please mail [email protected]\n"

I think that's a much better message =)

I don't, because I have no intention of ever putting the Cypress support back into the tree.

They can go use one of the BSDs or a release based upon an older kernel instead.

author maintainer
#10 lore raw
In reply to David Miller

From: Sam Ravnborg <[email protected]>
Date: Tue, 15 May 2012 17:28:55 +0200

Quoted 9 lines · David Miller
Quoted 7 lines
 arch/sparc/include/asm/cypress.h |   79 ---------
 arch/sparc/include/asm/elf_32.h  |   12 +-
 arch/sparc/include/asm/mbus.h    |    4 -
 arch/sparc/kernel/head_32.S      |   15 --
 arch/sparc/kernel/irq_32.c       |   11 --
 arch/sparc/mm/srmmu.c            |  333 +-------------------------------------
 6 files changed, 5 insertions(+), 449 deletions(-)
Quoted 7 lines

I had hoped to see more code gone with Cypress.
- kernel/muldiv.c
- lib/mul.S/umul.S etc.
- PATCH_IT() stuff in head_32.S
- "-mcpu=v8" in top-level Makefile

Partly on the todo list I assume.

It is the next step I planned to make.

Quoted 1 line

Pushed, thanks Sam.

author maintainer
#11 lore raw
In reply to David Miller

From: Sam Ravnborg <[email protected]>
Date: Tue, 15 May 2012 17:28:55 +0200

Quoted 5 lines

I had hoped to see more code gone with Cypress.
- kernel/muldiv.c
- lib/mul.S/umul.S etc.
- PATCH_IT() stuff in head_32.S
- "-mcpu=v8" in top-level Makefile

These should all be taken care of now.

I suspect that divdi3.S and udivdi3.S can be removed as well. I think the muldiv.c code as the only reference that could be generated to those.

I know that muldi3 and the "di3" shift routines need to stay. Other 32-bit platforms have to provide those too, since gcc does emit references to them for some of the expressions we have in the tree.

#12 lore raw
In reply to David Miller
Quoted 10 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Tue, 15 May 2012 17:28:55 +0200

Quoted 5 lines

I had hoped to see more code gone with Cypress.
- kernel/muldiv.c
- lib/mul.S/umul.S etc.
- PATCH_IT() stuff in head_32.S
- "-mcpu=v8" in top-level Makefile

These should all be taken care of now.

Thanks - I preferred someone knowledgeable to do this.

Quoted 4 lines

I suspect that divdi3.S and udivdi3.S can be removed as well. I think the muldiv.c code as the only reference that could be generated to those.

I can experiment with this.

Sam

author maintainer
#13 lore raw
In reply to David Miller

From: Sam Ravnborg <[email protected]>
Date: Tue, 15 May 2012 21:08:39 +0200

Quoted 8 lines · David Miller
Quoted 6 lines

From: Sam Ravnborg <[email protected]>
Date: Tue, 15 May 2012 17:28:55 +0200

I suspect that divdi3.S and udivdi3.S can be removed as well. I think the muldiv.c code as the only reference that could be generated to those.

I can experiment with this.

Thanks!