summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2014-07-17 07:52:24 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-07-22 13:59:18 -0500
commit31615f402551eaa9d77b94d2c79ed5110e825e85 (patch)
treeafe745ef8b864d484531e0f1d00c51da8b954baf
parent4f25725547a88037201b86487a1415f4dcdce13e (diff)
downloadtalos-hostboot-31615f402551eaa9d77b94d2c79ed5110e825e85.tar.gz
talos-hostboot-31615f402551eaa9d77b94d2c79ed5110e825e85.zip
Populate actual PVR value instead of architected version
Change-Id: I5d19166fe949394fae536f5165ce6138be7f820b Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/12277 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/kernel/syscalls.H6
-rw-r--r--src/include/sys/mmio.h10
-rw-r--r--src/kernel/start.S15
-rw-r--r--src/lib/syscall_mmio.C9
-rw-r--r--src/usr/devtree/bld_devtree.C6
5 files changed, 37 insertions, 9 deletions
diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H
index 0bbd7737d..951f55fac 100644
--- a/src/include/kernel/syscalls.H
+++ b/src/include/kernel/syscalls.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -138,6 +140,8 @@ namespace Systemcalls
MMIO_SCRATCH_READ = 0x0802,
/** mmio_scratch_write() */
MMIO_SCRATCH_WRITE = 0x0803,
+ /** mmio_pvr_read() */
+ MMIO_PVR_READ = 0x0804,
SYSCALL_FASTPATH_MAX
};
diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h
index 617c21460..4de734266 100644
--- a/src/include/sys/mmio.h
+++ b/src/include/sys/mmio.h
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -56,6 +58,12 @@ void* mmio_dev_map(void *ra, uint64_t i_devDataSize);
*/
int mmio_dev_unmap(void *ea);
+/** @fn mmio_pvr_read()
+ * @brief Reads and returns protected PVR register.
+ * @return PVR register value
+ */
+uint64_t mmio_pvr_read();
+
/** @fn mmio_hmer_read()
* @brief Reads and returns protected HMER register.
* @return HMER register value
diff --git a/src/kernel/start.S b/src/kernel/start.S
index 008270b94..6474a2ced 100644
--- a/src/kernel/start.S
+++ b/src/kernel/start.S
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2010,2014
+# Contributors Listed Below - COPYRIGHT 2010,2014
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -702,6 +704,7 @@ intvect_system_reset_external:
;// 0x801 = HMER write (r4 -> HMER).
;// 0x802 = SCRATCH read (r4 -> SPRC, SPRD -> r3).
;// 0x803 = SCRATCH write (r4 -> SPRC, r5 -> SPRD).
+ ;// 0x804 = PVR read (PVR -> r3).
system_call_fast_path:
;// Check if this is HMER read (0x800).
;// Compare was already done in system call path.
@@ -765,9 +768,15 @@ system_call_fast_path:
isync
mtspr SPRD, r5
b 1f ;// Jump to exit point.
- ;// Invalid system call, loop for debug.
+ ;// Check if this is PVR read (0x804).
5:
- b 5b
+ cmpi cr0, r3, 0x804
+ bne cr0, 6f
+ mfspr r3, PVR
+ b 1f ;// Jump to exit point.
+ ;// Invalid system call, loop for debug.
+6:
+ b 6b
1:
rfid ;// Return from interrupt.
diff --git a/src/lib/syscall_mmio.C b/src/lib/syscall_mmio.C
index a15b1c9b4..541528e3b 100644
--- a/src/lib/syscall_mmio.C
+++ b/src/lib/syscall_mmio.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -39,6 +41,11 @@ int mmio_dev_unmap(void *ea)
return (int64_t) _syscall1(DEV_UNMAP, ea);
}
+uint64_t mmio_pvr_read()
+{
+ return (uint64_t) _syscall0(MMIO_PVR_READ);
+}
+
uint64_t mmio_hmer_read()
{
return (uint64_t) _syscall0(MMIO_HMER_READ);
diff --git a/src/usr/devtree/bld_devtree.C b/src/usr/devtree/bld_devtree.C
index 9bb36f7ca..c77e713bc 100644
--- a/src/usr/devtree/bld_devtree.C
+++ b/src/usr/devtree/bld_devtree.C
@@ -337,9 +337,9 @@ uint32_t bld_cpu_node(devTree * i_dt, dtOffset_t & i_parentNode,
i_dt->addPropertyCells32(cpuNode, "ibm,ppc-interrupt-server#s",
interruptServerNum, numThreads);
- /* This is the "architected processor version" as defined in PAPR. Just
- * stick to 0x0f000004 for P8 and things will be fine */
- i_dt->addPropertyCell32(cpuNode, "cpu-version", 0x0f000004);
+ /* Fill in the actual PVR of chip -- it is only a 32 bit reg*/
+ uint32_t l_pvr = mmio_pvr_read() & 0xFFFFFFFF;
+ i_dt->addPropertyCell32(cpuNode, "cpu-version", l_pvr);
i_dt->addPropertyCells32(cpuNode, "ibm,processor-segment-sizes",
segmentSizes,
OpenPOWER on IntegriCloud