diff options
author | Stephan Broyles <sbroyles@us.ibm.com> | 2014-12-10 11:55:46 -0600 |
---|---|---|
committer | Stephan Broyles <sbroyles@us.ibm.com> | 2014-12-10 11:56:52 -0600 |
commit | f95898d98e3bee8c01bce29b70269a06af974916 (patch) | |
tree | d7ef1fda69a2e47a35e210e786b540020520df30 /src/occ/gpe | |
parent | ca821385a28b843d3934fd3e0face1da7e2183c8 (diff) | |
download | talos-occ-f95898d98e3bee8c01bce29b70269a06af974916.tar.gz talos-occ-f95898d98e3bee8c01bce29b70269a06af974916.zip |
More gpe macro cleanup.
Change-Id: Ia12ee1ad2c4cfb98f3094b8e5e0745b9e63e0d15
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14838
Reviewed-by: Stephan Broyles <sbroyles@us.ibm.com>
Tested-by: Stephan Broyles <sbroyles@us.ibm.com>
Diffstat (limited to 'src/occ/gpe')
-rwxr-xr-x | src/occ/gpe/gpe_macros.h | 163 | ||||
-rwxr-xr-x | src/occ/gpe/pss_macros.h | 28 |
2 files changed, 87 insertions, 104 deletions
diff --git a/src/occ/gpe/gpe_macros.h b/src/occ/gpe/gpe_macros.h index ef9d0ca..9a34f98 100755 --- a/src/occ/gpe/gpe_macros.h +++ b/src/occ/gpe/gpe_macros.h @@ -26,30 +26,30 @@ #ifndef _GPE_MACROS_H #define _GPE_MACROS_H - //-------------------------------------------------------------------- - // Macro Specification: - // - // Name: _saveffdc - // - // Description: Save FFDC into error structure - // - // struct { - // uint64_t rc; // This should be read as 63:32=addr, 31:0=rc - // uint64_t ffdc; // Whatever GPE program puts in for FFDC data - // } PoreGpeErrorStruct; - // - // - Copy D0 into PoreGpeErrorStruct->ffdc - // - Copy \gpe_id into PoreGpeErrorStruct->rc[63:32] - // - Copy \rc into PoreGpeErrorStruct->rc[31:0] - // - // Inputs: \gpe_id - Unique GPE program number to identify what prog failed - // \rc - Unique GPE error code that will indicate failure - // ETR - Assumed to be set to base address of - // passed argument structure - // - // End Macro Specification - //-------------------------------------------------------------------- - .macro _saveffdc, gpe_id, rc +//-------------------------------------------------------------------- +// Macro Specification: +// +// Name: _saveffdc +// +// Description: Save FFDC into error structure +// +// struct { +// uint64_t rc; // This should be read as 63:32=addr, 31:0=rc +// uint64_t ffdc; // Whatever GPE program puts in for FFDC data +// } PoreGpeErrorStruct; +// +// - Copy D0 into PoreGpeErrorStruct->ffdc +// - Copy \gpe_id into PoreGpeErrorStruct->rc[63:32] +// - Copy \rc into PoreGpeErrorStruct->rc[31:0] +// +// Inputs: \gpe_id - Unique GPE program number to identify what prog failed +// \rc - Unique GPE error code that will indicate failure +// ETR - Assumed to be set to base address of +// passed argument structure +// +// End Macro Specification +//-------------------------------------------------------------------- +.macro _saveffdc, gpe_id, rc // Make sure passed Structure Pointer is loaded into A1 mr A1, ETR @@ -86,71 +86,66 @@ ld D0, 0, A1 1: - .endm - - - //-------------------------------------------------------------------- - // Macro Specification: - // - // Name: _getscom - // - // Description: Get a SCOM based on passed in Address, put it in D0 - // - // Inputs: SCOM Address - // - // Outputs: D0 - Result of SCOM - // - // End Macro Specification - //-------------------------------------------------------------------- - .macro _getscom, address +.endm + + +//-------------------------------------------------------------------- +// Macro Specification: +// +// Name: _getscom +// +// Description: Get a SCOM based on passed in Address, put it in D0 +// +// Inputs: SCOM Address +// +// Outputs: D0 - Result of SCOM +// +// End Macro Specification +//-------------------------------------------------------------------- +.macro _getscom, address lpcs P0, \address - ld D0, \address, P0 - - .endm - - //-------------------------------------------------------------------- - // Macro Specification: - // - // Name: _putscom - // - // Description: Store data into SCOM based on passed in Address - // - // Inputs: SCOM Address, Data - // - // Outputs: None - // - // End Macro Specification - //-------------------------------------------------------------------- - .macro _putscom, address, data - + ld D0, \address, P0 +.endm + +//-------------------------------------------------------------------- +// Macro Specification: +// +// Name: _putscom +// +// Description: Store data into SCOM based on passed in Address +// +// Inputs: SCOM Address, Data +// +// Outputs: None +// +// End Macro Specification +//-------------------------------------------------------------------- +.macro _putscom, address, data lpcs P0, \address - li D0, \data - std D0, \address, P0 - - .endm - - //-------------------------------------------------------------------- - // Macro Specification: - // - // Name: _putscom_d0 - // - // Description: Store D0 into SCOM based on passed in Address - // - // Inputs: SCOM Address - // - // Outputs: None - // - // End Macro Specification - //-------------------------------------------------------------------- - .macro _putscom_d0, address - + li D0, \data + std D0, \address, P0 +.endm + +//-------------------------------------------------------------------- +// Macro Specification: +// +// Name: _putscom_d0 +// +// Description: Store D0 into SCOM based on passed in Address +// +// Inputs: SCOM Address +// +// Outputs: None +// +// End Macro Specification +//-------------------------------------------------------------------- +.macro _putscom_d0, address lpcs P0, \address - std D0, \address, P0 - - .endm + std D0, \address, P0 +.endm -#define TOD_VALUE_REG 0x00040020 +#define TOD_VALUE_REG 0x00040020 // Constant for use in wait statments: waits (5 * MICROSECONDS) #define MICROSECONDS 600 diff --git a/src/occ/gpe/pss_macros.h b/src/occ/gpe/pss_macros.h index 163ab9d..9de29be 100755 --- a/src/occ/gpe/pss_macros.h +++ b/src/occ/gpe/pss_macros.h @@ -43,12 +43,9 @@ // // Modifies: CTR, D0, D1 //-------------------------------------------------------------------- - - .macro _wait_for_spi_ops_complete, timeout, timeout_label - +.macro _wait_for_spi_ops_complete, timeout, timeout_label _wait_for_ops_complete SPIPSS_P2S_STATUS_REG, \timeout, \timeout_label - - .endm +.endm //-------------------------------------------------------------------- @@ -68,13 +65,9 @@ // // Modifies: CTR, D0, D1 //-------------------------------------------------------------------- - - .macro _wait_for_adc_ops_complete, timeout, timeout_label - +.macro _wait_for_adc_ops_complete, timeout, timeout_label _wait_for_ops_complete SPIPSS_ADC_STATUS_REG, \timeout, \timeout_label - - - .endm +.endm //-------------------------------------------------------------------- @@ -95,9 +88,7 @@ // // Modifies: CTR, D0, D1 //-------------------------------------------------------------------- - - .macro _wait_for_ops_complete, register, timeout, timeout_label - +.macro _wait_for_ops_complete, register, timeout, timeout_label // Load CTR with approximate timeout value (1usec delay per retry) li CTR, (\timeout - 1) 1: @@ -120,13 +111,10 @@ // Timeout waiting for spiadc_p2s_ongoing bra \timeout_label 2: - .endm +.endm - -// TODO: Subroutine would be more efficient than macro, however: -// Subroutines do not currently clear the stack after a halt -// so we can NOT use subroutine (SCOM error, branch on fail, etc..) +// TODO Clean this up if it isn't required #if 0 //-------------------------------------------------------------------- // Name: sub_wait_for_spi_ops_complete (SUBROUTINE) @@ -171,4 +159,4 @@ ops_are_complete: #endif #endif //_PSS_MACROS_H - + |