24 #include <soc/pci_devs.h>
26 #include <soc/southbridge.h>
144 uint32_t core_freq, core_freq_mul, core_freq_div;
145 bool valid_freq_divisor;
154 if (core_freq_div == 0) {
159 valid_freq_divisor = 1;
163 valid_freq_divisor = 1;
165 valid_freq_divisor = 0;
168 if (valid_freq_divisor) {
182 uint32_t voltage_in_uvolts, core_vid, current_value_amps, current_divisor, power_in_mw;
197 if ((core_vid >= 0xF8) && (core_vid <= 0xFF)) {
199 voltage_in_uvolts = 0;
206 power_in_mw = (voltage_in_uvolts) / 1000 * current_value_amps;
208 switch (current_divisor) {
212 power_in_mw = power_in_mw / 10L;
215 power_in_mw = power_in_mw / 100L;
234 size_t pstate_count, pstate;
240 for (pstate = 0; pstate <= max_pstate; pstate++) {
255 pstate_xpss_values[pstate_count].
core_freq =
256 (
uint64_t)pstate_values[pstate_count].core_freq;
257 pstate_xpss_values[pstate_count].
power =
272 size_t pstate_count, cpu, proc_blk_len;
275 uint32_t threads_per_core, proc_blk_addr;
311 .addrl = cstate_base_address + 1,
322 for (cpu = 0; cpu < logical_cores; cpu++) {
342 if (
CONFIG(ACPI_SSDT_PSD_INDEPENDENT))
unsigned long acpi_create_madt_lapics(unsigned long current)
int acpi_create_madt_irqoverride(acpi_madt_irqoverride_t *irqoverride, u8 bus, u8 source, u32 gsirq, u16 flags)
int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr, u32 gsi_base)
int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu, u16 flags, u8 lint)
void acpigen_write_PPC(u8 nr)
void acpigen_pop_len(void)
void acpigen_write_pss_object(const struct acpi_sw_pstate *pstate_values, size_t nentries)
void acpigen_write_CST_package(const acpi_cstate_t *cstate, int nentries)
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
void acpigen_write_processor_package(const char *const name, const unsigned int first_core, const unsigned int core_count)
void acpigen_write_xpss_object(const struct acpi_xpss_sw_pstate *pstate_values, size_t nentries)
void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index)
void acpigen_write_pct_package(const acpi_addr_t *perf_ctrl, const acpi_addr_t *perf_sts)
void acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype)
#define IO_APIC_INTERRUPTS
const struct soc_amd_common_config * soc_get_common_config(void)
#define printk(level,...)
void generate_cpu_entries(const struct device *device)
static int get_cpu_count(void)
#define ACPI_FADT_S4_RTC_WAKE
#define ACPI_FADT_PLATFORM_CLOCK
#define ACPI_FADT_32BIT_TIMER
#define ACPI_FADT_C2_NOT_SUPPORTED
static int permanent_smi_handler(void)
#define ACPI_ACCESS_SIZE_WORD_ACCESS
#define ACPI_MADT_LAPIC_NMI_ALL_PROCESSORS
#define ACPI_FADT_S4_RTC_VALID
#define ACPI_ACCESS_SIZE_DWORD_ACCESS
#define ACPI_FADT_REMOTE_POWER_ON
#define ACPI_FADT_PCI_EXPRESS_WAKE
#define ACPI_FADT_C1_SUPPORTED
#define ACPI_ACCESS_SIZE_BYTE_ACCESS
#define ACPI_FADT_C3_NOT_SUPPORTED
#define ACPI_ADDRESS_SPACE_IO
#define ACPI_ADDRESS_SPACE_FIXED
#define MSR_CSTATE_ADDRESS
#define SERIAL_VID_DECODE_MICROVOLTS
#define PS_LIM_MAX_VAL_MASK
#define SERIAL_VID_MAX_MICROVOLTS
#define MSR_CSTATE_ADDRESS_MASK
static __always_inline msr_t rdmsr(unsigned int index)
#define APM_CNT_ACPI_DISABLE
#define APM_CNT_ACPI_ENABLE
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
#define MP_IRQ_TRIGGER_DEFAULT
#define MP_IRQ_POLARITY_LOW
#define MP_IRQ_POLARITY_HIGH
#define MP_IRQ_POLARITY_DEFAULT
#define MP_IRQ_TRIGGER_EDGE
#define MP_IRQ_TRIGGER_LEVEL
static const struct pnpconfig power[]
void acpi_fill_fadt(acpi_fadt_t *fadt)
unsigned long acpi_fill_madt(unsigned long current)
#define PSTATE_DEF_HI_ENABLE_SHIFT
#define PSTATE_DEF_LO_FREQ_DIV_MASK
#define PSTATE_DEF_LO_CUR_VAL_SHIFT
#define PSTATE_DEF_LO_FREQ_DIV_SHIFT
#define PSTATE_DEF_LO_FREQ_MUL_MASK
#define PSTATE_DEF_LO_CUR_VAL_MASK
#define PSTATE_DEF_LO_CORE_VID_MASK
#define PSTATE_DEF_LO_EIGHTH_STEP_MAX
#define PSTATE_DEF_HI_ENABLE_MASK
#define PSTATE_DEF_LO_CUR_DIV_SHIFT
#define PSTATE_DEF_LO_FREQ_DIV_MAX
#define PSTATE_DEF_LO_CORE_FREQ_BASE
#define PSTATE_DEF_LO_CUR_DIV_MASK
#define PSTATE_DEF_LO_FREQ_DIV_MIN
#define PSTATE_DEF_LO_CORE_VID_SHIFT
unsigned long acpi_fill_madt_irqoverride(unsigned long current)
unsigned int get_threads_per_core(void)
static size_t get_pstate_info(struct acpi_sw_pstate *pstate_values, struct acpi_xpss_sw_pstate *pstate_xpss_values)
static uint32_t get_pstate_core_freq(msr_t pstate_def)
static uint32_t get_pstate_core_power(msr_t pstate_def)
unsigned long long uint64_t
acpi_addr_t x_pm1a_evt_blk
acpi_addr_t x_pm1a_cnt_blk