History

firmware: coreboot: Generate aliases for coreboot modules

Generate aliases for coreboot modules to allow automatic module probing.

Nícolas F. R. A. Prado committed 2 years ago

Commit f1cebae1 parent c2b28f63 files · +23 −0Browse files

Unified · Split

3 files
  1. include/linux/mod_devicetable.h +10 −0
  2. scripts/mod/devicetable-offsets.c +3 −0
  3. scripts/mod/file2alias.c +10 −0
include/linux/mod_devicetable.h+10−0
@@ -960,4 +960,14 @@ struct vchiq_device_id { · 959 unmodified lines
960 char name[32];960 char name[32];
961};961};
962 962
963/**
964 * struct coreboot_device_id - Identifies a coreboot table entry
965 * @tag: tag ID
966 * @driver_data: driver specific data
967 */
968struct coreboot_device_id {
969 __u32 tag;
970 kernel_ulong_t driver_data;
971};
972
963#endif /* LINUX_MOD_DEVICETABLE_H */973#endif /* LINUX_MOD_DEVICETABLE_H */
scripts/mod/devicetable-offsets.c+3−0
@@ -274,5 +274,8 @@ int main(void) · 273 unmodified lines
274 DEVID(vchiq_device_id);274 DEVID(vchiq_device_id);
275 DEVID_FIELD(vchiq_device_id, name);275 DEVID_FIELD(vchiq_device_id, name);
276 276
277 DEVID(coreboot_device_id);
278 DEVID_FIELD(coreboot_device_id, tag);
279
277 return 0;280 return 0;
278}281}
scripts/mod/file2alias.c+10−0
@@ -1494,6 +1494,15 @@ static int do_vchiq_entry(const char *filename, void *symval, char *alias) · 1493 unmodified lines
1494 return 1;1494 return 1;
1495}1495}
1496 1496
1497/* Looks like: coreboot:tN */
1498static 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
1497/* Does namelen bytes of name exactly match the symbol? */1506/* Does namelen bytes of name exactly match the symbol? */
1498static bool sym_is(const char *name, unsigned namelen, const char *symbol)1507static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1499{1508{
@@ -1575,6 +1584,7 @@ static const struct devtable devtable[] = { · 75 unmodified lines
1575 {"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},1584 {"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
1576 {"cdx", SIZE_cdx_device_id, do_cdx_entry},1585 {"cdx", SIZE_cdx_device_id, do_cdx_entry},
1577 {"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},1586 {"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},
1587 {"coreboot", SIZE_coreboot_device_id, do_coreboot_entry},
1578};1588};
1579 1589
1580/* Create MODULE_ALIAS() statements.1590/* Create MODULE_ALIAS() statements.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t