From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.62.25 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795788281; b=Yor0L2nPk1py3bUi9TyNLGcnI+DHb5t8ooZ0SWa5jbYVYcX2nXvKlQ4/YbYTyzgSDL4D QCdNuaL048oRE9cU2eRGPbI+EKE4kSRR3SHSySv6ydjQB1pO2taB+k5o72A/b4Ccy1AOv EpWNMjHwqo+Zu5sl0a92WSmZ4JDThMDOTbDMawshJ0PJh0/6RR2tAOnxXpQdToY5klgpN mrbr5I/Wvtc62zhjoRTlWLhBakKJEJJ/9PEc0t2U5dOqYFe/jyodLlUW6vTL+3pmJ55aw y6XEBsh1k83KSA4dzJPECN8TFVi+bgZi/iougTWkbEqFb2LrEs9SiobmUcX0/d9pVZA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795788281; h=DMARC-Filter:DKIM-Signature:Received:Received:From:Date:Subject: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0: X-MS-Exchange-AntiSpam-MessageData-1:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=7yZ8Uk/imzmj8YoCqq3nnQqHOKRXU6SGUT2osWC2ICM=; b=PGWqgZzEhauSnvsLwjtpJ5UznYTqE1gJ67kFOaHzWg6sXwCC/gp3nHDTKY9OfKHZkCaS xe847qk6DdznZZS4JukzadUdyR+V3Vid4IsgJoM+fE6KJtjvob6Wdt6qJonmXmI8pfeyV SOkWdYp8Qx1SBAvO9CjL06DMp7YYXJ2RtW4Qj98v+R+dGAzggjbkEZqDAAkmbeIyQB1jA /9w68cRRMJ7xRs7FuB53UdLqEQ9/vCW6VbUU/rxiKX503rOQsFkj//0ZG9jLBHvLWsfJO cfUk69krQAIrgLlT0ZatRt8I+Ju4QhUPI2ZgX04EvjRxyq24gNxizkrHnlXw3kSMptw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=GINUyWL5; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.62.25 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11011025.outbound.protection.outlook.com [52.101.62.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA5F606A32D for ; Fri, 27 Nov 2026 14:04:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ACA5F606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=GINUyWL5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JnEPM8I9GGRSDfbLll/8e1s0KVN3/gUJYPmTaqHvlf+5cTk5SzbQNv0YC7qQ73SYXst7Hd2F/D63nKb6PN8vgdpd+sgGgzXM+gnZi8q+UP1e50EKDRYeMvAlXa2zHlf2c3C+xzsCpnEhUihKIzHdaoqZaAKo+34dNEuGKjUspKWtSqCDlMiGOk4Js12nQQNY8b9ORHtgLjaKQzxm68LAiq53puODM/elADnCq3CQhke8SRDF4NRP9DrwCvo0U6VZqgoo/S3PMDWWKUVQyDO3bGs305dy2kcyhIDP9wMaHACG2C5B/wMVdbFXDWw8PtYftDbQdjdip4DKjzliW0/trw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7yZ8Uk/imzmj8YoCqq3nnQqHOKRXU6SGUT2osWC2ICM=; b=TryBQV4szHUIOKNcvtaWDL6Mz5bVMJ9s+n/Bptn+hfoqFig2uG0CZWeR1iwiso1vOBg3xo2XZi01+j4ggMrifZ+tM/VJSHJbPTbhTXCaUfrUkDyK9t0NuN1/jQ+3m/GvGjVbSbY6wGkpuySkOvqzqGamxDKezwLNhyKd2OKCp3/BdSxkLV10j4I8It5/4YOb8tp5wyPzRKodIuqGjTFaB/E6E4qiMN9W9hf6My8vOzdzNTn2q4gDa5FSGJGY1JsZYYcA3jpolmRZXYY3oQEb9wQNPQHUlMFHxByyWZJLXP2xoe4s0Y4GMqldZ6ZCB3H8cbnFGULGjYho8jueL5IYvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7yZ8Uk/imzmj8YoCqq3nnQqHOKRXU6SGUT2osWC2ICM=; b=GINUyWL55Xke2bclY92aVQg4rIRXdKUfHe1pqSYbeFt+Wd7rX5R+Z0xEiTCStiTlSW2dwyXD2JEDznfbgtU8WOiJ3w30K6fX9Tl3Za6GkRkOlblZ8ynSUzc0mSQy/j4D8Kzodh7BJ7/0dVLAFc4jVFlFBphMYv+5hulmfnzm/Ar2fbhdrVfc0nKcJE4BbIBvOOivBDxU9xriJvpvk0ApbE1384ZSBmb9oSEYZpm7nbzxOzJrEw2xiQBBYDgox5WicJv8e7FzSV5iOAd8077dsbq72yXQvAtUm2xs7U++EMNWigmhun4Jg6ioYtrly8fUd0QrhI+ufg5BIt0f0LvSSA== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) by DS7PR12MB6168.namprd12.prod.outlook.com (2603:10b6:8:97::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.4; Fri, 27 Nov 2026 14:04:20 +0000 Received: from MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1]) by MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1%5]) with mapi id 15.21.0662.001; Fri, 27 Nov 2026 14:04:19 +0000 From: Alexandre Courbot Date: Fri, 27 Nov 2026 23:04:07 +0900 Subject: [PATCH 3/4] gpu: nova-core: gsp: return the static GPU configuration from boot Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261127-nova-r000-staging-v1-3-4eaf6e3c0942@nvidia.com> References: <20261127-nova-r000-staging-v1-0-4eaf6e3c0942@nvidia.com> In-Reply-To: <20261127-nova-r000-staging-v1-0-4eaf6e3c0942@nvidia.com> To: Danilo Krummrich , Alice Ryhl , David Airlie , Simona Vetter Cc: John Hubbard , Alistair Popple , Timur Tabi , Eliot Courtney , Zhi Wang , nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Alexandre Courbot X-Mailer: b4 0.16.0 X-ClientProxiedBy: TYCP286CA0060.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::15) To MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR12MB6873:EE_|DS7PR12MB6168:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b30ca07-0b42-4922-aab2-08df4c8f5449 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|10070799003|23010399003|261026121527099003|10067099003|11063799006|261026140227099003|56012099006|261021123027099003|261022105027099003|261022075727099003|261102123227099003|261009223027099003|261021121427099003|261028144727099003|22082099003|18002099003|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: 6KaE7AEzDeD0jXEsTM+UGMnj62BFQ+7C9i+VKkxOcv2u6Vg9pg2ZcG0X04hzJ/ERf0OaLC+VMdl6m4WdxktdbBa6lffouw0N4+JUrKbJVblK3WuiDkpJQE3iByHznrJnPYYnnxnIo+M87Kcb1xXL6vYJ1VYMK0Sx6HAMzSUF8v4KDmvqXolEsmrBTrsn6AOBZ13GJtxCrIzQ++2Ua2dLGfBw/2/EroCUD0RhM17TQO0jzcZ+yKCSLtEyODVAClx+cEBnrY80kAxOSmjLC6B8TK9Azm5RL8iZ3EQ73wB4JMsrqU37ac0GwJQo54GHnpEUo5Wh7c9sdyX32WsewVpncYaR70B0PgPvHu2PQEp/NLD31UQrOAHC3OM4ceTw5bUw1B2HyC8WhqvEVVcXWop14/X9o7oYhlQsyWA8caX+/X0HAY1w2+5VPOob9IrMo6aK5YU12ot+ikVVA0fi1eTzSkyTfFf4Yl6EssNPbTZnh5Vysw99SOCka3/2PHdaA7DzDbJ550XKierr8iLVo7CmMovLSmhunxGJqYSDQyUz26qeJg8jJRmoME7jpbWG8CgSk6H3kBNTNxq07qqcEZ+kCiuRyQLiJhWmQyY0WQA9Mk4FKalzKPD03NFC6fgRjlO83FGOqzIXthTkl3Y/FJtKxbQZeAdh+oag5qDpUdi9VZw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB6873.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(10070799003)(23010399003)(261026121527099003)(10067099003)(11063799006)(261026140227099003)(56012099006)(261021123027099003)(261022105027099003)(261022075727099003)(261102123227099003)(261009223027099003)(261021121427099003)(261028144727099003)(22082099003)(18002099003)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b0ZDdXBhNmhITTZsWmt1VVlobys2cVZyS01VVUlzUW01eVRaaVJjRlZSUnRH?= =?utf-8?B?akZNak1YN1J0MXNzN21BQ3Z3Z0lPbGRHeUlwUm5HZ0tScldVUmNjenlBVHhz?= =?utf-8?B?aEEzWWlOSi9EYUMvK3VRNGNPRW4waUdaVGlLYzhWT1JiR1Vtczg1L2FOVG1G?= =?utf-8?B?eFFVdmpyY2pJM3RwMStwM2RVby9qQUxnamV2T2EwdG9Zbmlwd1FiTnJPeVll?= =?utf-8?B?R013b0dkYnJGWkhwVDZ6STkvR0swWGdNNU1aV2FjSE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HdlSzFFSTR5VFhrT2lpbituZUFuR04yK3NGUy9TenJYb0pSSHo1end4a2FZ?= =?utf-8?B?bm83QURJR3FiMjhsbGlCQkUvSnE1U3dsa3M4eTNYbnJPWUZTSzhVQ1RPSm5T?= =?utf-8?B?NWRCVEtqclVJc2tpQWZiUm5GZWtDdWk0bjhjcGM0MlFCUklma0pEd2drVnFM?= =?utf-8?B?b1Qwdnd6elgzcHg2a1FWbXZFenBVdGFXWVlyL3R1VWZQUW9wZWM1T2cvUGh2?= =?utf-8?B?TWVOY1IrOHpkU2Yvei9Zcng2YURIWk4yb3RTbXNsOGRmK1FFQW16R25JNnBk?= =?utf-8?Q?M0vb2F7UHhfbSZ+asFcH2d6/4bitTtdcuYSllL764jfY1?= X-MS-Exchange-AntiSpam-MessageData-1: MOKDzjf3An7+0A== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b30ca07-0b42-4922-aab2-08df4c8f5449 X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB6873.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2026 14:04:18.9185 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0+e1mLeyVbIcd/+4i+ymw8G7wH4XQmIdh/ps3D7zdzYywPmfqEWyZXy7JTzJm2xP86BBYwunbwY+T4m4k3JqcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6168 From: John Hubbard With the r000 firmware, GSP-RM reports the static GPU configuration in its reply to the GSP_INIT command that ends the boot, so the boot sequence holds the configuration when it returns. Nova-core fetches the configuration with an RPC command after the boot, once the interrupt handler is registered. On r000, the boot sequence would have to keep the GSP_INIT reply for that later step to read. Return the configuration from the boot sequence, together with the unload bundle, and send the RPC command at the end of the boot sequence instead. Signed-off-by: John Hubbard Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/api.rs | 2 +- drivers/gpu/nova-core/gpu.rs | 36 +++++++++++++++++++----------------- drivers/gpu/nova-core/gsp.rs | 13 ++++++++----- drivers/gpu/nova-core/gsp/boot.rs | 15 +++++++++++---- 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/nova-core/api.rs b/drivers/gpu/nova-core/api.rs index f800ba6c4183..a665eabc44c2 100644 --- a/drivers/gpu/nova-core/api.rs +++ b/drivers/gpu/nova-core/api.rs @@ -41,7 +41,7 @@ pub fn of(adev: &auxiliary::Device) -> Result> { /// Returns the GPU [`GspStaticInfo`]. pub fn gsp_static_info(&self) -> &GspStaticInfo { - &self.gpu.gsp_static_info + self.gpu.gsp_static_info() } /// Returns the GPU [`Spec`]. diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index 590d81f4e479..e4db5ce47316 100644 --- a/drivers/gpu/nova-core/gpu.rs +++ b/drivers/gpu/nova-core/gpu.rs @@ -32,7 +32,6 @@ gsp::{ self, cmdq::Cmdq, - commands::GspStaticInfo, Gsp, GspBootContext, // }, @@ -341,8 +340,8 @@ struct GspResources<'gpu> { /// GSP runtime data. #[pin] gsp: Gsp<'gpu>, - /// GSP unload firmware bundle, if any. - unload_bundle: Option>, + /// The static GPU configuration and the unload bundle that the boot sequence returned. + boot_result: gsp::BootResult<'gpu>, } /// The GSP event handler's registration and the enable of its subtree at `TOP`. @@ -393,8 +392,6 @@ pub(crate) struct Gpu<'gpu> { #[pin] #[uses('tree)] _gsp_subtree: GspSubtree<'gsp_resources>, - /// Static GPU information as provided by the GSP. - pub(crate) gsp_static_info: GspStaticInfo, /// GPU memory manager owning memory management resources. /// /// Must be kept declared *before* `gsp_resources`, so that its components are dropped while @@ -425,7 +422,7 @@ fn drop(self: Pin<&mut Self>) { let this = self.project(); let device = *this.device; let bar = *this.bar; - let bundle = this.unload_bundle.take(); + let bundle = this.boot_result.unload_bundle.take(); let _ = this .gsp @@ -505,7 +502,7 @@ pub(crate) fn new<'a>( // This member must be initialized last, so the `UnloadBundle` can never be dropped // from outside of the constructed `GspResources`, ensuring that the unload sequence // is properly run in case of failure. - unload_bundle: gsp.boot(GspBootContext { + boot_result: gsp.boot(GspBootContext { pdev, bar, chipset: spec.chipset, @@ -537,9 +534,9 @@ pub(crate) fn new<'a>( gsp_resources.gsp.cmdq.drain()?; }, - gsp_static_info: { + _: { // Obtain and display basic GPU information. - let info = gsp_resources.gsp.get_static_info()?; + let info = &gsp_resources.boot_result.static_info; match info.gpu_name() { Ok(name) => dev_info!(dev, "GPU name: {}\n", name), Err(e) => dev_warn!(dev, "GPU name unavailable: {:?}\n", e), @@ -557,13 +554,12 @@ pub(crate) fn new<'a>( info.vram_size() / u64::SZ_1M ); } - - info }, // Create GPU memory manager owning memory management resources. mm: { - let usable_vram = gsp_static_info.usable_fb_regions.first().ok_or(ENODEV)?; + let info = &gsp_resources.boot_result.static_info; + let usable_vram = info.usable_fb_regions.first().ok_or(ENODEV)?; let buddy_params = GpuBuddyParams { base_offset: usable_vram.start, size: usable_vram.end - usable_vram.start, @@ -574,13 +570,14 @@ pub(crate) fn new<'a>( bar, gsp_resources.spec.chipset, buddy_params, - VramAddress::from_raw(gsp_static_info.total_fb_end), + VramAddress::from_raw(info.total_fb_end), )? }, // Create BAR1 user interface for CPU access to GPU virtual memory. bar_user <- { - let pdb_addr = VramAddress::from_raw(gsp_static_info.bar1_pde_base); + let info = &gsp_resources.boot_result.static_info; + let pdb_addr = VramAddress::from_raw(info.bar1_pde_base); let bar1_idx = crate::driver::bar1_resource_index(pdev)?; let bar1_size = pdev.resource_len(bar1_idx)?; @@ -594,6 +591,11 @@ pub(crate) fn new<'a>( }) } + /// Returns the static GPU configuration that GSP-RM reported at boot. + pub(crate) fn gsp_static_info(&self) -> &gsp::commands::GspStaticInfo { + &self.gsp_resources.boot_result.static_info + } + /// Waits for GFW, the GPU's boot firmware, to report completion. /// /// The driver must not program the GPU before then. @@ -616,14 +618,14 @@ pub(crate) fn wait_gfw_boot_completion( pub(crate) fn run_selftests(self: Pin<&mut Self>, pdev: &pci::Device) { let this = self.project(); let dev = pdev.as_ref(); - let regions = &this.gsp_static_info.usable_fb_regions; + let info = &this.gsp_resources.boot_result.static_info; if let Err(err) = crate::mm::selftest::run( dev, this.mm, - regions, + &info.usable_fb_regions, &this.bar_user, - this.gsp_static_info.bar1_pde_base, + info.bar1_pde_base, this.spec.chipset, ) { dev_err!(dev, "self-tests failed: {:?}\n", err); diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs index 398d6525b133..bf0028e52e3c 100644 --- a/drivers/gpu/nova-core/gsp.rs +++ b/drivers/gpu/nova-core/gsp.rs @@ -157,12 +157,15 @@ pub(crate) fn new( })) }) } - - /// Query the GSP for the static GPU information. - pub(crate) fn get_static_info(&self) -> Result { - self.cmdq.send_rpc_command(commands::rpc::GetGspStaticInfo) - } } /// Opaque bundle required to unload the GSP. Created by [`Gsp::boot`], consumed by [`Gsp::unload`]. pub(crate) struct UnloadBundle<'a>(KBox); + +/// The output of [`Gsp::boot`]: the static GPU configuration and the unload bundle. +pub(crate) struct BootResult<'a> { + /// The unload bundle for [`Gsp::unload`], if one could be built. + pub(crate) unload_bundle: Option>, + /// The static GPU configuration as reported by GSP-RM. + pub(crate) static_info: commands::GspStaticInfo, +} diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs index 9d5da5b165ac..a45f2b21a2ab 100644 --- a/drivers/gpu/nova-core/gsp/boot.rs +++ b/drivers/gpu/nova-core/gsp/boot.rs @@ -27,12 +27,12 @@ impl<'gsp> super::Gsp<'gsp> { /// user-space, patching them with signatures, and building firmware-specific intricate data /// structures that the GSP will use at runtime. /// - /// Upon return, the GSP is up and running, and its unload bundle (to be given as argument to - /// [`Self::unload`]) returned. + /// Returns, with the GSP running, the static configuration that GSP-RM reported and the + /// unload bundle for [`Self::unload`]. pub(crate) fn boot( self: Pin<&mut Self>, mut ctx: super::GspBootContext<'_, 'gsp>, - ) -> Result>> { + ) -> Result> { let pdev = ctx.pdev; let chipset = ctx.chipset; let gsp_falcon = ctx.gsp_falcon; @@ -84,7 +84,14 @@ pub(crate) fn boot( // Wait until GSP is fully initialized. commands::rpc::wait_gsp_init_done(&self.cmdq)?; - Ok(unload_guard.dismiss().1) + let static_info = self + .cmdq + .send_rpc_command(commands::rpc::GetGspStaticInfo)?; + + Ok(super::BootResult { + unload_bundle: unload_guard.dismiss().1, + static_info, + }) } /// Shut down the GSP and wait until it is offline. -- 2.56.1