diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2012-11-27 16:06:08 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-04 15:40:09 -0600 |
commit | 10085bf3f511a7b76e51814c1850d4b138a5b9d1 (patch) | |
tree | 7efbac16808870a359663bbd07a2cbe810f9a846 /src/usr/targeting | |
parent | 07e1c50a631d79121228354e94e2158336c843c5 (diff) | |
download | talos-hostboot-10085bf3f511a7b76e51814c1850d4b138a5b9d1.tar.gz talos-hostboot-10085bf3f511a7b76e51814c1850d4b138a5b9d1.zip |
Create new PNOR heap zero initialized section for Hostboot only attributes.
New section is needed for Hostboot specific attributes that we don't
want to sync to/from FSP. This is needed for MPIPL.
Change-Id: Ic40bec73c9b1331906a81b5804999865c0ec1616
RTC: 51687
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2445
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rw-r--r-- | src/usr/targeting/attrrp.C | 24 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 164 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 38 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 86 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/attribute_types_hb.xml | 203 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/makefile | 62 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/target_types_hb.xml | 92 | ||||
-rwxr-xr-x | src/usr/targeting/xmltohb/updatetargetxml.pl | 142 |
8 files changed, 583 insertions, 228 deletions
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index db6535106..7c7b6ecf0 100644 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -196,8 +196,10 @@ namespace TARGETING case MSG_MM_RP_READ: // HEAP_ZERO_INIT should never be requested for read // because kernel should automatically get a zero page. - if (iv_sections[section].type == - SECTION_TYPE_HEAP_ZERO_INIT) + if ( (iv_sections[section].type == + SECTION_TYPE_HEAP_ZERO_INIT) || + (iv_sections[section].type == + SECTION_TYPE_HB_HEAP_ZERO_INIT) ) { TRACFCOMP(g_trac_targeting, ERR_MRK "AttrRP: Read request on " @@ -395,6 +397,7 @@ namespace TARGETING break; case SECTION_TYPE_HEAP_ZERO_INIT: + case SECTION_TYPE_HB_HEAP_ZERO_INIT: l_perm = WRITABLE | ALLOCATE_FROM_ZERO; break; @@ -420,12 +423,19 @@ namespace TARGETING break; } - int rc = mm_alloc_block((iv_sections[i].type == - SECTION_TYPE_HEAP_ZERO_INIT ? - NULL : iv_msgQ), - reinterpret_cast<void*>( - iv_sections[i].vmmAddress), + int rc = 0; + msg_q_t l_msgQ = iv_msgQ; + + if ( (iv_sections[i].type == SECTION_TYPE_HEAP_ZERO_INIT) || + (iv_sections[i].type == SECTION_TYPE_HB_HEAP_ZERO_INIT) ) + { + l_msgQ = NULL; + } + + rc = mm_alloc_block(l_msgQ, + reinterpret_cast<void*>(iv_sections[i].vmmAddress), iv_sections[i].size); + if (rc) { /*@ diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index b00bcb7c7..4d9d673b7 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -25,7 +25,8 @@ <!-- ===================================================================== HOST BOOT ATTRIBUTE TYPES - Contains the definition of all hostboot attributes + Contains the definition of all hostboot attributes which can be synced + to/from FSP ================================================================= --> <enumerationType> @@ -655,32 +656,6 @@ </attribute> <attribute> - <id>XSCOM_VIRTUAL_ADDR</id> - <description>Cached Virtual Address of Xscom memory space for this Chip</description> - <simpleType> - <uint64_t> - <default>0</default> - </uint64_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> - <id>IBSCOM_VIRTUAL_ADDR</id> - <description>Cached Virtual Address of Inband Scom memory space for this Chip</description> - <simpleType> - <uint64_t> - <default>0</default> - </uint64_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>FSI_MASTER_CHIP</id> <description>Chip which contains the FSI master logic that drives this slave</description> <nativeType> @@ -740,19 +715,6 @@ </attribute> <attribute> - <id>FSI_MASTER_MUTEX</id> - <description>Mutex for FSI Master Operations</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>EXECUTION_PLATFORM</id> <description> Which execution platform the HW Procedure is running on @@ -788,23 +750,6 @@ </attribute> <attribute> - <id>IS_MPIPL</id> - <description>1 = in Memory Preserving IPL mode. 0 = in normal IPL mode.</description> - <simpleType> - <uint8_t> - <default>0</default> - </uint8_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - <hwpfToHbAttrMap> - <id>ATTR_IS_MPIPL</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> -</attribute> - -<attribute> <id>HWAS_STATE</id> <description>HardWare Availability Service State Attribute. Keeps track of Target values poweredOn, present, functional, @@ -941,19 +886,6 @@ </attribute> <attribute> - <id>HB_MUTEX_TEST_LOCK</id> - <description>Host boot mutex for testing</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>ISTEP_MODE</id> <description>If True, puts HostBoot into SPLess SingleStep mode.</description> <simpleType> @@ -1037,45 +969,6 @@ </attribute> <attribute> - <id>I2C_ENGINE_MUTEX_0</id> - <description>Mutex for I2C Master engine 0</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> - <id>I2C_ENGINE_MUTEX_1</id> - <description>Mutex for I2C Master engine 1</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> - <id>I2C_ENGINE_MUTEX_2</id> - <description>Mutex for I2C Master engine 2</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>MSS_VOLT</id> <description>DRAM Voltage. Initialized and used by HWPs.</description> <simpleType> @@ -2630,19 +2523,6 @@ </attribute> <attribute> - <id>FSI_SCOM_MUTEX</id> - <description>Mutex for FSI-based SCOM Operations</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>EC</id> <description>attribute indicating the chip target's EC level</description> <simpleType> @@ -2859,18 +2739,6 @@ </attribute> <attribute> - <id>SCOM_IND_MUTEX</id> - <description>Mutex for Indirect SCOM read operation</description> - <simpleType> - <hbmutex> - <default>0</default> - </hbmutex> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> -<attribute> <id>CHIP_UNIT</id> <description>A unit (chiplet) 's offset number within the chip. </description> <simpleType> @@ -4036,34 +3904,6 @@ </attribute> <attribute> - <id>SLW_IMAGE_ADDR</id> - <description> - Location of runtime winkle image for this processor chip. - Written by host_build_winkle (istep 15.1) - </description> - <simpleType> - <uint64_t></uint64_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> - <id>SLW_IMAGE_SIZE</id> - <description> - Size of runtime winkle image for this processor chip. - Written by host_build_winkle (istep 15.1) - </description> - <simpleType> - <uint64_t></uint64_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>PROC_MCS_GROUPS</id> <description> Per MCS group number diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 398c2d557..8a179814c 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -68,7 +68,6 @@ <attribute><id>SCRATCH_UINT64_ARRAY_1</id></attribute> <attribute><id>SCRATCH_UINT64_ARRAY_2</id></attribute> <attribute><id>NUMERIC_POD_TYPE_TEST</id></attribute> - <attribute><id>HB_MUTEX_TEST_LOCK</id></attribute> <attribute><id>DUMMY_RW</id></attribute> <attribute><id>XSCOM_BASE_ADDRESS</id></attribute> <attribute><id>TEST_NULL_STRING</id></attribute> @@ -87,7 +86,6 @@ <id>IS_SIMULATION</id> <default>0</default> </attribute> - <attribute><id>IS_MPIPL</id></attribute> <attribute><id>ISTEP_MODE</id></attribute> <attribute><id>PROC_EPS_TABLE_TYPE</id></attribute> <attribute><id>PROC_FABRIC_PUMP_MODE</id></attribute> @@ -192,15 +190,6 @@ <id>SCOM_SWITCHES</id> </attribute> <attribute> - <id>FSI_MASTER_MUTEX</id> - </attribute> - <attribute> - <id>FSI_SCOM_MUTEX</id> - </attribute> - <attribute> - <id>SCOM_IND_MUTEX</id> - </attribute> - <attribute> <!-- Processor chips have SCOM accessible FSI GP regs --> <id>FSI_GP_REG_SCOM_ACCESS</id> <default>1</default> @@ -229,9 +218,6 @@ <!-- proc_fab_smp_fabric_attributes.xml --> <attribute><id>FREQ_CORE</id></attribute> <attribute><id>PROC_PCIE_NOT_F_LINK</id></attribute> - <!-- new attribute for isteps 15 & 16 --> - <attribute><id>SLW_IMAGE_ADDR</id></attribute> - <attribute><id>SLW_IMAGE_SIZE</id></attribute> <attribute><id>MSS_INTERLEAVE_ENABLE</id></attribute> <attribute><id>MSS_MCS_GROUP_32</id></attribute> <!-- Start pm_attributes_all_plat.xml --> @@ -338,21 +324,6 @@ <parent>chip-processor</parent> <attribute><id>DUMMY_RW</id></attribute> <attribute><id>DUMMY_HEAP_ZERO_DEFAULT</id></attribute> - <attribute> - <id>I2C_ENGINE_MUTEX_0</id> - <default>0</default> - </attribute> - <attribute> - <id>I2C_ENGINE_MUTEX_1</id> - <default>0</default> - </attribute> - <attribute> - <id>I2C_ENGINE_MUTEX_2</id> - <default>0</default> - </attribute> - <attribute> - <id>XSCOM_VIRTUAL_ADDR</id> - </attribute> <attribute><id>MSS_MEM_MC_IN_GROUP</id></attribute> <!-- From PHYP Memory Map --> @@ -830,15 +801,6 @@ <attribute><id>EI_BUS_RX_MSB_LSB_SWAP</id></attribute> <attribute><id>EI_BUS_TX_MSB_LSB_SWAP</id></attribute> <attribute> - <id>FSI_SCOM_MUTEX</id> - </attribute> - <attribute> - <id>SCOM_IND_MUTEX</id> - </attribute> - <attribute> - <id>IBSCOM_VIRTUAL_ADDR</id> - </attribute> - <attribute> <!-- Centaur memory buffer chips do not have SCOM accessible FSI GP regs --> <id>FSI_GP_REG_SCOM_ACCESS</id> <default>0</default> diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 82982e6e9..6e3c36676 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -70,6 +70,7 @@ my $cfgVerbose = 0; my $cfgShortEnums = 0; my $cfgBigEndian = 1; my $cfgIncludeFspAttributes = 0; +my $cfgIncludeHbAttributes = 0; GetOptions("hb-xml-file:s" => \$cfgHbXmlFile, "src-output-dir:s" => \$cfgSrcOutputDir, @@ -80,6 +81,7 @@ GetOptions("hb-xml-file:s" => \$cfgHbXmlFile, "short-enums!" => \$cfgShortEnums, "big-endian!" => \$cfgBigEndian, "include-fsp-attributes!" => \$cfgIncludeFspAttributes, + "include-hb-attributes!" => \$cfgIncludeHbAttributes, "help" => \$cfgHelp, "man" => \$cfgMan, "verbose" => \$cfgVerbose ) || pod2usage(-verbose => 0); @@ -108,6 +110,7 @@ if($cfgVerbose) print STDOUT "Short enums = $cfgShortEnums\n"; print STDOUT "Big endian = $cfgBigEndian\n"; print STDOUT "include-fsp-attributes = $cfgIncludeFspAttributes\n", + print STDOUT "include-hb-attributes = $cfgIncludeHbAttributes\n", } ################################################################################ @@ -322,6 +325,7 @@ sub validateAttributes { $elements{"description"} = { required => 1, isscalar => 1}; $elements{"persistency"} = { required => 1, isscalar => 1}; $elements{"fspOnly"} = { required => 0, isscalar => 0}; + $elements{"hbOnly"} = { required => 0, isscalar => 0}; $elements{"readable"} = { required => 0, isscalar => 0}; $elements{"simpleType"} = { required => 0, isscalar => 0}; $elements{"complexType"} = { required => 0, isscalar => 0}; @@ -740,6 +744,12 @@ namespace TARGETING // Intialized to default from P3 on hard reset, else existing P1 // memory copied on R/R SECTION_TYPE_FSP_P1_FLASH_INIT = 0x9, + + // HOSTBOOT section + + // Targeting heap section intialized to zero + SECTION_TYPE_HB_HEAP_ZERO_INIT = 0x0A, + }; struct TargetingSection @@ -3365,6 +3375,8 @@ sub generateTargetingImage { my $heapPnorInitBaseAddr = $pnorRwBaseAddress + $vmmSectionOffset; my $heapZeroInitBaseAddr = $heapPnorInitBaseAddr + $vmmSectionOffset; + #We will either have additional FSP sections or Hostboot section but not both + # Split "fsp" into additional sections my $fspP0DefaultedFromZeroBaseAddr = $heapZeroInitBaseAddr + $vmmSectionOffset; my $fspP0DefaultedFromP3BaseAddr = $fspP0DefaultedFromZeroBaseAddr + $vmmSectionOffset; @@ -3373,6 +3385,9 @@ sub generateTargetingImage { my $fspP1DefaultedFromZeroBaseAddr = $fspP3RwBaseAddr + $vmmSectionOffset; my $fspP1DefaultedFromP3BaseAddr = $fspP1DefaultedFromZeroBaseAddr + $vmmSectionOffset; + # Hostboot specific section + my $hbHeapZeroInitBaseAddr = $heapZeroInitBaseAddr + $vmmSectionOffset; + # Reserve 256 bytes for the header, then keep track of PNOR RO offset my $headerSize = 256; my $offset = $headerSize; @@ -3486,6 +3501,10 @@ sub generateTargetingImage { my $fspP3RwOffset = 0; my $fspP3RwBinData; + # Hostboot specific section + my $hbHeapZeroInitOffset = 0; + my $hbHeapZeroInitBinData; + my $attributePointerBinData; my $targetsBinData; @@ -3599,8 +3618,20 @@ sub generateTargetingImage { } else { - print STDOUT "Persistency not found =$attributeDef->{persistency}\n"; - fatal("Persistency not supported."); + fatal("Persistency '$attributeDef->{persistency}' is not " + . "supported for fspOnly attribute '$attributeId'."); + } + } + elsif( exists $attributeDef->{hbOnly} ) + { + if( $attributeDef->{persistency} eq "volatile-zeroed" ) + { + $section = "hb-heap-zero-initialized"; + } + else + { + fatal("Persistency '$attributeDef->{persistency}' is not " + . "supported for hbOnly attribute '$attributeId'."); } } elsif( exists $attributeDef->{writeable} @@ -3623,7 +3654,8 @@ sub generateTargetingImage { } else { - fatal("Persistency not supported."); + fatal("Persistency '$attributeDef->{persistency}' is not " + . "supported for attribute '$attributeId'."); } if($section eq "pnor-ro") @@ -3646,8 +3678,8 @@ sub generateTargetingImage { $roAttrBinData .= pack ("@".$pads); $offset += $pads; - $attributePointerBinData .= pack8byte( - $offset + $pnorRoBaseAddress); + $attributePointerBinData .= pack8byte( + $offset + $pnorRoBaseAddress); $offset += (length $rodata); @@ -3830,6 +3862,26 @@ sub generateTargetingImage { $fspP1DefaultedFromP3BinData .= $fspP1FlashData; } + # Hostboot specific section + elsif($section eq "hb-heap-zero-initialized") + { + my ($hbHeapZeroInitData,$alignment) = packAttribute( + $attributes, + $attributeDef,$attrhash{$attributeId}->{default}); + + # Align the data as necessary + my $pads = ($alignment - ($hbHeapZeroInitOffset + % $alignment)) % $alignment; + $hbHeapZeroInitBinData .= pack ("@".$pads); + $hbHeapZeroInitOffset += $pads; + + $attributePointerBinData .= pack8byte( + $hbHeapZeroInitOffset + $hbHeapZeroInitBaseAddr); + + $hbHeapZeroInitOffset += (length $hbHeapZeroInitData); + + $hbHeapZeroInitBinData .= $hbHeapZeroInitData; + } else { @@ -3919,6 +3971,16 @@ sub generateTargetingImage { $sectionHoH{ fspP1DefaultedFromP3 }{ size } = sizeBlockAligned($fspP1DefaultedFromP3Offset,$blockSize,1); } + elsif($cfgIncludeHbAttributes) + { + # zeroInitSection occupies no space in the binary, so set the + # Hostboot section address to that of the zeroInitSection + $sectionHoH{ hbHeapZeroInit }{ offset } = + $sectionHoH{heapZeroInit}{ offset }; + $sectionHoH{ hbHeapZeroInit }{ type } = 10; + $sectionHoH{ hbHeapZeroInit }{ size } = + sizeBlockAligned($hbHeapZeroInitOffset,$blockSize,1); + } my $numSections = keys %sectionHoH; @@ -3948,6 +4010,10 @@ sub generateTargetingImage { push(@sections,"fspP1DefaultedFromZero"); push(@sections,"fspP1DefaultedFromP3"); } + elsif($cfgIncludeHbAttributes) + { + push(@sections,"hbHeapZeroInit"); + } foreach my $section (@sections) { @@ -4108,6 +4174,16 @@ generated code. Omits FSP specific attributes and targets from the generated binaries and generated code. This is the default behavior. +=item B<--include-hb-attributes> + +Emits Hostboot specific attributes and targets into the generated binaries and +generated code. + +=item B<--noinclude-hb-attributes> + +Omits Hostboot specific attributes and targets from the generated binaries and +generated code. This is the default behavior. + =item B<--verbose> Prints out some internal workings diff --git a/src/usr/targeting/xmltohb/attribute_types_hb.xml b/src/usr/targeting/xmltohb/attribute_types_hb.xml new file mode 100644 index 000000000..8d4bbd8c9 --- /dev/null +++ b/src/usr/targeting/xmltohb/attribute_types_hb.xml @@ -0,0 +1,203 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/usr/targeting/common/xmltohb/attribute_types.xml $ --> +<!-- --> +<!-- IBM CONFIDENTIAL --> +<!-- --> +<!-- COPYRIGHT International Business Machines Corp. 2011,2012 --> +<!-- --> +<!-- p1 --> +<!-- --> +<!-- Object Code Only (OCO) source materials --> +<!-- Licensed Internal Code Source Materials --> +<!-- IBM HostBoot Licensed Internal Code --> +<!-- --> +<!-- The source code for this program is not published or otherwise --> +<!-- divested of its trade secrets, irrespective of what has been --> +<!-- deposited with the U.S. Copyright Office. --> +<!-- --> +<!-- Origin: 30 --> +<!-- --> +<!-- IBM_PROLOG_END_TAG --> + +<attributes> + +<!-- ===================================================================== + HOST BOOT ATTRIBUTE TYPES + Contains the definition of hostboot attributes which should not be + synced to/from FSP + ================================================================= --> + +<attribute> + <id>IS_MPIPL</id> + <description>1 = in Memory Preserving IPL mode. 0 = in normal IPL mode.</description> + <simpleType> + <uint8_t> + <default>0</default> + </uint8_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hwpfToHbAttrMap> + <id>ATTR_IS_MPIPL</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> +</attribute> + +<attribute> + <id>XSCOM_VIRTUAL_ADDR</id> + <description>Cached Virtual Address of Xscom memory space for this Chip</description> + <simpleType> + <uint64_t> + <default>0</default> + </uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>FSI_MASTER_MUTEX</id> + <description>Mutex for FSI Master Operations</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<!-- For POD Testing --> +<attribute> + <id>HB_MUTEX_TEST_LOCK</id> + <description>Host boot mutex for testing</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>I2C_ENGINE_MUTEX_0</id> + <description>Mutex for I2C Master engine 0</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>I2C_ENGINE_MUTEX_1</id> + <description>Mutex for I2C Master engine 1</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>I2C_ENGINE_MUTEX_2</id> + <description>Mutex for I2C Master engine 2</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>FSI_SCOM_MUTEX</id> + <description>Mutex for FSI-based SCOM Operations</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>SCOM_IND_MUTEX</id> + <description>Mutex for Indirect SCOM read operation</description> + <simpleType> + <hbmutex> + <default>0</default> + </hbmutex> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + +<attribute> + <id>SLW_IMAGE_ADDR</id> + <description> + Location of runtime winkle image for this processor chip. + Written by host_build_winkle (istep 15.1) + </description> + <simpleType> + <uint64_t></uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + +<attribute> + <id>SLW_IMAGE_SIZE</id> + <description> + Size of runtime winkle image for this processor chip. + Written by host_build_winkle (istep 15.1) + </description> + <simpleType> + <uint64_t></uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + +<attribute> + <id>IBSCOM_VIRTUAL_ADDR</id> + <description>Cached Virtual Address of Inband Scom memory space for this Chip</description> + <simpleType> + <uint64_t> + <default>0</default> + </uint64_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + +</attributes> diff --git a/src/usr/targeting/xmltohb/makefile b/src/usr/targeting/xmltohb/makefile index 569273b37..5a38c02fc 100644 --- a/src/usr/targeting/xmltohb/makefile +++ b/src/usr/targeting/xmltohb/makefile @@ -1,25 +1,25 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/usr/targeting/xmltohb/makefile $ +# $Source: src/usr/targeting/xmltohb/makefile $ # -# IBM CONFIDENTIAL +# IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011-2012 +# COPYRIGHT International Business Machines Corp. 2011,2012 # -# p1 +# p1 # -# Object Code Only (OCO) source materials -# Licensed Internal Code Source Materials -# IBM HostBoot Licensed Internal Code +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code # -# The source code for this program is not published or other- -# wise divested of its trade secrets, irrespective of what has -# been deposited with the U.S. Copyright Office. +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. # -# Origin: 30 +# Origin: 30 # -# IBM_PROLOG_END_TAG +# IBM_PROLOG_END_TAG ################################################################################ # # @file targeting/xmltohb/makefile @@ -50,6 +50,24 @@ FAPI_ATTR_SOURCE_DIR = ${ROOTPATH}/src/usr/hwpf/hwp XMLTOHB_FAPIATTR_SOURCES = \ ${addprefix ${FAPI_ATTR_SOURCE_DIR}/, ${FAPI_ATTR_SOURCES}} +XMLTOHB_COMMON_ATTRIBUTE_SOURCES = attribute_types.xml +XMLTOHB_COMMON_TARGET_SOURCES = target_types.xml + +XMLTOHB_HB_ATTRIBUTE_SOURCES = attribute_types_hb.xml +XMLTOHB_HB_TARGET_SOURCES = target_types_hb.xml + +XMLTOHB_MERGED_COMMON_TARGET_SOURCES = target_types_merged.xml + +#Redefine XMLTOHB_GENERIC_SOURCES +XMLTOHB_GENERIC_SOURCES = \ + ${XMLTOHB_COMMON_ATTRIBUTE_SOURCES} \ + ${XMLTOHB_HB_ATTRIBUTE_SOURCES} \ + ${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} \ + ${XMLTOHB_HB_TARGET_SOURCES} + +#XML target types merge script +XMLTOHB_TARGET_MERGE_SCRIPT = updatetargetxml.pl + VMM_CONSTS_FILE = \ ${ROOTPATH}/src/include/usr/vmmconst.h @@ -67,13 +85,19 @@ GENFILES = ${XMLTOHB_TARGETS} # @echo FAPI_ATTR_SOURCES = ${FAPI_ATTR_SOURCES} # @echo FAPI_ATTR_SOURCE_DIR = ${FAPI_ATTR_SOURCE_DIR} # @echo XMLTOHB_FAPIATTR_SOURCES = ${XMLTOHB_FAPIATTR_SOURCES} +# @echo XMLTOHB_COMMON_ATTRIBUTE_SOURCES = ${XMLTOHB_COMMON_ATTRIBUTE_SOURCES} +# @echo XMLTOHB_COMMON_TARGET_SOURCES = ${XMLTOHB_COMMON_TARGET_SOURCES} +# @echo XMLTOHB_HB_ATTRIBUTE_SOURCES = ${XMLTOHB_HB_ATTRIBUTE_SOURCES} +# @echo XMLTOHB_HB_TARGET_SOURCES = ${XMLTOHB_HB_TARGET_SOURCES} +# @echo XMLTOHB_MERGED_COMMON_TARGET_SOURCES = ${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} # @echo VPATH = ${VPATH} EXTRA_PARTS = $(addprefix $(IMGDIR)/, $(XMLTOHB_SYSTEM_BINARIES)) EXTRA_CLEAN = $(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES}) \ $(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES:.bin=.xml}) \ - ${GENDIR}/${XMLTOHB_GENERIC_XML} ${GENDIR}/${XMLTOHB_FAPI_XML} + ${GENDIR}/${XMLTOHB_GENERIC_XML} ${GENDIR}/${XMLTOHB_FAPI_XML} \ + ${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} include ${ROOTPATH}/config.mk @@ -83,6 +107,12 @@ include ${ROOTPATH}/config.mk ${EXTRA_PARTS}: ${IMGDIR}/% : ${GENDIR}/% cp -f $^ $@ +# create merged target xml +${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES}: \ + ${XMLTOHB_TARGET_MERGE_SCRIPT} ${XMLTOHB_COMMON_TARGET_SOURCES} ${XMLTOHB_HB_TARGET_SOURCES} + ./${XMLTOHB_TARGET_MERGE_SCRIPT} $(addprefix --hb=,${XMLTOHB_HB_TARGET_SOURCES}) \ + $(addprefix --common=,${COMMON_TARGETING_REL_PATH}/${XMLTOHB_COMMON_TARGET_SOURCES}) > $@ + # generic XML is created from the generic sources only ${GENDIR}/${XMLTOHB_GENERIC_XML}: \ ${XMLTOHB_MERGE_SCRIPT} ${XMLTOHB_GENERIC_SOURCES} @@ -114,5 +144,5 @@ ${GENDIR}/%_targeting.bin: ${XMLTOHB_COMPILER_SCRIPT} ${GENDIR}/%.hb.xml \ $(addprefix --fapi-attributes-xml-file=,${GENDIR}/${XMLTOHB_FAPI_XML}) \ --src-output-dir=none --img-output-dir=$(dir $@) \ --img-output-file=$(notdir $@) \ - --vmm-consts-file=$(VMM_CONSTS_FILE) --noshort-enums + --vmm-consts-file=$(VMM_CONSTS_FILE) --noshort-enums --include-hb-attributes diff --git a/src/usr/targeting/xmltohb/target_types_hb.xml b/src/usr/targeting/xmltohb/target_types_hb.xml new file mode 100644 index 000000000..4604bbb75 --- /dev/null +++ b/src/usr/targeting/xmltohb/target_types_hb.xml @@ -0,0 +1,92 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/usr/targeting/common/xmltohb/target_types.xml $ --> +<!-- --> +<!-- IBM CONFIDENTIAL --> +<!-- --> +<!-- COPYRIGHT International Business Machines Corp. 2011,2012 --> +<!-- --> +<!-- p1 --> +<!-- --> +<!-- Object Code Only (OCO) source materials --> +<!-- Licensed Internal Code Source Materials --> +<!-- IBM HostBoot Licensed Internal Code --> +<!-- --> +<!-- The source code for this program is not published or otherwise --> +<!-- divested of its trade secrets, irrespective of what has been --> +<!-- deposited with the U.S. Copyright Office. --> +<!-- --> +<!-- Origin: 30 --> +<!-- --> +<!-- IBM_PROLOG_END_TAG --> + +<attributes> + +<!-- ===================================================================== + HOST BOOT TARGETS + Contains the definition of the different types of Hostboot targets + and target type extensions to add attributes to common target types + ================================================================= --> + +<targetTypeExtension> + <id>sys-sys-power8</id> + <attribute><id>IS_MPIPL</id></attribute> + <attribute><id>HB_MUTEX_TEST_LOCK</id></attribute> +</targetTypeExtension> + +<targetTypeExtension> + <id>chip-processor</id> + <attribute> + <id>FSI_MASTER_MUTEX</id> + </attribute> + <attribute> + <id>FSI_SCOM_MUTEX</id> + </attribute> + <attribute> + <id>SCOM_IND_MUTEX</id> + </attribute> + <!-- new attribute for isteps 15 & 16 --> + <attribute> + <id>SLW_IMAGE_ADDR</id> + </attribute> + <attribute> + <id>SLW_IMAGE_SIZE</id> + </attribute> +</targetTypeExtension> + +<targetTypeExtension> + <id>chip-processor-power8</id> + <attribute> + <id>I2C_ENGINE_MUTEX_0</id> + <default>0</default> + </attribute> + <attribute> + <id>I2C_ENGINE_MUTEX_1</id> + <default>0</default> + </attribute> + <attribute> + <id>I2C_ENGINE_MUTEX_2</id> + <default>0</default> + </attribute> + <attribute> + <id>XSCOM_VIRTUAL_ADDR</id> + </attribute> +</targetTypeExtension> + +<!-- Centaur chip/DMI --> + +<targetTypeExtension> + <id>chip-membuf-centaur</id> + <attribute> + <id>FSI_SCOM_MUTEX</id> + </attribute> + <attribute> + <id>SCOM_IND_MUTEX</id> + </attribute> + <attribute> + <id>IBSCOM_VIRTUAL_ADDR</id> + </attribute> +</targetTypeExtension> + +</attributes> diff --git a/src/usr/targeting/xmltohb/updatetargetxml.pl b/src/usr/targeting/xmltohb/updatetargetxml.pl new file mode 100755 index 000000000..46861a167 --- /dev/null +++ b/src/usr/targeting/xmltohb/updatetargetxml.pl @@ -0,0 +1,142 @@ +#!/usr/bin/perl +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/targeting/xmltohb/updatetargetxml.pl $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END_TAG + +# +# Original file created by Van Lee for fsp. +# File copied to Hostboot and modified by CamVan Nguyen +# +# Usage: +# +# updatetargetxml --hb=target_types_hb.xml --common=target_types.xml +# +# Purpose: +# +# This perl script processes the target_types_hb.xml file to find the +# <targetTypeExtension> tags, and update target_types.xml if needed. +# The updated target_types.xml is written to the console. +# + +use strict; +use XML::Simple; +use Data::Dumper; + +my $hb = ""; +my $common = ""; +my $usage = 0; +use Getopt::Long; +GetOptions( "hb:s" => \$hb, + "common:s" => \$common, + "help" => \$usage, ); + +if ($usage || ($hb eq "") || ($common eq "")) +{ + display_help(); + exit 0; +} + +open (FH, "<$hb") || + die "ERROR: unable to open $hb\n"; +close (FH); + +my $generic = XMLin("$hb", ForceArray=>1); + +open (FH, "<$common") || + die "ERROR: unable to open $common\n"; +close (FH); + +my $generic1 = XMLin("$common"); + +my @NewAttr; +foreach my $Extension ( @{$generic->{targetTypeExtension}} ) +{ + my $id = $Extension->{id}->[0]; + foreach my $attr ( @{$Extension->{attribute}} ) + { + my $attribute_id = $attr->{id}->[0]; + my $default = ""; + if (exists $attr->{default}) + { + $default = $attr->{default}->[0]; + } + #print "$id, $attribute_id $default\n"; + if (! exists $generic1->{targetType}->{$id}->{attribute}->{$attribute_id}) + { + push @NewAttr, [ $id, $attribute_id, $default ]; + } + } +} + +open (FH, "<$common"); + +my $check = 0; +my $id = ""; +while (my $line = <FH>) +{ + if ( $line =~ /^\s*<targetType>.*/) + { + $check = 1; + } + elsif ($check == 1 && $line =~ /^\s*<id>/) + { + $check = 0; + $id = $line; + $id =~ s/\n//; + $id =~ s/.*<id>(.*)<\/id>.*/$1/; + } + elsif ($line =~ /^\s*<\/targetType>.*/) + { + for my $i ( 0 .. $#NewAttr ) + { + if ($NewAttr[$i][0] eq $id) + { + print " <attribute>\n"; + print " <id>$NewAttr[$i][1]</id>\n"; + if ($NewAttr[$i][2] ne "") + { + print " <default>$NewAttr[$i][2]</default>\n"; + } + print " </attribute>\n"; + } + } + } + print "$line"; +} + +close (FH); + +sub display_help +{ + use File::Basename; + my $scriptname = basename($0); + print STDERR " +Usage: + + $scriptname --help + $scriptname --hb=hbfname --hb=commonfname + --hb=hbfname + hbfname is the complete pathname of the target_types_hb.xml file + --common=commonfname + commonfname is the complete pathname of the target_types.xml file +\n"; +} |