Skip to content

Commit

Permalink
Revert "SBE Space optimisation" by moving ramming to pibmem
Browse files Browse the repository at this point in the history
This reverts commit 2dce1d2.
And move plat target init and plat attr init to seeprom
Perfromace measurements - from sbe_tart to proc_attn_listen:
Without this change: 3.433112590s
With this change   : 3.458556197s

Change-Id: If6b5dfcae2e40aa5d0d608e1d01036546c525628
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56239
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
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>
  • Loading branch information
Shakeebbk authored and sgupta2m committed Mar 29, 2018
1 parent b6c3a88 commit 783b420
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 15 deletions.
14 changes: 9 additions & 5 deletions src/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ LIB_DIRS += -L$(OBJDIR)/fapi2
FAPI2LIB := $(OBJDIR)/fapi2/libfapi2.a
LLIBS += -lfapi2

LIB_DIRS += -L$(OBJDIR)/fapi2_seeprom
FAPI2LIB := $(OBJDIR)/fapi2/libfapi2seeprom.a
LLIBS += -lfapi2seeprom

include $(HWPERR_SRCDIR)/hwpErrors.mk

# Common Utils library
Expand Down Expand Up @@ -138,7 +142,7 @@ $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).dis: $(IMG
$(OBJDUMP) -S $< > $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).dis

#create a linked ELF executable
$(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) _sbecore_seeprom _sbeapp_seeprom $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM)
$(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) _seeprom_libs $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM)
$(LD) -n -T$(LINK_SCRIPT_SEEPROM) -Map $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).map \
-Bstatic -o $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out $(BOOT_OBJDIR)/$(BOOT_OBJECTS) $(BUILDDATA_OBJDIR)/$(IMAGE_BASE_PPE_HEADER).o $(OBJS) $(LIB_DIRS) \
--start-group $(LLIBS) --end-group
Expand All @@ -158,7 +162,7 @@ $(IMG_DIR)/$(IMAGE_SBE_NAME).bin $(IMG_DIR)/$(IMAGE_SBE_NAME).dis: $(IMG_DIR)/$(
$(OBJDUMP) -S $< > $(IMG_DIR)/$(IMAGE_SBE_NAME).dis

# create a linked ELF executable
$(IMG_DIR)/$(IMAGE_SBE_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) _sbecore_seeprom _sbeapp_seeprom $(LINK_OBJS) $(LINK_SCRIPT_SBE)
$(IMG_DIR)/$(IMAGE_SBE_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) _seeprom_libs $(LINK_OBJS) $(LINK_SCRIPT_SBE)
$(LD) -e __system_reset -T$(LINK_SCRIPT_SBE) -Map $(IMG_DIR)/$(IMAGE_SBE_NAME).map -Bstatic -o $(IMG_DIR)/$(IMAGE_SBE_NAME).out $(LIB_DIRS) $(BUILDDATA_OBJDIR)/base_sbe_fixed.o --start-group $(LLIBS) --end-group

# pass the link command file through the C preprocessor to evaluate macros and remove comments
Expand Down Expand Up @@ -196,7 +200,7 @@ tar:
@echo "Generated simics.tar in Sbe images Directory"

.PHONY: all normalize compress defaultset appendloader add_LoaderAddr symbols report \
appendoverrides xml security tracehash topfixedheaders $(SUBDIRS) _sbecore_seeprom _sbeapp_seeprom\
appendoverrides xml security tracehash topfixedheaders $(SUBDIRS) _seeprom_libs \
tar install

buildinfo: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin
Expand Down Expand Up @@ -262,9 +266,9 @@ platattr:
# Build the subdirectories
$(SUBDIRS):
$(MAKE) -I $(INCLUDES) -C $@ -f Makefile
_sbecore_seeprom:
_seeprom_libs:
$(MAKE) -I $(INCLUDES) -C ../hwpf -f Makefile img_mem=seeprom
$(MAKE) -I $(INCLUDES) -C ../sbefw/core -f Makefile img_mem=seeprom
_sbeapp_seeprom:
$(MAKE) -I $(INCLUDES) -C ../sbefw/app/common -f Makefile img_mem=seeprom
$(MAKE) -I $(INCLUDES) -C ../sbefw/app/$(PROJECT_APP_DIR) -f Makefile img_mem=seeprom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ISTEPCOMMON-CPP-SOURCES +=p9_pm_ocb_init.C
ISTEPCOMMON-CPP-SOURCES +=p9_adu_setup.C
ISTEPCOMMON-CPP-SOURCES +=p9_adu_coherent_utils.C
ISTEPCOMMON-CPP-SOURCES +=p9_adu_access.C
ISTEPCOMMON-CPP-SOURCES +=p9_ram_core.C
#Istep2 Procedure but this is required to run from PIBMEM
ISTEPCOMMON-CPP-SOURCES +=p9_sbe_tp_switch_gears.C
ISTEPCOMMON-CPP-SOURCES +=p9_sbe_npll_setup.C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ ISTEPMPIPL-CPP-SOURCES +=p9_perv_sbe_cmn.C
ISTEPMPIPL-CPP-SOURCES +=p9_suspend_powman.C
ISTEPMPIPL-CPP-SOURCES +=p9_collect_suspend_ffdc.C
ISTEPMPIPL-CPP-SOURCES +=p9_eq_clear_atomic_lock.C
ISTEPMPIPL-CPP-SOURCES +=p9_ram_core.C
ISTEPMPIPL-CPP-SOURCES +=p9_query_cache_access_state.C
# Fast array procedures are moved here to locate it on seeprom
ISTEPMPIPL-CPP-SOURCES += p9_sbe_fastarray_abist_catchup.C
Expand Down
3 changes: 2 additions & 1 deletion src/build/linkerscripts/power/linkseeprom.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand Down Expand Up @@ -97,7 +98,7 @@ SECTIONS
////////////////////////////////
.text ALIGN(8): {
_text_origin = .; _text_offset = . - _seeprom_origin;
*\libistep2.a:(.text* ) *\libistep3.a:(.text* ) *\libistep4.a:(.text* ) *\libistepmpipl.a:(.text* ) *\libistep5.a:(.text* ) *\libsbecoreseeprom.a:(.text* ) *\libsbeapppowerseeprom.a:(.text* ) *\libsbeappcommonseeprom.a:(.text* ) } > seeprom
*\libistep2.a:(.text* ) *\libistep3.a:(.text* ) *\libistep4.a:(.text* ) *\libistepmpipl.a:(.text* ) *\libistep5.a:(.text* ) *\libsbecoreseeprom.a:(.text* ) *\libsbeapppowerseeprom.a:(.text* ) *\libsbeappcommonseeprom.a:(.text* ) *\libfapi2seeprom.a:(.text* ) } > seeprom
_text_size = . - _text_origin;

////////////////////////////////
Expand Down
19 changes: 13 additions & 6 deletions src/hwpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,16 +24,22 @@
# IBM_PROLOG_END_TAG
# This Makefile is designed to be invoked with the -I argument

ifneq ($(img_mem), seeprom)
export SUB_OBJDIR = /fapi2
OBJS = $(addprefix $(OBJDIR)/, $(FAPI2PLATLIB_OBJECTS))
LIBNAME = libfapi2
else
export SUB_OBJDIR = /fapi2_seeprom
GCC-DEFS += -D__SBEFW_SEEPROM__=1
OBJS = $(addprefix $(OBJDIR)/, $(FAPI2PLATLIB_SEEPROM_OBJECTS))
LIBNAME = libfapi2seeprom
endif

include img_defs.mk
include fapi2sbefiles.mk


OBJS := $(addprefix $(OBJDIR)/, $(FAPI2PLATLIB_OBJECTS))

libfapi2.a: fapi2 hwpf
$(AR) crs $(OBJDIR)/libfapi2.a $(OBJDIR)/*.o
$(LIBNAME).a: $(OBJS)
$(AR) crs $(OBJDIR)/$(LIBNAME).a $(OBJDIR)/*.o

.PHONY: clean fapi2 hwpf
fapi2: $(OBJS)
Expand Down
5 changes: 4 additions & 1 deletion src/hwpf/fapi2sbefiles.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -50,3 +51,5 @@ FAPI2PLAT-S-SOURCES =

FAPI2PLATLIB_OBJECTS += $(FAPI2PLAT-CPP-SOURCES:.C=.o) $(FAPI2PLAT-C-SOURCES:.c=.o) $(FAPI2PLAT-S-SOURCES:.S=.o)

FAPI2PLAT-SEEPROM-CPP-SOURCES += target.C
FAPI2PLATLIB_SEEPROM_OBJECTS += $(FAPI2PLAT-SEEPROM-CPP-SOURCES:.C=.o)
31 changes: 31 additions & 0 deletions src/hwpf/target.C
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <p9_perv_scom_addresses.H>
#include <p9_perv_scom_addresses_fld.H>

#ifndef __SBEFW_SEEPROM__
// Global Vector containing ALL targets. This structure is referenced by
// fapi2::getChildren to produce the resultant returned vector from that
// call.
Expand All @@ -46,8 +47,28 @@ fapi2attr::CoreAttributes_t* G_core_attributes_ptr;
fapi2attr::EQAttributes_t* G_eq_attributes_ptr;
fapi2attr::EXAttributes_t* G_ex_attributes_ptr;

#else // __SBEFW_SEEPROM__
extern std::vector<fapi2::plat_target_handle_t> G_vec_targets;

// Global variable for fixed section in pibmem
extern G_sbe_attrs_t G_sbe_attrs;

extern fapi2attr::SystemAttributes_t* G_system_attributes_ptr;
extern fapi2attr::ProcChipAttributes_t* G_proc_chip_attributes_ptr;
extern fapi2attr::PervAttributes_t* G_perv_attributes_ptr;
extern fapi2attr::CoreAttributes_t* G_core_attributes_ptr;
extern fapi2attr::EQAttributes_t* G_eq_attributes_ptr;
extern fapi2attr::EXAttributes_t* G_ex_attributes_ptr;

#endif // else __SBEFW_SEEPROM__

namespace fapi2
{
#ifdef __SBEFW_SEEPROM__
extern fapi2::ReturnCode
plat_TargetPresent( fapi2::Target<fapi2::TARGET_TYPE_PERV> & i_chiplet_target,
bool & b_present);

ReturnCode plat_AttrInit()
{
union
Expand Down Expand Up @@ -387,6 +408,9 @@ namespace fapi2
fapi_try_exit:
return fapi2::current_err;
}
#endif //__SBEFW_SEEPROM__

#ifndef __SBEFW_SEEPROM__

// Get the plat target handle by chiplet number - For PERV targets
template<>
Expand Down Expand Up @@ -753,6 +777,9 @@ fapi_try_exit:
return fapi2::current_err;
}

#endif // not __SBEFW_SEEPROM__

#ifdef __SBEFW_SEEPROM__

/// @brief Function to initialize the G_targets vector based on partial good
/// attributes /// this will move to plat_target.H formally
Expand Down Expand Up @@ -1006,6 +1033,9 @@ fapi_try_exit:
return fapi2::current_err;
}

#endif // __SBEFW_SEEPROM__
#ifndef __SBEFW_SEEPROM__

/// @brief Function to initialize the G_targets vector based on partial good
/// attributes
fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> plat_getChipTarget()
Expand Down Expand Up @@ -1075,4 +1105,5 @@ fapi_try_exit:
fapi_try_exit:
return fapi2::current_err;
}
#endif //not __SBEFW_SEEPROM__
} // fapi2
2 changes: 1 addition & 1 deletion src/sbefw/app/power/apppowerfiles.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ APPPOWERPIBMEM-CPP-SOURCES += sbecmdcntrldmt.C
APPPOWERPIBMEM-CPP-SOURCES += sbecmdsram.C
APPPOWERPIBMEM-CPP-SOURCES += sbecmdgeneric.C
APPPOWERPIBMEM-CPP-SOURCES += istep.C
APPPOWERPIBMEM-CPP-SOURCES += sbecmdtracearray.C

APPPOWERPIBMEM-C-SOURCES =
APPPOWERPIBMEM-S-SOURCES =
Expand All @@ -46,6 +45,7 @@ APPPOWERSEEPROM-CPP-SOURCES += sbecmdmemaccess.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdmpipl.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdfastarray.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdgeneric.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdtracearray.C

APPPOWERSEEPROM-C-SOURCES =
APPPOWERSEEPROM-S-SOURCES =
Expand Down

0 comments on commit 783b420

Please sign in to comment.