Skip to contentSkip to conversation

status of pegasos2 support

PATCH Christoph Hellwig 2 participants 2 messages Jan 9, 2005

lore
Share & tools
lore
#0 lore raw

Guys, could we please get some definit comments on the Pegasos2 support?

We've been carring it around forever in the Debian tree and it's been making no progress at all.

#! /bin/sh -e
##
## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: Add Pegasos 1 and 2 support.
## DP: Patch author: Sven Luther <[email protected]>
## DP: Upstream status: submitted and approved.

. $(dirname $0)/DPATCH

@DPATCH@

arch/ppc/kernel/ppc_ksyms.c +3 -0
diff -urN kernel-source-2.6.8.orig/arch/ppc/kernel/ppc_ksyms.c kernel-source-2.6.8/arch/ppc/kernel/ppc_ksyms.c
@@ -96,6 +96,9 @@
 EXPORT_SYMBOL(_prep_type);
 EXPORT_SYMBOL(ucSystemType);
 #endif
+#if defined(CONFIG_PPC_MULTIPLATFORM)
+EXPORT_SYMBOL(_chrp_type);
+#endif
 
 #if !defined(__INLINE_BITOPS)
 EXPORT_SYMBOL(set_bit);
arch/ppc/platforms/chrp_pci.c +36 -5

83 lines not on this page · raw message

arch/ppc/platforms/chrp_setup.c +65 -10

117 lines not on this page · raw message

arch/ppc/platforms/chrp_time.c +2 -0
diff -urN kernel-source-2.6.8.orig/arch/ppc/platforms/chrp_time.c kernel-source-2.6.8/arch/ppc/platforms/chrp_time.c
@@ -41,6 +41,8 @@
 	int base;
 
 	rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
+	if (rtcs == NULL)
+		rtcs = find_compatible_devices("rtc", "ds1385-rtc");
 	if (rtcs == NULL || rtcs->addrs == NULL)
 		return 0;
 	base = rtcs->addrs[0].address;
arch/ppc/syslib/prom_init.c +17 -5
diff -urN kernel-source-2.6.8.orig/arch/ppc/syslib/prom_init.c kernel-source-2.6.8/arch/ppc/syslib/prom_init.c
@@ -794,6 +794,9 @@
 	char *p, *d;
  	unsigned long phys;
 	void *result[3];
+	char model[32];
+	phandle node;
+	int rc;
 
  	/* Default */
  	phys = (unsigned long) &_stext;
@@ -850,11 +853,20 @@
 
 	klimit = (char *) (mem - offset);
 
-	/* If we are already running at 0xc0000000, we assume we were
-	 * loaded by an OF bootloader which did set a BAT for us.
-	 * This breaks OF translate so we force phys to be 0.
-	 */
-	if (offset == 0) {
+	node = call_prom("finddevice", 1, 1, "/");
+	rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model));
+	if (rc > 0 && !strncmp (model, "Pegasos", 7)
+		&& strncmp (model, "Pegasos2", 8)) {
+		/* Pegasos 1 has a broken translate method in the OF,
+		 * and furthermore the BATs are mapped 1:1 so the phys
+		 * address calculated above is correct, so let's use
+		 * it directly.
+		 */
+	} else if (offset == 0) {
+		/* If we are already running at 0xc0000000, we assume we were
+	 	 * loaded by an OF bootloader which did set a BAT for us.
+	 	 * This breaks OF translate so we force phys to be 0.
+	 	 */
 		prom_print("(already at 0xc0000000) phys=0\n");
 		phys = 0;
 	} else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu",
include/asm-ppc/processor.h +2 -0
diff -urN kernel-source-2.6.8.orig/include/asm-ppc/processor.h kernel-source-2.6.8/include/asm-ppc/processor.h
@@ -34,6 +34,7 @@
 /* these are arbitrary */
 #define _CHRP_Motorola	0x04	/* motorola chrp, the cobra */
 #define _CHRP_IBM	0x05	/* IBM chrp, the longtrail and longtrail 2 */
+#define _CHRP_Pegasos	0x06	/* Genesi/bplan's Pegasos and Pegasos2 */
 
 #define _GLOBAL(n)\
 	.stabs __stringify(n:F-1),N_FUN,0,0,n;\
@@ -54,6 +55,7 @@
 
 /* what kind of prep workstation we are */
 extern int _prep_type;
+extern int _chrp_type;
 
 /*
  * This is used to identify the board type from a given PReP board
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Guys, could we please get some definit comments on the Pegasos2 support?

We've been carring it around forever in the Debian tree and it's been making no progress at all.

As for me, it is ready to be submitted upstream, i sent it already, and it was mostly ok when i wrote to linuxppc-dev and i think benh also said they are ok.

I believe benh is waiting to go back home (should be in the plane right now if i am not wrong) to do the submission part of it.

Friendly,

Sven Luther