mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Watson <cjwatson@flatline.org.uk>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thom May <thom@clearairturbulence.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] ppc32 support for Apple Xserve G5s
Date: Mon, 19 Jul 2004 20:06:52 +0100	[thread overview]
Message-ID: <20040719190652.GB2943@riva.ucam.org> (raw)

Hi,

The following patch makes ppc32 work on Xserve G5 systems (ppc64 support
was already there, I just backported a few bits).

  http://powerpc.no-name-yet.com/patches/xserve-g5.diff

diff -ru kernel-source-2.6.7.orig/arch/ppc/kernel/cpu_setup_power4.S kernel-source-2.6.7/arch/ppc/kernel/cpu_setup_power4.S
--- kernel-source-2.6.7.orig/arch/ppc/kernel/cpu_setup_power4.S	2004-06-16 06:19:43.000000000 +0100
+++ kernel-source-2.6.7/arch/ppc/kernel/cpu_setup_power4.S	2004-07-15 13:16:44.000000000 +0100
@@ -112,7 +112,9 @@
 	/* We only deal with 970 for now */
 	mfspr	r0,SPRN_PVR
 	srwi	r0,r0,16
-	cmpwi	r0,0x39
+	cmpwi	cr0,r0,0x39
+	cmpwi	cr1,r0,0x3c
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq
 	bne	1f
 
 	/* Save HID0,1,4 and 5 */
@@ -144,7 +146,9 @@
 	/* We only deal with 970 for now */
 	mfspr	r0,SPRN_PVR
 	srwi	r0,r0,16
-	cmpwi	r0,0x39
+	cmpwi	cr0,r0,0x39
+	cmpwi	cr1,r0,0x3c
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq
 	bne	1f
 
 	/* Clear interrupt prefix */
diff -ru kernel-source-2.6.7.orig/arch/ppc/kernel/cputable.c kernel-source-2.6.7/arch/ppc/kernel/cputable.c
--- kernel-source-2.6.7.orig/arch/ppc/kernel/cputable.c	2004-06-16 06:19:26.000000000 +0100
+++ kernel-source-2.6.7/arch/ppc/kernel/cputable.c	2004-07-15 13:29:54.000000000 +0100
@@ -419,6 +419,15 @@
 	128, 128,
 	__setup_cpu_ppc970
     },
+    {	/* PPC970FX */
+	0xffff0000, 0x003c0000, "PPC970FX",
+	CPU_FTR_COMMON |
+	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
+	CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP,
+	COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_ALTIVEC_COMP,
+	128, 128,
+	__setup_cpu_ppc970
+    },
 #endif /* CONFIG_POWER4 */
 #ifdef CONFIG_8xx
     {	/* 8xx */
diff -ru kernel-source-2.6.7.orig/arch/ppc/platforms/pmac_feature.c kernel-source-2.6.7/arch/ppc/platforms/pmac_feature.c
--- kernel-source-2.6.7.orig/arch/ppc/platforms/pmac_feature.c	2004-06-16 06:20:03.000000000 +0100
+++ kernel-source-2.6.7/arch/ppc/platforms/pmac_feature.c	2004-07-15 11:23:44.000000000 +0100
@@ -2137,6 +2137,10 @@
 		PMAC_TYPE_POWERMAC_G5,		g5_features,
 		0,
 	},
+	{       "RackMac3,1",                   "XServe G5",
+		PMAC_TYPE_POWERMAC_G5,          g5_features,
+		0,
+	},
 #endif /* CONFIG_POWER4 */
 };
 

Our system didn't have a video card, only a serial console, so I had to
apply the following to get any feedback at all. Other people in a
similar situation might find it useful. However, I've no idea why it was
disabled in the first place, so I'm not asking for this to be applied,
merely curious ...

diff -ru kernel-source-2.6.7.orig/arch/ppc/kernel/head.S kernel-source-2.6.7/arch/ppc/kernel/head.S
--- kernel-source-2.6.7.orig/arch/ppc/kernel/head.S	2004-06-16 06:19:35.000000000 +0100
+++ kernel-source-2.6.7/arch/ppc/kernel/head.S	2004-07-15 14:02:22.000000000 +0100
@@ -1617,7 +1617,7 @@
 	lis	r4,0x2000		/* set pseudo-segment reg 12 */
 	ori	r5,r4,0x0ccc
 	mtsr	12,r5
-#if 0
+#if 1
 	ori	r5,r4,0x0888		/* set pseudo-segment reg 8 */
 	mtsr	8,r5			/* (for access to serial port) */
 #endif

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]

                 reply	other threads:[~2004-07-19 19:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20040719190652.GB2943@riva.ucam.org \
    --to=cjwatson@flatline.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thom@clearairturbulence.org \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®