From patchwork Thu Jan 11 15:11:47 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: 187418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1518615dyi; Thu, 11 Jan 2024 07:17:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsBVB9sfrqr1n3qRenedfkW//h6VdpW80PGg2I2MFqtcJboz5YzYGvv9A7SKyGucJgJ94v X-Received: by 2002:a17:903:d1:b0:1d3:2e0e:c889 with SMTP id x17-20020a17090300d100b001d32e0ec889mr1121093plc.62.1704986278056; Thu, 11 Jan 2024 07:17:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704986278; cv=none; d=google.com; s=arc-20160816; b=SVadtlgg1sudbTQ9gnb5hNPscPpYi9TxAoHNr6AxGw7mCI/QX08SBfo0SgC/tyKm4c W10kHzYrrsYoB3XewNq0ti8v4+MtL7c2gYoi6fjsOQ7MdQizJDADKP1ser0FZoIwWPV6 VbyfqOHFWfj7VXjl/ROKmeGXkRzqNxsQYLV6XZUeaHuIFHDm5ctFMwjqAePTKHuEXuDJ ++/ijbVVlQ92gq5n4PZCw1PFkT3UHEKVTVodCdQm82F9TdfHQ+uRXtPuLYoZsIXjJ7yO vthr00+5eZTDQ5N5jp7s2kGWBVOJWdtflf8pjfoNnM3L47FvuzTt8uSKTpPZ/bSa4/4N 6xtA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23775-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s13-20020a170902ea0d00b001d4f32b277dsi1355195plg.360.2024.01.11.07.17.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:17:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23775-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D54E3287351 for ; Thu, 11 Jan 2024 15:15:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3411C4F883; Thu, 11 Jan 2024 15:14:53 +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?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Tzung-Bi Shih Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787807691788688432 X-GMAIL-MSGID: 1787807691788688432 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.