diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2018-04-10 17:28:01 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-04-11 17:59:57 -0500 |
commit | 4cf135d9a87726561a8d3bbfad34516a77aa5e34 (patch) | |
tree | 19bcbcf64f189460950c731267d1f617f0041170 /platforms | |
parent | 9c21cae5aac4246ac4e438cac5a96a24907676c7 (diff) | |
download | skiboot-4cf135d9a87726561a8d3bbfad34516a77aa5e34.zip skiboot-4cf135d9a87726561a8d3bbfad34516a77aa5e34.tar.gz skiboot-4cf135d9a87726561a8d3bbfad34516a77aa5e34.tar.bz2 |
astbmc: Add more slot table helpers
Add some helper macros for the common case of a slot, or builtin
device directly under a PHB or switch port.
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 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h index feaca1d..b61c2dd 100644 --- a/platforms/astbmc/astbmc.h +++ b/platforms/astbmc/astbmc.h @@ -51,6 +51,33 @@ struct slot_table_entry { .children = child_table \ } +/* + * For the most part the "table" isn't really a table and only contains + * a single real entry and the etype = st_end terminator. In these cases + * we can use these helpers. If you need something special in the slot + * table for each slot (e.g. power limit, devfn != 0) then you need to + * define the actual structure. + */ +#define ST_BUILTIN_DEV(st_name, slot_name) \ +static struct slot_table_entry st_name[] = \ +{ \ + { \ + .etype = st_pluggable_slot, \ + .name = slot_name, \ + }, \ + { .etype = st_end }, \ +} + +#define ST_PLUGGABLE(st_name, slot_name) \ +static struct slot_table_entry st_name[] = \ +{ \ + { \ + .etype = st_pluggable_slot, \ + .name = slot_name, \ + }, \ + { .etype = st_end }, \ +} + extern const struct bmc_platform astbmc_ami; extern const struct bmc_platform astbmc_openbmc; |