From f00fe995e05f6ba871ad912dac4c86a0d091190f Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Sun, 14 Feb 2016 20:14:49 +0100 Subject: adapt SBE image build flow to P9-XIP with nested image support Change-Id: Ibd42c84d23d1848b97df982d2fb16da28bb66ee8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21035 Tested-by: Jenkins Server Reviewed-by: Martin Peschke --- sbe/image/Makefile | 10 ++++++---- sbe/image/base_loader.c | 2 +- sbe/image/base_ppe_header.S | 47 +++++++++++++++------------------------------ 3 files changed, 23 insertions(+), 36 deletions(-) (limited to 'sbe/image') diff --git a/sbe/image/Makefile b/sbe/image/Makefile index 3f5567d7..da00f581 100644 --- a/sbe/image/Makefile +++ b/sbe/image/Makefile @@ -203,9 +203,9 @@ all: @echo "Makefile option error: ALL is not compatible with FAPI2_test" endif -.PHONY: all normalize defaultset appendbase appendloader add_L1_LoaderAddr add_L2_LoaderAddr add_kernelAddr symbols +.PHONY: all normalize defaultset appendbase appendloader add_L1_LoaderAddr add_L2_LoaderAddr add_kernelAddr symbols appendoverrides -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_L1_LoaderAddr add_L2_LoaderAddr add_kernelAddr symbols tracehash buildinfo +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 appendoverrides add_L1_LoaderAddr add_L2_LoaderAddr add_kernelAddr symbols tracehash buildinfo buildinfo: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set build_date `date +%Y%m%d` @@ -364,11 +364,13 @@ $(OBJDIR)/fixed.bin: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin appendbase: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(OBJDIR)/$(IMAGE_SBE_NAME).bin $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin append .base $(OBJDIR)/$(IMAGE_SBE_NAME).bin - - appendloader: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin $(OBJDIR)/$(IMAGE_LOADER_NAME).bin $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin append .baseloader $(OBJDIR)/$(IMAGE_LOADER_NAME).bin +appendoverrides: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin + dd if=/dev/zero of=$(OBJDIR)/overrides.bin count=1 bs=2048 + $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin append .overrides $(OBJDIR)/overrides.bin + #/afs/bb/proj/cte/tools/ppetools/prod/powerpc-eabi/bin/objcopy -O binary --only-section=.fixed $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(OBJDIR)/fixed.bin # collect all of the trace hash files for this image into a single trexStringFile diff --git a/sbe/image/base_loader.c b/sbe/image/base_loader.c index 3fe43fc5..b5ea0235 100644 --- a/sbe/image/base_loader.c +++ b/sbe/image/base_loader.c @@ -22,7 +22,7 @@ int32_t base_loader() P9XipHeader *hdr = getXipHdr(); uint64_t *pibMemAddr = (uint64_t *)g_pibMemAddr; - loadSection(&(hdr->iv_section[P9_XIP_SECTION_BASE]), pibMemAddr); + loadSection(&(hdr->iv_section[P9_XIP_SECTION_SBE_BASE]), pibMemAddr); // Set the IVPR register. This is required so that interrupt vector table // points to pk interfaces. uint64_t data = (uint64_t)(SBE_BASE_ORIGIN) << 32; diff --git a/sbe/image/base_ppe_header.S b/sbe/image/base_ppe_header.S index 2cfbb23f..402385fb 100644 --- a/sbe/image/base_ppe_header.S +++ b/sbe/image/base_ppe_header.S @@ -62,22 +62,6 @@ .endm -// .macro P9XipHeader, magic, link_address, entry_point, image_size - - .macro P9XipSection, s:req, alignment=1, empty=0 -__\s\()_section: - .if \empty - .long 0 - .long 0 - .else - .long _\s\()_offset - .long _\s\()_size - .endif - .byte (\alignment) - .byte 0, 0, 0 - .endm - - .macro P9XipHeader, magic, link_address, entry_point, image_size .section .header, "a", @progbits @@ -110,20 +94,21 @@ __header_64_reserved: // Section Table - 8-byte aligned; 16 entries; Not TOC-Indexed ////////////////////////////////////////////////////////////////////// - P9XipSection header - P9XipSection fixed, 8 - P9XipSection fixed_toc, 8 - P9XipSection loader_text, 4 - P9XipSection loader_data, 8 - P9XipSection text, 4 - P9XipSection data, 8 - P9XipSection toc, 4 - P9XipSection strings - P9XipSection base, 4, empty=1 - P9XipSection baseloader, 8, empty=1 - P9XipSection overlay, 8, empty=1 - P9XipSection rings, 8, empty=1 - P9XipSection hbbl, 8, empty=1 + .xip_section header + .xip_section fixed, 8 + .xip_section fixed_toc, 8 + .xip_section toc, 4 + .xip_section strings + .xip_section loader_text, 4 + .xip_section loader_data, 8 + .xip_section text, 4 + .xip_section data, 8 + .xip_section base, 4, empty=1 + .xip_section baseloader, 8, empty=1 + .xip_section overrides, 8, empty=1 + .xip_section rings, 8, empty=1 + .xip_section overlay, 8, empty=1 + .xip_section hbbl, 8, empty=1 ////////////////////////////////////////////////////////////////////// @@ -189,7 +174,7 @@ __header_string_reserved: .section .strings, "aS", @progbits ..set_default_space IMAGE_SPACE_SEEPROM - P9XipHeader P9_SEEPROM_MAGIC, 0x80000000, 0x80000C78, _seeprom_size + P9XipHeader P9_XIP_MAGIC_SEEPROM, 0x80000000, 0x80000C78, _seeprom_size // Create the .fixed section .proc_sbe_fixed_system -- cgit v1.2.1