summaryrefslogtreecommitdiffstats
path: root/sbe
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2015-07-20 23:28:58 -0500
committerAmit J. Tendolkar <amit.tendolkar@in.ibm.com>2016-02-03 00:12:11 -0600
commitd39b495d089e8bc51e5dfa794cf6fd3d3db9f9ed (patch)
treeca365bfb28a1c7b373c18e7e5c2f14c44dc7854c /sbe
parent309c9ac32ee2e05ea5975b0973f79cd8b22acda2 (diff)
downloadtalos-sbe-d39b495d089e8bc51e5dfa794cf6fd3d3db9f9ed.tar.gz
talos-sbe-d39b495d089e8bc51e5dfa794cf6fd3d3db9f9ed.zip
SEEPREOM/PIBMEM Loader
RTC: 123472 Change-Id: I625ade56cbd56d7c3e7c6510e863351f054408ee Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19793 Tested-by: Jenkins Server Reviewed-by: Amit J. Tendolkar <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe')
-rw-r--r--sbe/image/Makefile27
-rw-r--r--sbe/image/base_loader.c63
-rw-r--r--sbe/image/base_loader_setup.S34
-rw-r--r--sbe/image/base_ppe_header.S2
-rw-r--r--sbe/image/linkloader.cmd21
-rw-r--r--sbe/image/linksbe.cmd7
-rw-r--r--sbe/image/linkseeprom.cmd46
-rw-r--r--sbe/image/pm_loader.S57
-rw-r--r--sbe/image/sbe_link.H32
-rw-r--r--sbe/image/sbe_loader.c19
-rw-r--r--sbe/image/topfiles.mk7
11 files changed, 224 insertions, 91 deletions
diff --git a/sbe/image/Makefile b/sbe/image/Makefile
index 3618cc84..900246aa 100644
--- a/sbe/image/Makefile
+++ b/sbe/image/Makefile
@@ -103,6 +103,10 @@ LINK_OBJS = $(OBJS) $(SBEFWLIB) $(PKLIB) $(FAPI2LIB) $(CACHELIB) $(CORELIB) $(HW
OBJS := $(addprefix $(OBJDIR)/, $(TOP_OBJECTS))
LINK_OBJS += $(OBJS) $(GCCLIBS)
+# Loader Objects
+LOADER_OBJS := $(addprefix $(OBJDIR)/, $(BASE_LOADER_OBJECTS))
+
+
LINK_SCRIPT_SEEPROM = $(addprefix $(OBJDIR)/, linkscriptseeprom)
LINK_SCRIPT_SBE = $(addprefix $(OBJDIR)/, linkscriptsbe)
LINK_SCRIPT_LOADER = $(addprefix $(OBJDIR)/, linkscriptloader)
@@ -134,7 +138,7 @@ 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)
+ $(CPP) -I. -E -x c++ -P $(DEFS) linkseeprom.cmd -o $(LINK_SCRIPT_SEEPROM)
# ---- PIBMEM Image ------
#This removes all unecessary headers from the ELF executable
@@ -149,20 +153,20 @@ $(OBJDIR)/$(IMAGE_SBE_NAME).out: pibMemAttrSet buildInfo $(OBJDIR)/base_sbe_fixe
# 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)
+ $(CPP) -E -x c++ -I. -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
-$(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)
+#create a linked ELF executable
+$(OBJDIR)/$(IMAGE_LOADER_NAME).out: $(LOADER_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 $(LOADER_OBJS)
# 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)
+ $(CPP) -I. -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
@@ -173,15 +177,18 @@ all:
@echo "Makefile option error: ALL is not compatible with FAPI2_test"
endif
-.PHONY: all normalize defaultset appendbase appendloader add_L1_LoaderAddr add_kernelAddr symbols
+.PHONY: all normalize defaultset appendbase appendloader add_L1_LoaderAddr add_L2_LoaderAddr add_kernelAddr symbols
-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_kernelAddr symbols tracehash
+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
add_L1_LoaderAddr: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out
- $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set L1_LoaderAddr 0x`nm $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out | grep sbe_loader | cut -f 1 -d " "`
+ $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set L1_LoaderAddr 0x`nm $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out | grep __pmLoader | cut -f 1 -d " "`
+
+add_L2_LoaderAddr: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out
+ $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set L2_LoaderAddr 0x`nm $(OBJDIR)/$(IMAGE_LOADER_NAME).out | grep __base_loader_setup | cut -f 1 -d " "`
add_kernelAddr: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_LOADER_NAME).out
- $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set kernelAddr 0x`nm $(OBJDIR)/$(IMAGE_LOADER_NAME).out | grep base_loader | cut -f 1 -d " "`
+ $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).bin set kernelAddr 0x`nm $(OBJDIR)/$(IMAGE_SBE_NAME).out | grep __pk_boot | cut -f 1 -d " "`
symbols: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(OBJDIR)/$(IMAGE_LOADER_NAME).out $(OBJDIR)/$(IMAGE_SBE_NAME).out
$(NM) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out > $(OBJDIR)/$(SBE_SYMBOLS_NAME)
diff --git a/sbe/image/base_loader.c b/sbe/image/base_loader.c
index 0e67a482..fa0f42fd 100644
--- a/sbe/image/base_loader.c
+++ b/sbe/image/base_loader.c
@@ -1,21 +1,64 @@
#include "p9_xip_image.h"
-#include "sbetrace.H"
+#include "ppe42_scom.h" // for PPE_STVD
+#include "sbe_link.H" // for SBE_BASE_ORIGIN, SBE_SEEPROM_BASE_ORIGIN
-int32_t base_loader();
+// Unconditional jump to a memory location
+#define JUMP_TO_ADDR(VAL ) \
+{ \
+asm volatile ( \
+ "mtlr %0 \n\t" \
+ : \
+ : "r" (VAL)); \
+asm volatile ( \
+ "blr \n\t" \
+ : \
+ );\
+}
+// PIBMEM start address
+const uint32_t g_pibMemAddr = SBE_BASE_ORIGIN;
+// SEEPROM start address
+const uint32_t g_headerAddr = SBE_SEEPROM_BASE_ORIGIN;
+// IVPR register address
+const uint32_t g_ivprLoc = 0xC0000160;
-int32_t base_loader() {
+// Get XIP image header
+P9XipHeader * getXipHdr()
+{
+ P9XipHeader *hdr = (P9XipHeader *)( g_headerAddr );
+ return hdr;
+}
- int32_t rc = 0;
+// Load section to destination address
+int32_t loadSection( P9XipSection * i_section, uint64_t *i_destAddr )
+{
+ uint32_t idx = 0;
+ uint64_t *seepromAddr = (uint64_t *)( g_headerAddr + i_section->iv_offset);
+ uint32_t sectionSize = i_section->iv_size;
+ for( idx = 0; idx < sectionSize; idx += 8 )
+ {
+ *i_destAddr = *seepromAddr;
+ i_destAddr++; seepromAddr++;
- P9XipHeader *hdr = 0;//getXipHdr();
- uint32_t idx;
+ }
+ return 0;
+}
+// Function to load base image into PIBMEM
+int32_t base_loader()
+{
+ int32_t rc = 0;
+ P9XipHeader *hdr = getXipHdr();
- for(idx = 0; idx < P9_XIP_SECTIONS; idx++) {
- hdr++;
- }
+ uint64_t *pibMemAddr = (uint64_t *)g_pibMemAddr;
+ loadSection(&(hdr->iv_section[P9_XIP_SECTION_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;
+ PPE_STVD(g_ivprLoc, data);
+ // Jump to pk boot function
+ uint32_t addr = hdr->iv_kernelAddr;
+ JUMP_TO_ADDR(addr);
return rc;
}
-
diff --git a/sbe/image/base_loader_setup.S b/sbe/image/base_loader_setup.S
new file mode 100644
index 00000000..7c24349c
--- /dev/null
+++ b/sbe/image/base_loader_setup.S
@@ -0,0 +1,34 @@
+ .nolist
+#include "pk.h"
+ .list
+
+### ****************************************************************************
+### Do the initial setup for base loader
+###
+### ****************************************************************************
+
+__base_loader_setup:
+
+ ## Set up PowerPC EABI constant registers.
+
+ _liw %r2, _SDA2_BASE_
+ _liw %r13, _SDA_BASE_
+
+ ## The stack pointer is initialized for use by the remainder of the
+ ## initialization. The linker script defines the initial stack area.
+ ##
+ ## Stacks are always 8-byte aligned. A '0' is stored at the
+ ## stack pointer to indicate the end of the stack chain. Stack frames
+ ## always consist of at least 8 bytes - the backchain pointer and the
+ ## slot above the backchain pointer for the callee's LR.
+
+ _liw %r1, _BASE_LOADER_STACK_LIMIT
+ _clrfield %r1, %r1, 3, 29 # 8-byte align
+ li %r3, 0
+ li %r4, 0
+ stvd %r3, -8(%r1)
+
+ ## Call the base loader
+ bl base_loader
+
+ .epilogue __base_loader_setup
diff --git a/sbe/image/base_ppe_header.S b/sbe/image/base_ppe_header.S
index 3d3ae607..2cfbb23f 100644
--- a/sbe/image/base_ppe_header.S
+++ b/sbe/image/base_ppe_header.S
@@ -189,7 +189,7 @@ __header_string_reserved:
.section .strings, "aS", @progbits
..set_default_space IMAGE_SPACE_SEEPROM
- P9XipHeader P9_SEEPROM_MAGIC, 0xFFF00000, 0xFFF00C78, _seeprom_size
+ P9XipHeader P9_SEEPROM_MAGIC, 0x80000000, 0x80000C78, _seeprom_size
// Create the .fixed section
.proc_sbe_fixed_system
diff --git a/sbe/image/linkloader.cmd b/sbe/image/linkloader.cmd
index b89748bc..e3df600e 100644
--- a/sbe/image/linkloader.cmd
+++ b/sbe/image/linkloader.cmd
@@ -2,20 +2,21 @@
// Need to do this so that elf32-powerpc is not modified!
#undef powerpc
-#ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE 256
+#ifndef BASE_LOADER_STACK_SIZE
+#define BASE_LOADER_STACK_SIZE 128
#endif
+#include <sbe_link.H>
OUTPUT_FORMAT(elf32-powerpc);
MEMORY
{
- sram : ORIGIN = 0xffff2000, LENGTH = 0x10000
+ sram : ORIGIN = SBE_LOADER_BASE_ORIGIN, LENGTH = SBE_LOADER_BASE_LENGTH
}
SECTIONS
{
- . = 0xffff2000;
+ . = SBE_LOADER_BASE_ORIGIN;
////////////////////////////////
// Read-only Data
@@ -29,13 +30,13 @@ SECTIONS
// SDA2 constant sections .sdata2 and .sbss2 must be adjacent to each
// other. Our SDATA sections are small so we'll use strictly positive
- // offsets.
+ // offsets.
_SDA2_BASE_ = .;
.sdata2 . : { *(.sdata2) } > sram
.sbss2 . : { *(.sbss2) } > sram
- // Other read-only data.
+ // Other read-only data.
.rodata . : { *(.rodata*) *(.got2) } > sram
@@ -50,7 +51,7 @@ SECTIONS
// SDA sections .sdata and .sbss must be adjacent to each
// other. Our SDATA sections are small so we'll use strictly positive
- // offsets.
+ // offsets.
_SDA_BASE_ = .;
.sdata . : { *(.sdata) } > sram
@@ -62,9 +63,9 @@ SECTIONS
.rela . : { *(.rela*) } > sram
.rwdata . : { *(.data) *(.bss) } > sram
- _PK_INITIAL_STACK_LIMIT = .;
- . = . + INITIAL_STACK_SIZE;
- _PK_INITIAL_STACK = . - 1;
+ _BASE_LOADER_STACK_LIMIT = .;
+ . = . + BASE_LOADER_STACK_SIZE;
+ _BASE_LOADER_STACK_LIMIT = . - 1;
. = ALIGN(8);
_loader_end = . - 0;
diff --git a/sbe/image/linksbe.cmd b/sbe/image/linksbe.cmd
index d30db15e..a0f76dca 100644
--- a/sbe/image/linksbe.cmd
+++ b/sbe/image/linksbe.cmd
@@ -5,17 +5,18 @@
#ifndef INITIAL_STACK_SIZE
#define INITIAL_STACK_SIZE 256
#endif
+#include <sbe_link.H>
OUTPUT_FORMAT(elf32-powerpc);
MEMORY
{
- sram : ORIGIN = 0xfffe8000, LENGTH = 0x18000
+ sram : ORIGIN = SBE_BASE_ORIGIN, LENGTH = SBE_BASE_LENGTH
}
SECTIONS
{
- . = 0xfffe8000;
+ . = SBE_BASE_ORIGIN;
.vectors : {. = ALIGN(512); *(.vectors)} > sram
.fixed . : {. = ALIGN(512); *(.fixed) } > sram
@@ -54,7 +55,7 @@ SECTIONS
// SDA sections .sdata and .sbss must be adjacent to each
// other. Our SDATA sections are small so we'll use strictly positive
- // offsets.
+ // offsets.
_SDA_BASE_ = .;
.sdata . : { *(.sdata*) } > sram
diff --git a/sbe/image/linkseeprom.cmd b/sbe/image/linkseeprom.cmd
index 42ee99e2..79ad5625 100644
--- a/sbe/image/linkseeprom.cmd
+++ b/sbe/image/linkseeprom.cmd
@@ -1,21 +1,30 @@
// Need to do this so that elf32-powerpc is not modified!
#undef powerpc
-
-#ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE 256
-#endif
-
+#include <sbe_link.H>
OUTPUT_FORMAT(elf32-powerpc);
SECTIONS
{
- . = 0xfff00000;
- _seeprom_origin = . - 0;
+ . = SBE_SEEPROM_BASE_ORIGIN;
+ _seeprom_origin = . - 0;
////////////////////////////////
// Header
////////////////////////////////
. = ALIGN(1); _header_origin = .; _header_offset = . - _seeprom_origin; .header . : { *(.header) } _header_size = . - _header_origin;
+ // @TODO via RTC 136315
+ // This value will change as per OTPROM requirement
+ . = SBE_SEEPROM_BASE_ORIGIN + 0x1000;
+ ////////////////////////////////
+ // LOADER_TEXT
+ ////////////////////////////////
+ . = ALIGN(4); _loader_text_origin = .; _loader_text_offset = . - _seeprom_origin; .loader_text . : { *(.loader_text) } _loader_text_size = . - _loader_text_origin;
+
+ ////////////////////////////////
+ // LOADER_DATA
+ ////////////////////////////////
+ . = ALIGN(8); _loader_data_origin = .; _loader_data_offset = . - _seeprom_origin; .loader_data . : { *(.loader_data) } _loader_data_size = . - _loader_data_origin;
+
////////////////////////////////
// FIXED
////////////////////////////////
@@ -26,15 +35,6 @@ SECTIONS
////////////////////////////////
. = ALIGN(8); _fixed_toc_origin = .; _fixed_toc_offset = . - _seeprom_origin; .fixed_toc . : { *(.fixed_toc) } _fixed_toc_size = . - _fixed_toc_origin;
- ////////////////////////////////
- // LOADER_TEXT
- ////////////////////////////////
- . = ALIGN(4); _loader_text_origin = .; _loader_text_offset = . - _seeprom_origin; .loader_text . : { *(.loader_text) } _loader_text_size = . - _loader_text_origin;
-
- ////////////////////////////////
- // LOADER_DATA
- ////////////////////////////////
- . = ALIGN(8); _loader_data_origin = .; _loader_data_offset = . - _seeprom_origin; .loader_data . : { *(.loader_data) } _loader_data_size = . - _loader_data_origin;
////////////////////////////////
// TEXT
@@ -56,11 +56,6 @@ SECTIONS
////////////////////////////////
. = ALIGN(1); _strings_origin = .; _strings_offset = . - _seeprom_origin; .strings . : { *(.strings) } _strings_size = . - _strings_origin;
-// . = ALIGN(8);
-// _seeprom_size = . - _seeprom_origin;
-// _seeprom_end = . - 0;
-
-
_RODATA_SECTION_BASE = .;
@@ -70,22 +65,15 @@ SECTIONS
// SDA sections .sdata and .sbss must be adjacent to each
// other. Our SDATA sections are small so we'll use strictly positive
- // offsets.
+ // offsets.
_SDA_BASE_ = .;
.sbss . : { *(.sbss) }
.sdata . : { *(.sdata) }
-
- _PK_INITIAL_STACK_LIMIT = .;
- . = . + INITIAL_STACK_SIZE;
- _PK_INITIAL_STACK = . - 1;
-
-
. = ALIGN(8);
_seeprom_size = . - _seeprom_origin;
_seeprom_end = . - 0;
-
}
diff --git a/sbe/image/pm_loader.S b/sbe/image/pm_loader.S
new file mode 100644
index 00000000..84c64020
--- /dev/null
+++ b/sbe/image/pm_loader.S
@@ -0,0 +1,57 @@
+
+ .nolist
+#include "pk.h"
+#include "sbe_link.H"
+ .list
+
+### ****************************************************************************
+### .loader_text - This section contains pm loader code
+### @TODO via RTC 136315
+### It also contains vector code. We can remove vector code
+### once OTPROM support for simics is in.
+### ****************************************************************************
+
+ .section .loader_text, "ax", @progbits
+
+ .global __vectors
+
+__vectors:
+
+ ############################################################
+ # 0x0040 : System Reset
+ ############################################################
+ .global __system_reset
+ .org __vectors + 0x0040
+__system_reset:
+ b __pmLoader
+
+
+__pmLoader:
+ _liw %r3, SBE_LOADER_BASE_SECTION # Base Loader Section Location
+ _liw %r4, SBE_LOADER_BASE_ORIGIN # dest
+ _liw %r9, SBE_SEEPROM_BASE_ORIGIN
+ lwz r5, 4(r3) #size of image in bytes
+ li r6, 3
+ srw r5, r5, r6 # Number of double word transfers
+ mtctr r5 # set the counter for loop
+ lwz r8, 0(r3) # offset of baseloader section
+ adde r8, r8, r9 # add base address to offset to get absolute address
+
+copy_loop:
+ lvd d28, 0(r8)
+ stvd d28, 0(r4)
+ addi r8, r8, 8
+ addi r4, r4, 8
+ bdnz copy_loop
+
+ ############################################################
+ # SBE entry function is 4 byte number in image header
+ ############################################################
+
+ _liw %r3, SBE_SEEPROM_BASE_ORIGIN + SBE_LOADER_ENTRY_HEADER_OFFSET
+ lwz r6, 0(r3)
+ mtlr r6
+ blr
+
+ .epilogue __pmLoader
+
diff --git a/sbe/image/sbe_link.H b/sbe/image/sbe_link.H
index 707e6149..01fe04b9 100644
--- a/sbe/image/sbe_link.H
+++ b/sbe/image/sbe_link.H
@@ -30,7 +30,30 @@
#define OTPROM_CODE_SIZE (1 * OTPROM_BLOCK_SIZE)
/// The link address of the P9 SBE Base image
-#define SBE_BASE_ORIGIN 0xFFFF0000
+#define SBE_BASE_ORIGIN 0xFFFE8000
+/// SBE base image length ( 96 KB - 512 bytes for loader)
+#define SBE_BASE_LENGTH 0x17DFF
+
+///This Index depends upon XIP HEADER File
+// Start offset of sectionTable in XIP header. There are 8 entries
+// of 8 byte each.
+#define SBE_XIP_TOC_OFFSET 8*8
+
+/// The link address of the P9 SBE Base image
+#define SBE_SEEPROM_BASE_ORIGIN 0x80000000
+
+/// This Index depends upon XIP HEADER File
+/// Each section table entry is 12 bytes(SIZE_OF_SBE_XIP_SECTION) size,
+// Base Loader is 10 th (P9_XIP_SECTION_BASELOADER) section
+#define SBE_LOADER_BASE_SECTION SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET \
+ + 120
+// Base Loader start address
+#define SBE_LOADER_BASE_ORIGIN 0xFFFFFE00
+// Base Loader length
+#define SBE_LOADER_BASE_LENGTH 0x200
+
+// Base Loader entry function offset in header
+#define SBE_LOADER_ENTRY_HEADER_OFFSET 20
/// The physical address offset where SBE-SEEPROM code is loaded
///
@@ -43,11 +66,8 @@
/// The link address of the PIBMEM image
#define PIBMEM_ORIGIN 0
-/// The amount of space available in the PIBMEM, in bytes (3KB)
-#define PIBMEM_SIZE (64 * 1024)
-
-/// The offset (in bytes) of the .fixed section in P9 SBE-XIP images
-#define SBE_XIP_FIXED_OFFSET 512
+/// The amount of space available in the PIBMEM, in bytes (96KB)
+#define PIBMEM_SIZE (96 * 1024)
#endif // __SBE_LINK_H
diff --git a/sbe/image/sbe_loader.c b/sbe/image/sbe_loader.c
deleted file mode 100644
index 184ead21..00000000
--- a/sbe/image/sbe_loader.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "p9_xip_image.h"
-
-int32_t sbe_loader() __attribute__ ((section (".loader_text")));
-
-
-int32_t sbe_loader() {
-
- int32_t rc = 0;
-
- P9XipHeader *hdr = 0;//getXipHdr();
- uint32_t idx;
-
-
- for(idx = 0; idx < P9_XIP_SECTIONS; idx++) {
- hdr++;
- }
-
- return rc;
-}
diff --git a/sbe/image/topfiles.mk b/sbe/image/topfiles.mk
index a8f95429..f94034ea 100644
--- a/sbe/image/topfiles.mk
+++ b/sbe/image/topfiles.mk
@@ -1,6 +1,6 @@
-TOP-C-SOURCES = base_ppe_main.c sbe_loader.c
+TOP-C-SOURCES =
TOP-CPP-SOURCES =
-TOP-S-SOURCES = base_ppe_header.S
+TOP-S-SOURCES = base_ppe_header.S pm_loader.S
# generated by ppeParseProcSbeFixed.pl
TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_system.H
@@ -13,8 +13,9 @@ TOP-FIXED-HEADERS += $(IMAGE_SRCDIR)/proc_sbe_fixed_eq.H
TOP_OBJECTS = $(TOP-C-SOURCES:.c=.o) $(TOP-CPP-SOURCES:.C=.o) $(TOP-S-SOURCES:.S=.o)
BASE-LOADER-C-SOURCES = base_loader.c
+BASE-LOADER-S-SOURCES = base_loader_setup.S
-BASE_LOADER_OBJECTS = $(BASE-LOADER-C-SOURCES:.c=.o)
+BASE_LOADER_OBJECTS = $(BASE-LOADER-C-SOURCES:.c=.o) $(BASE-LOADER-S-SOURCES:.S=.o)
PPE_FAPI2_DIR_INCL = $(PPE_FAPI2_DIR)/include
# generated by ppeParseAttributeInfo.pl
OpenPOWER on IntegriCloud