summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2012-09-10 16:05:01 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-09 17:10:32 -0500
commit1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39 (patch)
treec266815232142e67f15a61ffcbdf09407737f259 /src/usr
parentfb1836fd7b1b8839815595db08ae740ec7b86347 (diff)
downloadtalos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.tar.gz
talos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.zip
Extend VMM to 32M
Add mmLinearMap to create block at a specified phys addr. Added iv_MaptoPhy in the block to indicate we are physically mapped block and to not apply the HRMOR. Change-Id: I75ddb19b82ae9a2035ff873edff8a34a33c74639 RTC:43401 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1846 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwpf/hwp/dram_initialization/dram_initialization.C35
-rw-r--r--src/usr/testcore/kernel/segmenttest.H90
2 files changed, 100 insertions, 25 deletions
diff --git a/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C b/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
index a20c31edc..0fb777893 100644
--- a/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
+++ b/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
@@ -68,11 +68,13 @@
#include "proc_setup_bars/proc_setup_bars.H"
// #include "proc_pcie_config/proc_pcie_config.H"
#include "proc_exit_cache_contained/proc_exit_cache_contained.H"
-
+#include <hwpf/plat/fapiPlatReasonCodes.H>
//remove these once memory setup workaround is removed
#include <devicefw/driverif.H>
#include <spd/spdenums.H>
#include <sys/time.h>
+#include <sys/mm.h>
+
namespace DRAM_INITIALIZATION
{
@@ -558,6 +560,7 @@ void call_proc_exit_cache_contained( void *io_pArgs )
// figure out what targets we need
// customize any other inputs
// set up loops to go through all targets (if parallel, spin off a task)
+ // extend the memory space from 8MEG to 32Meg
// call the HWP with each fapi::Target
FAPI_INVOKE_HWP( l_errl,
@@ -574,11 +577,39 @@ void call_proc_exit_cache_contained( void *io_pArgs )
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : call_proc_exit_cache_contained" );
}
- // @@@@@ END CUSTOM BLOCK: @@@@@
+
+
+ // Call the function to extend VMM to 32MEG
+ int rc = mm_extend();
+
+ if (rc!=0)
+ {
+ /*@
+ * @errortype
+ * @moduleid fapi::MOD_EXIT_CACHE_CONTAINED
+ * @reasoncode fapi::RC_MM_EXTEND_FAILED
+ * @userdata1 rc from mm_extend
+ * @userdata2 <UNUSED>
+ *
+ * @devdesc Failure extending memory to 32MEG after
+ * exiting cache contained mode.
+ */
+ l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_EXIT_CACHE_CONTAINED,
+ fapi::RC_MM_EXTEND_FAILED,
+ rc,
+ 0);
+
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR : call_proc_exit_cache_contained - extendVMM, rc=0x%x",
+ rc );
+ }
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_proc_exit_cache_contained exit" );
+ // @@@@@ END CUSTOM BLOCK: @@@@@
+
// end task, returning any errorlogs to IStepDisp
task_end2( l_errl );
}
diff --git a/src/usr/testcore/kernel/segmenttest.H b/src/usr/testcore/kernel/segmenttest.H
index 72ae8f23a..478f63657 100644
--- a/src/usr/testcore/kernel/segmenttest.H
+++ b/src/usr/testcore/kernel/segmenttest.H
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/testcore/kernel/segmenttest.H $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2011-2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/testcore/kernel/segmenttest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __SEGMENTTEST_H
#define __SEGMENTTEST_H
/**
@@ -112,6 +111,51 @@ class segmenttest: public CxxTest::TestSuite
}
}
+ // Create 2 blocks at different specified address's and sizes and direct
+ // map this.
+ void testSegLinearBlock()
+ {
+ int rc = -1;
+ uint64_t phys = 0;
+ uint64_t addr = 0x8000000 - 0x5000; //128M- 16K
+ uint64_t size = 0x1000; //4K
+
+ rc = mm_linear_map(reinterpret_cast<void*>(addr),size);
+ if (rc != 0)
+ {
+ TS_FAIL("Failed to create BaseSegment block\n");
+ }
+
+ phys = mm_virt_to_phys( reinterpret_cast<void*>(addr) );
+
+ if( phys != addr )
+ {
+ TS_TRACE( "Block> virt=%lX, phys=%lX", &addr, phys );
+ TS_FAIL("Unexpected Physical Address for block.");
+ }
+
+
+ uint64_t addr2 = 0x8000000 - 0x3000; //128M- 12k
+ uint64_t size2 = 0x3000; //12K
+
+ rc = mm_linear_map(reinterpret_cast<void*>(addr2),size2);
+
+ if (rc != 0)
+ {
+ TS_FAIL("Failed to create BaseSegment block\n");
+ }
+
+ phys = mm_virt_to_phys( reinterpret_cast<void*>(addr2) );
+
+ if( phys != addr2 )
+ {
+ TS_TRACE( "Block> virt=%lX, phys=%lX", &addr2, phys );
+ TS_FAIL("Unexpected Physical Address for block.");
+
+ }
+
+ }
+
};
#endif
OpenPOWER on IntegriCloud