diff options
| author | Richard J. Knight <rjknight@us.ibm.com> | 2017-10-13 15:49:25 -0500 |
|---|---|---|
| committer | Richard J. Knight <rjknight@us.ibm.com> | 2017-10-17 15:05:22 -0500 |
| commit | 41e7df45e64f623499b8d286a4012e6e7d24eaf6 (patch) | |
| tree | e7a54e4950d2610c3fddeaf2b74b53b424315bf1 /tools/imageProcs | |
| download | talos-hcode-41e7df45e64f623499b8d286a4012e6e7d24eaf6.tar.gz talos-hcode-41e7df45e64f623499b8d286a4012e6e7d24eaf6.zip | |
Initial hcode commit
Change-Id: I2c6c9b05c6afbd7732f472ea9cf049d00c5cad45
Diffstat (limited to 'tools/imageProcs')
| -rw-r--r-- | tools/imageProcs/hw_image.S | 134 | ||||
| -rw-r--r-- | tools/imageProcs/hw_image.cmd | 141 | ||||
| -rw-r--r-- | tools/imageProcs/hw_image.mk | 99 | ||||
| -rw-r--r-- | tools/imageProcs/ioppe_image.S | 136 | ||||
| -rw-r--r-- | tools/imageProcs/ioppe_image.cmd | 97 | ||||
| -rw-r--r-- | tools/imageProcs/ioppe_image.mk | 78 |
6 files changed, 685 insertions, 0 deletions
diff --git a/tools/imageProcs/hw_image.S b/tools/imageProcs/hw_image.S new file mode 100644 index 00000000..9c0502a3 --- /dev/null +++ b/tools/imageProcs/hw_image.S @@ -0,0 +1,134 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: tools/imageProcs/hw_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 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 sgpe, 8 + .xip_section core_restore, 8 + .xip_section cme, 8 + .xip_section pgpe, 8 + .xip_section ioppe, 8 + .xip_section fppe, 8 + .xip_section rings, 8 + .xip_section overlays, 8 + + .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 +__build_tag: + .asciz "unknown " # 20 Characters + + .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 + .xip_toc build_tag, P9_XIP_STRING, __build_tag + + //////////////////////////////////////////////////////////////////// + // 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 +__build_host: + .asciz "unknown " # 40 characters +__header_string_reserved: + .space 8, 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_HW, 0x80000000, _hw_image_size + +// *INDENT-ON* diff --git a/tools/imageProcs/hw_image.cmd b/tools/imageProcs/hw_image.cmd new file mode 100644 index 00000000..f88820e6 --- /dev/null +++ b/tools/imageProcs/hw_image.cmd @@ -0,0 +1,141 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: tools/imageProcs/hw_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 HW_IMAGE_ORIGIN 0x80000000 +OUTPUT_FORMAT(elf32-powerpc); + +SECTIONS +{ + . = HW_IMAGE_ORIGIN; + _hw_image_origin = . - 0; + //////////////////////////////// + // Header + //////////////////////////////// + . = ALIGN(1); + _header_origin = .; + _header_offset = . - _hw_image_origin; + .header . : { *(.header) } + _header_size = . - _header_origin; + + //////////////////////////////// + // TOC + //////////////////////////////// + . = ALIGN(4); + _toc_origin = .; + _toc_offset = . - _hw_image_origin; + .toc . : { *(.toc) } + _toc_size = . - _toc_origin; + + //////////////////////////////// + // STRING + //////////////////////////////// + . = ALIGN(1); + _strings_origin = .; + _strings_offset = . - _hw_image_origin; + .strings . : { *(.strings) } + _strings_size = . - _strings_origin; + + //////////////////////////////// + // SGPE + //////////////////////////////// + . = ALIGN(8); + _sgpe_origin = .; + _sgpe_offset = . - _hw_image_origin; + .sgpe . : { *(.sgpe) } + _sgpe_size = . - _sgpe_origin; + + //////////////////////////////// + // CORE RESTORE + //////////////////////////////// + . = ALIGN(8); + _core_restore_origin = .; + _core_restore_offset = . - _hw_image_origin; + .core_restore . : { *(.core_restore) } + _core_restore_size = . - _core_restore_origin; + + //////////////////////////////// + // CME + //////////////////////////////// + . = ALIGN(8); + _cme_origin = .; + _cme_offset = . - _hw_image_origin; + .cme . : { *(.cme) } + _cme_size = . - _cme_origin; + + //////////////////////////////// + // PGPE + //////////////////////////////// + . = ALIGN(8); + _pgpe_origin = .; + _pgpe_offset = . - _hw_image_origin; + .pgpe . : { *(.pgpe) } + _pgpe_size = . - _pgpe_origin; + + //////////////////////////////// + // IOPPE + //////////////////////////////// + . = ALIGN(8); + _ioppe_origin = .; + _ioppe_offset = . - _hw_image_origin; + .ioppe . : { *(.ioppe) } + _ioppe_size = . - _ioppe_origin; + + //////////////////////////////// + // FPPE + //////////////////////////////// + . = ALIGN(8); + _fppe_origin = .; + _fppe_offset = . - _hw_image_origin; + .fppe . : { *(.fppe) } + _fppe_size = . - _fppe_origin; + + //////////////////////////////// + // RINGS + //////////////////////////////// + . = ALIGN(8); + _rings_origin = .; + _rings_offset = . - _hw_image_origin; + .rings . : { *(.rings) } + _rings_size = . - _rings_origin; + + //////////////////////////////// + // OVERLAYS + //////////////////////////////// + . = ALIGN(8); + _overlays_origin = .; + _overlays_offset = . - _hw_image_origin; + .overlays . : { *(.overlays) } + _overlays_size = . - _overlays_origin; + + //////////////////////////////// + // end of the image + //////////////////////////////// + . = ALIGN(8); + _hw_image_size = . - _hw_image_origin; + _hw_image_end = . - 0; + +} diff --git a/tools/imageProcs/hw_image.mk b/tools/imageProcs/hw_image.mk new file mode 100644 index 00000000..91776d4a --- /dev/null +++ b/tools/imageProcs/hw_image.mk @@ -0,0 +1,99 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: tools/imageProcs/hw_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 + +MAX_SBE_RING_SECTION_SIZE ?= 25600 + +#depend on the completion of the base hw_image +#binfiles to add to the hw_image +#various image dependencies to serialize hw_image creation +#$1 == type +#$2 == chipId +define BUILD_HW_IMAGE +$(eval IMAGE=$2.$1_image) + + +$(eval $(IMAGE)_PATH=$(IMAGEPATH)/hw_image) +$(eval $(IMAGE)_LINK_SCRIPT=hw_image.cmd) +$(eval $(IMAGE)_LAYOUT=$(IMAGEPATH)/hw_image/hw_image.o) +$(eval hw_image_COMMONFLAGS += -I$(ROOTPATH)/chips/p9/xip/) + +$(eval $(IMAGE)_FILE_SGPE = $(IMAGEPATH)/sgpe_image/$2.sgpe_image.bin) +$(eval $(IMAGE)_FILE_RESTORE = $(IMAGEPATH)/restore_image/$2.restore_image.bin) +$(eval $(IMAGE)_FILE_CME = $(IMAGEPATH)/cme_image/$2.cme_image.bin) +$(eval $(IMAGE)_FILE_PSTATE = $(IMAGEPATH)/pstate_gpe_image/$2.pstate_gpe_image.bin) +$(eval $(IMAGE)_FILE_IOPPE = $(IMAGEPATH)/ioppe_image/$2.ioppe_image.bin) +$(eval $(IMAGE)_FILE_RINGS = $(GENPATH)/rings/$1/$2.$1.rings.bin) +$(eval $(IMAGE)_FILE_OVERLAYS= $(GENPATH)/rings/$1/$2.$1.overlays.bin) + +# dependencies for appending image sections in sequence +$(eval $(IMAGE)_DEPS_SGPE =$(IMAGEPATH)/sgpe_image/.$2.sgpe_image.bin.built) +$(eval $(IMAGE)_DEPS_SGPE+=$$($(IMAGE)_PATH)/.$(IMAGE).setbuild_host) + + +$(eval $(IMAGE)_DEPS_RESTORE =$(IMAGEPATH)/restore_image/.$2.restore_image.bin.built) +$(eval $(IMAGE)_DEPS_RESTORE+=$$($(IMAGE)_PATH)/.$(IMAGE).append.sgpe) + +$(eval $(IMAGE)_DEPS_CME =$(IMAGEPATH)/cme_image/.$2.cme_image.bin.built) +$(eval $(IMAGE)_DEPS_CME+=$$($(IMAGE)_PATH)/.$(IMAGE).append.core_restore) + +$(eval $(IMAGE)_DEPS_PSTATE =$(IMAGEPATH)/pstate_gpe_image/.$2.pstate_gpe_image.bin.built) +$(eval $(IMAGE)_DEPS_PSTATE+=$$($(IMAGE)_PATH)/.$(IMAGE).append.cme) + +$(eval $(IMAGE)_DEPS_IOPPE =$(IMAGEPATH)/ioppe_image/.$2.ioppe_image.bin.built) +$(eval $(IMAGE)_DEPS_IOPPE+=$$($(IMAGE)_PATH)/.$(IMAGE).append.pgpe) + +$(eval $(IMAGE)_DEPS_RINGS =$$($(IMAGE)_FILE_RINGS)) +$(eval $(IMAGE)_DEPS_RINGS+=$$($(IMAGE)_PATH)/.$(IMAGE).append.ioppe) + +$(eval $(IMAGE)_DEPS_OVERLAYS = $$($(IMAGE)_FILE_OVERLAYS)) +$(eval $(IMAGE)_DEPS_OVERLAYS+= $$($(IMAGE)_PATH)/.$(IMAGE).append.rings) + +# image build using all files and serialised by dependencies +$(eval $(call XIP_TOOL,append,.sgpe,$$($(IMAGE)_DEPS_SGPE),$$($(IMAGE)_FILE_SGPE))) +$(eval $(call XIP_TOOL,append,.core_restore,$$($(IMAGE)_DEPS_RESTORE),$$($(IMAGE)_FILE_RESTORE))) +$(eval $(call XIP_TOOL,append,.cme,$$($(IMAGE)_DEPS_CME),$$($(IMAGE)_FILE_CME))) +$(eval $(call XIP_TOOL,append,.pgpe,$$($(IMAGE)_DEPS_PSTATE),$$($(IMAGE)_FILE_PSTATE))) +$(eval $(call XIP_TOOL,append,.ioppe,$$($(IMAGE)_DEPS_IOPPE),$$($(IMAGE)_FILE_IOPPE))) + + +$(eval $(call XIP_TOOL,append,.rings,$$($(IMAGE)_DEPS_RINGS),$$($(IMAGE)_FILE_RINGS))) + +$(eval $(call XIP_TOOL,append,.overlays,$$($(IMAGE)_DEPS_OVERLAYS), $$($(IMAGE)_FILE_OVERLAYS) 1)) + +$(eval $(call XIP_TOOL,report,,$$($(IMAGE)_PATH)/.$(IMAGE).append.overlays)) + +$(eval $(foreach ec, $(p9n_EC),\ + $(eval $(call VERIFY_SBE_RING_SECTION, 0x$(ec), $(MAX_SBE_RING_SECTION_SIZE),$(ec))))) + +$(eval $(call BUILD_XIPIMAGE)) +endef + +define VERIFY_SBE_RING_SECTION + $(eval $(call XIP_TOOL,check-sbe-ring-section,,$($(IMAGE)_PATH)/.$(IMAGE).report, $1 $2,$3)) +endef + +$(eval $(call BUILD_HW_IMAGE,hw,p9n)) + + diff --git a/tools/imageProcs/ioppe_image.S b/tools/imageProcs/ioppe_image.S new file mode 100644 index 00000000..4f3354be --- /dev/null +++ b/tools/imageProcs/ioppe_image.S @@ -0,0 +1,136 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: tools/imageProcs/ioppe_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 iof + .xip_section ioo_abus + .xip_section ioo_nv + .xip_section + .xip_section + + .xip_section + .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 +__build_tag: + .asciz "unknown " # 20 Characters + + .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 + .xip_toc build_tag, P9_XIP_STRING, __build_tag + + //////////////////////////////////////////////////////////////////// + // 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 +__build_host: + .asciz "unknown " # 24 characters +__header_string_reserved: + .space 8, 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 + + P9XipHeader P9_XIP_MAGIC_IOPPE, 0x80000000, _ioppe_image_size + +// *INDENT-ON* diff --git a/tools/imageProcs/ioppe_image.cmd b/tools/imageProcs/ioppe_image.cmd new file mode 100644 index 00000000..40955e12 --- /dev/null +++ b/tools/imageProcs/ioppe_image.cmd @@ -0,0 +1,97 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: tools/imageProcs/ioppe_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 IOPPE_IMAGE_ORIGIN 0x80000000 +OUTPUT_FORMAT(elf32-powerpc); + +SECTIONS +{ + . = IOPPE_IMAGE_ORIGIN; + _ioppe_image_origin = . - 0; + //////////////////////////////// + // Header + //////////////////////////////// + . = ALIGN(1); + _header_origin = .; + _header_offset = . - _ioppe_image_origin; + .header . : { *(.header) } + _header_size = . - _header_origin; + + //////////////////////////////// + // TOC + //////////////////////////////// + . = ALIGN(4); + _toc_origin = .; + _toc_offset = . - _ioppe_image_origin; + .toc . : { *(.toc) } + _toc_size = . - _toc_origin; + + //////////////////////////////// + // STRING + //////////////////////////////// + . = ALIGN(1); + _strings_origin = .; + _strings_offset = . - _ioppe_image_origin; + .strings . : { *(.strings) } + _strings_size = . - _strings_origin; + + //////////////////////////////// + // IOF + //////////////////////////////// + . = ALIGN(8); + _iof_origin = .; + _iof_offset = . - _ioppe_image_origin; + .iof . : { *(.iof) } + _iof_size = . - _iof_origin; + + //////////////////////////////// + // IOO ABUS + //////////////////////////////// + . = ALIGN(8); + _ioo_abus_origin = .; + _ioo_abus_offset = . - _ioppe_image_origin; + .ioo_abus . : { *(.ioo_abus) } + _ioo_abus_size = . - _ioo_abus_origin; + + //////////////////////////////// + // IOO NV + //////////////////////////////// + . = ALIGN(8); + _ioo_nv_origin = .; + _ioo_nv_offset = . - _ioppe_image_origin; + .ioo_nv . : { *(.ioo_nv) } + _ioo_nv_size = . - _ioo_nv_origin; + + //////////////////////////////// + // end of the image + //////////////////////////////// + . = ALIGN(8); + _ioppe_image_size = . - _ioppe_image_origin; + _ioppe_image_end = . - 0; + +} diff --git a/tools/imageProcs/ioppe_image.mk b/tools/imageProcs/ioppe_image.mk new file mode 100644 index 00000000..e7818bd7 --- /dev/null +++ b/tools/imageProcs/ioppe_image.mk @@ -0,0 +1,78 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: tools/imageProcs/ioppe_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 +# $1 == chipId +define BUILD_IOPPE_IMAGE +$(eval IMAGE=$1.ioppe_image) + +$(eval $(IMAGE)_PATH=$(IMAGEPATH)/ioppe_image) +$(eval $(IMAGE)_LINK_SCRIPT=ioppe_image.cmd) +$(eval $(IMAGE)_LAYOUT=$(IMAGEPATH)/ioppe_image/ioppe_image.o) +$(eval ioppe_image_COMMONFLAGS += -I$(ROOTPATH)/chips/p9/xip/) + +# files to be appended to image +$(eval $(IMAGE)_FILE_IOF=$(IMAGEPATH)/iox/iox.bin) +$(eval $(IMAGE)_FILE_IOO_ABUS=$(IMAGEPATH)/ioa/ioa.bin) + +$(eval $(IMAGE)_FILE_IOO_NV=$(CONFIG_IONV_FILE_LOCATION)) + +# dependencies for appending image sections in sequence: +# - file to be appended +# - all dependencies of previously appended sections or on raw image +# - append operation as to other section that has to be finished first +$(eval $(IMAGE)_DEPS_IOF =$$($(IMAGE)_FILE_IOF)) +$(eval $(IMAGE)_DEPS_IOF+=$$($(IMAGE)_PATH)/.$(IMAGE).setbuild_host) + +$(eval $(IMAGE)_DEPS_IOO_ABUS =$$($(IMAGE)_FILE_IOO_ABUS)) +$(eval $(IMAGE)_DEPS_IOO_ABUS+=$$($(IMAGE)_DEPS_IOF)) +$(eval $(IMAGE)_DEPS_IOO_ABUS+=$$($(IMAGE)_PATH)/.$(IMAGE).append.iof) + +$(eval $(IMAGE)_DEPS_IOO_NV =$$($(IMAGE)_FILE_IOO_NV)) +$(eval $(IMAGE)_DEPS_IOO_NV+=$$($(IMAGE)_DEPS_IOO_ABUS)) +$(eval $(IMAGE)_DEPS_IOO_NV+=$$($(IMAGE)_PATH)/.$(IMAGE).append.ioo_abus) + +$(eval $(IMAGE)_DEPS_REPORT =$$($(IMAGE)_DEPS_IOO_NV)) + +#fix up the dependancies if we include the ionv.bin file +$(if $(findstring y,$(CONFIG_INCLUDE_IONV)),\ +$(eval $(IMAGE)_DEPS_REPORT+=$$($(IMAGE)_PATH)/.$(IMAGE).append.ioo_nv),\ +$(eval $(IMAGE)_DEPS_REPORT+=$$($(IMAGE)_PATH)/.$(IMAGE).append.ioo_abus)) + +# image build using all files and serialised by dependencies +$(eval $(call XIP_TOOL,append,.iof,$$($(IMAGE)_DEPS_IOF),$$($(IMAGE)_FILE_IOF))) +$(eval $(call XIP_TOOL,append,.ioo_abus,$$($(IMAGE)_DEPS_IOO_ABUS),$$($(IMAGE)_FILE_IOO_ABUS))) + +$(if $(findstring y,$(CONFIG_INCLUDE_IONV)),\ +$(eval $(call XIP_TOOL,append,.ioo_nv,$$($(IMAGE)_DEPS_IOO_NV),$$($(IMAGE)_FILE_IOO_NV)))) + +# create image report for image with all files appended +$(eval $(call XIP_TOOL,report,,$$($(IMAGE)_DEPS_REPORT))) + +$(eval $(call BUILD_XIPIMAGE)) +endef + +$(foreach chip,$(CHIPS),\ + $(foreach chipId, $($(chip)_CHIPID),\ + $(eval $(call BUILD_IOPPE_IMAGE,$(chipId))))) + |

