summaryrefslogtreecommitdiffstats
path: root/sbe/sbefw
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2016-02-09 22:42:48 -0600
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2016-05-03 07:35:29 -0400
commit1a83cd915cd2be01158eb7016d7f92e1f7c54d80 (patch)
treee95f297d4ad13f058dbf4e80033bbaa77164c00c /sbe/sbefw
parentce2b54ae9458775feac2fab757afadc6817605a8 (diff)
downloadtalos-sbe-1a83cd915cd2be01158eb7016d7f92e1f7c54d80.tar.gz
talos-sbe-1a83cd915cd2be01158eb7016d7f92e1f7c54d80.zip
Single SEEPROM image for SBE
Currently we build seprarate images for PIBMEM and SEEPROM. Later using XIP tools we add pibmem image to seeprom. This activity will create only one image for SEEPROM and PIBMEM RTC: 145589 Change-Id: I5f560afaf310ace539a793ea7c2ce710dcb3fcc1 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/20653 Tested-by: Jenkins Server Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe/sbefw')
-rw-r--r--sbe/sbefw/attr.C100
-rw-r--r--sbe/sbefw/sbecmdcntlinst.C6
-rw-r--r--sbe/sbefw/sbefwfiles.mk1
-rw-r--r--sbe/sbefw/sbemain.C28
-rw-r--r--sbe/sbefw/vector2
5 files changed, 24 insertions, 113 deletions
diff --git a/sbe/sbefw/attr.C b/sbe/sbefw/attr.C
deleted file mode 100644
index f893e625..00000000
--- a/sbe/sbefw/attr.C
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <fapi2.H>
-extern fapi2attr::SystemAttributes_t G_system_attributes;
-extern fapi2attr::ProcChipAttributes_t G_proc_chip_attributes;
-extern fapi2attr::PervAttributes_t G_perv_attributes;
-extern fapi2attr::CoreAttributes_t G_core_attributes;
-extern fapi2attr::EQAttributes_t G_eq_attributes;
-extern fapi2attr::EXAttributes_t G_ex_attributes;
-void initAttrWA()
-{
-////// workaround start
-#ifndef SBE_SEEPROM_FIXED_SECTION
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_SYSTEM_IPL_PHASE=0x1;
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_IS_MPIPL=0x01;
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_PROC_FABRIC_ADDR_BAR_MODE=0x01;
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_MEM_MIRROR_PLACEMENT_POLICY=0x01;
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_SBE_BOOTLOADER_OFFSET=0x01;
-G_system_attributes.fapi2attr::SystemAttributes_t::ATTR_HOSTBOOT_HRMOR_OFFSET=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_FSI=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_PRV=0xF07D;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_N0=0xF03F;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_N1=0xF03F;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_N2=0xF03F;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_N3=0xF01F;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_XB=0xF01D;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_MC01=0xF0FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_MC23=0xF0FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_OB0=0xF1FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_OB1=0;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_OB2=0;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_OB3=0xF1FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_PCI0=0xF1FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_PCI1=0xF0FD;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_PCI2=0xF07D;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ0=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ1=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ2=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ3=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ4=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EQ5=0xF019;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC00=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC01=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC02=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC03=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC04=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC05=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC06=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC07=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC08=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC09=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC10=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC11=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC12=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC13=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC14=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC15=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC16=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC17=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC18=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC19=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC20=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC21=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC22=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PG_EC23=0xF1FF;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_FABRIC_SYSTEM_ID=0x1;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_MC_SYNC_MODE=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_EQ_GARD=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_EC_GARD=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_I2C_BUS_DIV_REF=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_BOOT_FLAGS=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_NODE_POS=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_CHIP_POS=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_BOOT_FREQ=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_NEST_PLL_BUCKET=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_VCS_BOOT_VOLTAGE=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_VDD_BOOT_VOLTAGE=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_FABRIC_CHIP_ID=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_FABRIC_GROUP_ID=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_ADU_XSCOM_BAR_BASE_ADDR=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PROC_SBE_MASTER_CHIP=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PROC_FABRIC_SYSTEM_ID=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PROC_FABRIC_GROUP_ID=0x01;
-G_proc_chip_attributes.fapi2attr::ProcChipAttributes_t::ATTR_PROC_FABRIC_CHIP_ID=0x01;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[0]=0x00;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[1]=0x01;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[2]=0x02;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[3]=0x03;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[4]=0x04;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[5]=0x05;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[6]=0x06;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[7]=0x07;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[8]=0x08;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[9]=0x09;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[10]=0x0A;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[11]=0x0B;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[12]=0x0C;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[13]=0x0D;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[14]=0x0E;
-G_perv_attributes.fapi2attr::PervAttributes_t::ATTR_CHIP_UNIT_POS[15]=0x0F;
-#endif //SBE_SEEPROM_FIXED_SECTION
-}
diff --git a/sbe/sbefw/sbecmdcntlinst.C b/sbe/sbefw/sbecmdcntlinst.C
index 09eb8232..11fd374a 100644
--- a/sbe/sbefw/sbecmdcntlinst.C
+++ b/sbe/sbefw/sbecmdcntlinst.C
@@ -19,6 +19,10 @@ using namespace fapi2;
// This is used to find out the array index in g_control_reg_map in
// p9_thread_control.C
static const uint8_t SINGLE_THREAD_BIT_MASK = 0x08;
+// TODO via RTC 152424
+// Currently all proecdures in core directory are in seeprom.
+// So we have to use function pointer to force a long call.
+p9_thread_control_FP_t threadCntlhwp = &p9_thread_control;
/* @brief Map User Thread Command to Hwp ThreadCommands Enum */
ThreadCommands getThreadCommand(const sbeCntlInstRegMsgHdr_t & i_req)
@@ -111,7 +115,7 @@ uint32_t sbeCntlInst(uint8_t *i_pArg)
do
{
// Call the Procedure
- l_fapiRc = p9_thread_control(
+ l_fapiRc = threadCntlhwp(
l_coreTgt,
(SINGLE_THREAD_BIT_MASK >> l_thread),
l_cmd, l_warnCheck,
diff --git a/sbe/sbefw/sbefwfiles.mk b/sbe/sbefw/sbefwfiles.mk
index 32826a7d..f666bdb6 100644
--- a/sbe/sbefw/sbefwfiles.mk
+++ b/sbe/sbefw/sbefwfiles.mk
@@ -8,7 +8,6 @@ SBEFW-CPP-SOURCES += sbecmdiplcontrol.C
SBEFW-CPP-SOURCES += pool.C
SBEFW-CPP-SOURCES += sbecmdgeneric.C
SBEFW-CPP-SOURCES += sbeFifoMsgUtils.C
-SBEFW-CPP-SOURCES += attr.C
SBEFW-CPP-SOURCES += sbecmdmemaccess.C
SBEFW-CPP-SOURCES += sbeHostUtils.C
SBEFW-CPP-SOURCES += sbecmdcntrldmt.C
diff --git a/sbe/sbefw/sbemain.C b/sbe/sbefw/sbemain.C
index 2f8f43f7..0502c2bf 100644
--- a/sbe/sbefw/sbemain.C
+++ b/sbe/sbefw/sbemain.C
@@ -19,10 +19,6 @@
#include "sbestates.H"
#include "fapi2.H" // For target init
-// TODO via RTC 142365
-// Remove this workaround once we have support to copy fixed section
-// from SEEPROM to PIBMEM.
-extern void initAttrWA();
////////////////////////////////////////////////////////////////
// @brief Global semaphores
////////////////////////////////////////////////////////////////
@@ -58,14 +54,31 @@ PkThread g_sbeAsyncCommandProcessor_thread;
extern "C"
{
// These variables are declared in linker script to keep track of
-// global constructor pointer functions.
+// global constructor pointer functions and sbss section.
extern void (*ctor_start_address)() __attribute__ ((section (".rodata")));
extern void (*ctor_end_address)() __attribute__ ((section (".rodata")));
+extern uint64_t _sbss_start __attribute__ ((section (".sbss")));
+extern uint64_t _sbss_end __attribute__ ((section (".sbss")));
// This function will be used to do any C++ handling required before doing
// any main job. Call to this function should get generated by
// compiler.
+// TODO via RTC 152070
+// We are also initialising sbss section to zero this function.
+// Though it does not do any harm as of now, it is better if we use loader
+// or linker script to zero init sbss section. This way we will be future
+// garded if pk boot uses some static/global data initialised to
+// false in future.
void __eabi()
{
+ // Initialise sbss section
+ uint64_t *startAddr = &_sbss_start;
+ while ( startAddr != &_sbss_end )
+ {
+ *startAddr = 0;
+ startAddr++;
+ }
+
+ // Call global constructors
void(**ctors)() = &ctor_start_address;
while( ctors != &ctor_end_address)
{
@@ -281,11 +294,6 @@ uint32_t main(int argc, char **argv)
break;
}
- // TODO via RTC 142365
- // Remove this workaround once we have support to copy fixed section
- // from SEEPROM to PIBMEM.
- initAttrWA();
-
// TODO via RTC 126146.
// Check if we should call plat_TargetsInit in some other thread.
// We may want to keep only PK init in main and can move
diff --git a/sbe/sbefw/vector b/sbe/sbefw/vector
index 59cbfdd3..1f14eb20 100644
--- a/sbe/sbefw/vector
+++ b/sbe/sbefw/vector
@@ -40,7 +40,7 @@ namespace std
protected:
- pointer iv_start;
+ pointer iv_start __attribute__ ((aligned (8)));
pointer iv_finish;
SBEVECTORPOOL::vectorMemPool_t *iv_poolPtr;
public:
OpenPOWER on IntegriCloud