Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2288466rdd; Fri, 12 Jan 2024 05:21:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN/vtr7IaerrJnmMIAOawoJHKAbu1J3kIsLCT1Yv/zzjFIIjYdVcaeDGeV57IVemw0Cayz X-Received: by 2002:a17:90b:1e43:b0:28c:70a6:c551 with SMTP id pi3-20020a17090b1e4300b0028c70a6c551mr967787pjb.35.1705065709964; Fri, 12 Jan 2024 05:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705065709; cv=none; d=google.com; s=arc-20160816; b=AkGa6NbYAGtCZyb8SjtKXzuzWHor6zp63MihPg413F64H8skaz3ET1pf4ivJkVM1hg E8DMPdFABGsCp2Cam0YJm6WGiNO913pA2QYT7NV0w86kHvbpLMF+/3p3edfMSvSWE5Vz VJMuLkljO3QqzthT91bHZSPrN5TjpvbCERO2+CKqKCl+NVmQAqMfF72V7uw/Rs/xU9wi YlpVHO7fNDDz2CrCaZrWq2ibcdTVM/zoqAKk+96F0x8hxRp9DhpEELuxFjpa1zVN+3Nv ZjcxGPd0D+szhvr0zE3TwxkoqpPj4gM/ZItzV+7A5CMsR7bYU5g288MxkF0aBrrZ7qCY b7GA== 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=TQSQcKMWa33xou7qjuKoh66Qievrc1HiFj3skq9SZYg=; fh=0B+KNpxEWMfZPolgAcIs9ckWcPKfDDiuSohy9Hlc1iw=; b=g/gpnBTg8dnYSLuW98gOIGP2UhT71gJaEKJTY+HcWygu9DgJLGUsgGCkwnrf+Mk97Z m6IfRUdCYsYRndnUuoUNQHwXeSGbrRabrOeJEc8GnyRmWBgFKQH1WIGxc2+MyUCvP6k1 fdhpKPOIs3QFuyaRfxW9gsd5XFYf5/CjXg5JV3780MMrv5UNx4kZH+HorN1BcbAuyQnL 4sc9ehO+bJpmNqXxFUbO5u+R42A4hW/0fi/VK36Oa+4b1oKVVpsmxDo7zwqWguZEXA7s y96wl4s1sLZE6lKQjQpp8hY7y4qDThqk6Yy9L4TqzA0y0uoa1bS5EepIFKO4nqlWfuwu rZww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=T3qA3z5I; spf=pass (google.com: domain of linux-kernel+bounces-24682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f19-20020a170902e99300b001d4f26341cdsi3191571plb.356.2024.01.12.05.21.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 05:21:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24682-linux.lists.archive=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=T3qA3z5I; spf=pass (google.com: domain of linux-kernel+bounces-24682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24682-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A1C2F282FD8 for ; Fri, 12 Jan 2024 13:21:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5704C6D1AA; Fri, 12 Jan 2024 13:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="T3qA3z5I" 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 41A586D1A4; Fri, 12 Jan 2024 13:21:22 +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=1705065680; bh=sPz7qlYsrHlq3cCOtHZi7BOxHqEKVr3tJDgaD7Qlm4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T3qA3z5IeURvAorefJ8yBC9ViApTUBJv7sEOilZu1dK9dPr99ixr/x5svUv3Yc5xQ j3hW3cAO3CKI73X3LCB6LyfIviNFq8IOOCkJWSj/b2SDVr2KH3hNsm7Ks6P1SZBvK2 sHkvvm2bN8OLRPTVc2UU3pRk+0hveFvAsNqDv5PE7yX+xfeHVsqKVEqCwVLplS2YvO YRFiZbvuNUZ/5cV5CyYuYP1iRikzbXEmE/gwzMfWZr3G2RpxOHEcEgYNDcvvsGWQ3l DmdrGOnVYVpVKwkpAfd/G2poivJI35vMzqBeQl3vaySdsB3fhd/tFdCeVSADM1Ktlk h8PtR3BdBI3RA== 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 685293782032; Fri, 12 Jan 2024 13:21:15 +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 , chrome-platform@lists.linux.dev, =?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 v2 2/7] firmware: coreboot: Generate aliases for coreboot modules Date: Fri, 12 Jan 2024 10:18:31 -0300 Message-ID: <20240112131857.900734-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240112131857.900734-1-nfraprado@collabora.com> References: <20240112131857.900734-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 --- (no changes since v1) 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