Skip to contentSkip to conversation

ppc64: Add new "Maple" platform support

PATCH New Benjamin Herrenschmidt 1 participant 1 message Oct 26, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64: Add new "Maple" platform support

Hi !

This patch adds support for the Maple 970FX Eval Board. It adds the basic arch support. For the Maple to be fully functional, it needs a couple more patches to be applied for IDE and Ethernet that are currently pending with the respective maintainers of those subsystems.

include/asm-ppc64/processor.h +1 -0
Index: linux-work/include/asm-ppc64/processor.h
===================================================================
@@ -389,6 +389,7 @@
 #define PLATFORM_ISERIES_LPAR 0x0201
 #define PLATFORM_LPAR         0x0001
 #define PLATFORM_POWERMAC     0x0400
+#define PLATFORM_MAPLE        0x0500
 
 /* Compatibility with drivers coming from PPC32 world */
 #define _machine	(systemcfg->platform)
arch/ppc64/kernel/Makefile +3 -0
Index: linux-work/arch/ppc64/kernel/Makefile
===================================================================
@@ -49,12 +49,15 @@
 obj-$(CONFIG_PPC_PMAC)		+= pmac_setup.o pmac_feature.o pmac_pci.o \
 				   pmac_time.o pmac_nvram.o pmac_low_i2c.o
 
+obj-$(CONFIG_PPC_MAPLE)		+= maple_setup.o maple_pci.o maple_time.o
+
 obj-$(CONFIG_U3_DART)		+= u3_iommu.o
 
 ifdef CONFIG_SMP
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o smp-tbsync.o
 obj-$(CONFIG_PPC_ISERIES)	+= iSeries_smp.o
 obj-$(CONFIG_PPC_PSERIES)	+= pSeries_smp.o
+obj-$(CONFIG_PPC_MAPLE)		+= smp-tbsync.o
 endif
 
 obj-$(CONFIG_ALTIVEC)		+= vecemu.o vector.o
arch/ppc64/kernel/prom_init.c +2 -0
Index: linux-work/arch/ppc64/kernel/prom_init.c
===================================================================
@@ -1132,6 +1132,8 @@
 			if (strstr(p, RELOC("Power Macintosh")) ||
 			    strstr(p, RELOC("MacRISC4")))
 				return PLATFORM_POWERMAC;
+			if (strstr(p, RELOC("Momentum,Maple")))
+				return PLATFORM_MAPLE;
 			i += sl + 1;
 		}
 	}
arch/ppc64/kernel/idle.c +5 -3
Index: linux-work/arch/ppc64/kernel/idle.c
===================================================================
@@ -22,6 +22,7 @@
 #include <linux/cpu.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
+#include <linux/smp.h>
 
 #include <asm/system.h>
 #include <asm/processor.h>
@@ -363,12 +364,13 @@
 		}
 	}
 #endif /* CONFIG_PPC_PSERIES */
-#ifdef CONFIG_PPC_PMAC
-	if (systemcfg->platform == PLATFORM_POWERMAC) {
+#ifndef CONFIG_PPC_ISERIES
+	if (systemcfg->platform == PLATFORM_POWERMAC ||
+	    systemcfg->platform == PLATFORM_MAPLE) {
 		printk(KERN_INFO "Using native/NAP idle loop\n");
 		idle_loop = native_idle;
 	}
-#endif /* CONFIG_PPC_PMAC */
+#endif /* CONFIG_PPC_ISERIES */
 
 	return 1;
 }
arch/ppc64/kernel/udbg.c +29 -3
Index: linux-work/arch/ppc64/kernel/udbg.c
===================================================================
@@ -20,6 +20,9 @@
 #include <asm/prom.h>
 #include <asm/pmac_feature.h>
 
+extern u8 real_readb(volatile u8 *addr);
+extern void real_writeb(u8 data, volatile u8 *addr);
+
 struct NS16550 {
 	/* this struct must be packed */
 	unsigned char rbr;  /* 0 */
@@ -148,9 +151,6 @@
 #endif /* CONFIG_PPC_PMAC */
 
 #if CONFIG_PPC_PMAC
-extern u8 real_readb(volatile u8 *addr);
-extern void real_writeb(u8 data, volatile u8 *addr);
-
 static void udbg_real_putc(unsigned char c)
 {
 	while ((real_readb(sccc) & SCC_TXRDY) == 0)
@@ -171,6 +171,32 @@
 }
 #endif /* CONFIG_PPC_PMAC */
 
+#ifdef CONFIG_PPC_MAPLE
+void udbg_maple_real_putc(unsigned char c)
+{
+	if (udbg_comport) {
+		while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
+			/* wait for idle */;
+		real_writeb(c, &udbg_comport->thr); eieio();
+		if (c == '\n') {
+			/* Also put a CR.  This is for convenience. */
+			while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
+				/* wait for idle */;
+			real_writeb('\r', &udbg_comport->thr); eieio();
+		}
+	}
+}
+
+void udbg_init_maple_realmode(void)
+{
+	udbg_comport = (volatile struct NS16550 *)0xf40003f8;
+
+	ppc_md.udbg_putc = udbg_maple_real_putc;
+	ppc_md.udbg_getc = NULL;
+	ppc_md.udbg_getc_poll = NULL;
+}
+#endif /* CONFIG_PPC_MAPLE */
+
 void udbg_putc(unsigned char c)
 {
 	if (udbg_comport) {
arch/ppc64/Makefile +2 -0
Index: linux-work/arch/ppc64/Makefile
===================================================================
@@ -55,11 +55,13 @@
 boot := arch/ppc64/boot
 
 boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
+boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
 boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
 $(boottarget-y): vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 bootimage-$(CONFIG_PPC_PSERIES) := zImage
+bootimage-$(CONFIG_PPC_MAPLE) := zImage
 bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
 BOOTIMAGE := $(bootimage-y)
 install: vmlinux
arch/ppc64/kernel/maple_setup.c new file +243 -0

243 lines not on this page · raw message

arch/ppc64/kernel/setup.c +8 -0
Index: linux-work/arch/ppc64/kernel/setup.c
===================================================================
@@ -75,11 +75,14 @@
 extern void udbg_init_pmac_realmode(void);
 /* That's RTAS panel debug */
 extern void call_rtas_display_status_delay(unsigned char c);
+/* Here's maple real mode debug */
+extern void udbg_init_maple_realmode(void);
 
 #define EARLY_DEBUG_INIT() do {} while(0)
 
 #if 0
 #define EARLY_DEBUG_INIT() udbg_init_debug_lpar()
+#define EARLY_DEBUG_INIT() udbg_init_maple_realmode()
 #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode()
 #define EARLY_DEBUG_INIT()						\
 	do { ppc_md.udbg_putc = call_rtas_display_status_delay; } while(0)
@@ -326,6 +329,7 @@
 
 extern struct machdep_calls pSeries_md;
 extern struct machdep_calls pmac_md;
+extern struct machdep_calls maple_md;
 
 /* Ultimately, stuff them in an elf section like initcalls... */
 static struct machdep_calls __initdata *machines[] = {
@@ -335,6 +339,9 @@
 #ifdef CONFIG_PPC_PMAC
 	&pmac_md,
 #endif /* CONFIG_PPC_PMAC */
+#ifdef CONFIG_PPC_MAPLE
+	&maple_md,
+#endif /* CONFIG_PPC_MAPLE */
 	NULL
 };
 
@@ -633,6 +640,7 @@
 	printk("naca->debug_switch            = 0x%lx\n", naca->debug_switch);
 	printk("naca->interrupt_controller    = 0x%ld\n", naca->interrupt_controller);
 	printk("systemcfg                     = 0x%p\n", systemcfg);
+	printk("systemcfg->platform           = 0x%x\n", systemcfg->platform);
 	printk("systemcfg->processorCount     = 0x%lx\n", systemcfg->processorCount);
 	printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize);
 	printk("systemcfg->dCacheL1LineSize   = 0x%x\n", systemcfg->dCacheL1LineSize);
arch/ppc64/Kconfig +15 -0
Index: linux-work/arch/ppc64/Kconfig
===================================================================
@@ -80,6 +80,16 @@
 	select ADB_PMU
 	select U3_DART
 
+config PPC_MAPLE
+	depends on PPC_MULTIPLATFORM
+	bool "  Maple 970FX Evaluation Board"
+	select U3_DART
+	select MPIC_BROKEN_U3
+	default n
+	help
+          This option enables support for the Maple 970FX Evaluation Board.
+	  For more informations, refer to http://www.970eval.com
+
 config PPC
 	bool
 	default y
@@ -115,6 +125,11 @@
 	depends on PPC_MULTIPLATFORM
 	default n
 
+config MPIC_BROKEN_U3
+	bool
+	depends on PPC_MAPLE
+	default y
+
 config PPC_PMAC64
 	bool
 	depends on PPC_PMAC
arch/ppc64/kernel/maple_time.c new file +226 -0

226 lines not on this page · raw message

arch/ppc64/kernel/misc.S +2 -2
Index: linux-work/arch/ppc64/kernel/misc.S
===================================================================
@@ -591,7 +591,7 @@
 	isync
 	b	1b
 
-#ifdef CONFIG_PPC_PMAC
+#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
 /*
  * Do an IO access in real mode
  */
@@ -653,7 +653,7 @@
 	sync
 	isync
 	blr
-#endif /* CONFIG_PPC_PMAC */
+#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
 
 /*
  * Create a kernel thread
arch/ppc64/kernel/maple_pci.c new file +528 -0

528 lines not on this page · raw message

arch/ppc64/configs/maple_defconfig new file +921 -0

921 lines not on this page · raw message