summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/mtlrvp/chromeos.c
diff options
context:
space:
mode:
authorHarsha B R <harsha.b.r@intel.com>2022-12-13 13:53:45 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-12-21 11:57:53 +0000
commit500da54891a2f6822a5b41290c565ad648a67a7d (patch)
tree8186fffc6efeb29349fcd0a8c05ab0bd1656c10d /src/mainboard/intel/mtlrvp/chromeos.c
parent1e638ba27ca3ef6d9ddf204af036744ab90873df (diff)
mb/intel/mtlrvp: Enable ChromeOS build for mtlrvp
This patch enables building ChromeOS for mtlrvp. Patch includes, 1. Add cros_gpios for mtlrvp 2. Add chrome OS configuration in Kconfig 3. Add Chromeos.c BUG=b:224325352 TEST=Able to build with the patch and boot the mtlrvp platform with the subsequent patches in the train (CB: 69886) Signed-off-by: Harsha B R <harsha.b.r@intel.com> Change-Id: Ia428941bd8269714c3edca6c7b0c2a3fbf08bd75 Signed-off-by: Jamie Ryu <jamie.m.ryu@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70724 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Usha P <usha.p@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/intel/mtlrvp/chromeos.c')
-rw-r--r--src/mainboard/intel/mtlrvp/chromeos.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mainboard/intel/mtlrvp/chromeos.c b/src/mainboard/intel/mtlrvp/chromeos.c
new file mode 100644
index 0000000000..bb6df26c45
--- /dev/null
+++ b/src/mainboard/intel/mtlrvp/chromeos.c
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/gpio.h>
+#include <bootmode.h>
+#include <boot/coreboot_tables.h>
+#include <gpio.h>
+#include <types.h>
+
+void fill_lb_gpios(struct lb_gpios *gpios)
+{
+ struct lb_gpio chromeos_gpios[] = {
+ {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
+ {-1, ACTIVE_HIGH, 0, "power"},
+ {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
+ {-1, ACTIVE_HIGH, 0, "EC in RW"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
+}
+
+#if !CONFIG(EC_GOOGLE_CHROMEEC_SWITCHES)
+int get_lid_switch(void)
+{
+ /* Lid always open */
+ return 1;
+}
+
+int get_recovery_mode_switch(void)
+{
+ return 0;
+}
+#endif /*!CONFIG(EC_GOOGLE_CHROMEEC_SWITCHES) */
+
+int get_write_protect_state(void)
+{
+ /* No write protect */
+ return 0;
+}