mainboards,ec: provide common declaration for mainboard_ec_init()
Add a header file to provide common declarations that the
mainboards can use regarding EC init.
BUG=chrome-os-partner:56677
Change-Id: Iaa0b37eff4de644e969a18364713b90b7f27fa1c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/16734
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins)
diff --git a/src/ec/ec.h b/src/ec/ec.h
new file mode 100644
index 0000000..ea48f5b
--- /dev/null
+++ b/src/ec/ec.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef EC_EC_H
+#define EC_EC_H
+
+#ifndef __ACPI__
+/* Entry point doing any mainboard specific EC initialization. */
+void mainboard_ec_init(void);
+#endif
+
+#endif
diff --git a/src/mainboard/google/auron/ec.h b/src/mainboard/google/auron/ec.h
index 5a98ad6..7290a9a 100644
--- a/src/mainboard/google/auron/ec.h
+++ b/src/mainboard/google/auron/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
@@ -55,8 +56,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/auron_paine/ec.h b/src/mainboard/google/auron_paine/ec.h
index 8b7d4e5..9bfb555 100644
--- a/src/mainboard/google/auron_paine/ec.h
+++ b/src/mainboard/google/auron_paine/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
@@ -54,8 +55,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/chell/ec.h b/src/mainboard/google/chell/ec.h
index 15d8e6d..ba9a450 100644
--- a/src/mainboard/google/chell/ec.h
+++ b/src/mainboard/google/chell/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define MAINBOARD_EC_SCI_EVENTS \
@@ -55,8 +56,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/cyan/ec.h b/src/mainboard/google/cyan/ec.h
index 483434b..4e35ac9 100644
--- a/src/mainboard/google/cyan/ec.h
+++ b/src/mainboard/google/cyan/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
/* GPIO_S0_000 is EC_SCI#, but it is bit 16 in GPE_STS */
@@ -59,8 +60,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/enguarde/ec.h b/src/mainboard/google/enguarde/ec.h
index 19f6090..4a4599c 100644
--- a/src/mainboard/google/enguarde/ec.h
+++ b/src/mainboard/google/enguarde/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
/* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */
@@ -55,8 +56,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/falco/ec.h b/src/mainboard/google/falco/ec.h
index 8de7065..2bd46e3 100644
--- a/src/mainboard/google/falco/ec.h
+++ b/src/mainboard/google/falco/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
@@ -53,8 +54,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/glados/ec.h b/src/mainboard/google/glados/ec.h
index 15d8e6d..ba9a450 100644
--- a/src/mainboard/google/glados/ec.h
+++ b/src/mainboard/google/glados/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define MAINBOARD_EC_SCI_EVENTS \
@@ -55,8 +56,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/lars/ec.h b/src/mainboard/google/lars/ec.h
index 15d8e6d..ba9a450 100644
--- a/src/mainboard/google/lars/ec.h
+++ b/src/mainboard/google/lars/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define MAINBOARD_EC_SCI_EVENTS \
@@ -55,8 +56,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/ninja/ec.h b/src/mainboard/google/ninja/ec.h
index 159351b..92c1318 100644
--- a/src/mainboard/google/ninja/ec.h
+++ b/src/mainboard/google/ninja/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
/* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */
@@ -55,8 +56,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/peppy/ec.h b/src/mainboard/google/peppy/ec.h
index 89630b2..22942ee 100644
--- a/src/mainboard/google/peppy/ec.h
+++ b/src/mainboard/google/peppy/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
@@ -51,8 +52,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/rambi/ec.h b/src/mainboard/google/rambi/ec.h
index 391f2da..6340b69 100644
--- a/src/mainboard/google/rambi/ec.h
+++ b/src/mainboard/google/rambi/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
/* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */
@@ -56,8 +57,4 @@
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/google/reef/bootblock.c b/src/mainboard/google/reef/bootblock.c
index da66009..57d20d9 100644
--- a/src/mainboard/google/reef/bootblock.c
+++ b/src/mainboard/google/reef/bootblock.c
@@ -15,12 +15,11 @@
#include <baseboard/variants.h>
#include <bootblock_common.h>
+#include <ec/ec.h>
#include <soc/lpc.h>
#include <soc/gpio.h>
#include <variant/ec.h>
-void mainboard_ec_init(void);
-
void bootblock_mainboard_init(void)
{
const struct pad_config *pads;
diff --git a/src/mainboard/google/reef/ec.c b/src/mainboard/google/reef/ec.c
index e1832fd..646216b 100644
--- a/src/mainboard/google/reef/ec.c
+++ b/src/mainboard/google/reef/ec.c
@@ -15,13 +15,12 @@
#include <arch/acpi.h>
#include <console/console.h>
+#include <ec/ec.h>
#include <ec/google/chromeec/ec.h>
#include <rules.h>
#include <soc/lpc.h>
#include <variant/ec.h>
-void mainboard_ec_init(void);
-
static void ramstage_ec_init(void)
{
printk(BIOS_ERR, "mainboard: EC init\n");
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index 016c9ac..3f23a77 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -18,6 +18,7 @@
#include <boardid.h>
#include <console/console.h>
#include <device/device.h>
+#include <ec/ec.h>
#include <nhlt.h>
#include <soc/gpio.h>
#include <soc/nhlt.h>
@@ -25,8 +26,6 @@
#include <variant/ec.h>
#include <variant/gpio.h>
-void mainboard_ec_init(void);
-
static void mainboard_init(void *chip_info)
{
int boardid;
diff --git a/src/mainboard/google/samus/ec.h b/src/mainboard/google/samus/ec.h
index c53aa4b..bfcdfb3 100644
--- a/src/mainboard/google/samus/ec.h
+++ b/src/mainboard/google/samus/ec.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
@@ -57,8 +58,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/intel/kunimitsu/ec.h b/src/mainboard/intel/kunimitsu/ec.h
index 15d8e6d..ba9a450 100644
--- a/src/mainboard/intel/kunimitsu/ec.h
+++ b/src/mainboard/intel/kunimitsu/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#define MAINBOARD_EC_SCI_EVENTS \
@@ -55,8 +56,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif
diff --git a/src/mainboard/intel/strago/ec.h b/src/mainboard/intel/strago/ec.h
index 483434b..4e35ac9 100644
--- a/src/mainboard/intel/strago/ec.h
+++ b/src/mainboard/intel/strago/ec.h
@@ -17,6 +17,7 @@
#ifndef MAINBOARD_EC_H
#define MAINBOARD_EC_H
+#include <ec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
/* GPIO_S0_000 is EC_SCI#, but it is bit 16 in GPE_STS */
@@ -59,8 +60,4 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)|\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
-#ifndef __ACPI__
-extern void mainboard_ec_init(void);
-#endif
-
#endif