From patchwork Mon Feb 12 14:50:06 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: 13553386 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 30B3EC4829B for ; Mon, 12 Feb 2024 14:51:39 +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=9e+VASxEsbfcmUyNvbgKUE1ZY/hhNhfKlbpwXRkSSyo=; b=PXE6kmw0B3KvN6 IxjYZV1F6AmGj6+JpIEtCCC8mbun8XNq90EWim2QBX/ZaKU+Bm531shOEl8mr5fwBKD2gaX5YsqGS jYvp8HlbkpbdAcSWkGLzDPZBSK/+sV0vC3MMucwXRSsttbCBr/SqZFsJS2GmZmn6DjwDRwMijLRdS BEdGdyExbDOBpn4uPKDqXJIF/s7jn+K/X4JoZlmxI5g4b7oCbLUbDM7KSF4j1pxbkkZ/YGLXxOjN5 tUBfi8g5D07O4SowZMqK5ANG+j2EWTJKd4ssp5jWasg4BXTBU+us/6Pi8EFyMJUL5RfVy/HxItjrn o/nmEczATJRMSzCd+FGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZXec-00000005qpI-0KOE; Mon, 12 Feb 2024 14:51:30 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZXeZ-00000005qo3-1Zaa for linux-arm-kernel@lists.infradead.org; Mon, 12 Feb 2024 14:51:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707749486; bh=1TCvFrGXA9WRNIGq5qiS6fBnB/8Sfm3xS2xnBDJoK28=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GX8DLeUcsHn718WGmcEX+K25/QWmMhkgZHgz5FKPw2HfaP9wTwEFGpGbXFQZsSJ4E dY2G11h816hu9Bo86/VdQWeFvWL7C9l4uk4sHfobftI68YLgqph1qUwOhCEVdw837w 7ugfshFFKYdaRfe/1P6yEwDcMe577HoMELj9FLcsy4kjI4yFHkuwRCjpEU/BhRRpEA Sdm0AAnmsSKjKmU7UaFydCBPm990kV70cA8irr2WS2BaIJMAVrIxIGV+sHwMSeZRmO Tqp7anmsAXg6MRzc3wkFwJ5NwQsq4WF21o9mCgcBSRM5kdStPaIpGNPn7+NtIkPvXd IDtAo4++BWVhA== Received: from [192.168.1.30] (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 2FE39378203F; Mon, 12 Feb 2024 14:51:23 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Mon, 12 Feb 2024 09:50:06 -0500 Subject: [PATCH v4 2/4] firmware: coreboot: Generate aliases for coreboot modules MIME-Version: 1.0 Message-Id: <20240212-coreboot-mod-defconfig-v4-2-d14172676f6d@collabora.com> References: <20240212-coreboot-mod-defconfig-v4-0-d14172676f6d@collabora.com> In-Reply-To: <20240212-coreboot-mod-defconfig-v4-0-d14172676f6d@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 , Greg Kroah-Hartman , 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-20240212_065127_564105_BEEB06E8 X-CRM114-Status: GOOD ( 11.48 ) 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 Reviewed-by: Brian Norris Signed-off-by: NĂ­colas F. R. A. Prado Acked-by: Masahiro Yamada --- include/linux/mod_devicetable.h | 10 ++++++++++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index f458469c5ce5..7a9a07ea451b 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -960,4 +960,14 @@ struct vchiq_device_id { char name[32]; }; +/** + * struct coreboot_device_id - Identifies a coreboot table entry + * @tag: tag ID + * @driver_data: driver specific data + */ +struct coreboot_device_id { + __u32 tag; + kernel_ulong_t driver_data; +}; + #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.