blob: 9b921c54a76e5f1691fd1599b744033b94e8edda [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008-2009 coresystems GmbH
5 * Copyright (C) 2011 Google Inc
Lee Leahy32471722015-04-20 15:20:28 -07006 * Copyright (C) 2015 Intel Corp.
Lee Leahy77ff0b12015-05-05 15:07:29 -07007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Lee Leahy77ff0b12015-05-05 15:07:29 -070016 */
17
Lee Leahy32471722015-04-20 15:20:28 -070018#ifndef _SOC_NVS_H_
19#define _SOC_NVS_H_
Lee Leahy77ff0b12015-05-05 15:07:29 -070020
Jonathan Neuschäfer0781cbe2017-10-30 17:20:18 +010021#include <commonlib/helpers.h>
Stefan Reinauer6a001132017-07-13 02:20:27 +020022#include <compiler.h>
Jonathan Neuschäfer0781cbe2017-10-30 17:20:18 +010023#include <rules.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070024#include <soc/device_nvs.h>
Jonathan Neuschäfer0781cbe2017-10-30 17:20:18 +010025#include <vendorcode/google/chromeos/gnvs.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070026
Jonathan Neuschäfer0781cbe2017-10-30 17:20:18 +010027typedef struct global_nvs_t {
Lee Leahy77ff0b12015-05-05 15:07:29 -070028 /* Miscellaneous */
29 u16 osys; /* 0x00 - Operating System */
30 u8 smif; /* 0x02 - SMI function call ("TRAP") */
31 u8 prm0; /* 0x03 - SMI function call parameter */
32 u8 prm1; /* 0x04 - SMI function call parameter */
33 u8 scif; /* 0x05 - SCI function call (via _L00) */
34 u8 prm2; /* 0x06 - SCI function call parameter */
35 u8 prm3; /* 0x07 - SCI function call parameter */
36 u8 lckf; /* 0x08 - Global Lock function for EC */
37 u8 prm4; /* 0x09 - Lock function parameter */
38 u8 prm5; /* 0x0a - Lock function parameter */
39 u32 p80d; /* 0x0b - Debug port (IO 0x80) value */
40 u8 lids; /* 0x0f - LID state (open = 1) */
41 u8 pwrs; /* 0x10 - Power state (AC = 1) */
Lee Leahy32471722015-04-20 15:20:28 -070042 u8 pcnt; /* 0x11 - Processor Count */
Lee Leahy77ff0b12015-05-05 15:07:29 -070043 u8 tpmp; /* 0x12 - TPM Present and Enabled */
44 u8 tlvl; /* 0x13 - Throttle Level */
45 u8 ppcm; /* 0x14 - Maximum P-state usable by OS */
46 u32 pm1i; /* 0x15 - System Wake Source - PM1 Index */
Duncan Lauriee73da802015-09-08 16:16:34 -070047 u32 gpei; /* 0x19 - GPE Wake Source */
48 u8 bdid; /* 0x1d - Board ID */
Felix Durairaj15184e02015-11-23 14:07:40 -080049 u16 cid1; /* 0x1a - Wifi Country Identifier */
Lee Leahy77ff0b12015-05-05 15:07:29 -070050
51 /* Device Config */
52 u8 s5u0; /* 0x20 - Enable USB0 in S5 */
53 u8 s5u1; /* 0x21 - Enable USB1 in S5 */
54 u8 s3u0; /* 0x22 - Enable USB0 in S3 */
55 u8 s3u1; /* 0x23 - Enable USB1 in S3 */
56 u8 tact; /* 0x24 - Thermal Active trip point */
57 u8 tpsv; /* 0x25 - Thermal Passive trip point */
58 u8 tcrt; /* 0x26 - Thermal Critical trip point */
59 u8 dpte; /* 0x27 - Enable DPTF */
60 u8 rsvd2[8];
61
62 /* Base Addresses */
Lee Leahy32471722015-04-20 15:20:28 -070063 u32 cmem; /* 0x30 - CBMEM TOC */
Lee Leahy77ff0b12015-05-05 15:07:29 -070064 u32 tolm; /* 0x34 - Top of Low Memory */
65 u32 cbmc; /* 0x38 - coreboot memconsole */
66 u8 rsvd3[196];
67
Lee Leahy32471722015-04-20 15:20:28 -070068 /* ChromeOS specific (0x100-0xfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070069 chromeos_acpi_t chromeos;
70
Lee Leahy32471722015-04-20 15:20:28 -070071 /* LPSS (0x1000) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070072 device_nvs_t dev;
Stefan Reinauer6a001132017-07-13 02:20:27 +020073} __packed global_nvs_t;
Jonathan Neuschäfer0781cbe2017-10-30 17:20:18 +010074check_member(global_nvs_t, chromeos, 0x100);
Lee Leahy77ff0b12015-05-05 15:07:29 -070075
Lee Leahy32471722015-04-20 15:20:28 -070076void acpi_create_gnvs(global_nvs_t *gnvs);
Lee Leahyacb9c0b2015-07-02 11:55:18 -070077#if ENV_SMM
Lee Leahy77ff0b12015-05-05 15:07:29 -070078/* Used in SMM to find the ACPI GNVS address */
79global_nvs_t *smm_get_gnvs(void);
80#endif
81
Lee Leahy32471722015-04-20 15:20:28 -070082#endif /* _SOC_NVS_H_ */