summaryrefslogtreecommitdiff
path: root/board/cr50/scratch_reg1.h
blob: 31a3b541d7ce9a8fa3ecff93c17fddc2081216d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
 * Copyright 2016 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef __EC_BOARD_CR50_SCRATCH_REG1_H
#define __EC_BOARD_CR50_SCRATCH_REG1_H

/*
 * Bit assignments of the LONG_LIFE_SCRATCH1 register. This register survives
 * all kinds of resets, it is cleared only on the Power ON event.
 */
#define BOARD_PERIPH_CONFIG_SPI       BIT(0)   /* TPM uses SPI interface */
#define BOARD_PERIPH_CONFIG_I2C       BIT(1)   /* TPM uses I2C interface */

/*
 * The gaps are left to ensure backwards compatibility with the earliest cr50
 * code releases. It will be possible to safely reuse these gaps if and when the
 * rest of the bits are taken.
 */

/* TODO(crosbug.com/p/56945): Remove when sys_rst_l has an external pullup */
#define BOARD_NEEDS_SYS_RST_PULL_UP  BIT(5)   /* Add a pullup to sys_rst_l */
#define BOARD_USE_PLT_RESET          BIT(6)   /* Use plt_rst_l instead of */
						/* sys_rst_l to monitor the */
						/* system resets */

/* Bits to store write protect bit state across deep sleep and resets. */
#define BOARD_WP_ASSERTED            BIT(8)
#define BOARD_FORCING_WP             BIT(9)

/*
 * Bit to signal to compatible RO to suppress its uart output.
 * Helps to reduce time to resume from deep sleep.
 */
#define BOARD_NO_RO_UART             BIT(10)

/*
 * Bits to store current case-closed debug state across deep sleep.
 *
 * DO NOT examine these bits to determine the current CCD state.  Call methods
 * from case_closed_debug.h instead.
 */
#define BOARD_CCD_SHIFT              11
#define BOARD_CCD_STATE              (3 << BOARD_CCD_SHIFT)

/* Prevent Cr50 from entering deep sleep when the AP is off */
#define BOARD_DEEP_SLEEP_DISABLED    BIT(13)
/* Use Cr50_RX_AP_TX to determine if the AP is off or on */
#define BOARD_DETECT_AP_WITH_UART    BIT(14)

/* ITE EC sync sequence generation after reset is required. */
#define BOARD_ITE_EC_SYNC_NEEDED     BIT(15)

/*
 * Enable delayed write protect disable for systems that can be opened
 * in less than 2 minutes
 */
#define BOARD_WP_DISABLE_DELAY       BIT(16)
/*
 * Enable custom options required for the closed source EC on the
 * Sarien/Arcada boards.  Includes the following behavior
 *    Enable factory mode to closed-source EC via GPIO
 *    Support customer diagnostic mode
 *    UEFI factory mode
 *    EC extended reset
 *    Power+Refresh recovery mode (instead of Power+Refresh+Esc)
 */
#define BOARD_CLOSED_SOURCE_SET1     BIT(17)

/*
 * Wait until PLT_RST_L is asserted before deasserting reset.
 */
#define BOARD_CLOSED_LOOP_RESET      BIT(18)

/*
 * The board uses INA pins as GPIOs, so it can't support reading inas using usb
 * i2c.
 */
#define BOARD_NO_INA_SUPPORT             BIT(19)

/*
 ****** Bit20 unused. DON'T FORGET TO INCLUDE IT INTO BOARD_ALL_PROPERTIES
 ****** WHEN IT GETS A NEW USE.
 */

/*
 * The board supports EC-CR50 communication.
 */
#define BOARD_EC_CR50_COMM_SUPPORT        BIT(21)

/*
 * Bits to store which pin is used for the ccd recovery switch/lid open signal.
 */
#define BOARD_CCD_REC_LID_PIN_SHIFT       22
#define BOARD_CCD_REC_LID_PIN_MASK        (3 << BOARD_CCD_REC_LID_PIN_SHIFT)
#define BOARD_CCD_REC_LID_PIN_DIOA1       (1 << BOARD_CCD_REC_LID_PIN_SHIFT)
#define BOARD_CCD_REC_LID_PIN_DIOA9       (2 << BOARD_CCD_REC_LID_PIN_SHIFT)
#define BOARD_CCD_REC_LID_PIN_DIOA12      (3 << BOARD_CCD_REC_LID_PIN_SHIFT)

/*
 * The board supports USER_PRES on DIOM4.
 */
#define BOARD_USE_DIOM4                   BIT(24)

/*
 * Indicates successful completion of FIPS power up
 * tests earlier. Reduces wake up time after sleep.
 * Stored in PWRDN_SCRATCH22 and use multiple bits to harden against
 * fault injection.
 */
#define BOARD_FIPS_POWERUP_DONE       0xAA556633

/*
 * Macro to capture all properties related to board strapping pins. This must be
 * updated if additional strap related properties are added.
 */
#define BOARD_ALL_PROPERTIES ( \
	BOARD_CCD_REC_LID_PIN_MASK | \
	BOARD_CLOSED_LOOP_RESET | \
	BOARD_CLOSED_SOURCE_SET1 | \
	BOARD_DEEP_SLEEP_DISABLED | \
	BOARD_DETECT_AP_WITH_UART | \
	BOARD_EC_CR50_COMM_SUPPORT | \
	BOARD_NEEDS_SYS_RST_PULL_UP | \
	BOARD_NO_INA_SUPPORT | \
	BOARD_PERIPH_CONFIG_I2C | \
	BOARD_PERIPH_CONFIG_SPI | \
	BOARD_USE_PLT_RESET | \
	BOARD_USE_DIOM4 | \
	BOARD_WP_DISABLE_DELAY)

#endif  /* ! __EC_BOARD_CR50_SCRATCH_REG1_H */