From patchwork Wed Jan 17 19:03:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13522117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65FCFC47422 for ; Wed, 17 Jan 2024 19:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XT8H/07sC6WFpcRZK+foHe6a9HLbyi9uwhnswYxGonQ=; b=2u6PzEB59Vl6wE PzycuTRD6TjZhg6o2VF6rkjMwwQ4LphEpj5CMzWHc5u4v4ibNJTmdZLKo9N/EZM0U/hfUxX8iJfCd 1cqmYrujuuvB5bQGMI2CN3dy09CgAScUf+Ch3TKj7xPsal22LqKuSWyXbuzEBnNmC6PXhe+T5WJZ0 zo/KiJGLGb1OZ2uwaj0+CZH5vQNTlD6YnHtGn5m6MF2nc3Vpc4X5UpdGCQ4voTI7y6ksDxOxrrxOB ucQ30Nvt3p1KiZJuOuko8TOLnJBr2wy7TLRopV3pzTFHVXBzPQFODbRsErYcYwLxT7YAtXaeKwmLq NhnJCXR4LThhn/qJrItA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEb-000RMc-2M; Wed, 17 Jan 2024 19:05:57 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEZ-000RLd-01 for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 19:05:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705518352; bh=+oH4EJn5sUeFLh47JfQVauFBQi5fBhiUE512d5N7kvA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=3mnn8/XzjgRV1yrJ/b0Bpm/qJbxf1HJflc3HSRevLRGcD9H1U+Ce3fwTb+l8Zkrmh 5NuxGp1EfTM/lzvqF+GqpNEuINU5oIotPcGQeBygv86q6ra+vwW3hCEyp+lU3OEiW3 pa2Kph7RhoRy7rAJ2dePc1+8MI8Fkqi+ge0nqRdLqMjDWGv5UViLhTgmxvcLkL7wKV lqwywWw1tFai/KHSQqVsq0bARuIqLDtPI8YpQSRSiv0zTZXMRJNsPlumyCMLoEViTR l786E/N96/lOKdR/os3q9AD58zgFDOMI2TvsGtytN9kFu/ZFCmLsXvJgc70YnVYGIo ZXP4l9e61jYfA== Received: from [192.168.0.47] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id AE9B73782033; Wed, 17 Jan 2024 19:05:47 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 17 Jan 2024 16:03:22 -0300 Subject: [PATCH v3 1/4] firmware: coreboot: Generate modalias uevent for devices MIME-Version: 1.0 Message-Id: <20240117-coreboot-mod-defconfig-v3-1-049565a27bba@collabora.com> References: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> In-Reply-To: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> To: Tzung-Bi Shih Cc: Arnd Bergmann , Brian Norris , Julius Werner , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Catalin Marinas , Will Deacon , AngeloGioacchino Del Regno , Andy Shevchenko , kernel@collabora.com, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_110555_171847_D6B2836D X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generate a modalias uevent for devices in the coreboot bus to allow userspace to automatically load the corresponding modules. Acked-by: Brian Norris Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado --- drivers/firmware/google/coreboot_table.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c index 2a4469bf1b81..c1b9a9e8e8ed 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -53,11 +53,20 @@ static void coreboot_bus_remove(struct device *dev) driver->remove(device); } +static int coreboot_bus_uevent(const struct device *dev, struct kobj_uevent_env *env) +{ + struct coreboot_device *device = CB_DEV(dev); + u32 tag = device->entry.tag; + + return add_uevent_var(env, "MODALIAS=coreboot:t%08X", tag); +} + static struct bus_type coreboot_bus_type = { .name = "coreboot", .match = coreboot_bus_match, .probe = coreboot_bus_probe, .remove = coreboot_bus_remove, + .uevent = coreboot_bus_uevent, }; static void coreboot_device_release(struct device *dev) From patchwork Wed Jan 17 19:03:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13522118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAEF0C47422 for ; Wed, 17 Jan 2024 19:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZT/ZAxDPgN2TGpX1R+rl1OoAEGc1mNXVnxQG/daRF6c=; b=S6S1B8yCWw3zRi ISVd/zYOSVWp0heNxB718t+Re5KU6s0E1lcpeMpGFqy17mY+rRgSrtkiHqm+jixqawV0kSPDeYnem ARmLykiNgM8F4kx+bAXWKy0v8kNs75yw6OcK/MmsX+v1r+N6jYbeivNp2nfHnaImlhfOYCh6R0jKx 2sGZxHusE9wPehXDUUW5hVwPrGn3zIErrbmJQ34j4ijAYpmexB5wSGb+WwnhyGAwtgf8qOj+3Kard hXNNYtXQi/2hewMUxv/v4Hg6P/wNElGD0Efi/aw7TCVe+KC5wLWtfEeUInnzIfFYSmhVcUSaPEfTP whN9rY+AkjtbGKuhQY4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEs-000RRb-1g; Wed, 17 Jan 2024 19:06:14 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEe-000RNE-2E for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 19:06:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705518358; bh=eOeOU3x614lsawB+rslBo/giR4eO6xhTQjWM2UWOobU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GXop1/APn+/hjPS2SlNEWm1M7m5jGZ1Ar+IYRFjIvHr/W5ryRiPW/BokDnimXt5lp PZM1pHH/SPsEMdYfu95Zg1/K8gN6V1W2A9p069azSnp3M0upE4yFSjd8wl7jloLaxn 5HNjMw5QlU81epDaBPj27tbGAxMpY4T+WmKau4Jc+8cBE+hZjqhh2LwgNWqppEotCh N0BZnvm+h0G7Wl1FGNsJ1ep7fVIxNdyN+qkoGy+PCO6b23lwVI/5U7uqOCnDc9ZmRq tSfr+OtvQOXYZLzIhEq1fjkQd+lgAYWA4V0R/WEADLmiDAgRNfTP8eyBOb2U2AeCW4 ZU6KttHP/8QbQ== Received: from [192.168.0.47] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6DD643782066; Wed, 17 Jan 2024 19:05:53 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 17 Jan 2024 16:03:23 -0300 Subject: [PATCH v3 2/4] firmware: coreboot: Generate aliases for coreboot modules MIME-Version: 1.0 Message-Id: <20240117-coreboot-mod-defconfig-v3-2-049565a27bba@collabora.com> References: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> In-Reply-To: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> To: Tzung-Bi Shih Cc: Arnd Bergmann , Brian Norris , Julius Werner , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Catalin Marinas , Will Deacon , AngeloGioacchino Del Regno , Andy Shevchenko , kernel@collabora.com, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_110601_700008_1DAA5943 X-CRM114-Status: GOOD ( 11.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generate aliases for coreboot modules to allow automatic module probing. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado --- 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. From patchwork Wed Jan 17 19:03:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13522119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 868EBC47258 for ; Wed, 17 Jan 2024 19:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=U5FX+bSxU6DqGbHvQM4xr+LmVXRyU31cBxZxMCzpQEI=; b=XYf3Jhq/4btkmS qdoNqqx4c21ihJBk//Yl+gWz4zYj0j16rIBuoB7IAb0tGEAfj7RNj1MWY79vghFhcc3EY93Q7hmOP IYXY42F3f+aLmn60S6cZ5Nxqq9/9Wrp2zcAedqAnG5+1PdW9uUJEfNPcCehPWH0suIGyg2bGzYdGD 7hiMIWj310E7sJYm2+QsxLKT2aTOFdyCJwkQyAircO1Y8O4m/zAiUIXgkXJMo1VY4mniv758UQjvJ azbkxMxiL9ghN++K62X8L+ovW67eTvkrgmmxQnxMQVzlcj8vryhEGddHq68BojsWgYYoZ+ZYe6u4P w1OpGhanAhMS64jk5RGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQBF0-000RWT-0O; Wed, 17 Jan 2024 19:06:22 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEq-000ROB-1X for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 19:06:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705518364; bh=8uW78FpceoDVMKHRzTpjOfMZqXDYMEkFZx5jYlY1Ks4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=weY0IrWFly7FK94biWblsIMljyLeyE7f97DsZfo+eEoCHWV23WEyYtjfC9ds76q1K OKfZUVJYnDBiML2LtL1DfbOHura1s7t3c9u0TmPs/rUqmkbwmS9iBCYGX8pOJDNxdv 2Umw5J6tZFu4gIfU574PqqpKQ+wB0bdVQ94PLshs0D6y/Y1KpSro4ziPEo2Rwq5xY3 oEwm001TVgICvSURaDo33Ca1jdCQOa7IW7T15tqbHdfc0LT/RfXbYN1CQnEGScuIZQ m9igRryqDl+a7qasYe2cOfDrFa6PtofhEW6nF3SGrQitCSaM/A4D2bodY2YEViQcHe eCMOIkeYD/UAg== Received: from [192.168.0.47] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 14526378000E; Wed, 17 Jan 2024 19:05:58 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 17 Jan 2024 16:03:24 -0300 Subject: [PATCH v3 3/4] firmware: coreboot: Replace tag with id table in driver struct MIME-Version: 1.0 Message-Id: <20240117-coreboot-mod-defconfig-v3-3-049565a27bba@collabora.com> References: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> In-Reply-To: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> To: Tzung-Bi Shih Cc: Arnd Bergmann , Brian Norris , Julius Werner , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Catalin Marinas , Will Deacon , AngeloGioacchino Del Regno , Andy Shevchenko , kernel@collabora.com, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_110613_572721_7A7A8CA4 X-CRM114-Status: GOOD ( 17.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch the plain 'tag' field in struct coreboot_driver for the newly created coreboot_device_id struct, which also contains a tag field and has the benefit of allowing modalias generation, and update all coreboot drivers accordingly. While at it, also add the id table for each driver to the module device table to allow automatically loading the module. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- drivers/firmware/google/cbmem.c | 8 +++++++- drivers/firmware/google/coreboot_table.c | 11 ++++++++++- drivers/firmware/google/coreboot_table.h | 3 ++- drivers/firmware/google/framebuffer-coreboot.c | 8 +++++++- drivers/firmware/google/memconsole-coreboot.c | 8 +++++++- drivers/firmware/google/vpd.c | 8 +++++++- 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/google/cbmem.c b/drivers/firmware/google/cbmem.c index 88e587ba1e0d..c2bffdc352a3 100644 --- a/drivers/firmware/google/cbmem.c +++ b/drivers/firmware/google/cbmem.c @@ -114,6 +114,12 @@ static int cbmem_entry_probe(struct coreboot_device *dev) return 0; } +static const struct coreboot_device_id cbmem_ids[] = { + { .tag = LB_TAG_CBMEM_ENTRY }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(coreboot, cbmem_ids); + static struct coreboot_driver cbmem_entry_driver = { .probe = cbmem_entry_probe, .drv = { @@ -121,7 +127,7 @@ static struct coreboot_driver cbmem_entry_driver = { .owner = THIS_MODULE, .dev_groups = dev_groups, }, - .tag = LB_TAG_CBMEM_ENTRY, + .id_table = cbmem_ids, }; module_coreboot_driver(cbmem_entry_driver); diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c index c1b9a9e8e8ed..33971cf33112 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -28,8 +28,17 @@ static int coreboot_bus_match(struct device *dev, struct device_driver *drv) { struct coreboot_device *device = CB_DEV(dev); struct coreboot_driver *driver = CB_DRV(drv); + const struct coreboot_device_id *id; - return device->entry.tag == driver->tag; + if (!driver->id_table) + return 0; + + for (id = driver->id_table; id->tag; id++) { + if (device->entry.tag == id->tag) + return 1; + } + + return 0; } static int coreboot_bus_probe(struct device *dev) diff --git a/drivers/firmware/google/coreboot_table.h b/drivers/firmware/google/coreboot_table.h index d814dca33a08..86427989c57f 100644 --- a/drivers/firmware/google/coreboot_table.h +++ b/drivers/firmware/google/coreboot_table.h @@ -13,6 +13,7 @@ #define __COREBOOT_TABLE_H #include +#include /* Coreboot table header structure */ struct coreboot_table_header { @@ -93,7 +94,7 @@ struct coreboot_driver { int (*probe)(struct coreboot_device *); void (*remove)(struct coreboot_device *); struct device_driver drv; - u32 tag; + const struct coreboot_device_id *id_table; }; /* Register a driver that uses the data from a coreboot table. */ diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c index 5c84bbebfef8..07c458bf64ec 100644 --- a/drivers/firmware/google/framebuffer-coreboot.c +++ b/drivers/firmware/google/framebuffer-coreboot.c @@ -80,13 +80,19 @@ static void framebuffer_remove(struct coreboot_device *dev) platform_device_unregister(pdev); } +static const struct coreboot_device_id framebuffer_ids[] = { + { .tag = CB_TAG_FRAMEBUFFER }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(coreboot, framebuffer_ids); + static struct coreboot_driver framebuffer_driver = { .probe = framebuffer_probe, .remove = framebuffer_remove, .drv = { .name = "framebuffer", }, - .tag = CB_TAG_FRAMEBUFFER, + .id_table = framebuffer_ids, }; module_coreboot_driver(framebuffer_driver); diff --git a/drivers/firmware/google/memconsole-coreboot.c b/drivers/firmware/google/memconsole-coreboot.c index 74b5286518ee..24c97a70aa80 100644 --- a/drivers/firmware/google/memconsole-coreboot.c +++ b/drivers/firmware/google/memconsole-coreboot.c @@ -96,13 +96,19 @@ static void memconsole_remove(struct coreboot_device *dev) memconsole_exit(); } +static const struct coreboot_device_id memconsole_ids[] = { + { .tag = CB_TAG_CBMEM_CONSOLE }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(coreboot, memconsole_ids); + static struct coreboot_driver memconsole_driver = { .probe = memconsole_probe, .remove = memconsole_remove, .drv = { .name = "memconsole", }, - .tag = CB_TAG_CBMEM_CONSOLE, + .id_table = memconsole_ids, }; module_coreboot_driver(memconsole_driver); diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c index ee6e08c0592b..8e4216714b29 100644 --- a/drivers/firmware/google/vpd.c +++ b/drivers/firmware/google/vpd.c @@ -306,13 +306,19 @@ static void vpd_remove(struct coreboot_device *dev) kobject_put(vpd_kobj); } +static const struct coreboot_device_id vpd_ids[] = { + { .tag = CB_TAG_VPD }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(coreboot, vpd_ids); + static struct coreboot_driver vpd_driver = { .probe = vpd_probe, .remove = vpd_remove, .drv = { .name = "vpd", }, - .tag = CB_TAG_VPD, + .id_table = vpd_ids, }; module_coreboot_driver(vpd_driver); From patchwork Wed Jan 17 19:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13522120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA27FC47258 for ; Wed, 17 Jan 2024 19:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=daG6umdzn195aVijUjxB3TIvmAw7AqOWDEru5cn7Agc=; b=bNl3q8EAOJqSKj Sk1jj8LeCBNEQZPIgYT99BnmEm6nW5m/+eJESf4Ova8J15CUYa7J+I7PYdMJ14jrxZcn6A4VAj/0H AB4GMc2oyY/Ulla7uvMcj8gB2fWLOkNqPZsiihpokXz/ZuPimfYyrh4IlXg5hDRUbtqyVFc1uMeFD aC5tDz9NI8FzDLGHRHHQ+hnDB3GGa6E4rhGlayjl0pC3JfQd2P6YAywXmcUoDn+RpZtYuiuYzUAMy HT5fD7cdk1ab9yyO7mEtVfEBrCkfUYzk16rZscJnH0qUYO9sly353nVtY4BVIgGbBxlKG3IhSg1y9 MJ3qzRxuqZ3/oemutZvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEy-000RVN-2B; Wed, 17 Jan 2024 19:06:20 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQBEr-000ROc-1J for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 19:06:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705518370; bh=7YAKPQ9tYWmvfAcseobwrvrV34TmrklbQkwFX2veRSg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ORwyB35hhAm9kLf8Bcd4HROoAmtgxqxmS2ACAQ3fMDQGcNkW2bMbpuzV+ZJ5HxfpD DgAY4TMzhNP4tMx939kuxoUA+F9xlD9veVlaQg4tWJiRsBCsOmBIkRGzN+hCYE7k6x DVjsw7r6MSfnrTTzQzk+Y9s2tdeuvcgvQJoZRHMdPrki05SHAIUfJNbz0iXuO/7fc/ mgjeG7NuuLZyX2a3WZVDL8s2UEnuznork+NcgqPbtL39ZBcHT5hnLTHqIG31x89TLz jiSZiPUltHzQnngZFxZxJeyJwLWx2hPufU4p3uo56YXb2CJDicn3CZ93w4Zn6ndz+z WTUBtWQUORmaw== Received: from [192.168.0.47] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E08823782033; Wed, 17 Jan 2024 19:06:04 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 17 Jan 2024 16:03:25 -0300 Subject: [PATCH v3 4/4] arm64: defconfig: Enable support for cbmem entries in the coreboot table MIME-Version: 1.0 Message-Id: <20240117-coreboot-mod-defconfig-v3-4-049565a27bba@collabora.com> References: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> In-Reply-To: <20240117-coreboot-mod-defconfig-v3-0-049565a27bba@collabora.com> To: Tzung-Bi Shih Cc: Arnd Bergmann , Brian Norris , Julius Werner , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Catalin Marinas , Will Deacon , AngeloGioacchino Del Regno , Andy Shevchenko , kernel@collabora.com, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_110613_749095_C02BA5FE X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Enable the cbmem driver and dependencies in order to support reading cbmem entries from the coreboot table, which are used to store logs from coreboot on arm64 Chromebooks, and provide useful information for debugging the boot process on those devices. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado --- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 361c31b5d064..49121133f045 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -255,6 +255,9 @@ CONFIG_INTEL_STRATIX10_RSU=m CONFIG_MTK_ADSP_IPC=m CONFIG_QCOM_QSEECOM=y CONFIG_QCOM_QSEECOM_UEFISECAPP=y +CONFIG_GOOGLE_FIRMWARE=y +CONFIG_GOOGLE_CBMEM=m +CONFIG_GOOGLE_COREBOOT_TABLE=m CONFIG_EFI_CAPSULE_LOADER=y CONFIG_IMX_SCU=y CONFIG_IMX_SCU_PD=y