From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
"Brian Norris" <briannorris@chromium.org>,
"Julius Werner" <jwerner@chromium.org>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nicolas@fjasle.eu>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
kernel@collabora.com, chrome-platform@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Subject: [PATCH v3 2/4] firmware: coreboot: Generate aliases for coreboot modules
Date: Wed, 17 Jan 2024 16:03:23 -0300 [thread overview]
Message-ID: <20240117-coreboot-mod-defconfig-v3-2-049565a27bba@collabora.com> (raw)
In-Reply-To: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com>
Generate aliases for coreboot modules to allow automatic module probing.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
include/linux/mod_devicetable.h | 8 ++++++++
scripts/mod/devicetable-offsets.c | 3 +++
scripts/mod/file2alias.c | 10 ++++++++++
3 files changed, 21 insertions(+)
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index f458469c5ce5..24e0dcfde809 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -960,4 +960,12 @@ struct vchiq_device_id {
char name[32];
};
+/**
+ * struct coreboot_device_id - Identifies a coreboot table entry
+ * @tag: tag ID
+ */
+struct coreboot_device_id {
+ __u32 tag;
+};
+
#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index e91a3c38143b..518200813d4e 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -274,5 +274,8 @@ int main(void)
DEVID(vchiq_device_id);
DEVID_FIELD(vchiq_device_id, name);
+ DEVID(coreboot_device_id);
+ DEVID_FIELD(coreboot_device_id, tag);
+
return 0;
}
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 4829680a0a6d..5d1c61fa5a55 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1494,6 +1494,15 @@ static int do_vchiq_entry(const char *filename, void *symval, char *alias)
return 1;
}
+/* Looks like: coreboot:tN */
+static int do_coreboot_entry(const char *filename, void *symval, char *alias)
+{
+ DEF_FIELD(symval, coreboot_device_id, tag);
+ sprintf(alias, "coreboot:t%08X", tag);
+
+ return 1;
+}
+
/* Does namelen bytes of name exactly match the symbol? */
static bool sym_is(const char *name, unsigned namelen, const char *symbol)
{
@@ -1575,6 +1584,7 @@ static const struct devtable devtable[] = {
{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
{"cdx", SIZE_cdx_device_id, do_cdx_entry},
{"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},
+ {"coreboot", SIZE_coreboot_device_id, do_coreboot_entry},
};
/* Create MODULE_ALIAS() statements.
--
2.43.0
next prev parent reply other threads:[~2024-01-17 19:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 19:03 [PATCH v3 0/4] Allow coreboot modules to autoload and enable cbmem in the arm64 defconfig Nícolas F. R. A. Prado
2024-01-17 19:03 ` [PATCH v3 1/4] firmware: coreboot: Generate modalias uevent for devices Nícolas F. R. A. Prado
2024-02-05 1:37 ` Tzung-Bi Shih
2024-02-05 14:13 ` Nícolas F. R. A. Prado
2024-02-06 3:54 ` Tzung-Bi Shih
2024-01-17 19:03 ` Nícolas F. R. A. Prado [this message]
2024-01-17 19:03 ` [PATCH v3 3/4] firmware: coreboot: Replace tag with id table in driver struct Nícolas F. R. A. Prado
2024-01-18 8:46 ` AngeloGioacchino Del Regno
2024-01-17 19:03 ` [PATCH v3 4/4] arm64: defconfig: Enable support for cbmem entries in the coreboot table Nícolas F. R. A. Prado
2024-01-19 2:39 ` [PATCH v3 0/4] Allow coreboot modules to autoload and enable cbmem in the arm64 defconfig Tzung-Bi Shih
2024-01-23 22:07 ` Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240117-coreboot-mod-defconfig-v3-2-049565a27bba@collabora.com \
--to=nfraprado@collabora.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=arnd@arndb.de \
--cc=briannorris@chromium.org \
--cc=catalin.marinas@arm.com \
--cc=chrome-platform@lists.linux.dev \
--cc=jwerner@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=tzungbi@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox