blob: 86c28120c7e307904d0d9489aa7b8b35b4fee901 [file] [log] [blame]
Simon Glassf53f57d2021-12-01 09:02:51 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Write an ACPI Firmware ACPI Control Structure (FACS) table
4 *
5 * Copyright 2021 Google LLC
6 */
7
Simon Glass83c3cb52021-12-01 09:02:52 -07008#define LOG_CATEGORY LOGC_ACPI
9
Simon Glassf53f57d2021-12-01 09:02:51 -070010#include <acpi/acpi_table.h>
11#include <dm/acpi.h>
Tom Rinia877ce12023-12-14 13:16:58 -050012#include <linux/string.h>
Simon Glassf53f57d2021-12-01 09:02:51 -070013
14int acpi_write_facs(struct acpi_ctx *ctx, const struct acpi_writer *entry)
15{
16 struct acpi_facs *facs = ctx->current;
17
18 memset((void *)facs, '\0', sizeof(struct acpi_facs));
19
20 memcpy(facs->signature, "FACS", 4);
21 facs->length = sizeof(struct acpi_facs);
22 facs->hardware_signature = 0;
23 facs->firmware_waking_vector = 0;
24 facs->global_lock = 0;
25 facs->flags = 0;
26 facs->x_firmware_waking_vector_l = 0;
27 facs->x_firmware_waking_vector_h = 0;
28 facs->version = 1;
29
30 ctx->facs = facs;
31 acpi_inc(ctx, sizeof(struct acpi_facs));
32
33 return 0;
34}
35ACPI_WRITER(1facs, "FACS", acpi_write_facs, 0);