summaryrefslogtreecommitdiffstats
path: root/src/sbefw/app
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2017-12-05 11:36:37 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2018-01-03 01:19:39 -0500
commit560106553412bfbb0351c1a7644a95b7c04c332d (patch)
treed0ffce81f502e3a4913882510d387da8e12cf69e /src/sbefw/app
parent819a606d9c583ccfa1ca7852a4bae42efb5da53e (diff)
downloadtalos-sbe-560106553412bfbb0351c1a7644a95b7c04c332d.tar.gz
talos-sbe-560106553412bfbb0351c1a7644a95b7c04c332d.zip
[SBE-code-re-org][2] Chip-op handler code
Separate chip-op handler and chip-op table to make it project specific Change-Id: I3ff0e83b199172ce0c0fcb49a980a0076ad778a7 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50504 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw/app')
-rw-r--r--src/sbefw/app/Makefile56
-rw-r--r--src/sbefw/app/power/Makefile (renamed from src/sbefw/app/MakefileSeeprom)32
-rw-r--r--src/sbefw/app/power/apppowerfiles.mk (renamed from src/sbefw/app/sbeappseepromfiles.mk)19
-rw-r--r--src/sbefw/app/power/chipop_table.C317
-rw-r--r--src/sbefw/app/power/sbeapp.C (renamed from src/sbefw/app/sbeapp.C)4
-rw-r--r--src/sbefw/app/sbeappfiles.mk29
6 files changed, 350 insertions, 107 deletions
diff --git a/src/sbefw/app/Makefile b/src/sbefw/app/Makefile
deleted file mode 100644
index de682146..00000000
--- a/src/sbefw/app/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
-#
-# $Source: src/sbefw/app/Makefile $
-#
-# OpenPOWER sbe Project
-#
-# Contributors Listed Below - COPYRIGHT 2016,2017
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
-#
-# IBM_PROLOG_END_TAG
-#export P2P_ENABLE = 1
-
-export SUB_OBJDIR = /sbefw/app
-
-include img_defs.mk
-include sbeappfiles.mk
-
-OBJS := $(addprefix $(OBJDIR)/, $(SBEAPP_OBJECTS))
-
-libsbeapp.a: $(OBJS)
- $(AR) crs $(OBJDIR)/libsbeapp.a $(OBJDIR)/*.o
-
-.PHONY: clean sbeapp
-sbeapp: $(OBJS)
-
-$(OBJS) $(OBJS:.o=.d): | $(OBJDIR)
-
-$(OBJDIR):
- mkdir -p $(OBJDIR)
-
-
-#clean the kernel directory first, then the application level clean
-clean:
- rm -fr $(OBJDIR)
-
-ifneq ($(MAKECMDGOALS),clean)
-include $(OBJS:.o=.d)
-endif
-
-
-
-
-
diff --git a/src/sbefw/app/MakefileSeeprom b/src/sbefw/app/power/Makefile
index 905121bb..a366531a 100644
--- a/src/sbefw/app/MakefileSeeprom
+++ b/src/sbefw/app/power/Makefile
@@ -1,12 +1,11 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/sbeapp/Makefile $
+# $Source: src/sbefw/app/power/Makefile $
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2017
-# [+] International Business Machines Corp.
+# Contributors Listed Below - COPYRIGHT 2016,2018
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,27 +23,32 @@
# IBM_PROLOG_END_TAG
#export P2P_ENABLE = 1
-export SUB_OBJDIR = /sbefw/appseeprom
-
-include img_defs.mk
-include sbeappseepromfiles.mk
-
+ifneq ($(img_mem), seeprom)
+export SUB_OBJDIR = /sbefw/app/power_pibmem
+OBJS = $(addprefix $(OBJDIR)/, $(APPPOWERPIBMEM_OBJECTS))
+LIBNAME = libsbeapppowerpibmem
+else
+export SUB_OBJDIR = /sbefw/app/power_seeprom
GCC-CFLAGS += -mlongcall
GCC-DEFS += -D__SBEFW_SEEPROM__=1
-OBJS := $(addprefix $(OBJDIR)/, $(SBEAPPSEEPROM_OBJECTS))
+OBJS = $(addprefix $(OBJDIR)/, $(APPPOWERSEEPROM_OBJECTS))
+LIBNAME = libsbeapppowerseeprom
+endif
-libsbeappseeprom.a: $(OBJS)
- $(AR) crs $(OBJDIR)/libsbeappseeprom.a $(OBJDIR)/*.o
+include img_defs.mk
+include apppowerfiles.mk
+
+$(LIBNAME).a: $(OBJS)
+ $(AR) crs $(OBJDIR)/$(LIBNAME).a $(OBJDIR)/*.o
-.PHONY: clean sbeappseeprom
-sbeappseeprom: $(OBJS)
+.PHONY: clean sbeapppower
+sbeapppower: $(OBJS)
$(OBJS) $(OBJS:.o=.d): | $(OBJDIR)
$(OBJDIR):
mkdir -p $(OBJDIR)
-
#clean the kernel directory first, then the application level clean
clean:
rm -fr $(OBJDIR)
diff --git a/src/sbefw/app/sbeappseepromfiles.mk b/src/sbefw/app/power/apppowerfiles.mk
index b79a1cd1..531c8787 100644
--- a/src/sbefw/app/sbeappseepromfiles.mk
+++ b/src/sbefw/app/power/apppowerfiles.mk
@@ -1,11 +1,11 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/sbefw/app/sbeappseepromfiles.mk $
+# $Source: src/sbefw/app/power/apppowerfiles.mk $
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2018
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,9 +21,16 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-SBEAPPSEEPROM-CPP-SOURCES = sbeapp.C
+APPPOWERPIBMEM-CPP-SOURCES = chipop_table.C
-SBEAPPSEEPROM-C-SOURCES =
-SBEAPPSEEPROM-S-SOURCES =
+APPPOWERPIBMEM-C-SOURCES =
+APPPOWERPIBMEM-S-SOURCES =
-SBEAPPSEEPROM_OBJECTS = $(SBEAPPSEEPROM-C-SOURCES:.c=.o) $(SBEAPPSEEPROM-CPP-SOURCES:.C=.o) $(SBEAPPSEEPROM-S-SOURCES:.S=.o)
+APPPOWERPIBMEM_OBJECTS = $(APPPOWERPIBMEM-C-SOURCES:.c=.o) $(APPPOWERPIBMEM-CPP-SOURCES:.C=.o) $(APPPOWERPIBMEM-S-SOURCES:.S=.o)
+
+APPPOWERSEEPROM-CPP-SOURCES = sbeapp.C
+
+APPPOWERSEEPROM-C-SOURCES =
+APPPOWERSEEPROM-S-SOURCES =
+
+APPPOWERSEEPROM_OBJECTS = $(APPPOWERSEEPROM-C-SOURCES:.c=.o) $(APPPOWERSEEPROM-CPP-SOURCES:.C=.o) $(APPPOWERSEEPROM-S-SOURCES:.S=.o)
diff --git a/src/sbefw/app/power/chipop_table.C b/src/sbefw/app/power/chipop_table.C
new file mode 100644
index 00000000..471262fe
--- /dev/null
+++ b/src/sbefw/app/power/chipop_table.C
@@ -0,0 +1,317 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/sbefw/app/power/chipop_table.C $ */
+/* */
+/* OpenPOWER sbe Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "sbecmdscomaccess.H"
+#include "sbecmdiplcontrol.H"
+#include "sbecmdgeneric.H"
+#include "sbecmdmemaccess.H"
+#include "sbecmdregaccess.H"
+#include "sbecmdcntrldmt.H"
+#include "sbecmdringaccess.H"
+#include "sbecmdsram.H"
+#include "sbecmdcntlinst.H"
+#include "sbecmdringaccess.H"
+#include "sbetrace.H"
+#include "sbe_sp_intf.H"
+#include "sbeHostMsg.H"
+#include "sbe_host_intf.H"
+#include "sbestates.H"
+#include "sberegaccess.H"
+#include "sbecmdmpipl.H"
+#include "sbecmdtracearray.H"
+#include "sbecmdCntrlTimer.H"
+#include "sbecmdfastarray.H"
+
+#include "core/chipop_handler.H"
+
+static const uint16_t HARDWARE_FENCED_STATE =
+ SBE_FENCE_AT_CONTINUOUS_IPL|SBE_FENCE_AT_DMT;
+
+static const uint16_t PUT_HARDWARE_FENCED_STATE =
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_MPIPL;
+
+////////////////////////////////////////////////////////////////
+// @brief g_sbeScomCmdArray
+////////////////////////////////////////////////////////////////
+CMD_ARR(
+ A2,
+ {sbeGetScom,
+ SBE_CMD_GETSCOM,
+ HARDWARE_FENCED_STATE,
+ },
+ {sbePutScom,
+ SBE_CMD_PUTSCOM,
+ HARDWARE_FENCED_STATE,
+ },
+ {sbeModifyScom,
+ SBE_CMD_MODIFYSCOM,
+ HARDWARE_FENCED_STATE,
+ },
+ {sbePutScomUnderMask,
+ SBE_CMD_PUTSCOM_MASK,
+ HARDWARE_FENCED_STATE,
+ },
+ {sbeMultiScom,
+ SBE_CMD_MULTISCOM,
+ HARDWARE_FENCED_STATE,
+ }
+)
+
+////////////////////////////////////////////////////////////////
+// @brief g_sbeIplControlCmdArray
+//
+////////////////////////////////////////////////////////////////
+CMD_ARR(
+ A1,
+ {sbeHandleIstep,
+ SBE_CMD_EXECUTE_ISTEP,
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_DUMPING,
+ },
+ {sbeHandleSuspendIO,
+ SBE_CMD_SUSPEND_IO,
+ SBE_FENCE_AT_DUMPING,
+ }
+)
+
+////////////////////////////////////////////////////////////////
+// @brief g_sbeGenericCmdArray
+//
+////////////////////////////////////////////////////////////////
+CMD_ARR(
+ A8,
+ {sbeGetCapabilities,
+ SBE_CMD_GET_SBE_CAPABILITIES,
+ SBE_NO_FENCE,
+ },
+
+ {sbeGetFfdc,
+ SBE_CMD_GET_SBE_FFDC,
+ SBE_NO_FENCE,
+ },
+
+ {sbeFifoQuiesce,
+ SBE_CMD_QUIESCE,
+ SBE_NO_FENCE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeMemoryAccessCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ A4,
+ {sbeGetMem,
+ SBE_CMD_GETMEM,
+ SBE_FENCE_AT_CONTINUOUS_IPL,
+ },
+
+ {sbePutMem,
+ SBE_CMD_PUTMEM,
+ PUT_HARDWARE_FENCED_STATE,
+ },
+
+ {sbeGetOccSram,
+ SBE_CMD_GETSRAM_OCC,
+ HARDWARE_FENCED_STATE,
+ },
+
+ {sbePutOccSram,
+ SBE_CMD_PUTSRAM_OCC,
+ PUT_HARDWARE_FENCED_STATE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeInstructionCntlCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ A7,
+ {sbeCntlInst,
+ SBE_CMD_CONTROL_INSTRUCTIONS,
+ HARDWARE_FENCED_STATE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeRegAccessCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ A5,
+ {sbeGetReg,
+ SBE_CMD_GETREG,
+ HARDWARE_FENCED_STATE,
+ },
+ {sbePutReg,
+ SBE_CMD_PUTREG,
+ PUT_HARDWARE_FENCED_STATE | SBE_FENCE_AT_SECURE_MODE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeMpiplCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ A9,
+ {sbeEnterMpipl,
+ SBE_CMD_MPIPL_ENTER,
+ PUT_HARDWARE_FENCED_STATE|SBE_FENCE_AT_ISTEP|
+ SBE_FENCE_AT_DUMPING,
+ // Allow Fspless system to enter MPIPL
+ // Issue 157287
+ },
+
+ {sbeContinueMpipl,
+ SBE_CMD_MPIPL_CONTINUE,
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_ISTEP|
+ SBE_FENCE_AT_RUNTIME|SBE_FENCE_AT_DUMPING,
+ // Only allowed State is MPIPL
+ },
+
+ {sbeStopClocks,
+ SBE_CMD_MPIPL_STOPCLOCKS,
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_DUMPING,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeRingAccessCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ A3,
+ {sbeGetRing,
+ SBE_CMD_GETRING,
+ SBE_FENCE_AT_CONTINUOUS_IPL|SBE_FENCE_AT_QUIESCE,
+ },
+
+ {sbePutRing,
+ SBE_CMD_PUTRING,
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_QUIESCE,
+ }
+)
+
+////////////////////////////////////////////////////////////////
+// @brief g_sbeArrayAccessCmdArray[]
+//
+////////////////////////////////////////////////////////////////
+CMD_ARR(
+ A6,
+ {sbeControlFastArray,
+ SBE_CMD_CONTROL_FAST_ARRAY,
+ SBE_FENCE_AT_QUIESCE,
+ },
+ {sbeControlTraceArray,
+ SBE_CMD_CONTROL_TRACE_ARRAY,
+ SBE_FENCE_AT_QUIESCE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeCoreStateControlCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ D1,
+ {sbeControlDeadmanTimer,
+ SBE_PSU_CMD_CONTROL_DEADMAN,
+ SBE_FENCE_AT_CONTINUOUS_IPL|SBE_FENCE_AT_QUIESCE|
+ SBE_FENCE_AT_MPIPL|SBE_FENCE_AT_ISTEP|
+ SBE_FENCE_AT_DUMPING,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbeControlTimerCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ D4,
+ {sbeCntrlTimer,
+ SBE_PSU_CMD_CONTROL_TIMER,
+ SBE_FENCE_AT_CONTINUOUS_IPL|SBE_FENCE_AT_QUIESCE|
+ SBE_FENCE_AT_MPIPL|SBE_FENCE_AT_DUMPING,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbePutRingFromImageCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ D3,
+ {sbePutRingFromImagePSU,
+ SBE_PSU_MSG_PUT_RING_FROM_IMAGE,
+ PUT_HARDWARE_FENCED_STATE|SBE_FENCE_AT_QUIESCE,
+ }
+)
+//
+//////////////////////////////////////////////////////////////
+// @brief g_sbePsuGenericCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ D6,
+ {sbeUpdateMemAccessRegion,
+ SBE_PSU_MSG_UPDATE_MEM_REGION,
+ SBE_FENCE_AT_QUIESCE,
+ }
+)
+
+//////////////////////////////////////////////////////////////
+// @brief g_sbePsuGenericCmdArray
+//
+//////////////////////////////////////////////////////////////
+CMD_ARR(
+ D7,
+ {sbeReadMem,
+ SBE_PSU_GENERIC_MSG_READ_SBE_MEM,
+ SBE_NO_FENCE,
+ },
+
+ {sbeSetFFDCAddr,
+ SBE_PSU_GENERIC_MSG_SET_FFDC_ADDR,
+ SBE_NO_FENCE,
+ },
+
+ {sbePsuQuiesce,
+ SBE_PSU_GENERIC_MSG_QUIESCE,
+ SBE_NO_FENCE,
+ },
+
+ {sbeSetSystemFabricMap,
+ SBE_PSU_GENERIC_MSG_SYSTEM_FABRIC_MAP,
+ SBE_NO_FENCE,
+ },
+
+ {sbeStashKeyAddrPair,
+ SBE_PSU_GENERIC_MSG_STASH_MPIPL_CONFIG,
+ SBE_NO_FENCE,
+ }
+)
+
+// Mandatory macro inclusion
+CMD_CLASS_DEFAULT_INTIALISATION
diff --git a/src/sbefw/app/sbeapp.C b/src/sbefw/app/power/sbeapp.C
index 036cd551..569a0955 100644
--- a/src/sbefw/app/sbeapp.C
+++ b/src/sbefw/app/power/sbeapp.C
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/sbefw/app/sbeapp.C $ */
+/* $Source: src/sbefw/app/power/sbeapp.C $ */
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
diff --git a/src/sbefw/app/sbeappfiles.mk b/src/sbefw/app/sbeappfiles.mk
deleted file mode 100644
index 6cfbb542..00000000
--- a/src/sbefw/app/sbeappfiles.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
-#
-# $Source: src/sbefw/app/sbeappfiles.mk $
-#
-# OpenPOWER sbe Project
-#
-# Contributors Listed Below - COPYRIGHT 2015,2017
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
-#
-# IBM_PROLOG_END_TAG
-SBEAPP-CPP-SOURCES = sbeapp.C
-
-SBEAPP-C-SOURCES =
-SBEAPP-S-SOURCES =
-
-SBEAPP_OBJECTS = $(SBEAPP-C-SOURCES:.c=.o) $(SBEAPP-CPP-SOURCES:.C=.o) $(SBEAPP-S-SOURCES:.S=.o)
OpenPOWER on IntegriCloud