diff options
author | Raja Das <rajadas2@in.ibm.com> | 2018-11-16 04:53:59 -0600 |
---|---|---|
committer | RAJA DAS <rajadas2@in.ibm.com> | 2019-01-28 23:24:55 -0600 |
commit | 0321b165dad79c924657e58b7b620a83a88e440c (patch) | |
tree | 12cc7954e71150df573757cfc3e5951c7fc8925e /src/tools | |
parent | e18d802d082f7db16037cde35f4e7c4120062d12 (diff) | |
download | talos-sbe-0321b165dad79c924657e58b7b620a83a88e440c.tar.gz talos-sbe-0321b165dad79c924657e58b7b620a83a88e440c.zip |
SBE scripts to update pib repair data
- Create a raw data file, which has scan and region type initialized
- some dummy data to emulate repr ring data
- Insert this binary into pib_repr section into sbe seeprom binary
Change-Id: I6a3db7f6af2a2788c1bc1eb836205af9d77b8509
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68845
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Anusha Reddy Rangareddygari <anusrang@in.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Diffstat (limited to 'src/tools')
-rwxr-xr-x | src/tools/pibrepr_tool/gen_pibrepr_data.py | 60 | ||||
-rwxr-xr-x | src/tools/pibrepr_tool/insert_pibrepr.sh | 36 |
2 files changed, 96 insertions, 0 deletions
diff --git a/src/tools/pibrepr_tool/gen_pibrepr_data.py b/src/tools/pibrepr_tool/gen_pibrepr_data.py new file mode 100755 index 00000000..b1d17769 --- /dev/null +++ b/src/tools/pibrepr_tool/gen_pibrepr_data.py @@ -0,0 +1,60 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/tools/pibrepr_tool/gen_pibrepr_data.py $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2018,2019 +# [+] 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 + +bin_file = open("pibrepr.bin", "wb") + +############################################################ +############# Format of the Data ############### +## 1st 1B of Command - (1) Putscom (0) Getscom +## 2nd 1B for end row indication +## 3rd & 4th Bytes are the pad bytes - 2B Pad +## 5th,6th,7th,8th Byte are the address bytes - 4B Addr +## Next 8Bytes are the data - 8B Data +## -------------------------------------------------------## +## Total ring length of the repr data is 707bits, which is +## 643 bits actual chain length + 64bits header. +## perv_pib_repr 0x01031006 707 N N Y Y PERVPIB OFF +############################################################ +string = ''' + 01 00 00 00 01 03 00 05 02 00 00 00 00 00 02 00 + 01 00 00 00 01 03 E0 40 A5 A5 A5 A5 A5 A5 A5 A5 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 40 00 00 00 00 00 00 00 00 + 01 00 00 00 01 03 E0 03 00 00 00 00 00 00 00 00 + 00 00 00 00 01 03 80 00 A5 A5 A5 A5 A5 A5 A5 A5 + 01 01 00 00 01 03 00 05 00 00 00 00 00 00 00 00''' +string = string.split() +string = [int(x,16) for x in string] +string = bytearray(string) +bin_file.write(string) +bin_file.close() diff --git a/src/tools/pibrepr_tool/insert_pibrepr.sh b/src/tools/pibrepr_tool/insert_pibrepr.sh new file mode 100755 index 00000000..705a15cb --- /dev/null +++ b/src/tools/pibrepr_tool/insert_pibrepr.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/tools/pibrepr_tool/insert_pibrepr.sh $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2018,2019 +# [+] 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 + +if [ $# -eq 0 ]; then + echo "This tool is used to insert a pib_repr section on to the seeprom binary" + echo "Usage: insert_pibrepr.sh <seeprom_image_path> <seeprom_image_name>" + echo "example: ./insert_pibrepr.sh /esw/san2/rajadas2/SBE_git/ppe/image sbe_seeprom_AXONE.bin" + exit 1 +fi + +# Generate the Pibrepr data +python gen_pibrepr_data.py +$1/p9_xip_tool $1/$2 append .pibrepr_data pibrepr.bin |