Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1715317rdd; Thu, 11 Jan 2024 07:17:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGasDMi5jvydGaObiK32msktA7GL9BXEg+AHCkxahoM2vOjwLMG72jTerI0tVdJvJkgxQoM X-Received: by 2002:a17:902:f688:b0:1d4:ac33:10bd with SMTP id l8-20020a170902f68800b001d4ac3310bdmr1329221plg.104.1704986255182; Thu, 11 Jan 2024 07:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704986255; cv=none; d=google.com; s=arc-20160816; b=tWTVARSBzXD6BxvNFB2r5iyJF2YseaYXNho9RbKP0hy62GqyaR7z0Z+xNuSMYyXYSe JRDlgaQVrNM08MzaIBfbLGAFF1C0vAMCTvMWncWEQgK7p0KIm+1oJWwWIa/B+NW3ZyU2 pnFs0mBjcqmI8ewX5NQSa21syLnI0lXYhwo9hp7nS29Gduju1o3VZMPqFpdgX/d2Qnh/ zpDDidMaIfUWXMUB3Z03AoDIfNUhmth0X6Y5DyT/fna63swueJXS2BkHj904ahKqtELI RSSfqHhLyBzAtLnnNHfZTz5SJuavSZCNDQC8aCSpTZN40Zu2D/QjJTLI6WlHhHGaUFav TsdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=a9j3eEYTe6fRvCkqy5o/bgZf1dZwfBsTI4LD4XpIEr8=; fh=/cGYBbKW/eS1nSeeVY6t2iFr6N9qlMipNvKh+j6EytE=; b=ZBvJU+2Z5oTZTWIU8ch6u7mhgiDD0P82iOZ2vUgXKXyBzeKcKnXUozrY6zm44xcmRu zAfgN+7zNmJ/EIbS1hHtlmjQg3yKp4VvUQEFAwsEtWbXoX7T2LJGw7OKjwlvFje1iUqb fGoxv1HP8KtyxDE4d4DiDg8xU/9UYU7t9GcF6IXMoTFpWdDmrr0etQrX9I83poA/BnRF y3UZ+ExxMXQBG24eRNS2X7O9JVMMFEMGed2kDLzO/wp6VmSQdJEIlB+sm0wVUk/1QAKU mg/QyF0HDr1NUUWhdQdhw7q3Q7rPwYTuky6bHXkvNjgoBO18CR67GxVM3WGV9YTOCOFA Fn+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MJB8zfnS; spf=pass (google.com: domain of linux-kernel+bounces-23775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id kr15-20020a170903080f00b001d3b51b851dsi1198993plb.327.2024.01.11.07.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MJB8zfnS; spf=pass (google.com: domain of linux-kernel+bounces-23775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C5B2DB222D6 for ; Thu, 11 Jan 2024 15:15:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5650E4CB34; Thu, 11 Jan 2024 15:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MJB8zfnS" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 327174EB33; Thu, 11 Jan 2024 15:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704986087; bh=UQawPUBSwtTExT/RYPtLtcnQmAVsJX1wiKs2v5V+ZEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJB8zfnSbDED0CXfaz6U+MqvWWIRFlXDS2s/kH1Fse+PulrYbrF9xPOxrdC84+dKP CpGdJyXH5Kpwpd4FG3181aj9pxVTdjVMqn9F5VLGot8p8ZgjZobn//xSkPon23HEJ3 8Uz3MTY7FUkUrZ49VqLAbMVK3ZhF/zAX70yu2jzXgsrV170eS/lEsXUMDzjwLmHfP+ VPfbB7pRp72qlKumOPHwJmYdyFbnRqIoYo65Hn2qMpFIc4HRew+b7GQC24VX7Fpuvv yIT2DYVAGZ60gZ9rWdiwEwYWrldgxLYEzKcwBBZlWN2g7sXAApcl43lyrfUOE6ogEj p5FDaB94WvimQ== Received: from localhost.localdomain (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 BC9FF3782011; Thu, 11 Jan 2024 15:14:42 +0000 (UTC) From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Tzung-Bi Shih Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Abhijit Gangurde , Andy Shevchenko , Greg Kroah-Hartman , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nipun Gupta , Pieter Jansen van Vuuren , Umang Jain , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] firmware: coreboot: Generate aliases for coreboot modules Date: Thu, 11 Jan 2024 12:11:47 -0300 Message-ID: <20240111151226.842603-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240111151226.842603-1-nfraprado@collabora.com> References: <20240111151226.842603-1-nfraprado@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate aliases for coreboot modules to allow automatic module probing. 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. -- 2.43.0