diff options
-rwxr-xr-x | create_pnor_image.pl | 19 | ||||
-rw-r--r-- | p9Layouts/defaultPnorLayout_128.xml | 275 | ||||
-rw-r--r-- | p9Layouts/defaultPnorLayout_32.xml | 275 | ||||
-rw-r--r-- | p9Layouts/defaultPnorLayout_64.xml | 275 | ||||
-rwxr-xr-x | update_image.pl | 25 |
5 files changed, 863 insertions, 6 deletions
diff --git a/create_pnor_image.pl b/create_pnor_image.pl index 3df9011..89427c6 100755 --- a/create_pnor_image.pl +++ b/create_pnor_image.pl @@ -4,6 +4,7 @@ use strict; use File::Basename; my $program_name = File::Basename::basename $0; +my $release = ""; my $outdir = ""; my $scratch_dir = ""; my $pnor_data_dir = ""; @@ -29,6 +30,10 @@ while (@ARGV > 0){ usage(); exit 0; } + elsif (/^-release/i){ + $release = $ARGV[1] or die "Bad command line arg given: expecting a release input.\n"; + shift; + } elsif (/^-scratch_dir/i){ $scratch_dir = $ARGV[1] or die "Bad command line arg given: expecting a scratch dir path.\n"; shift; @@ -100,7 +105,11 @@ while (@ARGV > 0){ if ($outdir eq "") { die "-outdir <path_to_directory_for_output_files> is a required command line variable. Please run again with this parameter.\n"; } +if ($release eq "") { + die "-release <p8 or p9> is a required command line variable. Please run again with this parameter.\n"; +} +print "release = $release\n"; print "scratch_dir = $scratch_dir\n"; print "pnor_data_dir = $pnor_data_dir\n"; @@ -108,8 +117,6 @@ my $build_pnor_command = "$hb_image_dir/buildpnor.pl"; $build_pnor_command .= " --pnorOutBin $pnor_filename --pnorLayout $xml_layout_file"; $build_pnor_command .= " --binFile_HBD $scratch_dir/$targeting_binary_filename"; $build_pnor_command .= " --binFile_SBE $scratch_dir/$sbe_binary_filename"; -$build_pnor_command .= " --binFile_SBEC $scratch_dir/$sbec_binary_filename"; -$build_pnor_command .= " --binFile_WINK $scratch_dir/$wink_binary_filename"; $build_pnor_command .= " --binFile_HBB $scratch_dir/hostboot.header.bin.ecc"; $build_pnor_command .= " --binFile_HBI $scratch_dir/hostboot_extended.header.bin.ecc"; $build_pnor_command .= " --binFile_HBRT $scratch_dir/hostboot_runtime.header.bin.ecc"; @@ -127,8 +134,14 @@ $build_pnor_command .= " --binFile_OCC $occ_binary_filename.ecc"; $build_pnor_command .= " --binFile_FIRDATA $scratch_dir/firdata.bin.ecc"; $build_pnor_command .= " --binFile_CAPP $scratch_dir/cappucode.bin.ecc"; $build_pnor_command .= " --binFile_SECBOOT $scratch_dir/secboot.bin.ecc"; -$build_pnor_command .= " --binFile_IMA_CATALOG $scratch_dir/$ima_catalog_filename"; $build_pnor_command .= " --binFile_VERSION $openpower_version_filename"; +if ($release eq "p8"){ + $build_pnor_command .= " --binFile_SBEC $scratch_dir/$sbec_binary_filename"; + $build_pnor_command .= " --binFile_WINK $scratch_dir/$wink_binary_filename"; + $build_pnor_command .= " --binFile_IMA_CATALOG $scratch_dir/$ima_catalog_filename"; +} else { + $build_pnor_command .= " --binFile_HCODE $scratch_dir/$wink_binary_filename"; +} $build_pnor_command .= " --fpartCmd \"fpart\""; $build_pnor_command .= " --fcpCmd \"fcp\""; print "###############################"; diff --git a/p9Layouts/defaultPnorLayout_128.xml b/p9Layouts/defaultPnorLayout_128.xml new file mode 100644 index 0000000..bed039a --- /dev/null +++ b/p9Layouts/defaultPnorLayout_128.xml @@ -0,0 +1,275 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: pnor/p9Layouts/defaultPnorLayout_128.xml $ --> +<!-- --> +<!-- OpenPOWER HostBoot Project --> +<!-- --> +<!-- COPYRIGHT International Business Machines Corp. 2013,2014 --> +<!-- --> +<!-- 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 --> +<!-- +Layout Description +<metadata> Element -> Contains high-level information about the PNOR layout. + <chipSize> -> Size of the chip that the pnor image will reside on + <imageSize> -> Size of PNOR image in bytes. + <blockSize> -> size of erase blocks in bytes. + <tocSize> -> size of each partition table + <!- TODO:RTC:123734 - remove side offsets once hwsv implements new layout -> + <sideAOffset> -> Location of Side A Partition Table + <sideBOffset> -> Location of Side B Partition Table + <side> -> Contains information about the side + <id> -> Id of the side (A or B) + <arrangement> -> Tag that specifies the arrangement of the side + (A-B-D or A-D-B) + A-B-D: Primary TOC (A),Backup TOC (B), and Section Information (Data - D) + A-D-B: Primary TOC (A), Section Information (Data - D), Backup TOC (B) + <golden/> -> Indicates that the side of the PNOR is golden +</metadata> +<section> Element -> Contains information about a PNOR Partition + <description> -> Text description of the partition. + Does not have to be machine readable. + <eyeCatch> -> Name of the Partition + <physicalOffset>-> Offset of the Partition in PNOR + in bytes. + <physicalSize> -> Size of the Partition in bytes. + <side> -> Side that this section is associated with. + could be (A, B, or sideless) + A - Section is associated with side A + B - Section is associated with side B + sideless - Indicates partition will be in both TOCs but + only one copy of the partition should be created + <testonly/> -> Indicates partition is used for internal testing only. + Partition should be skipped in production environments. + <ecc/> -> Indicates Partition should be ECC protected + <sha512Version/>-> Indicates Partition uses SHA512 for version information. + <sha512perEC/> -> Indicates SHA512 is used to indicate version for each + EC-specific image within the Partition. + <preserved/> -> Indicates Partition is preserved across code updates. +</section> +--> + +<pnor> + <metadata> + <imageSize>0x8000000</imageSize> + <chipSize>0x8000000</chipSize> + <blockSize>0x1000</blockSize> + <tocSize>0x8000</tocSize> + <arrangement>A-D-B</arrangement> + <side> + <id>A</id> + </side> + </metadata> + <section> + <description>Hostboot Base (576K)</description> + <eyeCatch>HBB</eyeCatch> + <physicalOffset>0x8000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Error Logs (144K)</description> + <eyeCatch>HBEL</eyeCatch> + <physicalOffset>0x98000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Guard Data (20K)</description> + <eyeCatch>GUARD</eyeCatch> + <physicalOffset>0xBC000</physicalOffset> + <physicalRegionSize>0x5000</physicalRegionSize> + <side>A</side> + <ecc/> + <preserved/> + <reprovision/> + </section> + <section> + <description>Hostboot Data (1.125M)</description> + <eyeCatch>HBD</eyeCatch> + <physicalOffset>0xC1000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>DIMM JEDEC (288K)</description> + <eyeCatch>DJVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x1E1000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Module VPD (576K)</description> + <eyeCatch>MVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x229000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Centaur VPD (288K)</description> + <eyeCatch>CVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x2B9000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Hostboot Extended image (11MB w/o ECC)</description> + <eyeCatch>HBI</eyeCatch> + <physicalOffset>0x301000</physicalOffset> + <physicalRegionSize>0xC60000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>SBE-IPL (Staging Area) (288K)</description> + <eyeCatch>SBE</eyeCatch> + <physicalOffset>0xF61000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <sha512perEC/> + <side>A</side> + <ecc/> + </section> + <section> + <description>HCODE Ref Image (1.125MB)</description> + <eyeCatch>HCODE</eyeCatch> + <physicalOffset>0xFA9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Runtime Services for Sapphire (4.5MB)</description> + <eyeCatch>HBRT</eyeCatch> + <physicalOffset>0x10C9000</physicalOffset> + <physicalRegionSize>0x480000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>Payload (1MB)</description> + <eyeCatch>PAYLOAD</eyeCatch> + <physicalOffset>0x1549000</physicalOffset> + <physicalRegionSize>0x100000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Bootloader Kernel (15MB)</description> + <eyeCatch>BOOTKERNEL</eyeCatch> + <physicalOffset>0x1649000</physicalOffset> + <physicalRegionSize>0xF00000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Nvram (576K)</description> + <eyeCatch>NVRAM</eyeCatch> + <physicalOffset>0x2549000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <preserved/> + <reprovision/> + </section> + <section> + <description>OCC Lid (1.125M)</description> + <eyeCatch>OCC</eyeCatch> + <physicalOffset>0x25D9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>FIRDATA (12K)</description> + <eyeCatch>FIRDATA</eyeCatch> + <physicalOffset>0x26F9000</physicalOffset> + <physicalRegionSize>0x3000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>CAPP Lid (144K)</description> + <eyeCatch>CAPP</eyeCatch> + <physicalOffset>0x26FC000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>Secure Boot (144K)</description> + <eyeCatch>SECBOOT</eyeCatch> + <physicalOffset>0x2720000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>sideless</side> + <ecc/> + <preserved/> + </section> + <section> + <description>BMC_INV (36K)</description> + <eyeCatch>BMC_INV</eyeCatch> + <physicalOffset>0x2744000</physicalOffset> + <physicalRegionSize>0x9000</physicalRegionSize> + <side>sideless</side> + <reprovision/> + </section> + <section> + <description>Hostboot Bootloader (22.5K)</description> + <eyeCatch>HBBL</eyeCatch> + <physicalOffset>0x274D000</physicalOffset> + <physicalRegionSize>0x6000</physicalRegionSize> + <side>sideless</side> + <ecc/> + </section> + <section> + <description>Temporary Attribute Override (32K)</description> + <eyeCatch>ATTR_TMP</eyeCatch> + <physicalOffset>0x2753000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <reprovision/> + </section> + <section> + <description>Permanent Attribute Override (32K)</description> + <eyeCatch>ATTR_PERM</eyeCatch> + <physicalOffset>0x275B000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>PNOR Version (4K)</description> + <eyeCatch>VERSION</eyeCatch> + <physicalOffset>0x2763000</physicalOffset> + <physicalRegionSize>0x1000</physicalRegionSize> + <side>A</side> + </section> +</pnor> diff --git a/p9Layouts/defaultPnorLayout_32.xml b/p9Layouts/defaultPnorLayout_32.xml new file mode 100644 index 0000000..1471265 --- /dev/null +++ b/p9Layouts/defaultPnorLayout_32.xml @@ -0,0 +1,275 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: pnor/p9Layouts/defaultPnorLayout_32.xml $ --> +<!-- --> +<!-- OpenPOWER HostBoot Project --> +<!-- --> +<!-- COPYRIGHT International Business Machines Corp. 2013,2014 --> +<!-- --> +<!-- 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 --> +<!-- +Layout Description +<metadata> Element -> Contains high-level information about the PNOR layout. + <chipSize> -> Size of the chip that the pnor image will reside on + <imageSize> -> Size of PNOR image in bytes. + <blockSize> -> size of erase blocks in bytes. + <tocSize> -> size of each partition table + <!- TODO:RTC:123734 - remove side offsets once hwsv implements new layout -> + <sideAOffset> -> Location of Side A Partition Table + <sideBOffset> -> Location of Side B Partition Table + <side> -> Contains information about the side + <id> -> Id of the side (A or B) + <arrangement> -> Tag that specifies the arrangement of the side + (A-B-D or A-D-B) + A-B-D: Primary TOC (A),Backup TOC (B), and Section Information (Data - D) + A-D-B: Primary TOC (A), Section Information (Data - D), Backup TOC (B) + <golden/> -> Indicates that the side of the PNOR is golden +</metadata> +<section> Element -> Contains information about a PNOR Partition + <description> -> Text description of the partition. + Does not have to be machine readable. + <eyeCatch> -> Name of the Partition + <physicalOffset>-> Offset of the Partition in PNOR + in bytes. + <physicalSize> -> Size of the Partition in bytes. + <side> -> Side that this section is associated with. + could be (A, B, or sideless) + A - Section is associated with side A + B - Section is associated with side B + sideless - Indicates partition will be in both TOCs but + only one copy of the partition should be created + <testonly/> -> Indicates partition is used for internal testing only. + Partition should be skipped in production environments. + <ecc/> -> Indicates Partition should be ECC protected + <sha512Version/>-> Indicates Partition uses SHA512 for version information. + <sha512perEC/> -> Indicates SHA512 is used to indicate version for each + EC-specific image within the Partition. + <preserved/> -> Indicates Partition is preserved across code updates. +</section> +--> + +<pnor> + <metadata> + <imageSize>0x2000000</imageSize> + <chipSize>0x2000000</chipSize> + <blockSize>0x1000</blockSize> + <tocSize>0x8000</tocSize> + <arrangement>A-D-B</arrangement> + <side> + <id>A</id> + </side> + </metadata> + <section> + <description>Hostboot Base (576K)</description> + <eyeCatch>HBB</eyeCatch> + <physicalOffset>0x8000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Error Logs (144K)</description> + <eyeCatch>HBEL</eyeCatch> + <physicalOffset>0x98000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Guard Data (20K)</description> + <eyeCatch>GUARD</eyeCatch> + <physicalOffset>0xBC000</physicalOffset> + <physicalRegionSize>0x5000</physicalRegionSize> + <side>A</side> + <ecc/> + <preserved/> + <reprovision/> + </section> + <section> + <description>Hostboot Data (1.125M)</description> + <eyeCatch>HBD</eyeCatch> + <physicalOffset>0xC1000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>DIMM JEDEC (288K)</description> + <eyeCatch>DJVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x1E1000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Module VPD (576K)</description> + <eyeCatch>MVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x229000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Centaur VPD (288K)</description> + <eyeCatch>CVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x2B9000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Hostboot Extended image (11MB w/o ECC)</description> + <eyeCatch>HBI</eyeCatch> + <physicalOffset>0x301000</physicalOffset> + <physicalRegionSize>0xC60000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>SBE-IPL (Staging Area) (288K)</description> + <eyeCatch>SBE</eyeCatch> + <physicalOffset>0xF61000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <sha512perEC/> + <side>A</side> + <ecc/> + </section> + <section> + <description>HCODE Ref Image (1.125MB)</description> + <eyeCatch>HCODE</eyeCatch> + <physicalOffset>0xFA9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Runtime Services for Sapphire (4.5MB)</description> + <eyeCatch>HBRT</eyeCatch> + <physicalOffset>0x10C9000</physicalOffset> + <physicalRegionSize>0x480000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>Payload (1MB)</description> + <eyeCatch>PAYLOAD</eyeCatch> + <physicalOffset>0x1549000</physicalOffset> + <physicalRegionSize>0x100000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Bootloader Kernel (15MB)</description> + <eyeCatch>BOOTKERNEL</eyeCatch> + <physicalOffset>0x1649000</physicalOffset> + <physicalRegionSize>0xF00000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Nvram (576K)</description> + <eyeCatch>NVRAM</eyeCatch> + <physicalOffset>0x2549000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <preserved/> + <reprovision/> + </section> + <section> + <description>OCC Lid (1.125M)</description> + <eyeCatch>OCC</eyeCatch> + <physicalOffset>0x25D9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>FIRDATA (12K)</description> + <eyeCatch>FIRDATA</eyeCatch> + <physicalOffset>0x26F9000</physicalOffset> + <physicalRegionSize>0x3000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>CAPP Lid (144K)</description> + <eyeCatch>CAPP</eyeCatch> + <physicalOffset>0x26FC000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>Secure Boot (144K)</description> + <eyeCatch>SECBOOT</eyeCatch> + <physicalOffset>0x2720000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>sideless</side> + <ecc/> + <preserved/> + </section> + <section> + <description>BMC_INV (36K)</description> + <eyeCatch>BMC_INV</eyeCatch> + <physicalOffset>0x2744000</physicalOffset> + <physicalRegionSize>0x9000</physicalRegionSize> + <side>sideless</side> + <reprovision/> + </section> + <section> + <description>Hostboot Bootloader (22.5K)</description> + <eyeCatch>HBBL</eyeCatch> + <physicalOffset>0x274D000</physicalOffset> + <physicalRegionSize>0x6000</physicalRegionSize> + <side>sideless</side> + <ecc/> + </section> + <section> + <description>Temporary Attribute Override (32K)</description> + <eyeCatch>ATTR_TMP</eyeCatch> + <physicalOffset>0x2753000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <reprovision/> + </section> + <section> + <description>Permanent Attribute Override (32K)</description> + <eyeCatch>ATTR_PERM</eyeCatch> + <physicalOffset>0x275B000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>PNOR Version (4K)</description> + <eyeCatch>VERSION</eyeCatch> + <physicalOffset>0x2763000</physicalOffset> + <physicalRegionSize>0x1000</physicalRegionSize> + <side>A</side> + </section> +</pnor> diff --git a/p9Layouts/defaultPnorLayout_64.xml b/p9Layouts/defaultPnorLayout_64.xml new file mode 100644 index 0000000..f5fd226 --- /dev/null +++ b/p9Layouts/defaultPnorLayout_64.xml @@ -0,0 +1,275 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: pnor/p9Layouts/defaultPnorLayout_64.xml $ --> +<!-- --> +<!-- OpenPOWER HostBoot Project --> +<!-- --> +<!-- COPYRIGHT International Business Machines Corp. 2013,2014 --> +<!-- --> +<!-- 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 --> +<!-- +Layout Description +<metadata> Element -> Contains high-level information about the PNOR layout. + <chipSize> -> Size of the chip that the pnor image will reside on + <imageSize> -> Size of PNOR image in bytes. + <blockSize> -> size of erase blocks in bytes. + <tocSize> -> size of each partition table + <!- TODO:RTC:123734 - remove side offsets once hwsv implements new layout -> + <sideAOffset> -> Location of Side A Partition Table + <sideBOffset> -> Location of Side B Partition Table + <side> -> Contains information about the side + <id> -> Id of the side (A or B) + <arrangement> -> Tag that specifies the arrangement of the side + (A-B-D or A-D-B) + A-B-D: Primary TOC (A),Backup TOC (B), and Section Information (Data - D) + A-D-B: Primary TOC (A), Section Information (Data - D), Backup TOC (B) + <golden/> -> Indicates that the side of the PNOR is golden +</metadata> +<section> Element -> Contains information about a PNOR Partition + <description> -> Text description of the partition. + Does not have to be machine readable. + <eyeCatch> -> Name of the Partition + <physicalOffset>-> Offset of the Partition in PNOR + in bytes. + <physicalSize> -> Size of the Partition in bytes. + <side> -> Side that this section is associated with. + could be (A, B, or sideless) + A - Section is associated with side A + B - Section is associated with side B + sideless - Indicates partition will be in both TOCs but + only one copy of the partition should be created + <testonly/> -> Indicates partition is used for internal testing only. + Partition should be skipped in production environments. + <ecc/> -> Indicates Partition should be ECC protected + <sha512Version/>-> Indicates Partition uses SHA512 for version information. + <sha512perEC/> -> Indicates SHA512 is used to indicate version for each + EC-specific image within the Partition. + <preserved/> -> Indicates Partition is preserved across code updates. +</section> +--> + +<pnor> + <metadata> + <imageSize>0x4000000</imageSize> + <chipSize>0x4000000</chipSize> + <blockSize>0x1000</blockSize> + <tocSize>0x8000</tocSize> + <arrangement>A-D-B</arrangement> + <side> + <id>A</id> + </side> + </metadata> + <section> + <description>Hostboot Base (576K)</description> + <eyeCatch>HBB</eyeCatch> + <physicalOffset>0x8000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Error Logs (144K)</description> + <eyeCatch>HBEL</eyeCatch> + <physicalOffset>0x98000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Guard Data (20K)</description> + <eyeCatch>GUARD</eyeCatch> + <physicalOffset>0xBC000</physicalOffset> + <physicalRegionSize>0x5000</physicalRegionSize> + <side>A</side> + <ecc/> + <preserved/> + <reprovision/> + </section> + <section> + <description>Hostboot Data (1.125M)</description> + <eyeCatch>HBD</eyeCatch> + <physicalOffset>0xC1000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>DIMM JEDEC (288K)</description> + <eyeCatch>DJVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x1E1000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Module VPD (576K)</description> + <eyeCatch>MVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x229000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Centaur VPD (288K)</description> + <eyeCatch>CVPD</eyeCatch> + <!--NOTE: MUST update standalone.simics if offset changes --> + <physicalOffset>0x2B9000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>Hostboot Extended image (11MB w/o ECC)</description> + <eyeCatch>HBI</eyeCatch> + <physicalOffset>0x301000</physicalOffset> + <physicalRegionSize>0xC60000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>SBE-IPL (Staging Area) (288K)</description> + <eyeCatch>SBE</eyeCatch> + <physicalOffset>0xF61000</physicalOffset> + <physicalRegionSize>0x48000</physicalRegionSize> + <sha512perEC/> + <side>A</side> + <ecc/> + </section> + <section> + <description>HCODE Ref Image (1.125MB)</description> + <eyeCatch>HCODE</eyeCatch> + <physicalOffset>0xFA9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <sha512Version/> + <ecc/> + </section> + <section> + <description>Hostboot Runtime Services for Sapphire (4.5MB)</description> + <eyeCatch>HBRT</eyeCatch> + <physicalOffset>0x10C9000</physicalOffset> + <physicalRegionSize>0x480000</physicalRegionSize> + <sha512Version/> + <side>A</side> + <ecc/> + </section> + <section> + <description>Payload (1MB)</description> + <eyeCatch>PAYLOAD</eyeCatch> + <physicalOffset>0x1549000</physicalOffset> + <physicalRegionSize>0x100000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Bootloader Kernel (15MB)</description> + <eyeCatch>BOOTKERNEL</eyeCatch> + <physicalOffset>0x1649000</physicalOffset> + <physicalRegionSize>0xF00000</physicalRegionSize> + <side>A</side> + </section> + <section> + <description>Nvram (576K)</description> + <eyeCatch>NVRAM</eyeCatch> + <physicalOffset>0x2549000</physicalOffset> + <physicalRegionSize>0x90000</physicalRegionSize> + <side>A</side> + <preserved/> + <reprovision/> + </section> + <section> + <description>OCC Lid (1.125M)</description> + <eyeCatch>OCC</eyeCatch> + <physicalOffset>0x25D9000</physicalOffset> + <physicalRegionSize>0x120000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>FIRDATA (12K)</description> + <eyeCatch>FIRDATA</eyeCatch> + <physicalOffset>0x26F9000</physicalOffset> + <physicalRegionSize>0x3000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>CAPP Lid (144K)</description> + <eyeCatch>CAPP</eyeCatch> + <physicalOffset>0x26FC000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>A</side> + <ecc/> + </section> + <section> + <description>Secure Boot (144K)</description> + <eyeCatch>SECBOOT</eyeCatch> + <physicalOffset>0x2720000</physicalOffset> + <physicalRegionSize>0x24000</physicalRegionSize> + <side>sideless</side> + <ecc/> + <preserved/> + </section> + <section> + <description>BMC_INV (36K)</description> + <eyeCatch>BMC_INV</eyeCatch> + <physicalOffset>0x2744000</physicalOffset> + <physicalRegionSize>0x9000</physicalRegionSize> + <side>sideless</side> + <reprovision/> + </section> + <section> + <description>Hostboot Bootloader (22.5K)</description> + <eyeCatch>HBBL</eyeCatch> + <physicalOffset>0x274D000</physicalOffset> + <physicalRegionSize>0x6000</physicalRegionSize> + <side>sideless</side> + <ecc/> + </section> + <section> + <description>Temporary Attribute Override (32K)</description> + <eyeCatch>ATTR_TMP</eyeCatch> + <physicalOffset>0x2753000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <reprovision/> + </section> + <section> + <description>Permanent Attribute Override (32K)</description> + <eyeCatch>ATTR_PERM</eyeCatch> + <physicalOffset>0x275B000</physicalOffset> + <physicalRegionSize>0x8000</physicalRegionSize> + <side>A</side> + <ecc/> + <reprovision/> + </section> + <section> + <description>PNOR Version (4K)</description> + <eyeCatch>VERSION</eyeCatch> + <physicalOffset>0x2763000</physicalOffset> + <physicalRegionSize>0x1000</physicalRegionSize> + <side>A</side> + </section> +</pnor> diff --git a/update_image.pl b/update_image.pl index 76030f9..a893e0b 100755 --- a/update_image.pl +++ b/update_image.pl @@ -5,6 +5,7 @@ use File::Basename; #my $ecc_tool_dir = "/opt/mcp/shared/fr_FLD8-1-20140528/opt/fsp/usr/bin"; #wh_todo +my $release = ""; my $op_target_dir = ""; my $hb_image_dir = ""; my $scratch_dir = ""; @@ -29,6 +30,10 @@ while (@ARGV > 0){ usage(); #print help content exit 0; } + elsif (/^-release/i){ + $release = $ARGV[1] or die "Bad command line arg given: expecting a release (p8 or p9).\n"; + shift; + } elsif (/^-op_target_dir/i){ $op_target_dir = $ARGV[1] or die "Bad command line arg given: expecting a config type.\n"; shift; @@ -106,15 +111,29 @@ if (($payload ne "") and ($xz_compression)) ### ### To calculate the pad, ibs=(<partition size>/9)*8 ### -run_command("dd if=$op_target_dir/$targeting_binary_source of=$scratch_dir/$targeting_binary_source ibs=4k conv=sync"); +if ($release eq "p8") { + run_command("dd if=$op_target_dir/$targeting_binary_source of=$scratch_dir/$targeting_binary_source ibs=4k conv=sync"); +} else { + run_command("env echo -en VERSION\\\\0 > $scratch_dir/hostboot_data.sha.bin"); + run_command("sha512sum $op_target_dir/$targeting_binary_source | awk \'{print \$1}\' | xxd -pr -r >> $scratch_dir/hostboot_data.sha.bin"); + run_command("dd if=$scratch_dir/hostboot_data.sha.bin of=$scratch_dir/hostboot.temp.bin ibs=4k conv=sync"); + run_command("cat $op_target_dir/$targeting_binary_source >> $scratch_dir/hostboot.temp.bin"); + run_command("dd if=$scratch_dir/hostboot.temp.bin of=$scratch_dir/$targeting_binary_source ibs=4k conv=sync"); +} run_command("ecc --inject $scratch_dir/$targeting_binary_source --output $scratch_dir/$targeting_binary_filename --p8"); -run_command("echo \"00000000001800000000000008000000000000000007EF80\" | xxd -r -ps - $scratch_dir/sbe.header"); +if ($release eq "p8") { + run_command("echo \"00000000001800000000000008000000000000000007EF80\" | xxd -r -ps - $scratch_dir/sbe.header"); +} run_command("env echo -en VERSION\\\\0 > $scratch_dir/hostboot.sha.bin"); run_command("sha512sum $hb_image_dir/img/hostboot.bin | awk \'{print \$1}\' | xxd -pr -r >> $scratch_dir/hostboot.sha.bin"); run_command("dd if=$scratch_dir/hostboot.sha.bin of=$scratch_dir/secureboot.header ibs=4k conv=sync"); run_command("dd if=/dev/zero of=$scratch_dir/hbb.footer count=1 bs=128K"); -run_command("cat $scratch_dir/sbe.header $scratch_dir/secureboot.header $hb_image_dir/img/hostboot.bin $scratch_dir/hbb.footer > $scratch_dir/hostboot.stage.bin"); +if ($release eq "p8") { + run_command("cat $scratch_dir/sbe.header $scratch_dir/secureboot.header $hb_image_dir/img/hostboot.bin $scratch_dir/hbb.footer > $scratch_dir/hostboot.stage.bin"); +} else { + run_command("cat $scratch_dir/secureboot.header $hb_image_dir/img/hostboot.bin $scratch_dir/hbb.footer > $scratch_dir/hostboot.stage.bin"); +} run_command("head -c 524288 $scratch_dir/hostboot.stage.bin > $scratch_dir/hostboot.header.bin"); run_command("ecc --inject $hb_image_dir/img/hostboot.bin --output $scratch_dir/hostboot.bin.ecc --p8"); |