2015-06-09 22:42:55 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
2015-06-10 05:18:38 +02:00
|
|
|
* Copyright (C) 2014 Google Inc.
|
2015-06-09 22:42:55 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arch/ioapic.h>
|
2019-03-06 09:30:17 +01:00
|
|
|
#include <arch/acpi.h>
|
2015-06-10 05:18:38 +02:00
|
|
|
#include <soc/acpi.h>
|
|
|
|
#include <soc/nvs.h>
|
2016-12-18 18:59:58 +01:00
|
|
|
#include <variant/thermal.h>
|
2015-06-10 05:18:38 +02:00
|
|
|
|
2015-06-09 22:42:55 +02:00
|
|
|
static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
|
|
|
{
|
|
|
|
gnvs->tmps = CTL_TDP_SENSOR_ID;
|
|
|
|
gnvs->tcrt = CRITICAL_TEMPERATURE;
|
|
|
|
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
|
|
|
gnvs->tmax = MAX_TEMPERATURE;
|
|
|
|
gnvs->flvl = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void acpi_create_gnvs(global_nvs_t *gnvs)
|
|
|
|
{
|
2015-06-10 05:18:38 +02:00
|
|
|
acpi_init_gnvs(gnvs);
|
|
|
|
|
2015-06-09 22:42:55 +02:00
|
|
|
/* Enable USB ports in S3 */
|
|
|
|
gnvs->s3u0 = 1;
|
|
|
|
|
|
|
|
/* Disable USB ports in S5 */
|
|
|
|
gnvs->s5u0 = 0;
|
|
|
|
|
|
|
|
acpi_update_thermal_table(gnvs);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long acpi_fill_madt(unsigned long current)
|
|
|
|
{
|
|
|
|
/* Local APICs */
|
|
|
|
current = acpi_create_madt_lapics(current);
|
|
|
|
|
|
|
|
/* IOAPIC */
|
|
|
|
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
|
|
|
|
2, IO_APIC_ADDR, 0);
|
|
|
|
|
2015-06-10 05:18:38 +02:00
|
|
|
return acpi_madt_irq_overrides(current);
|
2015-06-09 22:42:55 +02:00
|
|
|
}
|