tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / mainboard / google / peppy / ec.c
blobc011f33d60e4069ef1b1abd0458d1c8aaf1d549e
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2012 Google Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <arch/acpi.h>
17 #include <types.h>
18 #include <console/console.h>
19 #include <ec/google/chromeec/ec.h>
20 #include "ec.h"
22 void mainboard_ec_init(void)
24 printk(BIOS_DEBUG, "mainboard_ec_init\n");
25 post_code(0xf0);
27 /* Restore SCI event mask on resume. */
28 if (acpi_is_wakeup_s3()) {
29 google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
30 MAINBOARD_EC_S3_WAKE_EVENTS);
32 /* Disable SMI and wake events */
33 google_chromeec_set_smi_mask(0);
35 /* Clear pending events */
36 while (google_chromeec_get_event() != 0);
37 google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
38 } else {
39 google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
40 MAINBOARD_EC_S5_WAKE_EVENTS);
43 /* Clear wake events, these are enabled on entry to sleep */
44 google_chromeec_set_wake_mask(0);
46 post_code(0xf1);