From 560106553412bfbb0351c1a7644a95b7c04c332d Mon Sep 17 00:00:00 2001 From: spashabk-in Date: Tue, 5 Dec 2017 11:36:37 -0600 Subject: [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 Tested-by: FSP CI Jenkins Reviewed-by: Sachin Gupta --- src/sbefw/app/power/Makefile | 63 +++++++ src/sbefw/app/power/apppowerfiles.mk | 36 ++++ src/sbefw/app/power/chipop_table.C | 317 +++++++++++++++++++++++++++++++++++ src/sbefw/app/power/sbeapp.C | 34 ++++ 4 files changed, 450 insertions(+) create mode 100644 src/sbefw/app/power/Makefile create mode 100644 src/sbefw/app/power/apppowerfiles.mk create mode 100644 src/sbefw/app/power/chipop_table.C create mode 100644 src/sbefw/app/power/sbeapp.C (limited to 'src/sbefw/app/power') diff --git a/src/sbefw/app/power/Makefile b/src/sbefw/app/power/Makefile new file mode 100644 index 00000000..a366531a --- /dev/null +++ b/src/sbefw/app/power/Makefile @@ -0,0 +1,63 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/sbefw/app/power/Makefile $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2016,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 +#export P2P_ENABLE = 1 + +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)/, $(APPPOWERSEEPROM_OBJECTS)) +LIBNAME = libsbeapppowerseeprom +endif + +include img_defs.mk +include apppowerfiles.mk + +$(LIBNAME).a: $(OBJS) + $(AR) crs $(OBJDIR)/$(LIBNAME).a $(OBJDIR)/*.o + +.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) + +ifneq ($(MAKECMDGOALS),clean) +include $(OBJS:.o=.d) +endif + + + + + diff --git a/src/sbefw/app/power/apppowerfiles.mk b/src/sbefw/app/power/apppowerfiles.mk new file mode 100644 index 00000000..531c8787 --- /dev/null +++ b/src/sbefw/app/power/apppowerfiles.mk @@ -0,0 +1,36 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/sbefw/app/power/apppowerfiles.mk $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2015,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 +APPPOWERPIBMEM-CPP-SOURCES = chipop_table.C + +APPPOWERPIBMEM-C-SOURCES = +APPPOWERPIBMEM-S-SOURCES = + +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/power/sbeapp.C b/src/sbefw/app/power/sbeapp.C new file mode 100644 index 00000000..569a0955 --- /dev/null +++ b/src/sbefw/app/power/sbeapp.C @@ -0,0 +1,34 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/sbefw/app/power/sbeapp.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 */ +#ifndef __SBEFW_SEEPROM__ +void helloWorld() +{ +} +#endif + +#ifdef __SBEFW_SEEPROM__ +void helloWorldSeeprom() +{ +} +#endif -- cgit v1.2.1