summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_boot.h
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-30 23:44:55 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-30 23:44:55 -0400
commit97381a2cc9d3d2cc6d05a4da650e13ac27c5fc25 (patch)
treee16fdce841146455376d708cf7a08ff952d974da /kernel/gsp_phys_boot.h
parent770e61ae3b7c85bd0d19ff2301f00acbab50d382 (diff)
downloadopen-iov-97381a2cc9d3d2cc6d05a4da650e13ac27c5fc25.tar.gz
open-iov-97381a2cc9d3d2cc6d05a4da650e13ac27c5fc25.zip
gsp-phys: boot-layout stage 3b - boot-argument pages, WPR meta and FB layout (no device writes)
Diffstat (limited to 'kernel/gsp_phys_boot.h')
-rw-r--r--kernel/gsp_phys_boot.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/kernel/gsp_phys_boot.h b/kernel/gsp_phys_boot.h
new file mode 100644
index 0000000..8ab203a
--- /dev/null
+++ b/kernel/gsp_phys_boot.h
@@ -0,0 +1,52 @@
+#ifndef GSP_PHYS_BOOT_H
+#define GSP_PHYS_BOOT_H
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/dma-mapping.h>
+
+/*
+ * Real-GSP boot bring-up stage 3b: boot-argument DMA memory and the computed
+ * WPR/FB layout. Allocated and filled by gsp_phys_boot.c while the module owns
+ * the physical GPU. Stage 3b writes no device registers; the WPR metadata page
+ * is filled in host memory only, ready for the later FWSEC/booter stages.
+ */
+struct gsp_phys_boot {
+ bool initialized;
+
+ /* Boot-argument pages (DMA-coherent and GPU-addressable) */
+ void *wpr_meta_va;
+ dma_addr_t wpr_meta_dma;
+ size_t wpr_meta_size;
+ void *libos_args_va;
+ dma_addr_t libos_args_dma;
+ size_t libos_args_size;
+ void *gsp_args_va;
+ dma_addr_t gsp_args_dma;
+ size_t gsp_args_size;
+
+ /* Computed layout, FB byte offsets measured from the FB base */
+ u64 fb_size;
+ u64 vga_workspace_offset;
+ u64 vga_workspace_size;
+ u64 gsp_fw_wpr_end;
+ u64 frts_offset;
+ u64 frts_size;
+ u64 boot_bin_offset;
+ u64 size_of_bootloader;
+ u64 gsp_fw_offset;
+ u64 size_of_radix3_elf;
+ u64 gsp_fw_heap_offset;
+ u64 gsp_fw_heap_size;
+ u64 gsp_fw_wpr_start;
+ u64 non_wpr_heap_offset;
+ u64 non_wpr_heap_size;
+ u64 gsp_fw_rsvd_start;
+};
+
+bool gsp_phys_layout_enabled(void);
+int gsp_phys_boot_layout_init(struct gsp_phys_boot *boot, struct pci_dev *pdev,
+ u64 fw_image_size, resource_size_t usable_fb_size);
+void gsp_phys_boot_layout_fini(struct gsp_phys_boot *boot, struct pci_dev *pdev);
+
+#endif /* GSP_PHYS_BOOT_H */