blob: 5c97f4e2f64baa831ba5e05834b70d3a7835a93e [file] [log] [blame]
Angel Ponsc3c7ef32020-07-12 19:08:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <acpi/acpi.h>
Angel Ponsc3c7ef32020-07-12 19:08:57 +02004#include <soc/iomap.h>
5#include <soc/pm.h>
6#include "chip.h"
7
Michael Niewöhnerf6611a22020-08-03 16:53:41 +02008void soc_fill_fadt(acpi_fadt_t *fadt)
Angel Ponsc3c7ef32020-07-12 19:08:57 +02009{
10 const uint16_t pmbase = ACPI_BASE_ADDRESS;
11 config_t *config = config_of_soc();
12
Angel Ponsc3c7ef32020-07-12 19:08:57 +020013 fadt->pm2_cnt_blk = pmbase + PM2_CNT;
14 fadt->pm_tmr_blk = pmbase + PM1_TMR;
Angel Ponsc3c7ef32020-07-12 19:08:57 +020015
Angel Ponsc3c7ef32020-07-12 19:08:57 +020016 fadt->pm2_cnt_len = 1;
17 fadt->pm_tmr_len = 4;
Michael Niewöhnerf6611a22020-08-03 16:53:41 +020018
Kyösti Mälkki88decca2023-04-28 07:04:34 +030019 fill_fadt_extended_pm_io(fadt);
20
Angel Ponsc3c7ef32020-07-12 19:08:57 +020021 fadt->iapc_boot_arch = ACPI_FADT_LEGACY_FREE;
22 if (!CONFIG(NO_FADT_8042))
23 fadt->iapc_boot_arch |= ACPI_FADT_8042;
24
Angel Ponsc3c7ef32020-07-12 19:08:57 +020025 if (config->s0ix_enable)
26 fadt->flags |= ACPI_FADT_LOW_PWR_IDLE_S0;
27
Angel Ponsc3c7ef32020-07-12 19:08:57 +020028
Angel Ponsc3c7ef32020-07-12 19:08:57 +020029}