diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2018-04-10 17:29:21 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-04-11 17:59:57 -0500 |
commit | d15e2e5ef92f5e79f90ac06a8a3b848881886005 (patch) | |
tree | c0802d1de1c880288e7caa932bca7edee68bee1c /platforms | |
parent | f10feca2b3324270ca3de47aa98d99911cf85a7c (diff) | |
download | skiboot-d15e2e5ef92f5e79f90ac06a8a3b848881886005.zip skiboot-d15e2e5ef92f5e79f90ac06a8a3b848881886005.tar.gz skiboot-d15e2e5ef92f5e79f90ac06a8a3b848881886005.tar.bz2 |
slots: Add power limit support
Add support for sourcing power limit information from either the DT slot
heirachy or the slot table.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/astbmc/astbmc.h | 1 | ||||
-rw-r--r-- | platforms/astbmc/slots.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h index b61c2dd..fb6c68a 100644 --- a/platforms/astbmc/astbmc.h +++ b/platforms/astbmc/astbmc.h @@ -39,6 +39,7 @@ struct slot_table_entry { uint32_t location; const char *name; const struct slot_table_entry *children; + uint8_t power_limit; }; /* diff --git a/platforms/astbmc/slots.c b/platforms/astbmc/slots.c index 19b82fd..5c0effd 100644 --- a/platforms/astbmc/slots.c +++ b/platforms/astbmc/slots.c @@ -121,6 +121,7 @@ void slot_table_get_slot_info(struct phb *phb, struct pci_device *pd) slot->pluggable = !!(ent->etype == st_pluggable_slot); slot->ops.add_properties = slot_table_add_properties; + slot->power_limit = ent->power_limit; slot->data = (void *)ent; } @@ -141,6 +142,7 @@ void dt_slot_get_slot_info(struct phb *phb, struct pci_device *pd) struct dt_node *slot_np; struct pci_slot *slot; const char *name = NULL; + uint32_t power_limit = 0; bool pluggable = false; if (!pd || pd->slot) @@ -150,6 +152,8 @@ void dt_slot_get_slot_info(struct phb *phb, struct pci_device *pd) if (slot_np) { pluggable = dt_has_node_property(slot_np, "ibm,pluggable", NULL); + power_limit = dt_prop_get_u32_def(slot_np, + "ibm,power-limit", 0); name = dt_prop_get_def(slot_np, "ibm,slot-label", NULL); } @@ -169,6 +173,7 @@ void dt_slot_get_slot_info(struct phb *phb, struct pci_device *pd) slot->ops.add_properties = dt_slot_add_properties; slot->pluggable = pluggable; + slot->power_limit = power_limit; slot->data = (void *)slot_np; } |