summaryrefslogtreecommitdiffstats
path: root/sbe/image
diff options
context:
space:
mode:
Diffstat (limited to 'sbe/image')
-rw-r--r--sbe/image/Makefile71
-rw-r--r--sbe/image/base_ppe_header.S46
-rw-r--r--sbe/image/base_sbe_fixed.S17
-rw-r--r--sbe/image/img_defs.mk4
-rw-r--r--sbe/image/proc_sbe_fixed.H51
-rw-r--r--sbe/image/topfiles.mk1
6 files changed, 115 insertions, 75 deletions
diff --git a/sbe/image/Makefile b/sbe/image/Makefile
index 84c0c969..24fa27b4 100644
--- a/sbe/image/Makefile
+++ b/sbe/image/Makefile
@@ -6,6 +6,13 @@ export P2P_ENABLE = 1
#remove this once we have a real compiler
export SBEFW_ENABLE = 1
+# Force a non-interrupt variant of PK for FAPI2 testing. This allows the test to run
+# on any of the PPE SIMICS models.
+# This must be before the inclusion of img_defs.mk.
+ifdef FAPI2_TEST
+PPE_TYPE := ppe
+endif
+
#Pull in the definitions that affect all makefiles for this image
include img_defs.mk
@@ -98,52 +105,68 @@ LINK_SCRIPT_SEEPROM = $(addprefix $(OBJDIR)/, linkscriptseeprom)
LINK_SCRIPT_SBE = $(addprefix $(OBJDIR)/, linkscriptsbe)
LINK_SCRIPT_LOADER = $(addprefix $(OBJDIR)/, linkscriptloader)
-
-#default target is to make a binary application image
-#This removes all unecessary headers from the ELF executable
+# ---- SEEPROM Image ------
+# This removes all unecessary headers from the ELF executable
$(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(OBJDIR)/$(IMAGE_SEEPROM_NAME).dis: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out
$(OBJCOPY) -O binary $< $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin --pad-to 0x`/usr/bin/nm $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out | grep "A _seeprom_end" | cut -d " " -f 1`
$(OBJDUMP) -S $< > $(OBJDIR)/$(IMAGE_SEEPROM_NAME).dis
+
+ifndef FAPI2_TEST
+# This is the production build of the SEEPROM
#create a linked ELF executable
$(OBJDIR)/$(IMAGE_SEEPROM_NAME).out: $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM)
+ @echo ">>>>> Production Build <<<<<<"
$(LD) -e __system_reset -T$(LINK_SCRIPT_SEEPROM) -Map $(OBJDIR)/$(IMAGE_SEEPROM_NAME).map -Bstatic -o $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(OBJS)
-#pass the link command file through the C preprocessor to evaluate macros and remove comments
+else
+# This a special build of the SEEPROM image that includes the PK to allow for test threads to be used.
+# create a linked ELF executable
+$(OBJDIR)/$(IMAGE_SEEPROM_NAME).out: $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM)
+ @echo ">>>>> Special FAPI2 Test Build <<<<<<"
+ $(LD) -e __system_reset -T$(LINK_SCRIPT_SEEPROM) -Map $(OBJDIR)/$(IMAGE_SEEPROM_NAME).map -Bstatic -o $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(LIB_DIRS) $(OBJS) --start-group $(LLIBS) --end-group
+
+endif
+
+# pass the link command file through the C preprocessor to evaluate macros and remove comments
$(LINK_SCRIPT_SEEPROM): linkseeprom.cmd
$(CPP) -E -x c++ -P $(DEFS) linkseeprom.cmd -o $(LINK_SCRIPT_SEEPROM)
-#default target is to make a binary pibmem image
+# ---- PIBMEM Image ------
#This removes all unecessary headers from the ELF executable
$(OBJDIR)/$(IMAGE_SBE_NAME).bin $(OBJDIR)/$(IMAGE_SBE_NAME).dis: $(OBJDIR)/$(IMAGE_SBE_NAME).out
$(OBJCOPY) -O binary $< $(OBJDIR)/$(IMAGE_SBE_NAME).bin --pad-to 0x`/usr/bin/nm $(OBJDIR)/$(IMAGE_SBE_NAME).out | grep "A _sbe_end" | cut -d " " -f 1`
$(OBJDUMP) -S $< > $(OBJDIR)/$(IMAGE_SBE_NAME).dis
-#create a linked ELF executable
+# create a linked ELF executable
$(OBJDIR)/$(IMAGE_SBE_NAME).out: $(OBJDIR)/base_sbe_fixed.o $(LINK_OBJS) $(LINK_SCRIPT_SBE)
$(LD) -e __system_reset -T$(LINK_SCRIPT_SBE) -Map $(OBJDIR)/$(IMAGE_SBE_NAME).map -Bstatic -o $(OBJDIR)/$(IMAGE_SBE_NAME).out $(LIB_DIRS) $(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
+# pass the link command file through the C preprocessor to evaluate macros and remove comments
$(LINK_SCRIPT_SBE): linksbe.cmd
$(CPP) -E -x c++ -P $(DEFS) linksbe.cmd -o $(LINK_SCRIPT_SBE)
-
-
-
+# ---- Loader Image ------
$(OBJDIR)/$(IMAGE_LOADER_NAME).bin $(OBJDIR)/$(IMAGE_LOADER_NAME).dis: $(OBJDIR)/$(IMAGE_LOADER_NAME).out
$(OBJCOPY) -O binary $< $(OBJDIR)/$(IMAGE_LOADER_NAME).bin --pad-to 0x`/usr/bin/nm $(OBJDIR)/$(IMAGE_LOADER_NAME).out | grep "A _loader_end" | cut -d " " -f 1`
$(OBJDUMP) -S $< > $(OBJDIR)/$(IMAGE_LOADER_NAME).dis
-#create a linked ELF executable
+# create a linked ELF executable
$(OBJDIR)/$(IMAGE_LOADER_NAME).out: $(OBJDIR)/$(BASE_LOADER_OBJECTS) $(LINK_OBJS) $(LINK_SCRIPT_LOADER)
$(LD) -e base_loader -T$(LINK_SCRIPT_LOADER) -Map $(OBJDIR)/$(IMAGE_LOADER_NAME).map -Bstatic -o $(OBJDIR)/$(IMAGE_LOADER_NAME).out $(OBJDIR)/$(BASE_LOADER_OBJECTS)
-#pass the link command file through the C preprocessor to evaluate macros and remove comments
+# pass the link command file through the C preprocessor to evaluate macros and remove comments
$(LINK_SCRIPT_LOADER): linkloader.cmd
$(CPP) -E -x c++ -P $(DEFS) linkloader.cmd -o $(LINK_SCRIPT_LOADER)
-
-
+# Remove the "all" rule if FAPI2_TEST as the SBE FW is incompatible with the
+# option of PK enabled
+ifndef FAPI2_TEST
+all: seeprom $(OBJDIR)/$(IMAGE_SBE_NAME).bin $(OBJDIR)/$(IMAGE_LOADER_NAME).bin $(SBE_TOOLS) appendbase appendloader
+else
+all:
+ @echo "Makefile option error: ALL is not compatible with FAPI2_test"
+endif
all: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(OBJDIR)/$(IMAGE_SBE_NAME).bin $(OBJDIR)/$(IMAGE_LOADER_NAME).bin $(SBE_TOOLS) normalize defaultset $(OBJDIR)/fixed.bin appendbase appendloader add_entry_offset add_entry_address_sbe
@@ -153,7 +176,7 @@ add_entry_offset: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out
add_entry_address_sbe: $(OBJDIR)/$(IMAGE_LOADER_NAME).out
$(TOOLS_IMAGE_DIR)/sbe_xip_tool $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set entry_address_sbe 0x`nm $(OBJDIR)/$(IMAGE_LOADER_NAME).out | grep base_loader | cut -f 1 -d " "`
-generic: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(SBE_TOOLS) normalize defaultset $(OBJDIR)/fixed.bin
+seeprom: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(SBE_TOOLS) normalize defaultset $(OBJDIR)/fixed.bin
$(TOOLS_IMAGE_DIR)/sbe_xip_tool $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin report > $(OBJDIR)/$(IMAGE_SEEPROM_NAME).rpt
#Create an obj directory if needed
@@ -165,6 +188,7 @@ ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/proc_attributes.xml
ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/ex_attributes.xml
ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/eq_attributes.xml
ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/core_attributes.xml
+ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/nest_attributes.xml
$(OBJDIR):
$(TOOLS_ATTR_DIR)/ppeParseProcSbeFixed.pl . $(IMPORT_XML_DIR)/p9_ppe_attributes.xml $(ATTRFILES)
@@ -194,7 +218,7 @@ attrserv:
$(PKLIB):
$(MAKE) -I $(IMAGE_SRCDIR) -C $(PK_MAKE_DIR) -f Makefile
-#Build macro-specific kernel code
+#Build SBE firmware
$(SBEFWLIB):
$(MAKE) -I $(IMAGE_SRCDIR) -C $(SBEFW_MAKE_DIR) -f Makefile
@@ -223,8 +247,6 @@ $(NESTLIB):
@echo "Processing nest makefile"
$(MAKE) -I $(IMAGE_SRCDIR) -C $(NEST_MAKE_DIR) -f Makefile
-#Build the comming HWP lib procedures
-
#Build the HWP lib procedures
$(HWPLIB):
@echo "Processing HWP lib makefile"
@@ -240,6 +262,7 @@ $(P2PLIB):
$(MAKE) -I $(IMAGE_SRCDIR) -C $(P2P_SRCDIR) -f Makefile
endif
+#Build the SBE XIP Tools
$(SBE_TOOLS):
$(MAKE) -C $(TOOLS_IMAGE_DIR) -f Makefile
@@ -306,21 +329,13 @@ dump:
objdump -s $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out > $(IMAGE_SEEPROM_NAME).dump
objdump -s $(OBJDIR)/$(IMAGE_SBE_NAME).out > $(IMAGE_SBE_NAME).dump
-.PHONY : run_spgpe run_pmgpe
+.PHONY : run_spgpe
# load and run the SBE SeeProm image in a GPE simics environment
-#run_spgpe: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out
-run_spgpe: generic
+run_spgpe: seeprom
$(SIMICS_WS)/simics \
-e '$$occ_gpe0_binary_to_load=$(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin;$$occ_gpe0_sym_tbl_file=$(OBJDIR)/$(IMAGE_SEEPROM_NAME).out' \
modelsetup.simics
-# load and run the SBE PibMem image in a GPE simics environment
-run_pmgpe: $(OBJDIR)/$(IMAGE_NAME).out
- $(SIMICS_WS)/simics \
- -e '$$occ_gpe0_binary_to_load=$(OBJDIR)/$(IMAGE_SBE_NAME).bin;$$occ_gpe0_binary_to_load=$(OBJDIR)/$(IMAGE_SBE_NAME).bin' \
- modelsetup.simics
-
-
#Add dependencies to header files
ifneq ($(MAKECMDGOALS),clean)
diff --git a/sbe/image/base_ppe_header.S b/sbe/image/base_ppe_header.S
index 2de8f887..1220b170 100644
--- a/sbe/image/base_ppe_header.S
+++ b/sbe/image/base_ppe_header.S
@@ -12,13 +12,13 @@
#include "sbe_xip_image.h"
#include "proc_sbe_fixed.H"
-
+
#define IMAGE_SPACE_UNDEFINED 0xffff
#define IMAGE_SPACE_OCI 0x8000
#define IMAGE_SPACE_PNOR 0x800b
#define IMAGE_SPACE_OTPROM 0x0001
#define IMAGE_SPACE_SEEPROM 0x800c
-#define IMAGE_SPACE_BASE 0x0008
+#define IMAGE_SPACE_BASE 0x0008
@@ -31,37 +31,37 @@
.iflt (\x)
.error "An unsigned value is required here"
.endif
-
+
.ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits))))
.error "\err"
.endif
- .endm
+ .endm
.macro ..check_u16, u16
..checku (\u16), 16, "Unsigned immediate is larger than 16 bits"
.endm
-
-
+
+
.macro ..set_default_space, s
..check_u16 (\s)
.set _PGAS_DEFAULT_SPACE, (\s)
.endm
-
+
.macro ..check_default_space
.if (_PGAS_DEFAULT_SPACE == IMAGE_SPACE_UNDEFINED)
.error "The PGAS default address space has not been defined"
.endif
- .endm
-
+ .endm
+
.macro .quada, offset:req
..check_default_space
.long _PGAS_DEFAULT_SPACE
.long (\offset)
- .endm
+ .endm
+
-
// .macro SbeXipHeader, magic, link_address, entry_point, image_size
.macro SbeXipSection, s:req, alignment=1, empty=0
@@ -79,7 +79,7 @@ __\s\()_section:
.macro SbeXipHeader, magic, link_address, entry_point, image_size
-
+
.section .header, "a", @progbits
@@ -87,9 +87,9 @@ __\s\()_section:
// Identification - 8-byte aligned; 8 Entries; TOC-Indexed
//////////////////////////////////////////////////////////////////////
-__magic:
+__magic:
.quad (\magic)
-__entry_offset:
+__entry_offset:
.quad ((\entry_point) - (\link_address))
__link_address:
.quada (\link_address)
@@ -102,8 +102,7 @@ __header_64_reserved:
.xip_toc entry_offset, SBE_XIP_UINT64, __entry_offset
.xip_toc link_address, SBE_XIP_UINT64, __link_address
.xip_toc entry_address_sbe, SBE_XIP_UINT64, __entry_address_sbe
-
-
+
//////////////////////////////////////////////////////////////////////
// Section Table - 8-byte aligned; 16 entries; Not TOC-Indexed
//////////////////////////////////////////////////////////////////////
@@ -122,7 +121,7 @@ __header_64_reserved:
SbeXipSection overlay, 8, empty=1
SbeXipSection rings, 8, empty=1
-
+
//////////////////////////////////////////////////////////////////////
// Other Information - 4-byte aligned; 8 entries; TOC-Indexed
//////////////////////////////////////////////////////////////////////
@@ -175,20 +174,21 @@ __header_string_reserved:
.endm
-
+
.section .fixed, "a", @progbits
- .section .fixed_toc, "a", @progbits
+ .section .fixed_toc, "a", @progbits
.section .loader_data, "a", @progbits
- .section .loader_text, "a", @progbits
-
+ .section .loader_text, "a", @progbits
+
.section .toc, "a", @progbits
.section .strings, "aS", @progbits
-
+
..set_default_space IMAGE_SPACE_SEEPROM
SbeXipHeader SBE_SEEPROM_MAGIC, 0xFFF00000, 0xFFF00C78, _seeprom_size
- // Create the .fixed section
+ // Create the .fixed section
+ .proc_sbe_fixed_system
.proc_sbe_fixed_proc_chip
.proc_sbe_fixed_perv
.proc_sbe_fixed_core
diff --git a/sbe/image/base_sbe_fixed.S b/sbe/image/base_sbe_fixed.S
index 08fc4f0c..496b7e82 100644
--- a/sbe/image/base_sbe_fixed.S
+++ b/sbe/image/base_sbe_fixed.S
@@ -4,7 +4,7 @@
#include "sbe_xip_image.h"
#include "proc_sbe_fixed.H"
-
+
.macro ..checku, x:req, bits:req, err="Unsigned value too large"
.if (((\bits) <= 0) || ((\bits) > 63))
@@ -14,30 +14,29 @@
.iflt (\x)
.error "An unsigned value is required here"
.endif
-
+
.ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits))))
.error "\err"
.endif
- .endm
+ .endm
+
-
.macro ..check_u16, u16
..checku (\u16), 16, "Unsigned immediate is larger than 16 bits"
.endm
-
+
.macro ..set_default_space, s
..check_u16 (\s)
.set _PGAS_DEFAULT_SPACE, (\s)
.endm
-
-
.section .fixed, "a", @progbits
-
- // Create the .fixed section
+
+ // Create the .fixed section
+ .proc_sbe_fixed_system
.proc_sbe_fixed_proc_chip
.proc_sbe_fixed_perv
.proc_sbe_fixed_core
diff --git a/sbe/image/img_defs.mk b/sbe/image/img_defs.mk
index c1214c80..771214a9 100644
--- a/sbe/image/img_defs.mk
+++ b/sbe/image/img_defs.mk
@@ -276,8 +276,10 @@ endif
#override the GNU Make implicit rule for going from a .C to a .o
%.o: %.C
+# -Wno-conversion-null is necesary to allow mapping of NULL to TARGET_TYPE_SYSTEM
+# for attribute accesses
$(OBJDIR)/%.s: %.C
- $(TCC) $(PPE-CFLAGS) $(DEFS) -S -std=c++11 -o $@ $<
+ $(TCC) $(PPE-CFLAGS) $(DEFS) -Wno-conversion-null -S -std=c++11 -o $@ $<
#override the GNU Make implicit rule for going from a .c to a .o
diff --git a/sbe/image/proc_sbe_fixed.H b/sbe/image/proc_sbe_fixed.H
index 2969e3b1..16701f74 100644
--- a/sbe/image/proc_sbe_fixed.H
+++ b/sbe/image/proc_sbe_fixed.H
@@ -21,19 +21,19 @@
/// TOC.
///
/// This header file can be #include-ed into either C or SBE assembly language
-/// source code. In C, it creates simple structures 'ProcChipAttributes',
-/// 'PervAttributes', 'CoreAttributes', 'EQAttributes' and 'EXAttributes' that
+/// source code. In C, it creates simple structures 'ProcChipAttributes',
+/// 'PervAttributes', 'CoreAttributes', 'EQAttributes' and 'EXAttributes' that
/// contain attribute information that are sized per XML definition per entry.
///
-/// PPE image data is always stored big-endian, so applications on little-endian
+/// PPE image data is always stored big-endian, so applications on little-endian
/// hosts will need to perform the appropriate endian converison when reading or
/// writing images via this header.
///
/// In assembler code, this header creates macros '.proc_sbe_fixed_proc_chip',
-/// '.proc_sbe_fixed_perv', '.proc_sbe_fixed_core', '.proc_sbe_fixed_ex',
-/// '.proc_sbe_fixed_eq', that is expanded exactly once in the file
-/// 'sbe_base_header.S', creating the actual data allocation of the data
-/// equivalent to the C structure. Assembler code references the data symbols
+/// '.proc_sbe_fixed_perv', '.proc_sbe_fixed_core', '.proc_sbe_fixed_ex',
+/// '.proc_sbe_fixed_eq', that is expanded exactly once in the file
+/// 'sbe_base_header.S', creating the actual data allocation of the data
+/// equivalent to the C structure. Assembler code references the data symbols
/// as normal.
///
/// To simplify programming a 'mini-TOC' is also provided for this data in
@@ -50,14 +50,37 @@
#include "plat_target_parms.H"
#include "fapi2AttributeIds.H"
+#ifdef __ASSEMBLER__
+ .macro .proc_sbe_fixed_system
+ .section .fixed, "a", @progbits
+ .balign 8
+ .global G_system_attributes
+G_system_attributes:
+#else
+
+extern "C" {
+namespace fapi2attr {
+typedef struct SystemAttributes_t {
+#endif
+
+#include "proc_sbe_fixed_system.H"
+
+#ifdef __ASSEMBLER__
+ .endm
+#else
+} SystemAttributes;
+} // fapi2
+} // C
+#endif
#ifdef __ASSEMBLER__
.macro .proc_sbe_fixed_proc_chip
.section .fixed, "a", @progbits
.balign 8
.global G_proc_chip_attributes
-G_proc_chip_attributes:
+G_proc_chip_attributes:
#else
+
extern "C" {
namespace fapi2attr {
typedef struct ProcChipAttributes_t {
@@ -80,7 +103,7 @@ typedef struct ProcChipAttributes_t {
.section .fixed, "a", @progbits
.balign 8
.global G_perv_attributes
-G_perv_attributes:
+G_perv_attributes:
#else
namespace fapi2attr {
typedef struct PervAttributes_t {
@@ -102,14 +125,14 @@ typedef struct PervAttributes_t {
.section .fixed, "a", @progbits
.balign 8
.global G_core_attributes
-G_core_attributes:
+G_core_attributes:
#else
namespace fapi2attr {
typedef struct CoreAttributes_t {
#endif
#include "proc_sbe_fixed_core.H"
-
+
#ifdef __ASSEMBLER__
.endm
#else
@@ -124,14 +147,14 @@ typedef struct CoreAttributes_t {
.section .fixed, "a", @progbits
.balign 8
.global G_ex_attributes
-G_ex_attributes:
+G_ex_attributes:
#else
namespace fapi2attr {
typedef struct EXAttributes_t {
#endif
#include "proc_sbe_fixed_ex.H"
-
+
#ifdef __ASSEMBLER__
.endm
#else
@@ -153,7 +176,7 @@ typedef struct EQAttributes_t {
#endif
#include "proc_sbe_fixed_eq.H"
-
+
#ifdef __ASSEMBLER__
.endm
#else
diff --git a/sbe/image/topfiles.mk b/sbe/image/topfiles.mk
index 78623f03..a8f95429 100644
--- a/sbe/image/topfiles.mk
+++ b/sbe/image/topfiles.mk
@@ -3,6 +3,7 @@ TOP-CPP-SOURCES =
TOP-S-SOURCES = base_ppe_header.S
# generated by ppeParseProcSbeFixed.pl
+TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_system.H
TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_perv.H
TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_proc_chip.H
TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_core.H
OpenPOWER on IntegriCloud