blob: ef807fc64ada97bd090f601414e89521d71d6988 [file] [log] [blame]
Patrick Georgi04746fc2015-06-05 18:53:43 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2010 coresystems GmbH
5 * Copyright (C) 2014 Google Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Patrick Georgi04746fc2015-06-05 18:53:43 +020015 */
16
Kyösti Mälkki1de32642018-06-21 17:23:19 +030017#include <bootmode.h>
Patrick Georgi04746fc2015-06-05 18:53:43 +020018#include <console/console.h>
19#include <string.h>
20#include <ec/google/chromeec/ec.h>
21#include <soc/gpio.h>
22#include <soc/pei_data.h>
23#include <soc/pei_wrapper.h>
24#include <soc/romstage.h>
25#include <superio/ite/common/ite.h>
26#include <superio/ite/it8772f/it8772f.h>
27#include <mainboard/google/jecht/spd/spd.h>
Matt DeVillier0148fcb2016-12-17 17:13:23 -060028#include <variant/gpio.h>
29#include "onboard.h"
Patrick Georgi04746fc2015-06-05 18:53:43 +020030
Patrick Georgi04746fc2015-06-05 18:53:43 +020031
32void mainboard_romstage_entry(struct romstage_params *rp)
33{
34 struct pei_data pei_data;
35
36 post_code(0x32);
37
38 /* Initialize GPIOs */
39 init_gpios(mainboard_gpio_config);
40
41 /* Fill out PEI DATA */
42 memset(&pei_data, 0, sizeof(pei_data));
43 mainboard_fill_pei_data(&pei_data);
44 mainboard_fill_spd_data(&pei_data);
45 rp->pei_data = &pei_data;
46
47 /* Call into the real romstage main with this board's attributes. */
48 romstage_common(rp);
Julius Wernerb04cc6b2017-03-17 14:14:14 -070049
50 if (IS_ENABLED(CONFIG_CHROMEOS))
Kyösti Mälkki1de32642018-06-21 17:23:19 +030051 init_bootmode_straps();
Patrick Georgi04746fc2015-06-05 18:53:43 +020052}
53
54void mainboard_pre_console_init(void)
55{
56 /* Early SuperIO setup */
Elyes HAOUASf5f1b382018-04-26 09:43:03 +020057 it8772f_ac_resume_southbridge(IT8772F_SUPERIO_DEV);
Matt DeVillier0148fcb2016-12-17 17:13:23 -060058 ite_kill_watchdog(IT8772F_GPIO_DEV);
59 ite_enable_serial(IT8772F_SERIAL_DEV, CONFIG_TTYS0_BASE);
60
61 /* Turn On Power LED */
62 set_power_led(LED_ON);
63
Patrick Georgi04746fc2015-06-05 18:53:43 +020064}