diff options
| author | Martin Peschke <mpeschke@de.ibm.com> | 2016-03-21 11:44:00 +0100 |
|---|---|---|
| committer | Joshua Hunsberger <jahunsbe@us.ibm.com> | 2017-10-23 16:00:20 -0500 |
| commit | 2bf67e21aa28bd4c0f5c74a135018782d4f1588b (patch) | |
| tree | 05f1247898c817aa6e595e171cacfbbd8eea04d3 /import/tools | |
| parent | f9daa4d82873a0c3631c9e852bd44e4d7354824f (diff) | |
| download | talos-hcode-2bf67e21aa28bd4c0f5c74a135018782d4f1588b.tar.gz talos-hcode-2bf67e21aa28bd4c0f5c74a135018782d4f1588b.zip | |
SGPE Image Build Flow
Preliminary content:
- some dummy sections with 1kB zeros instead of real content
- hcode contains stop_gpe.bin (not sure if this is the right thing)
Change-Id: I8f3dc3f855c08946a2ba36ebe16fe83338c1a0c7
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22284
Tested-by: Jenkins Server
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Diffstat (limited to 'import/tools')
| -rw-r--r-- | import/tools/imageProcs/sgpe_image.S | 136 | ||||
| -rw-r--r-- | import/tools/imageProcs/sgpe_image.cmd | 124 | ||||
| -rw-r--r-- | import/tools/imageProcs/sgpe_image.mk | 33 |
3 files changed, 293 insertions, 0 deletions
diff --git a/import/tools/imageProcs/sgpe_image.S b/import/tools/imageProcs/sgpe_image.S new file mode 100644 index 00000000..228eda8f --- /dev/null +++ b/import/tools/imageProcs/sgpe_image.S @@ -0,0 +1,136 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: import/tools/imageProcs/sgpe_image.S $ */ +/* */ +/* OpenPOWER HCODE Project */ +/* */ +/* COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// *INDENT-OFF* + +#include <p9_xip_image.h> + + .macro P9XipHeader, magic, link_address, image_size + + .section .header, "a", @progbits + + //////////////////////////////////////////////////////////////////// + // First, reserve space for all the enteries in the header + // Identification - 8-byte aligned; 8 Entries; TOC-Indexed + //////////////////////////////////////////////////////////////////// + +__magic: + .quad (\magic) +__L1_LoaderAddr: + .quad 0 +__L2_LoaderAddr: + .quad 0 +__kernelAddr: + .quad 0 +__link_address: + .quad (\link_address) +__header_64_reserved: + .quad 0, 0, 0 + + .xip_toc magic, P9_XIP_UINT64, __magic + .xip_toc L1_LoaderAddr, P9_XIP_UINT64, __L1_LoaderAddr + .xip_toc L2_LoaderAddr, P9_XIP_UINT64, __L2_LoaderAddr + .xip_toc kernelAddr, P9_XIP_UINT64, __kernelAddr + .xip_toc link_address, P9_XIP_UINT64, __link_address + + //////////////////////////////////////////////////////////////////// + // Section Table - 8-byte aligned; 15 entries; Not TOC-Indexed + //////////////////////////////////////////////////////////////////// + + .xip_section header + .xip_section + .xip_section + .xip_section toc, 4 + .xip_section strings + + .xip_section qpmr, 8 + .xip_section lvl1_bl, 8 + .xip_section lvl2_bl, 8 + .xip_section vect, 8 + .xip_section sgpe_image_header 8 + .xip_section hcode, 8 + + .xip_section + .xip_section + .xip_section + .xip_section + + //////////////////////////////////////////////////////////////////// + // Other Information - 4-byte aligned; 8 entries; TOC-Indexed + //////////////////////////////////////////////////////////////////// + +__image_size: + .long (\image_size) +__build_date: + .long 0 +__build_time: + .long 0 +__header_32_reserved: + .long 0, 0, 0, 0, 0 + + .xip_toc image_size, P9_XIP_UINT32, __image_size + .xip_toc build_date, P9_XIP_UINT32, __build_date + .xip_toc build_time, P9_XIP_UINT32, __build_time + + //////////////////////////////////////////////////////////////////// + // Other Information - 1-byte aligned; 8 entries; TOC-Indexed + //////////////////////////////////////////////////////////////////// + +__header_version: + .byte P9_XIP_HEADER_VERSION +__toc_normalized: + .byte 0 +__toc_sorted: + .byte 0 +__header_8_reserved: + .byte 0, 0, 0, 0, 0 + + .xip_toc header_version, P9_XIP_UINT8, __header_version + .xip_toc toc_normalized, P9_XIP_UINT8, __toc_normalized + .xip_toc toc_sorted, P9_XIP_UINT8, __toc_sorted + + //////////////////////////////////////////////////////////////////// + // Strings; 64 characters allocated; TOC-Indexed + //////////////////////////////////////////////////////////////////// + +__build_user: + .asciz "unknown " # 16 Characters allocated +__build_host: + .asciz "unknown " # 24 characters allocated +__header_string_reserved: + .space 24, 0 + + .xip_toc build_user, P9_XIP_STRING, __build_user + .xip_toc build_host, P9_XIP_STRING, __build_host + + .endm + + .section .toc, "a", @progbits + .section .strings, "aS", @progbits + + // FIXME: start address of HW Image in PNOR + P9XipHeader P9_XIP_MAGIC_SGPE, 0x80000000, _sgpe_image_size + +// *INDENT-ON* diff --git a/import/tools/imageProcs/sgpe_image.cmd b/import/tools/imageProcs/sgpe_image.cmd new file mode 100644 index 00000000..3fc6679d --- /dev/null +++ b/import/tools/imageProcs/sgpe_image.cmd @@ -0,0 +1,124 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: import/tools/imageProcs/sgpe_image.cmd $ */ +/* */ +/* OpenPOWER HCODE Project */ +/* */ +/* COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Need to do this so that elf32-powerpc is not modified! +#undef powerpc + +#define SGPE_IMAGE_ORIGIN 0x80000000 +OUTPUT_FORMAT(elf32-powerpc); + +SECTIONS +{ + . = SGPE_IMAGE_ORIGIN; + _sgpe_image_origin = . - 0; + //////////////////////////////// + // Header + //////////////////////////////// + . = ALIGN(1); + _header_origin = .; + _header_offset = . - _sgpe_image_origin; + .header . : { *(.header) } + _header_size = . - _header_origin; + + //////////////////////////////// + // TOC + //////////////////////////////// + . = ALIGN(4); + _toc_origin = .; + _toc_offset = . - _sgpe_image_origin; + .toc . : { *(.toc) } + _toc_size = . - _toc_origin; + + //////////////////////////////// + // STRING + //////////////////////////////// + . = ALIGN(1); + _strings_origin = .; + _strings_offset = . - _sgpe_image_origin; + .strings . : { *(.strings) } + _strings_size = . - _strings_origin; + + //////////////////////////////// + // QPMR + //////////////////////////////// + . = ALIGN(8); + _qpmr_origin = .; + _qpmr_offset = . - _sgpe_image_origin; + .qpmr . : { *(.qpmr) } + _qpmr_size = . - _qpmr_origin; + + //////////////////////////////// + // Level 1 Bootloader + //////////////////////////////// + . = ALIGN(8); + _lvl1_bl_origin = .; + _lvl1_bl_offset = . - _sgpe_image_origin; + .lvl1_bl . : { *(.lvl1_bl) } + _lvl1_bl_size = . - _lvl1_bl_origin; + + //////////////////////////////// + // Level 2 Bootloader + //////////////////////////////// + . = ALIGN(8); + _lvl2_bl_origin = .; + _lvl2_bl_offset = . - _sgpe_image_origin; + .lvl2_bl . : { *(.lvl2_bl) } + _lvl2_bl_size = . - _lvl2_bl_origin; + + //////////////////////////////// + // Vectors + //////////////////////////////// + . = ALIGN(8); + _vect_origin = .; + _vect_offset = . - _sgpe_image_origin; + .vect . : { *(.vect) } + _vect_size = . - _vect_origin; + + //////////////////////////////// + // SGPE Image Header + //////////////////////////////// + . = ALIGN(8); + _sgpe_image_header_origin = .; + _sgpe_image_header_offset = . - _sgpe_image_origin; + .sgpe_image_header . : { *(.sgpe_image_header) } + _sgpe_image_header_size = . - _sgpe_image_header_origin; + + //////////////////////////////// + // HCODE + //////////////////////////////// + . = ALIGN(8); + _hcode_origin = .; + _hcode_offset = . - _sgpe_image_origin; + .hcode . : { *(.hcode) } + _hcode_size = . - _hcode_origin; + + //////////////////////////////// + // end of the image + //////////////////////////////// + . = ALIGN(8); + _sgpe_image_size = . - _sgpe_image_origin; + _sgpe_image_end = . - 0; + +} diff --git a/import/tools/imageProcs/sgpe_image.mk b/import/tools/imageProcs/sgpe_image.mk new file mode 100644 index 00000000..1a0a0e85 --- /dev/null +++ b/import/tools/imageProcs/sgpe_image.mk @@ -0,0 +1,33 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: import/tools/imageProcs/sgpe_image.mk $ +# +# OpenPOWER HCODE Project +# +# COPYRIGHT 2016,2017 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +IMAGE=sgpe_image +$(call ADD_IMAGE_INCDIR,$(IMAGE),$(ROOTPATH)/chips/p9/xip) +$(call APPEND_EMPTY_SECTION,qpmr,1024) +$(call APPEND_EMPTY_SECTION,lvl1_bl,1024) +$(call APPEND_EMPTY_SECTION,lvl2_bl,1024) +$(call APPEND_EMPTY_SECTION,vect,1024) +$(call APPEND_EMPTY_SECTION,sgpe_image_header,1024) +$(call XIP_TOOL,append,.hcode,$(ROOTPATH)/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/obj/stop_gpe/stop_gpe.bin) +$(call BUILD_IMAGE) |

