mb/google/brox: Configure ISH device based on FW_CONFIG
ISH Firmware name needs to be configured only when full sensing capabilities are enabled through ISH_ENABLE FW_CONFIG. Similarly DMA property needs to be added only when UFS is enabled through STORAGE_UFS FW_CONFIG. Hence configure the ISH device at run-time based on FW_CONFIG. BUG=b:319164720 TEST=Build Brox BIOS image and boot to OS. Change-Id: I678416acd48e03ab77ae299beae6e295a688b8df Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81418 Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com>
This commit is contained in:
		
				
					committed by
					
						 Martin L Roth
						Martin L Roth
					
				
			
			
				
	
			
			
			
						parent
						
							6943b6c8e6
						
					
				
				
					commit
					4f085915fb
				
			| @@ -1,10 +1,12 @@ | |||||||
| /* SPDX-License-Identifier: GPL-2.0-only */ | /* SPDX-License-Identifier: GPL-2.0-only */ | ||||||
|  |  | ||||||
| #include <bootstate.h> | #include <bootstate.h> | ||||||
|  | #include <drivers/intel/ish/chip.h> | ||||||
| #include <fw_config.h> | #include <fw_config.h> | ||||||
| #include <gpio.h> | #include <gpio.h> | ||||||
|  |  | ||||||
| #define GPIO_PADBASED_OVERRIDE(b, a) gpio_padbased_override(b, a, ARRAY_SIZE(a)) | #define GPIO_PADBASED_OVERRIDE(b, a) gpio_padbased_override(b, a, ARRAY_SIZE(a)) | ||||||
|  | #define ISH_FIRMWARE_NAME "brox_ish.bin" | ||||||
|  |  | ||||||
| static const struct pad_config ish_enable_pads[] = { | static const struct pad_config ish_enable_pads[] = { | ||||||
| 	/* GPP_B5 : ISH I2C0_SDA */ | 	/* GPP_B5 : ISH I2C0_SDA */ | ||||||
| @@ -27,9 +29,19 @@ static const struct pad_config ish_enable_pads[] = { | |||||||
|  |  | ||||||
| static void fw_config_handle(void *unused) | static void fw_config_handle(void *unused) | ||||||
| { | { | ||||||
|  | 	struct device *ish_config_device = DEV_PTR(ish_conf); | ||||||
|  | 	struct drivers_intel_ish_config *config = config_of(ish_config_device); | ||||||
|  |  | ||||||
| 	if (fw_config_probe(FW_CONFIG(ISH, ISH_ENABLE))) { | 	if (fw_config_probe(FW_CONFIG(ISH, ISH_ENABLE))) { | ||||||
| 		printk(BIOS_INFO, "Configure GPIOs for ISH.\n"); | 		printk(BIOS_INFO, "Configure GPIOs, device config for ISH.\n"); | ||||||
| 		gpio_configure_pads(ish_enable_pads, ARRAY_SIZE(ish_enable_pads)); | 		gpio_configure_pads(ish_enable_pads, ARRAY_SIZE(ish_enable_pads)); | ||||||
|  |  | ||||||
|  | 		config->firmware_name = ISH_FIRMWARE_NAME; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) { | ||||||
|  | 		printk(BIOS_INFO, "Configure GPIOs, device config for UFS.\n"); | ||||||
|  | 		config->add_acpi_dma_property = true; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); | BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); | ||||||
|   | |||||||
| @@ -300,9 +300,7 @@ chip soc/intel/alderlake | |||||||
| 		end | 		end | ||||||
| 		device ref ish on | 		device ref ish on | ||||||
| 			chip drivers/intel/ish | 			chip drivers/intel/ish | ||||||
| 				register "firmware_name" = ""brox_ish.bin"" | 				device generic 0 alias ish_conf on end | ||||||
| 				register "add_acpi_dma_property" = "true" |  | ||||||
| 				device generic 0 on end |  | ||||||
| 			end | 			end | ||||||
| 			probe ISH ISH_ENABLE | 			probe ISH ISH_ENABLE | ||||||
| 			probe STORAGE STORAGE_UFS | 			probe STORAGE STORAGE_UFS | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user