diff --git a/src/mainboard/google/brya/Kconfig.name b/src/mainboard/google/brya/Kconfig.name index 6608193284..2c639bf2ff 100644 --- a/src/mainboard/google/brya/Kconfig.name +++ b/src/mainboard/google/brya/Kconfig.name @@ -254,6 +254,7 @@ config BOARD_GOOGLE_KULDAX config BOARD_GOOGLE_JOXER bool "-> Joxer" + select ALDERLAKE_CONFIGURE_DESCRIPTOR select BOARD_GOOGLE_BASEBOARD_NISSA select DRIVERS_GENESYSLOGIC_GL9750 diff --git a/src/mainboard/google/brya/variants/joxer/Makefile.inc b/src/mainboard/google/brya/variants/joxer/Makefile.inc index d38141ca24..ee9b555ab7 100644 --- a/src/mainboard/google/brya/variants/joxer/Makefile.inc +++ b/src/mainboard/google/brya/variants/joxer/Makefile.inc @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only bootblock-y += gpio.c +bootblock-y += variant.c romstage-y += gpio.c diff --git a/src/mainboard/google/brya/variants/joxer/variant.c b/src/mainboard/google/brya/variants/joxer/variant.c new file mode 100644 index 0000000000..702468280d --- /dev/null +++ b/src/mainboard/google/brya/variants/joxer/variant.c @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include +#include + +/* + * TODO(b/229022567): This is a workaround which will be removed once we + * implement a proper solution for configuring the descriptor differently for + * different SKUs. + */ +void variant_update_descriptor(void) +{ + /* + * UfsCont1Config = "Disabled" + * IshSupported = "No" + */ + struct descriptor_byte emmc_bytes[] = { + { 0x1f8, 0x55 }, + { 0x1f9, 0x55 }, + { 0xc18, 0x89 }, + { 0xc1d, 0xb8 }, + }; + + /* + * UfsCont1Config = "X2" + * IshSupported = "Yes" + */ + struct descriptor_byte ufs_bytes[] = { + { 0x1f8, 0x95 }, + { 0x1f9, 0x59 }, + { 0xc18, 0x09 }, + { 0xc1d, 0x28 }, + }; + + if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) { + printk(BIOS_INFO, "Configuring descriptor for UFS\n"); + configure_descriptor(ufs_bytes, ARRAY_SIZE(ufs_bytes)); + } else { + printk(BIOS_INFO, "Configuring descriptor for eMMC\n"); + configure_descriptor(emmc_bytes, ARRAY_SIZE(emmc_bytes)); + } +}