Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Support PowerPC 405EX/EXr.
details: https://anonhg.NetBSD.org/src/rev/f8a5ae8886bb
branches: trunk
changeset: 753148:f8a5ae8886bb
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Thu Mar 18 13:58:38 2010 +0000
description:
Support PowerPC 405EX/EXr.
1. Add some new source and header files.
(MAL(split) and RGMII(new) relations for EMAC)
2. Create dcr4xx.h. Its moved from dcr405gp.h. Also remove dcr405xx.h.
3. intr.c supports MULTIUIC with virtual-irq. likes to oea.
support 32-virq/128-hwirq.
4. multiple emac support.
5. WALNUT and VIRTEX_* includes arch/powerpc/conf/files.ibm4xx.
6. WALNUT pci uses arch/powerpc/ibm4xx/pci/.
diffstat:
sys/arch/evbppc/obs405/obs266_autoconf.c | 9 ++-
sys/arch/evbppc/virtex/autoconf.c | 10 +-
sys/arch/evbppc/virtex/virtex_start.S | 4 +-
sys/arch/evbppc/walnut/autoconf.c | 11 ++-
sys/arch/evbppc/walnut/machdep.c | 91 +++++++++++++++++++++++++++---
sys/arch/evbppc/walnut/walnut_start.S | 4 +-
sys/arch/powerpc/conf/files.ibm4xx | 30 +++++++++-
sys/arch/powerpc/ibm4xx/openbios/locore.S | 4 +-
sys/arch/powerpc/ibm4xx/pci/pci_machdep.c | 15 +----
sys/arch/powerpc/powerpc/bus_space.c | 14 ++++-
10 files changed, 145 insertions(+), 47 deletions(-)
diffs (truncated from 438 to 300 lines):
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/obs405/obs266_autoconf.c
--- a/sys/arch/evbppc/obs405/obs266_autoconf.c Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/obs405/obs266_autoconf.c Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: obs266_autoconf.c,v 1.4 2006/10/07 14:59:53 tsutsui Exp $ */
+/* $NetBSD: obs266_autoconf.c,v 1.5 2010/03/18 14:04:07 kiyohara Exp $ */
/*
* Copyright 2004 Shigeyuki Fukushima.
@@ -33,14 +33,17 @@
* DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obs266_autoconf.c,v 1.4 2006/10/07 14:59:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs266_autoconf.c,v 1.5 2010/03/18 14:04:07 kiyohara Exp $");
#include <sys/systm.h>
#include <sys/device.h>
#include <machine/obs266.h>
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/cpu.h>
+#include <powerpc/ibm4xx/dcr4xx.h>
+
+#include <dev/ic/comreg.h>
/*
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/virtex/autoconf.c
--- a/sys/arch/evbppc/virtex/autoconf.c Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/virtex/autoconf.c Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.1 2006/12/02 22:18:47 freza Exp $ */
+/* $NetBSD: autoconf.c,v 1.2 2010/03/18 14:04:07 kiyohara Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
@@ -61,21 +61,21 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2006/12/02 22:18:47 freza Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2010/03/18 14:04:07 kiyohara Exp $");
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/systm.h>
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/spr.h>
#include <powerpc/ibm4xx/dev/plbvar.h>
/* List of port-specific devices to attach to the processor local bus. */
static const struct plb_dev local_plb_devs [] = {
- { "xcvbus" },
- { NULL }
+ { XILVIRTEX, "xcvbus" },
+ { 0, NULL }
};
/*
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/virtex/virtex_start.S
--- a/sys/arch/evbppc/virtex/virtex_start.S Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/virtex/virtex_start.S Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtex_start.S,v 1.5 2010/02/25 23:33:44 matt Exp $ */
+/* $NetBSD: virtex_start.S,v 1.6 2010/03/18 14:04:07 kiyohara Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
@@ -55,7 +55,7 @@
#include <powerpc/spr.h>
#include <powerpc/ibm4xx/spr.h>
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/dcr4xx.h>
#include <powerpc/ibm4xx/pmap.h>
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/walnut/autoconf.c
--- a/sys/arch/evbppc/walnut/autoconf.c Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/walnut/autoconf.c Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.17 2007/02/22 05:27:47 thorpej Exp $ */
+/* $NetBSD: autoconf.c,v 1.18 2010/03/18 14:04:07 kiyohara Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2007/02/22 05:27:47 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.18 2010/03/18 14:04:07 kiyohara Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -41,15 +41,16 @@
#include <dev/ic/comreg.h> /* For COM_FREQ */
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/dcr4xx.h>
#include <powerpc/ibm4xx/dev/plbvar.h>
+#include <powerpc/ibm4xx/spr.h>
/*
* List of port-specific devices to attach to the processor local bus.
*/
static const struct plb_dev local_plb_devs [] = {
- { "pbus", },
- { NULL }
+ { IBM405GP, "pbus", },
+ { 0, NULL }
};
/*
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/walnut/machdep.c
--- a/sys/arch/evbppc/walnut/machdep.c Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/walnut/machdep.c Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.45 2010/02/25 23:33:44 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.46 2010/03/18 14:04:07 kiyohara Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.45 2010/02/25 23:33:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.46 2010/03/18 14:04:07 kiyohara Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@@ -104,9 +104,11 @@
#include <powerpc/spr.h>
#include <powerpc/ibm4xx/spr.h>
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/dcr4xx.h>
#include <dev/cons.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pciconf.h>
#include "ksyms.h"
@@ -175,7 +177,7 @@
struct cpu_info * const ci = curcpu();
/* Disable all external interrupts */
- mtdcr(DCR_UIC0_ER, 0);
+ mtdcr(DCR_UIC0_BASE + DCR_UIC_ER, 0);
/* Initialize cache info for memcpy, etc. */
cpu_probe_cache();
@@ -188,7 +190,7 @@
physmemr[0].start = 0;
physmemr[0].size = board_data.mem_size & ~PGOFSET;
/* Lower memory reserved by eval board BIOS */
- availmemr[0].start = startkernel;
+ availmemr[0].start = startkernel;
availmemr[0].size = board_data.mem_size - availmemr[0].start;
/* Linear map kernel memory */
@@ -244,11 +246,11 @@
memcpy((void *)EXC_DTMISS, &tlbdmiss4xx,
(size_t)&tlbdm4size);
break;
- /*
- * EXC_PIT, EXC_FIT, EXC_WDOG handlers
- * are spaced by 0x10 bytes only..
+ /*
+ * EXC_PIT, EXC_FIT, EXC_WDOG handlers
+ * are spaced by 0x10 bytes only..
*/
- case EXC_PIT:
+ case EXC_PIT:
memcpy((void *)EXC_PIT, &pitfitwdog,
(size_t)&pitfitwdogsize);
break;
@@ -257,7 +259,7 @@
(size_t)&debugsize);
break;
case EXC_DTMISS|EXC_ALI:
- /* PPC405GP Rev D errata item 51 */
+ /* PPC405GP Rev D errata item 51 */
memcpy((void *)(EXC_DTMISS|EXC_ALI), &errata51handler,
(size_t)&errata51size);
break;
@@ -290,7 +292,7 @@
* Now enable translation (and machine checks/recoverable interrupts).
*/
__asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0; isync"
- : : "r"(0), "K"(PSL_IR|PSL_DR));
+ : : "r"(0), "K"(PSL_IR|PSL_DR));
/* XXXX PSL_ME - With ME set kernel gets stuck... */
uvm_setpagesize();
@@ -550,3 +552,70 @@
*mem = physmemr;
*avail = availmemr;
}
+
+
+int
+pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
+{
+
+ /*
+ * Bus number is irrelevant. Configuration Mechanism 1 is in
+ * use, can have devices 0-32 (i.e. the `normal' range).
+ */
+ return 5;
+}
+
+int
+pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+{
+ int pin = pa->pa_intrpin;
+ int dev = pa->pa_device;
+
+ if (pin == 0)
+ /* No IRQ used. */
+ goto bad;
+
+ if (pin > 4) {
+ printf("pci_intr_map: bad interrupt pin %d\n", pin);
+ goto bad;
+ }
+
+ /*
+ * We need to map the interrupt pin to the interrupt bit in the UIC
+ * associated with it. This is highly machine-dependent.
+ */
+ switch(dev) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ *ihp = 27 + dev;
+ break;
+ default:
+ printf("Hmm.. PCI device %d should not exist on this board\n",
+ dev);
+ goto bad;
+ }
+ return 0;
+
+bad:
+ *ihp = -1;
+ return 1;
+}
+
+void
+pci_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
+ int swiz, int *iline)
+{
+
+ if (bus == 0)
+ switch(dev) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ *iline = 31 - dev;
+ }
+ else
+ *iline = 20 + ((swiz + dev + 1) & 3);
+}
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/evbppc/walnut/walnut_start.S
--- a/sys/arch/evbppc/walnut/walnut_start.S Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/evbppc/walnut/walnut_start.S Thu Mar 18 13:58:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: walnut_start.S,v 1.18 2010/02/25 23:33:44 matt Exp $ */
+/* $NetBSD: walnut_start.S,v 1.19 2010/03/18 14:04:07 kiyohara Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@@ -89,7 +89,7 @@
#include <powerpc/spr.h>
#include <powerpc/ibm4xx/spr.h>
-#include <powerpc/ibm4xx/dcr405gp.h>
+#include <powerpc/ibm4xx/dcr4xx.h>
#include <powerpc/ibm4xx/pmap.h>
/* Function pointer for requesting board_config_data from openbios*/
diff -r 2f572f909a12 -r f8a5ae8886bb sys/arch/powerpc/conf/files.ibm4xx
--- a/sys/arch/powerpc/conf/files.ibm4xx Thu Mar 18 13:47:04 2010 +0000
+++ b/sys/arch/powerpc/conf/files.ibm4xx Thu Mar 18 13:58:38 2010 +0000
@@ -1,9 +1,12 @@
-# $NetBSD: files.ibm4xx,v 1.10 2006/03/13 15:31:11 shige Exp $
+# $NetBSD: files.ibm4xx,v 1.11 2010/03/18 13:58:38 kiyohara Exp $
#
# IBM 4xx specific configuration info
Home |
Main Index |
Thread Index |
Old Index