summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/i2c/max98390/max98390.c6
-rw-r--r--src/drivers/i2c/rt1011/rt1011.c4
-rw-r--r--src/mainboard/google/brya/Kconfig.name16
-rw-r--r--src/mainboard/google/hatch/Kconfig8
-rw-r--r--src/mainboard/google/volteer/Kconfig2
-rw-r--r--src/vendorcode/google/Kconfig19
-rw-r--r--src/vendorcode/google/Makefile.inc1
-rw-r--r--src/vendorcode/google/chromeos/Kconfig17
-rw-r--r--src/vendorcode/google/chromeos/Makefile.inc1
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h10
-rw-r--r--src/vendorcode/google/dsm_calib.c (renamed from src/vendorcode/google/chromeos/dsm_calib.c)2
-rw-r--r--src/vendorcode/google/dsm_calib.h20
12 files changed, 59 insertions, 47 deletions
diff --git a/src/drivers/i2c/max98390/max98390.c b/src/drivers/i2c/max98390/max98390.c
index 9786e2bc13..11acd22829 100644
--- a/src/drivers/i2c/max98390/max98390.c
+++ b/src/drivers/i2c/max98390/max98390.c
@@ -8,7 +8,7 @@
#include <device/path.h>
#include <identity.h>
#include <stdint.h>
-#include <vendorcode/google/chromeos/chromeos.h>
+#include <vendorcode/google/dsm_calib.h>
#include "chip.h"
#define MAX98390_ACPI_HID "MX98390"
@@ -47,7 +47,7 @@ static void max98390_fill_ssdt(const struct device *dev)
acpigen_write_resourcetemplate_footer();
/* Device Properties */
- if (CONFIG(CHROMEOS_DSM_CALIB)) {
+ if (CONFIG(GOOGLE_DSM_CALIB)) {
if (get_dsm_calibration_from_key(config->r0_calib_key, &r0_value)
|| get_dsm_calibration_from_key(config->temperature_calib_key,
&temp_value)) {
@@ -63,7 +63,7 @@ static void max98390_fill_ssdt(const struct device *dev)
}
}
- if (CONFIG(CHROMEOS_DSM_PARAM_FILE_NAME)) {
+ if (CONFIG(GOOGLE_DSM_PARAM_FILE_NAME)) {
if (config->dsm_param_file_name) {
if (!dp)
dp = acpi_dp_new_table("_DSD");
diff --git a/src/drivers/i2c/rt1011/rt1011.c b/src/drivers/i2c/rt1011/rt1011.c
index 6977d95f51..9a21748e53 100644
--- a/src/drivers/i2c/rt1011/rt1011.c
+++ b/src/drivers/i2c/rt1011/rt1011.c
@@ -7,7 +7,7 @@
#include <device/device.h>
#include <device/path.h>
#include <stdint.h>
-#include <vendorcode/google/chromeos/chromeos.h>
+#include <vendorcode/google/dsm_calib.h>
#include "chip.h"
#define RT1011_ACPI_HID "10EC1011"
@@ -45,7 +45,7 @@ static void rt1011_fill_ssdt(const struct device *dev)
acpigen_write_resourcetemplate_footer();
/* Device Properties */
- if (CONFIG(CHROMEOS_DSM_CALIB)) {
+ if (CONFIG(GOOGLE_DSM_CALIB)) {
if (get_dsm_calibration_from_key(config->r0_calib_key, &r0_value)
|| get_dsm_calibration_from_key(config->temperature_calib_key,
&temp_value)) {
diff --git a/src/mainboard/google/brya/Kconfig.name b/src/mainboard/google/brya/Kconfig.name
index 9cdc8e7c9e..14aa8d0f6c 100644
--- a/src/mainboard/google/brya/Kconfig.name
+++ b/src/mainboard/google/brya/Kconfig.name
@@ -57,16 +57,16 @@ config BOARD_GOOGLE_FELWINTER
config BOARD_GOOGLE_GIMBLE
bool "-> Gimble"
select BOARD_GOOGLE_BASEBOARD_BRYA
- select CHROMEOS_DSM_CALIB if CHROMEOS
- select CHROMEOS_DSM_PARAM_FILE_NAME if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
+ select GOOGLE_DSM_PARAM_FILE_NAME if VPD
select DRIVERS_GENESYSLOGIC_GL9750
select DRIVERS_I2C_MAX98390
config BOARD_GOOGLE_GIMBLE4ES
bool "-> Gimble4ES"
select BOARD_GOOGLE_BASEBOARD_BRYA
- select CHROMEOS_DSM_CALIB if CHROMEOS
- select CHROMEOS_DSM_PARAM_FILE_NAME if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
+ select GOOGLE_DSM_PARAM_FILE_NAME if VPD
select DEFAULT_ADL_NEM
select DRIVERS_GENESYSLOGIC_GL9750
select DRIVERS_I2C_MAX98390
@@ -118,8 +118,8 @@ config BOARD_GOOGLE_PRIMUS4ES
config BOARD_GOOGLE_REDRIX
bool "-> Redrix"
select BOARD_GOOGLE_BASEBOARD_BRYA
- select CHROMEOS_DSM_CALIB if CHROMEOS
- select CHROMEOS_DSM_PARAM_FILE_NAME if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
+ select GOOGLE_DSM_PARAM_FILE_NAME if VPD
select DRIVERS_GENESYSLOGIC_GL9755
select DRIVERS_GFX_GENERIC
select DRIVERS_I2C_MAX98390
@@ -130,8 +130,8 @@ config BOARD_GOOGLE_REDRIX
config BOARD_GOOGLE_REDRIX4ES
bool "-> Redrix4ES"
select BOARD_GOOGLE_BASEBOARD_BRYA
- select CHROMEOS_DSM_CALIB if CHROMEOS
- select CHROMEOS_DSM_PARAM_FILE_NAME if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
+ select GOOGLE_DSM_PARAM_FILE_NAME if VPD
select DEFAULT_ADL_NEM
select DRIVERS_GENESYSLOGIC_GL9755
select DRIVERS_GFX_GENERIC
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index 174978e7e5..c674036735 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -44,13 +44,13 @@ config BOARD_GOOGLE_HATCH
config BOARD_GOOGLE_HELIOS
select BOARD_GOOGLE_BASEBOARD_HATCH
- select CHROMEOS_DSM_CALIB if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
select DRIVERS_I2C_RT1011
select INTEL_GMA_HAVE_VBT
config BOARD_GOOGLE_HELIOS_DISKSWAP
select BOARD_GOOGLE_BASEBOARD_HATCH
- select CHROMEOS_DSM_CALIB if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
select DRIVERS_I2C_RT1011
select INTEL_GMA_HAVE_VBT
@@ -74,13 +74,13 @@ config BOARD_GOOGLE_MUSHU
config BOARD_GOOGLE_NIGHTFURY
select BOARD_GOOGLE_BASEBOARD_HATCH
- select CHROMEOS_DSM_CALIB if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
select DRIVERS_I2C_MAX98390
select INTEL_GMA_HAVE_VBT
config BOARD_GOOGLE_PALKIA
select BOARD_GOOGLE_BASEBOARD_HATCH
- select CHROMEOS_DSM_CALIB if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
select DRIVERS_I2C_RT1011
if BOARD_GOOGLE_BASEBOARD_HATCH
diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig
index f4ab6de479..7064a14d06 100644
--- a/src/mainboard/google/volteer/Kconfig
+++ b/src/mainboard/google/volteer/Kconfig
@@ -77,7 +77,7 @@ config BOARD_GOOGLE_HALVOR
config BOARD_GOOGLE_LINDAR
select BOARD_GOOGLE_BASEBOARD_VOLTEER
- select CHROMEOS_DSM_CALIB if CHROMEOS
+ select GOOGLE_DSM_CALIB if VPD
select DRIVERS_GENERIC_BAYHUB_LV2
select DRIVERS_I2C_RT1011
select INTEL_CAR_NEM
diff --git a/src/vendorcode/google/Kconfig b/src/vendorcode/google/Kconfig
index 60c0c228a7..796f8b4089 100644
--- a/src/vendorcode/google/Kconfig
+++ b/src/vendorcode/google/Kconfig
@@ -9,3 +9,22 @@ config GOOGLE_SMBIOS_MAINBOARD_VERSION
help
Provide a common implementation for mainboard version,
which returns a formatted 'rev%d' board_id() string.
+
+config GOOGLE_DSM_CALIB
+ bool
+ default n
+ depends on VPD
+ help
+ On some boards, there are calibrated parameters for Dynamic Speaker Management(DSM)
+ stored in VPD. Enable this config to read and parse these VPD values and write them
+ to ACPI DSD table in device driver. These parameters will be applied by kernel driver
+ through device property at boot.
+
+config GOOGLE_DSM_PARAM_FILE_NAME
+ bool
+ default n
+ depends on GOOGLE_DSM_CALIB
+ help
+ On some boards, there are different dsm parameter files for Dynamic Speaker
+ Management (DSM). Enable this config to assign dsm parameters file name in ACPI
+ SSDT table. Kernel driver uses this to load the DSM parameter file.
diff --git a/src/vendorcode/google/Makefile.inc b/src/vendorcode/google/Makefile.inc
index c67ea20268..c9e83897ff 100644
--- a/src/vendorcode/google/Makefile.inc
+++ b/src/vendorcode/google/Makefile.inc
@@ -2,4 +2,5 @@
subdirs-$(CONFIG_CHROMEOS) += chromeos
+ramstage-$(CONFIG_GOOGLE_DSM_CALIB) += dsm_calib.c
ramstage-$(CONFIG_GOOGLE_SMBIOS_MAINBOARD_VERSION) += smbios.c
diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig
index 868492062e..09796527a1 100644
--- a/src/vendorcode/google/chromeos/Kconfig
+++ b/src/vendorcode/google/chromeos/Kconfig
@@ -57,23 +57,6 @@ config CHROMEOS_USE_EC_WATCHDOG_FLAG
help
Use the AP watchdog flag stored in EC.
-config CHROMEOS_DSM_CALIB
- bool
- default n
- help
- On some boards, there are calibrated parameters for Dynamic Speaker Management(DSM)
- stored in VPD. Enable this config to read and parse these VPD values and write them
- to ACPI DSD table in device driver. These parameters will be applied by kernel driver
- through device property at boot.
-
-config CHROMEOS_DSM_PARAM_FILE_NAME
- bool
- default n
- help
- On some boards, there are different dsm parameter files for Dynamic Speaker
- Management (DSM). Enable this config to assign dsm parameters file name in ACPI
- SSDT table. Kernel driver uses this to load the DSM parameter file.
-
config CHROMEOS_CSE_BOARD_RESET_OVERRIDE
bool
default n
diff --git a/src/vendorcode/google/chromeos/Makefile.inc b/src/vendorcode/google/chromeos/Makefile.inc
index ce77194070..fbfd7a4e2f 100644
--- a/src/vendorcode/google/chromeos/Makefile.inc
+++ b/src/vendorcode/google/chromeos/Makefile.inc
@@ -8,7 +8,6 @@ ramstage-y += vpd_mac.c vpd_serialno.c vpd_calibration.c
ramstage-$(CONFIG_CHROMEOS_DISABLE_PLATFORM_HIERARCHY_ON_RESUME) += tpm2.c
ramstage-$(CONFIG_HAVE_REGULATORY_DOMAIN) += wrdd.c
ramstage-$(CONFIG_USE_SAR) += sar.c
-ramstage-$(CONFIG_CHROMEOS_DSM_CALIB) += dsm_calib.c
ramstage-$(CONFIG_TPM_GOOGLE) += cr50_enable_update.c
romstage-$(CONFIG_CHROMEOS_CSE_BOARD_RESET_OVERRIDE) += cse_board_reset.c
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 98aa4faf9b..cab855d34e 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -27,16 +27,6 @@ void cbmem_add_vpd_calibration_data(void);
void chromeos_set_me_hash(u32*, int);
void chromeos_set_ramoops(void *ram_oops, size_t size);
-/**
- * get_dsm_calibration_from_key - Gets value related to DSM calibration from VPD
- * @key: The key in RO_VPD. The valid prefix is "dsm_calib_". The valid keys are
- * documented in https://chromeos.google.com/partner/dlm/docs/factory/vpd.html.
- * @value: Output value. The value read from VPD parsed into uint64_t integer.
- *
- * Returns CB_SUCCESS on success or CB_ERR on failure.
- */
-enum cb_err get_dsm_calibration_from_key(const char *key, uint64_t *value);
-
/*
* Declaration for mainboards to use to generate ACPI-specific ChromeOS needs.
*/
diff --git a/src/vendorcode/google/chromeos/dsm_calib.c b/src/vendorcode/google/dsm_calib.c
index ad4291d776..a245b80403 100644
--- a/src/vendorcode/google/chromeos/dsm_calib.c
+++ b/src/vendorcode/google/dsm_calib.c
@@ -5,7 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
+#include "dsm_calib.h"
#define DSM_BUF_LEN 128
#define DSM_PREFIX "dsm_calib_"
diff --git a/src/vendorcode/google/dsm_calib.h b/src/vendorcode/google/dsm_calib.h
new file mode 100644
index 0000000000..efbfe045c1
--- /dev/null
+++ b/src/vendorcode/google/dsm_calib.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __DSM_CALIB_H__
+#define __DSM_CALIB_H__
+
+#include <stddef.h>
+#include <stdint.h>
+#include <types.h>
+
+/**
+ * get_dsm_calibration_from_key - Gets value related to DSM calibration from VPD
+ * @key: The key in RO_VPD. The valid prefix is "dsm_calib_". The valid keys are
+ * documented in https://chromeos.google.com/partner/dlm/docs/factory/vpd.html.
+ * @value: Output value. The value read from VPD parsed into uint64_t integer.
+ *
+ * Returns CB_SUCCESS on success or CB_ERR on failure.
+ */
+enum cb_err get_dsm_calibration_from_key(const char *key, uint64_t *value);
+
+#endif /* __DSM_CALIB_H__ */