diff --git a/src/soc/intel/alderlake/pmutil.c b/src/soc/intel/alderlake/pmutil.c index 60d6e10984..c4591007e7 100644 --- a/src/soc/intel/alderlake/pmutil.c +++ b/src/soc/intel/alderlake/pmutil.c @@ -156,11 +156,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_alderlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c index 5366ca8baf..ddc5647dac 100644 --- a/src/soc/intel/apollolake/pmutil.c +++ b/src/soc/intel/apollolake/pmutil.c @@ -140,11 +140,16 @@ void soc_clear_pm_registers(uintptr_t pmc_bar) static void gpe0_different_values(const struct soc_intel_apollolake_config *config) { - bool result = (config->gpe0_dw1 != config->gpe0_dw2) && + bool all_zero = (config->gpe0_dw1 == 0) && + (config->gpe0_dw2 == 0) && + (config->gpe0_dw3 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->gpe0_dw1 != config->gpe0_dw2) && (config->gpe0_dw1 != config->gpe0_dw3) && (config->gpe0_dw2 != config->gpe0_dw3); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/cannonlake/pmutil.c b/src/soc/intel/cannonlake/pmutil.c index 63eed164c4..f7d9345578 100644 --- a/src/soc/intel/cannonlake/pmutil.c +++ b/src/soc/intel/cannonlake/pmutil.c @@ -150,11 +150,16 @@ uint32_t *soc_pmc_etr_addr(void) static void gpe0_different_values(const struct soc_intel_cannonlake_config *config) { - bool result = (config->gpe0_dw0 != config->gpe0_dw1) && + bool all_zero = (config->gpe0_dw0 == 0) && + (config->gpe0_dw1 == 0) && + (config->gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->gpe0_dw0 != config->gpe0_dw1) && (config->gpe0_dw0 != config->gpe0_dw2) && (config->gpe0_dw1 != config->gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/elkhartlake/pmutil.c b/src/soc/intel/elkhartlake/pmutil.c index a862bdd6e2..72f9bd6e36 100644 --- a/src/soc/intel/elkhartlake/pmutil.c +++ b/src/soc/intel/elkhartlake/pmutil.c @@ -149,11 +149,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_elkhartlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/jasperlake/pmutil.c b/src/soc/intel/jasperlake/pmutil.c index 569eac7ea8..09eb57fc53 100644 --- a/src/soc/intel/jasperlake/pmutil.c +++ b/src/soc/intel/jasperlake/pmutil.c @@ -149,11 +149,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_jasperlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/meteorlake/pmutil.c b/src/soc/intel/meteorlake/pmutil.c index 154c3bef97..a0bba92f11 100644 --- a/src/soc/intel/meteorlake/pmutil.c +++ b/src/soc/intel/meteorlake/pmutil.c @@ -152,11 +152,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_meteorlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/pantherlake/pmutil.c b/src/soc/intel/pantherlake/pmutil.c index 306d834c5d..7ce1dacfa3 100644 --- a/src/soc/intel/pantherlake/pmutil.c +++ b/src/soc/intel/pantherlake/pmutil.c @@ -147,11 +147,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_pantherlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c index ed1ab8be6b..91f0836108 100644 --- a/src/soc/intel/skylake/pmutil.c +++ b/src/soc/intel/skylake/pmutil.c @@ -156,11 +156,16 @@ uint32_t *soc_pmc_etr_addr(void) static void gpe0_different_values(const struct soc_intel_skylake_config *config) { - bool result = (config->gpe0_dw0 != config->gpe0_dw1) && + bool all_zero = (config->gpe0_dw0 == 0) && + (config->gpe0_dw1 == 0) && + (config->gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->gpe0_dw0 != config->gpe0_dw1) && (config->gpe0_dw0 != config->gpe0_dw2) && (config->gpe0_dw1 != config->gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) diff --git a/src/soc/intel/tigerlake/pmutil.c b/src/soc/intel/tigerlake/pmutil.c index 7903264b88..0c5a1b5986 100644 --- a/src/soc/intel/tigerlake/pmutil.c +++ b/src/soc/intel/tigerlake/pmutil.c @@ -155,11 +155,16 @@ uint32_t *soc_pmc_etr_addr(void) static void pmc_gpe0_different_values(const struct soc_intel_tigerlake_config *config) { - bool result = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && + bool all_zero = (config->pmc_gpe0_dw0 == 0) && + (config->pmc_gpe0_dw1 == 0) && + (config->pmc_gpe0_dw2 == 0); + + /* Check if all values are different AND not all zero */ + bool all_different = (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw1) && (config->pmc_gpe0_dw0 != config->pmc_gpe0_dw2) && (config->pmc_gpe0_dw1 != config->pmc_gpe0_dw2); - assert(result); + assert(all_different || all_zero); } void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2)