summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/include
diff options
context:
space:
mode:
authorLean Sheng Tan <lean.sheng.tan@intel.com>2021-06-16 09:41:37 -0700
committerWerner Zeh <werner.zeh@siemens.com>2021-06-30 07:35:09 +0000
commitbed1b602d0cb6027c1b796cb1e44f335e56e0471 (patch)
treece30d40c1db81c2207ffbc1617a82ee9e6e336c6 /src/soc/intel/common/block/include
parent508dc163f183f99f4683365ef3a6443658979846 (diff)
soc/intel/common: Refine pmc_get_xtal_freq function
1. Remove 'PCH_EPOC_XTAL_FREQ(__epoc)' macro since it only be used in 1 place. 2. Transform macro into more readable C code. 3. Add additional case check to make sure the returned value is defined in the 'pch_pmc_xtal' enum. Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com> Change-Id: If57a99bf8e837a6eb8f225297399b1f5363cfa85 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55587 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/common/block/include')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/pmclib.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/pmclib.h b/src/soc/intel/common/block/include/intelblocks/pmclib.h
index a54ae18a8c..4972a09f8b 100644
--- a/src/soc/intel/common/block/include/intelblocks/pmclib.h
+++ b/src/soc/intel/common/block/include/intelblocks/pmclib.h
@@ -7,19 +7,19 @@
#include <types.h>
#define PCH_PMC_EPOC 0x18EC
-/* XTAL frequency in bits 21, 20, 17 */
-#define PCH_EPOC_XTAL_FREQ(__epoc) ((((__epoc) >> 19) & 0x6) | ((__epoc) >> 17 & 0x1))
/**
* enum pch_pmc_xtal - External crystal oscillator frequency.
* @XTAL_24_MHZ: 24 MHz external crystal.
* @XTAL_19_2_MHZ: 19.2 MHz external crystal.
* @XTAL_38_4_MHZ: 38.4 MHz external crystal.
+ * @XTAL_UNKNOWN_FREQ: Unsupported external crystal.
*/
enum pch_pmc_xtal {
XTAL_24_MHZ,
XTAL_19_2_MHZ,
XTAL_38_4_MHZ,
+ XTAL_UNKNOWN_FREQ = 0xf,
};
/*