From patchwork Fri Jan 12 13:18:31 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: 187728 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp167792dyc; Fri, 12 Jan 2024 05:22:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVTnsV5VpQ/vRj2pntbRgYo+bv4ZAronKm2wjVkvNXPcNIYnGzOMo73+5uwYuIc2mDSFya X-Received: by 2002:a05:6830:114d:b0:6d9:d144:c9a9 with SMTP id x13-20020a056830114d00b006d9d144c9a9mr1660378otq.22.1705065732196; Fri, 12 Jan 2024 05:22:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705065732; cv=none; d=google.com; s=arc-20160816; b=E6xi2ZR0znyzXTHCiwTSKZlHzWkQdlEpNi4iubVb6ZHLNATnWtMsFKa+plWtTzuVe8 Q8SdVGtjiuJXEq9NAF58QV83xTsxEBm1L8Ps7fj2JStmtI3ufBUdHXFXxKlM6PurWGOg 7uXrZKNotf+07aUzBMLsKf48GXrB0KFaEDNnIQjd/ahs4G1LHmua2LelGXx11KcPay9P 8EDF6RFw3/PTzAfyvDjXkk2Qfaof2HRSlb2n3IxqHX51CxWva/EWFozu6RxGsxcnCPNE txC/RVGyvhav+Xigpjx2u/qDKuNHjnEVvzbOb/h7awfl0NfT5YWcAlf3pjMhylT6bWxI wFww== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24682-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b11-20020a056a000ccb00b006d60c30ba57si3236477pfv.2.2024.01.12.05.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 05:22:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24682-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B76D7B23738 for ; Fri, 12 Jan 2024 13:21:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F2AE6D1DA; Fri, 12 Jan 2024 13:21:26 +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?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Tzung-Bi Shih Cc: kernel@collabora.com, AngeloGioacchino Del Regno , chrome-platform@lists.linux.dev, =?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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787891004791253668 X-GMAIL-MSGID: 1787891004791253668 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.