summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-02-13 14:13:39 +0000
committermarius <marius@FreeBSD.org>2010-02-13 14:13:39 +0000
commita9f745a7804ab5158b27da8d1760caf079f1c6d9 (patch)
tree581d1ee68dfed5794bd44dc27f5340ad4ffbbf69 /sys/sparc64/include
parent43f4e3729a30086f02cf5716ce2a080071669d03 (diff)
downloadFreeBSD-src-a9f745a7804ab5158b27da8d1760caf079f1c6d9.zip
FreeBSD-src-a9f745a7804ab5158b27da8d1760caf079f1c6d9.tar.gz
- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
of Sun Fire V1280 doesn't round up the size itself but instead lets claiming of non page-sized amounts of memory fail. - Change parameters and variables related to the TLB slots to unsigned which is more appropriate. - Search the whole OFW device tree instead of only the children of the root nexus device for the BSP as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. - Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Check the return value of init_heap(). This requires moving it after cons_probe() so we can panic when appropriate. This should be fine as the PowerPC OFW loader uses that order for quite some time now.
Diffstat (limited to 'sys/sparc64/include')
-rw-r--r--sys/sparc64/include/asi.h20
-rw-r--r--sys/sparc64/include/cmt.h39
-rw-r--r--sys/sparc64/include/fireplane.h40
-rw-r--r--sys/sparc64/include/jbus.h39
4 files changed, 132 insertions, 6 deletions
diff --git a/sys/sparc64/include/asi.h b/sys/sparc64/include/asi.h
index 9371378..90dc3f3 100644
--- a/sys/sparc64/include/asi.h
+++ b/sys/sparc64/include/asi.h
@@ -33,7 +33,7 @@
#define _MACHINE_ASI_H_
/*
- * Standard v9 asis
+ * Standard v9 ASIs
*/
#define ASI_N 0x4
#define ASI_NL 0xc
@@ -51,7 +51,7 @@
#define ASI_SNFL 0x8b
/*
- * UltraSPARC extensions. ASIs limited to a certain family are annotated.
+ * UltraSPARC extensions - ASIs limited to a certain family are annotated.
*/
#define ASI_PHYS_USE_EC 0x14
#define ASI_PHYS_BYPASS_EC_WITH_EBIT 0x15
@@ -91,9 +91,12 @@
#define ASI_INTR_RECEIVE 0x49
#define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */
-#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III Cu */
-#define AA_FIREPLANE_CONFIG 0x0 /* US-III Cu */
-#define AA_FIREPLANE_ADDRESS 0x8 /* US-III Cu */
+#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */
+#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */
+#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */
+#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */
+
+#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */
#define ASI_ESTATE_ERROR_EN_REG 0x4b
#define AA_ESTATE_CEEN 0x1
@@ -153,6 +156,11 @@
#define ASI_IIU_INST_TRAP 0x60 /* US-III family */
+#define ASI_INTR_ID 0x63 /* US-IV{,+} */
+#define AA_INTR_ID 0x0 /* US-IV{,+} */
+#define AA_CORE_ID 0x10 /* US-IV{,+} */
+#define AA_CESR_ID 0x40 /* US-IV{,+} */
+
#define ASI_ICACHE_INSTR 0x66
#define ASI_ICACHE_TAG 0x67
#define ASI_ICACHE_SNOOP_TAG 0x68 /* US-III family */
@@ -179,7 +187,7 @@
/*
* With the advent of the US-III, the numbering has changed, as additional
- * registers were inserted in between. We retain the original ordering for
+ * registers were inserted in between. We retain the original ordering for
* now, and append an A to the inserted registers.
* Exceptions are AA_SDB_INTR_D6 and AA_SDB_INTR_D7, which were appended
* at the end.
diff --git a/sys/sparc64/include/cmt.h b/sys/sparc64/include/cmt.h
new file mode 100644
index 0000000..cdeed29
--- /dev/null
+++ b/sys/sparc64/include/cmt.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2010 Marius Strobl <marius@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_CMT_H_
+#define _MACHINE_CMT_H_
+
+#define INTR_ID_ID_SHIFT (0)
+#define INTR_ID_ID_SIZE (10)
+#define INTR_ID_ID_MASK \
+ (((1 << INTR_ID_ID_SIZE) - 1) << INTR_ID_ID_SHIFT)
+
+#define INTR_ID_GET_ID(cr) ((cr & INTR_ID_ID_MASK) >> INTR_ID_ID_SHIFT)
+
+#endif /* _MACHINE_CMT_H_ */
diff --git a/sys/sparc64/include/fireplane.h b/sys/sparc64/include/fireplane.h
new file mode 100644
index 0000000..8348954
--- /dev/null
+++ b/sys/sparc64/include/fireplane.h
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2010 Marius Strobl <marius@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_FIREPLANE_H_
+#define _MACHINE_FIREPLANE_H_
+
+#define FIREPLANE_CR_AID_SHIFT (17)
+#define FIREPLANE_CR_AID_SIZE (10)
+#define FIREPLANE_CR_AID_MASK \
+ (((1 << FIREPLANE_CR_AID_SIZE) - 1) << FIREPLANE_CR_AID_SHIFT)
+
+#define FIREPLANE_CR_GET_AID(cr) \
+ ((cr & FIREPLANE_CR_AID_MASK) >> FIREPLANE_CR_AID_SHIFT)
+
+#endif /* _MACHINE_FIREPLANE_H_ */
diff --git a/sys/sparc64/include/jbus.h b/sys/sparc64/include/jbus.h
new file mode 100644
index 0000000..09c93b4
--- /dev/null
+++ b/sys/sparc64/include/jbus.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2010 Marius Strobl <marius@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_JBUS_H_
+#define _MACHINE_JBUS_H_
+
+#define JBUS_CR_JID_SHIFT (17)
+#define JBUS_CR_JID_SIZE (3)
+#define JBUS_CR_JID_MASK \
+ (((1 << JBUS_CR_JID_SIZE) - 1) << JBUS_CR_JID_SHIFT)
+
+#define JBUS_CR_GET_JID(cr) ((cr & JBUS_CR_JID_MASK) >> JBUS_CR_JID_SHIFT)
+
+#endif /* _MACHINE_JBUS_H_ */
OpenPOWER on IntegriCloud