payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / intel / baskingridge / chromeos.c
blobe82edeba045d5cee35f2b5626fdd422634596a4a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootmode.h>
4 #include <boot/coreboot_tables.h>
5 #include <device/device.h>
6 #include <southbridge/intel/lynxpoint/pch.h>
7 #include <southbridge/intel/common/gpio.h>
8 #include <types.h>
9 #include <vendorcode/google/chromeos/chromeos.h>
10 #include "onboard.h"
12 void fill_lb_gpios(struct lb_gpios *gpios)
14 struct lb_gpio chromeos_gpios[] = {
15 /* Recovery: GPIO69 - SV_DETECT - J8E3 (silkscreen: J8E2) */
16 {GPIO_REC_MODE, ACTIVE_HIGH, get_recovery_mode_switch(), "presence"},
18 /* Hard code the lid switch GPIO to open. */
19 {-1, ACTIVE_HIGH, 1, "lid"},
21 /* Power Button */
22 {-1, ACTIVE_HIGH, 0, "power"},
24 /* Did we load the VGA option ROM? */
25 {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
27 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
30 int get_recovery_mode_switch(void)
33 * Recovery: GPIO69, Connected to J8E3, however the silkscreen says
34 * J8E2. The jump is active high.
36 return get_gpio(GPIO_REC_MODE);
39 int get_write_protect_state(void)
41 /* Write protect is active low, so invert it here */
42 return !get_gpio(GPIO_SPI_WP);
45 static const struct cros_gpio cros_gpios[] = {
46 CROS_GPIO_REC_AH(GPIO_REC_MODE, CROS_GPIO_DEVICE_NAME),
47 CROS_GPIO_WP_AL(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
50 DECLARE_CROS_GPIOS(cros_gpios);