coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pattrs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _SOC_PATTRS_H_
4 #define _SOC_PATTRS_H_
5 
6 #include <stdint.h>
7 #include <cpu/x86/msr.h>
8 
9 enum {
15 };
16 
17 /*
18  * The pattrs structure is a common place to stash pertinent information
19  * about the processor or platform. Instead of going to the source (msrs, cpuid)
20  * every time an attribute is needed use the pattrs structure.
21  */
22 struct pattrs {
28  int revid;
29  int stepping;
30  const void *microcode_patch;
31  int address_bits;
32  unsigned int num_cpus;
33  unsigned int bclk_khz;
34 };
35 
36 /*
37  * This is just to hide the abstraction w/o relying on how the underlying
38  * storage is allocated.
39  */
40 extern struct pattrs __global_pattrs;
41 static inline const struct pattrs *pattrs_get(void)
42 {
43  return &__global_pattrs;
44 }
45 
46 #endif /* _SOC_PATTRS_H_ */
struct pattrs __global_pattrs
Definition: ramstage.c:28
@ IACORE_TURBO
Definition: pattrs.h:13
@ IACORE_MAX
Definition: pattrs.h:12
@ IACORE_MIN
Definition: pattrs.h:10
@ IACORE_END
Definition: pattrs.h:14
@ IACORE_LFM
Definition: pattrs.h:11
static const struct pattrs * pattrs_get(void)
Definition: pattrs.h:41
unsigned int uint32_t
Definition: stdint.h:14
Definition: pattrs.h:22
unsigned int num_cpus
Definition: pattrs.h:32
msr_t platform_id
Definition: pattrs.h:23
int iacore_vids[IACORE_END]
Definition: pattrs.h:26
int address_bits
Definition: pattrs.h:31
msr_t platform_info
Definition: pattrs.h:24
unsigned int bclk_khz
Definition: pattrs.h:33
int stepping
Definition: pattrs.h:29
int revid
Definition: pattrs.h:28
uint32_t cpuid
Definition: pattrs.h:27
int iacore_ratios[IACORE_END]
Definition: pattrs.h:25
const void * microcode_patch
Definition: pattrs.h:30