Skip to content

Commit f1cebae

Browse files
nfrapradoTzung-Bi Shih
authored andcommitted
firmware: coreboot: Generate aliases for coreboot modules
Generate aliases for coreboot modules to allow automatic module probing. Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Brian Norris <[email protected]> Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Acked-by: Masahiro Yamada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent c2b28f6 commit f1cebae

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

include/linux/mod_devicetable.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,4 +960,14 @@ struct vchiq_device_id {
960960
char name[32];
961961
};
962962

963+
/**
964+
* struct coreboot_device_id - Identifies a coreboot table entry
965+
* @tag: tag ID
966+
* @driver_data: driver specific data
967+
*/
968+
struct coreboot_device_id {
969+
__u32 tag;
970+
kernel_ulong_t driver_data;
971+
};
972+
963973
#endif /* LINUX_MOD_DEVICETABLE_H */

scripts/mod/devicetable-offsets.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,8 @@ int main(void)
274274
DEVID(vchiq_device_id);
275275
DEVID_FIELD(vchiq_device_id, name);
276276

277+
DEVID(coreboot_device_id);
278+
DEVID_FIELD(coreboot_device_id, tag);
279+
277280
return 0;
278281
}

scripts/mod/file2alias.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,15 @@ static int do_vchiq_entry(const char *filename, void *symval, char *alias)
14941494
return 1;
14951495
}
14961496

1497+
/* Looks like: coreboot:tN */
1498+
static int do_coreboot_entry(const char *filename, void *symval, char *alias)
1499+
{
1500+
DEF_FIELD(symval, coreboot_device_id, tag);
1501+
sprintf(alias, "coreboot:t%08X", tag);
1502+
1503+
return 1;
1504+
}
1505+
14971506
/* Does namelen bytes of name exactly match the symbol? */
14981507
static bool sym_is(const char *name, unsigned namelen, const char *symbol)
14991508
{
@@ -1575,6 +1584,7 @@ static const struct devtable devtable[] = {
15751584
{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
15761585
{"cdx", SIZE_cdx_device_id, do_cdx_entry},
15771586
{"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},
1587+
{"coreboot", SIZE_coreboot_device_id, do_coreboot_entry},
15781588
};
15791589

15801590
/* Create MODULE_ALIAS() statements.

0 commit comments

Comments
 (0)