summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/baytrail/include/soc/pattrs.h
blob: 624c902b906f4ce0022f17c07356d848820b9674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */

#ifndef _PATTRS_H_
#define _PATTRS_H_

#include <stdint.h>
#include <cpu/x86/msr.h>

enum {
	IACORE_MIN,
	IACORE_LFM,
	IACORE_MAX,
	IACORE_TURBO,
	IACORE_END
};

/* The pattrs structure is a common place to stash pertinent information
 * about the processor or platform. Instead of going to the source (msrs, cpuid)
 * every time an attribute is needed use the pattrs structure.
 */
struct pattrs {
	msr_t platform_id;
	msr_t platform_info;
	int iacore_ratios[IACORE_END];
	int iacore_vids[IACORE_END];
	uint32_t cpuid;
	int revid;
	int stepping;
	const void *microcode_patch;
	int address_bits;
	int num_cpus;
	unsigned int bclk_khz;
};

/* This is just to hide the abstraction w/o relying on how the underlying
 * storage is allocated. */
#define PATTRS_GLOB_NAME __global_pattrs
#define DEFINE_PATTRS struct pattrs PATTRS_GLOB_NAME
extern DEFINE_PATTRS;

static inline const struct pattrs *pattrs_get(void)
{
	return &PATTRS_GLOB_NAME;
}


#endif /* _PATTRS_H_ */