summaryrefslogtreecommitdiffstats
path: root/import/tools/imageProcs
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2016-03-20 20:00:24 -0500
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2017-10-23 16:00:02 -0500
commit65d3612b7983bf7f2299fa30285dfa7aa7c1ec84 (patch)
tree7c05f2d42dee558fd87429c65519b0f88d6e85b1 /import/tools/imageProcs
parent67e95c483435e3ac29164cd38c331fcbf9e27140 (diff)
downloadtalos-hcode-65d3612b7983bf7f2299fa30285dfa7aa7c1ec84.tar.gz
talos-hcode-65d3612b7983bf7f2299fa30285dfa7aa7c1ec84.zip
CME Image Build Flow
Added 1K of zeros to vect, cme_image_header,and hcode section cme_image_header does not contain "XIP CMEM" as first 8 bytes Should this be in this header or XIP header? Change-Id: I9eda19696d86d26dcd9a28956e22aae21ea273c0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22265 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/imageProcs')
-rw-r--r--import/tools/imageProcs/cme_image.S137
-rw-r--r--import/tools/imageProcs/cme_image.cmd132
-rw-r--r--import/tools/imageProcs/cme_image.mk30
3 files changed, 299 insertions, 0 deletions
diff --git a/import/tools/imageProcs/cme_image.S b/import/tools/imageProcs/cme_image.S
new file mode 100644
index 00000000..0a671cec
--- /dev/null
+++ b/import/tools/imageProcs/cme_image.S
@@ -0,0 +1,137 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: import/tools/imageProcs/cme_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 fixed, 8
+ .xip_section fixed_toc, 8
+ .xip_section toc, 4
+ .xip_section strings
+
+ .xip_section vect, 8
+ .xip_section cme_image_header, 8
+ .xip_section hcode, 8
+ .xip_section cmn_ring, 8
+ .xip_section spec_ring, 8
+
+ .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
+__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 .fixed, "a", @progbits
+ .section .fixed_toc, "a", @progbits
+ .section .toc, "a", @progbits
+ .section .strings, "aS", @progbits
+
+ P9XipHeader P9_XIP_MAGIC_CME, 0x80000000, _cme_image_size
+
+// *INDENT-ON*
diff --git a/import/tools/imageProcs/cme_image.cmd b/import/tools/imageProcs/cme_image.cmd
new file mode 100644
index 00000000..2ff05150
--- /dev/null
+++ b/import/tools/imageProcs/cme_image.cmd
@@ -0,0 +1,132 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: import/tools/imageProcs/cme_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 CME_IMAGE_ORIGIN 0x80000000
+OUTPUT_FORMAT(elf32-powerpc);
+
+SECTIONS
+{
+ . = CME_IMAGE_ORIGIN;
+ _cme_image_origin = . - 0;
+ ////////////////////////////////
+ // Header
+ ////////////////////////////////
+ . = ALIGN(1);
+ _header_origin = .;
+ _header_offset = . - _cme_image_origin;
+ .header . : { *(.header) }
+ _header_size = . - _header_origin;
+
+ ////////////////////////////////
+ // FIXED
+ ////////////////////////////////
+ . = ALIGN(512);
+ _fixed_origin = .;
+ _fixed_offset = . - _cme_image_origin;
+ .fixed . : { *(.fixed) }
+ _fixed_size = . - _fixed_origin;
+
+ ////////////////////////////////
+ // FIXED_TOC
+ ////////////////////////////////
+ . = ALIGN(8);
+ _fixed_toc_origin = .;
+ _fixed_toc_offset = . - _cme_image_origin;
+ .fixed_toc . : { *(.fixed_toc) }
+ _fixed_toc_size = . - _fixed_toc_origin;
+
+ ////////////////////////////////
+ // TOC
+ ////////////////////////////////
+ . = ALIGN(4);
+ _toc_origin = .;
+ _toc_offset = . - _cme_image_origin;
+ .toc . : { *(.toc) }
+ _toc_size = . - _toc_origin;
+
+ ////////////////////////////////
+ // STRING
+ ////////////////////////////////
+ . = ALIGN(1);
+ _strings_origin = .;
+ _strings_offset = . - _cme_image_origin;
+ .strings . : { *(.strings) }
+ _strings_size = . - _strings_origin;
+
+ ////////////////////////////////
+ // VECT
+ ////////////////////////////////
+ . = ALIGN(8);
+ _vect_origin = .;
+ _vect_offset = . - _cme_image_origin;
+ .vect . : { *(.vect) }
+ _vect_size = . - _vect_origin;
+
+ ////////////////////////////////
+ // CME IMAGE HEADER
+ ////////////////////////////////
+ . = ALIGN(8);
+ _cme_image_header_origin = .;
+ _cme_image_header_offset = . - _cme_image_origin;
+ .cme_image_header . : { *(.cme_image_header) }
+ _cme_image_header_size = . - _cme_image_header_origin;
+
+ ////////////////////////////////
+ // HCODE
+ ////////////////////////////////
+ . = ALIGN(8);
+ _hcode_origin = .;
+ _hcode_offset = . - _cme_image_origin;
+ .hcode . : { *(.hcode) }
+ _hcode_size = . - _hcode_origin;
+
+ ////////////////////////////////
+ // CMN RING
+ ////////////////////////////////
+ . = ALIGN(8);
+ _cmn_ring_origin = .;
+ _cmn_ring_offset = . - _cme_image_origin;
+ .cmn_ring . : { *(.cmn_ring) }
+ _cmn_ring_size = . - _cmn_ring_origin;
+
+ ////////////////////////////////
+ // SPEC RING
+ ///////////////////////////////
+ . = ALIGN(8);
+ _spec_ring_origin = .;
+ _spec_ring_offset = . - _cme_image_origin;
+ .spec_ring . : { *(.spec_ring) }
+ _spec_ring_size = . - _spec_ring_origin;
+
+ ////////////////////////////////
+ // end of the image
+ ////////////////////////////////
+ . = ALIGN(8);
+ _cme_image_size = . - _cme_image_origin;
+ _cme_image_end = . - 0;
+
+}
diff --git a/import/tools/imageProcs/cme_image.mk b/import/tools/imageProcs/cme_image.mk
new file mode 100644
index 00000000..f6a96bdd
--- /dev/null
+++ b/import/tools/imageProcs/cme_image.mk
@@ -0,0 +1,30 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: import/tools/imageProcs/cme_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=cme_image
+$(call ADD_IMAGE_INCDIR,$(IMAGE),$(ROOTPATH)/chips/p9/xip)
+$(call APPEND_EMPTY_SECTION,vect,1024)
+$(call APPEND_EMPTY_SECTION,cme_image_header,1024)
+$(call APPEND_EMPTY_SECTION,hcode,1024)
+$(call BUILD_IMAGE)
OpenPOWER on IntegriCloud