summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@us.ibm.com>2018-08-16 10:30:44 -0500
committerhostboot <hostboot@us.ibm.com>2019-02-04 10:50:16 -0600
commitf38abc883f4a0e7ba8868d3500518d8b131d0206 (patch)
treedbce903488f0fd171bbc2530bd020fee6d714235
parenta6f1075b895564541da772110ea5ca0b4abc1514 (diff)
downloadtalos-hcode-f38abc883f4a0e7ba8868d3500518d8b131d0206.tar.gz
talos-hcode-f38abc883f4a0e7ba8868d3500518d8b131d0206.zip
HCODE: Add git commit to version field for QPMR, PPMR, and CPMR
Key_Cronus_Test=PM_REGRESS Change-Id: I0fb804fcc4a591260138ebda65940b61fab8b9c4 RTC: 201124 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64648 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9c10.mk5
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9c11.mk5
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9n10.mk7
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9n20.mk7
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9n21.mk5
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9n22.mk5
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/cme_p9n23.mk5
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/p9_cpmr_img_edit.C155
-rw-r--r--import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_img_edit.c12
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_img_edit.c14
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c10.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c11.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n10.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n20.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n21.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n22.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n23.mk4
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/p9_sgpe_img_edit.c141
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_img_edit.c14
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9c10.mk7
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n10.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n20.mk7
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n21.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n22.mk6
-rw-r--r--import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n23.mk4
25 files changed, 113 insertions, 338 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9c10.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9c10.mk
index 57e9d47f..db599449 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9c10.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9c10.mk
@@ -79,4 +79,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin,$(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9c11.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9c11.mk
index fdd88956..6b6d1208 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9c11.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9c11.mk
@@ -79,4 +79,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin,$(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n10.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n10.mk
index a633ed9e..d56fd077 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n10.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n10.mk
@@ -77,6 +77,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-$(call BUILD_BINHEADER, \
- $(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin, \
- $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_TARGET)/$(CME_TARGET).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n20.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n20.mk
index 5744b18d..902e560b 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n20.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n20.mk
@@ -77,6 +77,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER, \
- $(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin, \
- $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n21.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n21.mk
index 9a9f3c9e..65503546 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n21.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n21.mk
@@ -80,4 +80,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin,$(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n22.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n22.mk
index 67f12a45..df41bb28 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n22.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n22.mk
@@ -80,4 +80,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin,$(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+ gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n23.mk b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n23.mk
index fea0317d..08e168bc 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/cme_p9n23.mk
+++ b/import/chips/p9/procedures/ppe_closed/cme/cme_p9n23.mk
@@ -80,4 +80,7 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
- $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin,$(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+ $(call BUILD_BINHEADER,$(IMAGEPATH)/$(CME_IMAGE)/$(CME_IMAGE).bin, \
+ $(ROOTPATH)/chips/p9/procedures/utils/stopreg/selfRest.bin \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/cme/p9_cpmr_img_edit.C b/import/chips/p9/procedures/ppe_closed/cme/p9_cpmr_img_edit.C
deleted file mode 100644
index c4ae3e34..00000000
--- a/import/chips/p9/procedures/ppe_closed/cme/p9_cpmr_img_edit.C
+++ /dev/null
@@ -1,155 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: import/chips/p9/procedures/ppe_closed/cme/p9_cpmr_img_edit.C $ */
-/* */
-/* OpenPOWER HCODE Project */
-/* */
-/* COPYRIGHT 2015,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 */
-
-#include <stdio.h>
-#include <stdint.h>
-#include <netinet/in.h>
-#include <time.h>
-#include <stddef.h> /* offsetof */
-
-#include <pk_debug_ptrs.h>
-#include <p9_hcode_image_defines.H>
-
-using namespace p9_hcodeImageBuild;
-
-int main(int narg, char* argv[])
-{
- if (narg < 4)
- {
- printf("Usage: %s <full path to image>\n",
- argv[0]);
- return -1;
- }
-
- FILE* pImage = fopen( argv[1], "r+" );
- FILE* pCpmr = fopen( argv[2], "r+" );
- FILE* pSelfRest = fopen( argv[3], "r+");
-
- time_t buildTime = time(NULL);
- struct tm* headerTime = localtime(&buildTime);
-
- cmeHeader_t cmeHeader;
- cpmrHeader_t cpmrHeader;
-
- do
- {
- if( !pImage )
- {
- break;
- }
-
- if( !pCpmr )
- {
- break;
- }
-
- printf(" Debug Pointers Offset : %d (0x%X)\n", PPE_DEBUG_PTRS_OFFSET, PPE_DEBUG_PTRS_OFFSET);
- printf(" Debug Pointers size : %d (0x%X)\n", sizeof(pk_debug_ptrs_t), sizeof(pk_debug_ptrs_t));
-
- printf(" CME Image Offset : %d (0x%X)\n", PPE_DEBUG_PTRS_OFFSET + sizeof(pk_debug_ptrs_t),
- PPE_DEBUG_PTRS_OFFSET + sizeof(pk_debug_ptrs_t));
-
- fseek (pCpmr, 0, SEEK_END);
- uint32_t Cpmrsize = ftell (pCpmr);
- rewind(pCpmr);
- printf(" CPMR size : %d (0x%X)\n", Cpmrsize, Cpmrsize);
-
- fseek (pImage, 0, SEEK_END);
- uint32_t Imagesize = ftell (pImage);
- rewind(pImage);
- printf(" Hcode Image size : %d (0x%X)\n", Imagesize, Imagesize);
-
- fseek (pSelfRest, 0, SEEK_END);
- uint32_t selfRestSize = ftell (pSelfRest);
- rewind(pSelfRest);
- printf(" Self Restore size : %d (0x%X)\n", selfRestSize, selfRestSize);
-
- // cme build date yyyymmdd
- fseek ( pImage, CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t, g_cme_build_date) , SEEK_SET );
- fseek ( pCpmr, offsetof(cpmrHeader_t, cpmrbuildDate) , SEEK_SET );
- uint32_t temp = (((headerTime->tm_year + 1900) << 16) |
- ((headerTime->tm_mon + 1) << 8) |
- (headerTime->tm_mday));
- printf(" Build date : %X -> %04d/%02d/%02d (YYYY/MM/DD)\n",
- temp, headerTime->tm_year + 1900, headerTime->tm_mon + 1, headerTime->tm_mday);
-
- temp = htonl(temp);
- fwrite(&temp, sizeof(cmeHeader.g_cme_build_date), 1, pImage );
- fwrite(&temp, sizeof(cpmrHeader.cpmrbuildDate), 1, pCpmr );
-
- // cme build version
- fseek ( pImage, CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t, g_cme_build_ver) , SEEK_SET );
- fseek ( pCpmr, offsetof(cpmrHeader_t, cpmrVersion) , SEEK_SET );
- temp = htonl(CME_BUILD_VERSION);
- fwrite(&temp, sizeof(cmeHeader.g_cme_build_ver), 1, pImage );
- fwrite(&temp, sizeof(cpmrHeader.cpmrVersion), 1, pCpmr );
-
- printf(" CME_HEADER_IMAGE_OFFSET : %X\n", CME_HEADER_IMAGE_OFFSET);
-
- // cme hcode offset
- fseek ( pImage, CME_HCODE_OFF_IMAGE_OFFSET , SEEK_SET );
- temp = CME_HCODE_IMAGE_OFFSET;
- temp = htonl(temp);
- fwrite(&(temp), sizeof(uint32_t), 1, pImage );
-
- // cme hcode length
- fseek ( pImage , CME_HCODE_LEN_IMAGE_OFFSET , SEEK_SET );
- temp = htonl( Imagesize );
- fwrite(&temp, sizeof(uint32_t), 1, pImage );
- fwrite(&temp, sizeof(uint32_t), 1, pCpmr );
-
- // self restore offset+ length
- fseek ( pCpmr , CPMR_SELF_RESTORE_OFFSET_BYTE , SEEK_SET );
- temp = htonl( SELF_RESTORE_CPMR_OFFSET );
- fwrite(&temp, sizeof(uint32_t), 1, pCpmr );
-
- fseek ( pCpmr , CPMR_SELF_RESTORE_LENGTH_BYTE , SEEK_SET );
- temp = htonl( selfRestSize );
- fwrite(&temp, sizeof(uint32_t), 1, pCpmr );
-
- printf(" CME Hcode Offset Address: %X\n", CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t,
- g_cme_hcode_offset));
- fseek ( pImage, CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t, g_cme_hcode_offset) , SEEK_SET );
- temp = CME_HCODE_IMAGE_OFFSET;
- temp = htonl(temp);
- fwrite(&temp, sizeof(cmeHeader.g_cme_hcode_offset), 1, pImage );
- fwrite(&temp, sizeof(cpmrHeader.cmeImgOffset), 1, pCpmr );
-
- // cme hcode length
- printf(" CME HCode Length Address: %X\n", CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t,
- g_cme_hcode_length));
- fseek ( pImage, CME_HEADER_IMAGE_OFFSET + offsetof(cmeHeader_t, g_cme_hcode_length) , SEEK_SET );
- fseek ( pCpmr, offsetof(cpmrHeader_t, cmeImgLength) , SEEK_SET );
- temp = htonl( Imagesize );
- fwrite(&temp, sizeof(cmeHeader.g_cme_hcode_length), 1, pImage );
- fwrite(&temp, sizeof(cpmrHeader.cmeImgLength), 1, pCpmr );
-
- fclose(pImage);
- fclose(pCpmr);
- }
- while(0);
-
- return 0;
-}
diff --git a/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_img_edit.c b/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_img_edit.c
index fb3bcac0..a7e4ad48 100644
--- a/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_img_edit.c
+++ b/import/chips/p9/procedures/ppe_closed/cme/stop_cme/p9_cme_img_edit.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
-/* COPYRIGHT 2015,2017 */
+/* COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -27,6 +27,7 @@
#include <stdint.h>
#include <netinet/in.h>
#include <stddef.h> /* offsetof */
+#include <stdlib.h>
#include <pk_debug_ptrs.h>
#include <p9_hcode_image_defines.H>
@@ -85,6 +86,7 @@ int main(int narg, char* argv[])
imageType = CPMR_IMAGE;
hcodeLenPos = offsetof(cpmrHeader_t, cmeImgLength);
hcodeOffsetPos = offsetof(cpmrHeader_t, cmeImgOffset);
+
printf(" CPMR size : %d (0x%X)\n", size, size);
FILE* pHcodeImage = fopen( argv[2], "r+" );
fseek (pHcodeImage, 0, SEEK_END);
@@ -121,6 +123,14 @@ int main(int narg, char* argv[])
fseek ( pImage , CPMR_SELF_RESTORE_LENGTH_BYTE , SEEK_SET );
temp = htonl( selfRestSize );
fwrite(&temp, sizeof(uint32_t), 1, pImage );
+
+ if(narg > 4) // if version passed in then set it.
+ {
+ long int buildVerPos = offsetof(cpmrHeader_t, cpmrVersion);
+ uint32_t gitsha = htonl(strtoul(argv[4], 0, 16));
+ fseek ( pImage , buildVerPos, SEEK_SET );
+ fwrite(&gitsha, sizeof(uint32_t), 1, pImage);
+ }
}
fclose(pImage);
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_img_edit.c b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_img_edit.c
index ba843cbe..79075635 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_img_edit.c
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_img_edit.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
-/* COPYRIGHT 2015,2018 */
+/* COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stddef.h> /* offsetof */
+#include <stdlib.h>
#include <netinet/in.h>
#include <time.h>
#include <p9_hcode_image_defines.H>
@@ -124,7 +125,16 @@ int main(int narg, char* argv[])
// build ver
printf(" Build version: %X pos %X\n", temp, buildVerPos);
fseek( pMainImage, buildVerPos, SEEK_SET );
- temp = htonl(PGPE_BUILD_VERSION);
+
+ if(narg > 3) // if version passed in the use it
+ {
+ temp = htonl(strtoul(argv[3], 0, 16));
+ }
+ else
+ {
+ temp = htonl(PGPE_BUILD_VERSION);
+ }
+
fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
if (imageType == PPMR_IMAGE)
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c10.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c10.mk
index 704bcc89..fdb077e5 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c10.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c10.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -65,4 +65,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c11.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c11.mk
index 69478ec6..7d0cf59c 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c11.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9c11.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -65,4 +65,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n10.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n10.mk
index bab77abf..55f2bfe0 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n10.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n10.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -62,4 +62,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n20.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n20.mk
index 2e9e9a18..d3b8aac3 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n20.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n20.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -62,4 +62,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n21.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n21.mk
index 3fe65737..049d94e4 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n21.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n21.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2017,2018
+# COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -63,4 +63,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n22.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n22.mk
index 188431af..d41c133a 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n22.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n22.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2017,2018
+# COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -63,4 +63,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n23.mk b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n23.mk
index afa9d049..19174b32 100644
--- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n23.mk
+++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/pstate_gpe_p9n23.mk
@@ -63,4 +63,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(PSTATE_TARGET)/$(PSTATE_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/p9_sgpe_img_edit.c b/import/chips/p9/procedures/ppe_closed/sgpe/p9_sgpe_img_edit.c
deleted file mode 100644
index b449f850..00000000
--- a/import/chips/p9/procedures/ppe_closed/sgpe/p9_sgpe_img_edit.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: import/chips/p9/procedures/ppe_closed/sgpe/p9_sgpe_img_edit.c $ */
-/* */
-/* OpenPOWER HCODE Project */
-/* */
-/* COPYRIGHT 2015,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 */
-#include <stdio.h>
-#include <stdint.h>
-#include <netinet/in.h>
-#include <time.h>
-
-#include <p9_hcd_memmap_base.H>
-
-enum
-{
- SGPE_IMAGE = 1,
- QPMR_IMAGE = 2,
-};
-
-int main(int narg, char* argv[])
-{
-
- if(narg < 2)
- {
- printf("Usage: %s <full path to image>\n",
- argv[0]);
- return -1;
- }
-
- int imageType = SGPE_IMAGE;
- long int buildDatePos = SGPE_BUILD_DATE_IMAGE_OFFSET;
- long int buildVerPos = SGPE_BUILD_VER_IMAGE_OFFSET;
-
- FILE* pMainImage = fopen( argv[1], "r+");
- FILE* pDependImage = fopen(argv[2], "r+");
-
- time_t buildTime = time(NULL);
- struct tm* headerTime = localtime(&buildTime);
-
- do
- {
- if( !pMainImage )
- {
- printf("\n image file to edit was not found\n");
- break;
- }
-
- fseek (pMainImage, 0, SEEK_END);
- uint32_t size = ftell (pMainImage);
- rewind(pMainImage);
- uint32_t QPMR_SGPE_HCODE_LEN_VAL = 0;
-
-
- // For ekb build it's desired to detect the image type w/o special
- // make rules. Better way?
- if(size < 1024)
- {
- imageType = QPMR_IMAGE;
- buildDatePos = QPMR_BUILD_DATE_BYTE;
- buildVerPos = QPMR_BUILD_VER_BYTE;
-
- if( !pDependImage )
- {
- printf("\n image file to find the size was not found\n");
- break;
- }
-
- fseek (pDependImage, 0, SEEK_END);
- QPMR_SGPE_HCODE_LEN_VAL = ftell (pDependImage);
- rewind(pDependImage);
- }
-
- uint32_t temp = 0;
-
- if(imageType == SGPE_IMAGE)
- {
-
- // populating SGPE Image Header
- // populating RESET address
- fseek (pMainImage, SGPE_RESET_ADDR_IMAGE_OFFSET, SEEK_SET);
- temp = SGPE_HCODE_RESET_ADDR_VAL;
- temp = htonl(temp);
- fwrite(&(temp), sizeof(uint32_t), 1, pMainImage );
- }
-
-
- //build date
- fseek( pMainImage, buildDatePos, SEEK_SET );
- // date format same as in XIP Header YYYYMMDD
- temp = ((headerTime->tm_mday ) |
- ((headerTime->tm_mon + 1) << 8) |
- (headerTime->tm_year + 1900) << 16);
-
- temp = htonl(temp);
- fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
-
- // build ver
- fseek( pMainImage, buildVerPos, SEEK_SET );
- temp = htonl(SGPE_BUILD_VERSION);
- fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
-
- if (imageType == QPMR_IMAGE)
- {
- //SGPE HCODE offset in QPMR header
- fseek ( pMainImage , QPMR_SGPE_HCODE_OFFSET_BYTE, SEEK_SET );
- temp = SGPE_IMAGE_QPMR_OFFSET;
- temp = htonl(temp);
- fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
-
- //SGPE Hcode length in QPMR header
- fseek ( pMainImage , QPMR_SGPE_HCODE_LENGTH_BYTE, SEEK_SET );
- temp = QPMR_SGPE_HCODE_LEN_VAL;
- temp = htonl(temp);
- fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
- }
-
- fclose(pMainImage);
- fclose(pDependImage);
- }
- while(0);
-
- return 0;
-}
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_img_edit.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_img_edit.c
index dcc08e7f..eb1603c4 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_img_edit.c
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_img_edit.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
-/* COPYRIGHT 2015,2018 */
+/* COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stddef.h> /* offsetof */
+#include <stdlib.h>
#include <netinet/in.h>
#include <time.h>
@@ -117,7 +118,16 @@ int main(int narg, char* argv[])
// build ver
fseek( pMainImage, buildVerPos, SEEK_SET );
- temp = htonl(SGPE_BUILD_VERSION);
+
+ if(narg > 3) // if version pass in then use it
+ {
+ temp = htonl(strtoul(argv[3], 0, 16));
+ }
+ else
+ {
+ temp = htonl(SGPE_BUILD_VERSION);
+ }
+
fwrite(&temp, sizeof(uint32_t), 1, pMainImage );
if (imageType == QPMR_IMAGE)
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9c10.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9c10.mk
index 60442c9d..f422c07e 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9c10.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9c10.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -90,5 +90,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n10.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n10.mk
index 8c358b4f..91803d4a 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n10.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n10.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -86,4 +86,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n20.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n20.mk
index 900b76dd..a67543ff 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n20.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n20.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2016,2018
+# COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -89,5 +89,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/procedures/hwp/lib/ \
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n21.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n21.mk
index 8552e737..abd3cb18 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n21.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n21.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2017,2018
+# COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -90,4 +90,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n22.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n22.mk
index 66f85354..5b345c56 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n22.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n22.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HCODE Project
#
-# COPYRIGHT 2017,2018
+# COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -90,4 +90,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n23.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n23.mk
index 2b049c24..25dc9167 100644
--- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n23.mk
+++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe_p9n23.mk
@@ -90,4 +90,6 @@ $(call ADD_BINHEADER_INCDIR,$(IMAGE),\
$(ROOTPATH)/chips/p9/utils/imageProcs/ \
)
-$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin)
+gitsha := $(shell git log -1 --pretty=format:"%h")
+$(call BUILD_BINHEADER,$(IMAGEPATH)/$(STOP_TARGET)/$(STOP_TARGET).bin, \
+ $(gitsha))
OpenPOWER on IntegriCloud