diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-08-20 11:29:26 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-09-01 16:10:40 +1000 |
commit | 7df64e132bdb0a87a92b3edb1edae6b50198828e (patch) | |
tree | 919f331544f5e35de7ce18f142d1cc13fb1527a1 /core | |
parent | 6d511c11ecbbaba062ec97ab4853549b3b5fb820 (diff) | |
download | skiboot-7df64e132bdb0a87a92b3edb1edae6b50198828e.zip skiboot-7df64e132bdb0a87a92b3edb1edae6b50198828e.tar.gz skiboot-7df64e132bdb0a87a92b3edb1edae6b50198828e.tar.bz2 |
pci/fsp: Cleanup slot_info
This moves some fields that are specific to the LXVPD mechanism out
of the generic pci_slot_info into a private wrapper. Additionally,
most fields in pci_slot_info are made signed integers in order to
allow them to be set to "-1" which indicates that the field doesn't
have a meaningful value, and inhibits creation of the corresponding
device-tree property.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/pci.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1142,14 +1142,21 @@ static void pci_add_slot_properties(struct phb *phb, struct pci_slot_info *info, /* Add other slot information */ dt_add_property_cells(np, "ibm,slot-pluggable", info->pluggable); dt_add_property_cells(np, "ibm,slot-power-ctl", info->power_ctl); - dt_add_property_cells(np, "ibm,slot-wired-lanes", info->wired_lanes); + if (info->wired_lanes >= 0) + dt_add_property_cells(np, "ibm,slot-wired-lanes", info->wired_lanes); /*dt_add_property(np, "ibm,slot-bus-clock", &pd->slot_info->bus_clock, sizeof(uint8_t));*/ - dt_add_property_cells(np, "ibm,slot-connector-type", info->connector_type); - dt_add_property_cells(np, "ibm,slot-card-desc", info->card_desc); - dt_add_property_cells(np, "ibm,slot-card-mech", info->card_mech); - dt_add_property_cells(np, "ibm,slot-pwr-led-ctl", info->pwr_led_ctl); - dt_add_property_cells(np, "ibm,slot-attn-led-ctl", info->attn_led_ctl); - dt_add_property_string(np, "ibm,slot-label", info->label); + if (info->connector_type >= 0) + dt_add_property_cells(np, "ibm,slot-connector-type", info->connector_type); + if (info->card_desc >= 0) + dt_add_property_cells(np, "ibm,slot-card-desc", info->card_desc); + if (info->card_mech >= 0) + dt_add_property_cells(np, "ibm,slot-card-mech", info->card_mech); + if (info->pwr_led_ctl >= 0) + dt_add_property_cells(np, "ibm,slot-pwr-led-ctl", info->pwr_led_ctl); + if (info->attn_led_ctl >= 0) + dt_add_property_cells(np, "ibm,slot-attn-led-ctl", info->attn_led_ctl); + if (strlen(info->label) > 0) + dt_add_property_string(np, "ibm,slot-label", info->label); } static void pci_add_loc_code(struct dt_node *np, struct pci_device *pd) |