From bb8d069dd305950ad53d20495ceadff695903d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Grzesik?= Date: Tue, 20 May 2025 13:10:13 +0200 Subject: [PATCH] vc/google/chromeos: Move pvmfw cbmem and enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change moves pvmfw cbmem implementation to chromeos directory and under CHROMEOS kconfig. The kconfigs have been renamed accordingly and with this change CHROMEOS_PVMFW_CBMEM is enabled by default for CHROMEOS. BUG=b:410735713 TEST=The build with CONFIG_CHROMEOS=y allocates buffer for pvmfw, the depthcharge adds the location and size of the buffer to the kernel command line Change-Id: I024f21ceee1334ebd7ae9bf1b897ad670ddc9ef9 Signed-off-by: Bartłomiej Grzesik Reviewed-on: https://review.coreboot.org/c/coreboot/+/87763 Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/vendorcode/google/Kconfig | 14 -------------- src/vendorcode/google/Makefile.mk | 1 - src/vendorcode/google/chromeos/Kconfig | 15 +++++++++++++++ src/vendorcode/google/chromeos/Makefile.mk | 1 + .../google/{ => chromeos}/pvmfw_cbmem.c | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) rename src/vendorcode/google/{ => chromeos}/pvmfw_cbmem.c (83%) diff --git a/src/vendorcode/google/Kconfig b/src/vendorcode/google/Kconfig index a846336c0b..2a1a327cec 100644 --- a/src/vendorcode/google/Kconfig +++ b/src/vendorcode/google/Kconfig @@ -38,17 +38,3 @@ config MAINBOARD_HAS_GOOGLE_STRAUSS_KEYBOARD config ACPI_FNKEY_GEN_SCANCODE default 94 if MAINBOARD_HAS_GOOGLE_STRAUSS_KEYBOARD -config GOOGLE_PVMFW_CBMEM - bool "Enable reserving memory for pvmfw using cbmem" - default n - help - Select this config to enable allocating a region for Android protected - virtual machine firmware within cbmem. The region shall be filled by - the payload and the purpose is to just reserve the memory. - cbmem is used to make sure that the region won't overlap with other - reserved regions or device regions. - -config GOOGLE_PVMFW_CBMEM_SIZE - hex "Size of the pvmfw buffer to be reserved using cbmem" - depends on GOOGLE_PVMFW_CBMEM - default 0x400000 diff --git a/src/vendorcode/google/Makefile.mk b/src/vendorcode/google/Makefile.mk index 32bb90ff74..c9e83897ff 100644 --- a/src/vendorcode/google/Makefile.mk +++ b/src/vendorcode/google/Makefile.mk @@ -4,4 +4,3 @@ subdirs-$(CONFIG_CHROMEOS) += chromeos ramstage-$(CONFIG_GOOGLE_DSM_CALIB) += dsm_calib.c ramstage-$(CONFIG_GOOGLE_SMBIOS_MAINBOARD_VERSION) += smbios.c -ramstage-$(CONFIG_GOOGLE_PVMFW_CBMEM) += pvmfw_cbmem.c diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig index 60f48fef33..5cfab094dc 100644 --- a/src/vendorcode/google/chromeos/Kconfig +++ b/src/vendorcode/google/chromeos/Kconfig @@ -123,5 +123,20 @@ config CHROMEOS_ENABLE_ESOL If your platform supports eSOL, enable it by selecting the appropriate option. +config CHROMEOS_PVMFW_CBMEM + bool "Enable reserving memory for pvmfw using cbmem" + default y + help + Select this config to enable allocating a region for Android protected + virtual machine firmware within cbmem. The region shall be filled by + the payload and the purpose is to just reserve the memory. + cbmem is used to make sure that the region won't overlap with other + reserved regions or device regions. + +config CHROMEOS_PVMFW_CBMEM_SIZE + hex "Size of the pvmfw buffer to be reserved using cbmem" + depends on CHROMEOS_PVMFW_CBMEM + default 0x400000 + endif # CHROMEOS endmenu diff --git a/src/vendorcode/google/chromeos/Makefile.mk b/src/vendorcode/google/chromeos/Makefile.mk index 6eb010e8eb..54673bcaf9 100644 --- a/src/vendorcode/google/chromeos/Makefile.mk +++ b/src/vendorcode/google/chromeos/Makefile.mk @@ -24,6 +24,7 @@ romstage-$(CONFIG_CHROMEOS_DRAM_PART_NUMBER_IN_CBI) += dram_part_num_override.c ramstage-$(CONFIG_PLATFORM_HAS_LOW_BATTERY_INDICATOR) += battery.c ramstage-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += splash.c +ramstage-$(CONFIG_CHROMEOS_PVMFW_CBMEM) += pvmfw_cbmem.c # Add logo to the cbfs image BMP_LOGO_COMPRESS_FLAG := $(CBFS_COMPRESS_FLAG) diff --git a/src/vendorcode/google/pvmfw_cbmem.c b/src/vendorcode/google/chromeos/pvmfw_cbmem.c similarity index 83% rename from src/vendorcode/google/pvmfw_cbmem.c rename to src/vendorcode/google/chromeos/pvmfw_cbmem.c index 15b0710645..dd0c0e5e57 100644 --- a/src/vendorcode/google/pvmfw_cbmem.c +++ b/src/vendorcode/google/chromeos/pvmfw_cbmem.c @@ -9,7 +9,7 @@ static void add_pvmfw_cbmem(void *unused) (void)unused; void *pvmfw; - pvmfw = cbmem_add(CBMEM_ID_PVMFW, CONFIG_GOOGLE_PVMFW_CBMEM_SIZE); + pvmfw = cbmem_add(CBMEM_ID_PVMFW, CONFIG_CHROMEOS_PVMFW_CBMEM_SIZE); if (!pvmfw) printk(BIOS_ERR, "Failed to add pvmfw info to CBMEM\n"); }