From nobody Thu Dec 25 21:27:41 2025 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 AA43B4CB34 for ; Thu, 11 Jan 2024 15:14:43 +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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="OPbNb62l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704986082; bh=Eo8gKt5JYCXR+AsI/6kbMVWmmQfxzbA30c+2Y+wtasI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OPbNb62lsPmHpn+uJjiQTn32fEbP2pUl6LEOUIj9oVJDYpu4q8a9mIICL2fmSmALk l0pjWEowxCQHL6O8TcfCS35h93qxxkljzl1oqUiuqKu+l7UjjH+/HPhxlp2aV5b8eI ge+3+VLDBvZP3UVEgwxvXYf4CIHM6bqxjKeuJZWBa8xaCC27nYMgLxnVqx3qaNO2mP oCm0d4D8G3d4mYonBDfdhv5on+J1lwjzHQr8wh2vJWA5TjzumbhJpbM7cr++uF38Xj ywKX4t7m7XtddBgcpojViv0XaovXjDeVArpi/vZd7Hu+WgkAiuonpb1rhqQuRFflRq eKtov3UjpgOfw== 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 4AC063781F80; Thu, 11 Jan 2024 15:14:39 +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?= , Brian Norris , Julius Werner , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] firmware: coreboot: Generate modalias uevent for devices Date: Thu, 11 Jan 2024 12:11:46 -0300 Message-ID: <20240111151226.842603-2-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: quoted-printable Generate a modalias uevent for devices in the coreboot bus to allow userspace to automatically load the corresponding modules. Signed-off-by: N=C3=ADcolas F. R. A. Prado Acked-by: Brian Norris --- drivers/firmware/google/coreboot_table.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/go= ogle/coreboot_table.c index 2a4469bf1b81..c1b9a9e8e8ed 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -53,11 +53,20 @@ static void coreboot_bus_remove(struct device *dev) driver->remove(device); } =20 +static int coreboot_bus_uevent(const struct device *dev, struct kobj_ueven= t_env *env) +{ + struct coreboot_device *device =3D CB_DEV(dev); + u32 tag =3D device->entry.tag; + + return add_uevent_var(env, "MODALIAS=3Dcoreboot:t%08X", tag); +} + static struct bus_type coreboot_bus_type =3D { .name =3D "coreboot", .match =3D coreboot_bus_match, .probe =3D coreboot_bus_probe, .remove =3D coreboot_bus_remove, + .uevent =3D coreboot_bus_uevent, }; =20 static void coreboot_device_release(struct device *dev) --=20 2.43.0 From nobody Thu Dec 25 21:27:41 2025 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MJB8zfnS" 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: quoted-printable Generate aliases for coreboot modules to allow automatic module probing. Signed-off-by: N=C3=ADcolas 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_devicetabl= e.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]; }; =20 +/** + * 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-of= fsets.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); =20 + 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; } =20 +/* Looks like: coreboot:tN */ +static int do_coreboot_entry(const char *filename, void *symval, char *ali= as) +{ + 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[] =3D { {"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}, }; =20 /* Create MODULE_ALIAS() statements. --=20 2.43.0 From nobody Thu Dec 25 21:27:41 2025 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 85FC84F213 for ; Thu, 11 Jan 2024 15:14:52 +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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="VFxLYHDq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704986091; bh=CHvr4PScujipymb+OTlox6s6i63JQHd4PBTYty5wiek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VFxLYHDq8htIlCQPt2uLpfyJxCn40rH/SW4OZM4tonLsrFfzfgA/l85xIRUD9OfQp eJwDTAP0JAxdSIhq7CbAL4lQQURW9WCvW75P9434gUTV1NVDwBzsMmkk8NkKSWlsPC HOuB03bhDe7rdLPT4C1kc0oMCAcZuCKkoQMZpU+7yAPeEkODkdRb5tbP6cnbRun/Oy e65p1QuPFCjkh7pOWWeBCCqmf9Mv+Y+WoCtZ2FcXKX8C4SQjaKIEvOKwUY9nTqUBWK gjmmTRX+JXaSwFsAp7SH3T/fTFh6JOcDfQtT06IngFPgMsGoZcOmuokelAC8sxGSW8 NN1iuq9uehaSw== 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 4A7113781F80; Thu, 11 Jan 2024 15:14:47 +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?= , Brian Norris , Julius Werner , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] firmware: google: cbmem: Add to module device table Date: Thu, 11 Jan 2024 12:11:48 -0300 Message-ID: <20240111151226.842603-4-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: quoted-printable Create an id table and add it to the module device table to allow the cbmem driver to be automatically loaded when a matching device is found. Signed-off-by: N=C3=ADcolas F. R. A. Prado Acked-by: Brian Norris --- drivers/firmware/google/cbmem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/google/cbmem.c b/drivers/firmware/google/cbme= m.c index 88e587ba1e0d..ceb89b4cdbe0 100644 --- a/drivers/firmware/google/cbmem.c +++ b/drivers/firmware/google/cbmem.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,12 @@ static int cbmem_entry_probe(struct coreboot_device *d= ev) return 0; } =20 +static const struct coreboot_device_id cbmem_ids[] =3D { + { .tag =3D LB_TAG_CBMEM_ENTRY }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(coreboot, cbmem_ids); + static struct coreboot_driver cbmem_entry_driver =3D { .probe =3D cbmem_entry_probe, .drv =3D { --=20 2.43.0 From nobody Thu Dec 25 21:27:41 2025 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 1A6EB4CB47 for ; Thu, 11 Jan 2024 15:14:57 +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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="p+9+sKPZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704986096; bh=0znedC8OB15oZfdhOihzbhh+CJ3Focnsl8tk4l0W1qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+9+sKPZS08mP2NlNyNeVGEBxJTNTsLGDmyvYAANyw2Kt8BEJ04UljvZ1otKuZFMd 1Iw2i/8aDoRKNOGMlEUFg51NlZ8WlZ7BSsacnnjCVG/7xLV5Sx7rOk58ADP7/7RTDc t9C41EXRKksWgJDD9tfH+APcdsqEjhavuSZNmxsDfs7EaGnVFS+DwbleIkPi+vQFog PFxRhFOG4fo5U7sIHdeT65sTo2R4ThUzwAGRBpM3FurLdNOqsbDN94MhJTGG7zPwvs kJ+DCEe139Mqjg9grNJcNyPvvb1azG5t55oYTRtkNOPY1irow/2CLH4IY6RWKJqkSV s22Z2Xih+4ggw== 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 956CE3782012; Thu, 11 Jan 2024 15:14:51 +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?= , Arnd Bergmann , Bjorn Andersson , Catalin Marinas , Geert Uytterhoeven , Konrad Dybcio , Krzysztof Kozlowski , Marek Szyprowski , Neil Armstrong , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] arm64: defconfig: Enable support for cbmem entries in the coreboot table Date: Thu, 11 Jan 2024 12:11:49 -0300 Message-ID: <20240111151226.842603-5-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: quoted-printable Enable the cbmem driver and dependencies in order to support reading cbmem entries from the coreboot table, which are used to store logs from coreboot on arm64 Chromebooks, and provide useful information for debugging the boot process on those devices. Signed-off-by: N=C3=ADcolas F. R. A. Prado --- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 0b0ef6877a12..cd94d55b23b2 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -255,6 +255,9 @@ CONFIG_INTEL_STRATIX10_RSU=3Dm CONFIG_MTK_ADSP_IPC=3Dm CONFIG_QCOM_QSEECOM=3Dy CONFIG_QCOM_QSEECOM_UEFISECAPP=3Dy +CONFIG_GOOGLE_FIRMWARE=3Dy +CONFIG_GOOGLE_CBMEM=3Dm +CONFIG_GOOGLE_COREBOOT_TABLE=3Dm CONFIG_EFI_CAPSULE_LOADER=3Dy CONFIG_IMX_SCU=3Dy CONFIG_IMX_SCU_PD=3Dy --=20 2.43.0