Skip to content

Commit

Permalink
Always use original defaults for attribute fields with no value
Browse files Browse the repository at this point in the history
When a complex attribute is modified to add new fields, it is
possible for the system xml to get generated with blank values
for the new fields.  This value will then get pushed into the
final binary instead of a valid default from the metadata xml
files.

Change-Id: I26d5434c7039d62486b52eb79b395c6dd3d77db7
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73089
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Mar 11, 2019
1 parent 552339e commit 4636db0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 29 deletions.
17 changes: 10 additions & 7 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5902,6 +5902,7 @@
<id>PRIMARY_CAPABILITIES</id>
<persistency>non-volatile</persistency>
<readable/>
<no_export/>
</attribute>

<attribute>
Expand Down Expand Up @@ -6979,12 +6980,14 @@

<attribute>
<complexType>
<description>Structure which defines a system's SP functions.
<description>
Structure which defines a system's SP functions.
Applicable for System target only. Structure is read-only.
</description>
Default values match OpenBMC implementation.
</description>
<field>
<bits>1</bits>
<default>1</default>
<default>0</default>
<description>
If this flag is set then mailboxEnabled MUST also be set

Expand All @@ -6996,7 +6999,7 @@
</field>
<field>
<bits>1</bits>
<default>1</default>
<default>0</default>
<description>
0b0: SP does not initialize FSI slave logic, Hostboot must;
0b1: SP does initialize FSI slave logic so Hostboot should not
Expand All @@ -7016,7 +7019,7 @@
</field>
<field>
<bits>1</bits>
<default>1</default>
<default>0</default>
<description>
0b0: SP does not initialize FSI master logic, Hostboot must;
0b1: SP does initialize FSI master logic so Hostboot should not
Expand All @@ -7026,7 +7029,7 @@
</field>
<field>
<bits>1</bits>
<default>1</default>
<default>0</default>
<description>
0b0: SP does not perform hardware change detection, Hostboot must;
0b1: SP does perform hardware change detection (HCDB) so Hostboot should not
Expand All @@ -7036,7 +7039,7 @@
</field>
<field>
<bits>1</bits>
<default>1</default>
<default>0</default>
<description>
0b0: SP does not perform Power Line Disturbance (PLD) detection, Hostboot must;
0b1: SP does perform Power Line Disturbance (PLD) detection so Hostboot should not
Expand Down
14 changes: 7 additions & 7 deletions src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,13 @@
<attribute>
<id>SP_FUNCTIONS</id>
<default>
<field><id>baseServices</id><value/></field>
<field><id>fsiMasterInit</id><value/></field>
<field><id>fsiSlaveInit</id><value/></field>
<field><id>hardwareChangeDetection</id><value/></field>
<field><id>mailboxEnabled</id><value/></field>
<field><id>powerLineDisturbance</id><value/></field>
<field><id>reserved</id><value/></field>
<field><id>fsiSlaveInit</id><value>0</value></field>
<field><id>mailboxEnabled</id><value>0</value></field>
<field><id>fsiMasterInit</id><value>0</value></field>
<field><id>hardwareChangeDetection</id><value>0</value></field>
<field><id>powerLineDisturbance</id><value>0</value></field>
<field><id>baseServices</id><value>0</value></field>
<field><id>reserved</id><value>0</value></field>
</default>
</attribute>
<attribute>
Expand Down
16 changes: 8 additions & 8 deletions src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2018 -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2019 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -549,13 +549,13 @@
<attribute>
<id>SP_FUNCTIONS</id>
<default>
<field><id>baseServices</id><value/></field>
<field><id>fsiMasterInit</id><value/></field>
<field><id>fsiSlaveInit</id><value/></field>
<field><id>hardwareChangeDetection</id><value/></field>
<field><id>mailboxEnabled</id><value/></field>
<field><id>powerLineDisturbance</id><value/></field>
<field><id>reserved</id><value/></field>
<field><id>fsiSlaveInit</id><value>0</value></field>
<field><id>mailboxEnabled</id><value>0</value></field>
<field><id>fsiMasterInit</id><value>0</value></field>
<field><id>hardwareChangeDetection</id><value>0</value></field>
<field><id>powerLineDisturbance</id><value>0</value></field>
<field><id>baseServices</id><value>0</value></field>
<field><id>reserved</id><value>0</value></field>
</default>
</attribute>
<attribute>
Expand Down
2 changes: 2 additions & 0 deletions src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@
<id>tpmEnabled</id>
<value>1</value>
</field>
<field><id>i2cMuxBusSelector</id><value/></field>
<field><id>i2cMuxPath</id><value/></field>
</default>
</attribute>
<attribute>
Expand Down
14 changes: 7 additions & 7 deletions src/usr/targeting/common/xmltohb/xmltohb.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5085,6 +5085,13 @@ sub mergeComplexAttributeFields {
{
my $foundField = 0;

# Do not try to merge in a field with no value
if (ref($newField->{value}) eq "HASH")
{
#print STDOUT "Skip $newField->{id}\n";
next;
}

# Iterate over $mergedFields (really $currentAttrFields) looking
# for the $newField of $newAttrFields
foreach my $currentField (@{$mergedFields->{default}->{field}})
Expand Down Expand Up @@ -5543,15 +5550,8 @@ sub packComplexType {
# If native "EntityPath" type, process accordingly
if($field->{type} eq "EntityPath")
{
if( ref($default->{value}) eq "HASH" )
{
#print STDOUT "Skipping empty EntityPath field\n";
}
else
{
$binaryData .= packEntityPath($attributes,
$default->{value});
}
}
# If not a defined simple type, process as an enumeration
elsif(!exists $simpleTypeProperties->{$field->{type}})
Expand Down

0 comments on commit 4636db0

Please sign in to comment.