Patrick Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 1 | /* |
| 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 Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
Kyösti Mälkki | 1de3264 | 2018-06-21 17:23:19 +0300 | [diff] [blame] | 17 | #include <bootmode.h> |
Patrick Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 18 | #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 DeVillier | 0148fcb | 2016-12-17 17:13:23 -0600 | [diff] [blame] | 28 | #include <variant/gpio.h> |
| 29 | #include "onboard.h" |
Patrick Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 30 | |
Patrick Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 31 | |
| 32 | void 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 Werner | b04cc6b | 2017-03-17 14:14:14 -0700 | [diff] [blame] | 49 | |
| 50 | if (IS_ENABLED(CONFIG_CHROMEOS)) |
Kyösti Mälkki | 1de3264 | 2018-06-21 17:23:19 +0300 | [diff] [blame] | 51 | init_bootmode_straps(); |
Patrick Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | void mainboard_pre_console_init(void) |
| 55 | { |
| 56 | /* Early SuperIO setup */ |
Elyes HAOUAS | f5f1b38 | 2018-04-26 09:43:03 +0200 | [diff] [blame] | 57 | it8772f_ac_resume_southbridge(IT8772F_SUPERIO_DEV); |
Matt DeVillier | 0148fcb | 2016-12-17 17:13:23 -0600 | [diff] [blame] | 58 | 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 Georgi | 04746fc | 2015-06-05 18:53:43 +0200 | [diff] [blame] | 64 | } |