diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2012-08-30 12:05:09 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-09-04 17:04:05 -0500 |
| commit | d94559078015ade8301370c54ccd8773f666fec1 (patch) | |
| tree | b7c6c38671118abf1ac87b5b077850b27c5e1447 | |
| parent | 2e8754b467914eb554a886317b88a3a654e0f58d (diff) | |
| download | talos-hostboot-d94559078015ade8301370c54ccd8773f666fec1.tar.gz talos-hostboot-d94559078015ade8301370c54ccd8773f666fec1.zip | |
Write scratch register in start_payload / shutdown.
Change-Id: I47a8ad7914c6833c476a7944be5d352f45467f3a
RTC: 47725
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1646
Tested-by: Jenkins Server
Reviewed-by: Mark W. Wenning <wenning@us.ibm.com>
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
| -rw-r--r-- | src/include/kernel/ppcconsts.S | 46 | ||||
| -rw-r--r-- | src/include/sys/mmio.h | 50 | ||||
| -rw-r--r-- | src/kernel/shutdown.S | 6 | ||||
| -rw-r--r-- | src/kernel/start.S | 30 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 6 |
5 files changed, 87 insertions, 51 deletions
diff --git a/src/include/kernel/ppcconsts.S b/src/include/kernel/ppcconsts.S index 8b84e9135..d888e497e 100644 --- a/src/include/kernel/ppcconsts.S +++ b/src/include/kernel/ppcconsts.S @@ -1,25 +1,25 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/include/kernel/ppcconsts.S $ -# -# IBM CONFIDENTIAL -# -# COPYRIGHT International Business Machines Corp. 2010-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/include/kernel/ppcconsts.S $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2010,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 #*--------------------------------------------------------------------*# #* Register Constants *# #*--------------------------------------------------------------------*# @@ -148,6 +148,8 @@ .set SPRG1,273 .set SPRG2,274 .set SPRG3,275 + .set SPRC,276 + .set SPRD,277 .set EAR,282 .set TBL,284 .set TBU,285 diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h index e5537f016..a00f124a1 100644 --- a/src/include/sys/mmio.h +++ b/src/include/sys/mmio.h @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/include/sys/mmio.h $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2010-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/include/sys/mmio.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2010,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 __SYS_MMIO_H #define __SYS_MMIO_H @@ -97,8 +96,9 @@ enum MMIO_Scratch_Register MMIO_SCRATCH_RSVD_T5 = 0x28, /** Thread6 Scratch Register - Unused */ MMIO_SCRATCH_RSVD_T6 = 0x30, - /** Thread7 Scratch Register - Unused */ - MMIO_SCRATCH_RSVD_T7 = 0x38, + /** Thread7 Scratch Register - Identifies if Hostboot is active after + * host_start_payload. */ + MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x38, }; /** @fn mmio_scratch_read() diff --git a/src/kernel/shutdown.S b/src/kernel/shutdown.S index 30a81ea46..2e03a58a7 100644 --- a/src/kernel/shutdown.S +++ b/src/kernel/shutdown.S @@ -154,6 +154,12 @@ kernel_shutdown_ea0_1_mode: isync ;// Raise thread priority and leave ourselves. or 3,3,3 + ;// Clear "Hostboot active" scratch register. + li r3, (0x40 + 0x38) ;// See sys/mmio.h + mtspr SPRC, r3 + li r3, 0x0 + mtspr SPRD, r3 + b 2b .section .data diff --git a/src/kernel/start.S b/src/kernel/start.S index fd15697f5..d7d4ec202 100644 --- a/src/kernel/start.S +++ b/src/kernel/start.S @@ -1,3 +1,25 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/kernel/start.S $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2010,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 /* IBM_PROLOG_BEGIN_TAG * This is an automatically generated prolog. * @@ -676,9 +698,9 @@ system_call_fast_path: extrdi. r6, r6, 1, CPU_STATUS_MASTER beq cr0, 300f ;// Call TASK_MIGRATE_TO_MASTER if not on master. ;// Read scratch. - mtspr 276, r4 + mtspr SPRC, r4 isync - mfspr r3, 277 + mfspr r3, SPRD b 1f ;// Jump to exit point. ;// Migrate task via TASK_MIGRATE_TO_MASTER 300: @@ -703,9 +725,9 @@ system_call_fast_path: extrdi. r6, r6, 1, CPU_STATUS_MASTER beq cr0, 300b ;// Call TASK_MIGRATE_TO_MASTER if not on master. ;// Write scratch. - mtspr 276, r4 + mtspr SPRC, r4 isync - mtspr 277, r5 + mtspr SPRD, r5 b 1f ;// Jump to exit point. ;// Invalid system call, loop for debug. 5: diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index 50de5afcf..772c84c53 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -46,6 +46,7 @@ #include <usr/cxxtest/TestSuite.H> #include <hwpf/istepreasoncodes.H> #include <sys/time.h> +#include <sys/mmio.h> #include <mbox/mbox_queues.H> #include <mbox/mboxif.H> @@ -163,6 +164,11 @@ errlHndl_t callShutdown ( void ) do { + // Set scratch register to indicate Hostboot is [still] active. + const char * hostboot_string = "hostboot"; + mmio_scratch_write(MMIO_SCRATCH_HOSTBOOT_ACTIVE, + *reinterpret_cast<const uint64_t*>(hostboot_string)); + // Get Target Service, and the system target. TargetService& tS = targetService(); TARGETING::Target* sys = NULL; |

