diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-11-05 18:43:51 +1100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-11-14 16:09:45 +1100 |
commit | bbe5f0038786e412e38364d48d93fa8961ec054e (patch) | |
tree | 047b8c1b42cbadad95fdc31b9a1475688016b469 /platforms | |
parent | 446f9f036c994666be391b77c6a1554d4c50a350 (diff) | |
download | skiboot-bbe5f0038786e412e38364d48d93fa8961ec054e.zip skiboot-bbe5f0038786e412e38364d48d93fa8961ec054e.tar.gz skiboot-bbe5f0038786e412e38364d48d93fa8961ec054e.tar.bz2 |
platforms/astbmc: Add more slot helper macros
Add a helper for adding builtin devices to a switch slot table and use
the VA_ARGS macro hacks to allow initialising other struct members (such
as the child pointer) to the ST_PLUGGABLE() and ST_BUILTIN() macros.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/astbmc/astbmc.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h index b9f71fc..a3b4a07 100644 --- a/platforms/astbmc/astbmc.h +++ b/platforms/astbmc/astbmc.h @@ -47,22 +47,24 @@ struct slot_table_entry { * 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) \ +#define ST_BUILTIN_DEV(st_name, slot_name, ...) \ static struct slot_table_entry st_name[] = \ { \ { \ .etype = st_pluggable_slot, \ .name = slot_name, \ + ##__VA_ARGS__ \ }, \ { .etype = st_end }, \ } -#define ST_PLUGGABLE(st_name, slot_name) \ +#define ST_PLUGGABLE(st_name, slot_name, ...) \ static struct slot_table_entry st_name[] = \ { \ { \ .etype = st_pluggable_slot, \ .name = slot_name, \ + ##__VA_ARGS__ \ }, \ { .etype = st_end }, \ } @@ -75,6 +77,14 @@ static struct slot_table_entry st_name[] = \ ##__VA_ARGS__ \ } +#define SW_BUILTIN(slot_name, port, ...) \ +{ \ + .etype = st_builtin_dev, \ + .name = slot_name, \ + .location = ST_LOC_DEVFN(port, 0), \ + ##__VA_ARGS__ \ +} + extern const struct bmc_hw_config bmc_hw_ast2400; extern const struct bmc_hw_config bmc_hw_ast2500; extern const struct bmc_platform bmc_plat_ast2400_ami; |