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)
This commit is contained in:
Aaron Durbin 2016-09-23 16:38:27 -05:00
parent 59cf5028a8
commit 91fa9d7696
18 changed files with 41 additions and 62 deletions

24
src/ec/ec.h Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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");

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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