blob: d51462244213b1073d885ac414ea16b6802104ed [file] [log] [blame]
Aaron Durbin849e4f52016-01-25 17:02:11 -06001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2016 Google Inc.
5 *
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.
9 *
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.
14 */
15
Subrata Banik50b92582016-07-21 23:47:38 +053016#include <bootblock_common.h>
Aaron Durbin849e4f52016-01-25 17:02:11 -060017#include <ec/google/chromeec/ec.h>
Aaron Durbin849e4f52016-01-25 17:02:11 -060018#include <soc/gpio.h>
19#include "gpio.h"
20
21static void early_config_gpio(void)
22{
23 /* This is a hack for FSP because it does things in MemoryInit()
Subrata Banik50b92582016-07-21 23:47:38 +053024 * which it shouldn't do. We have to prepare certain gpios here
Aaron Durbin849e4f52016-01-25 17:02:11 -060025 * because of the brokenness in FSP. */
26 gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
27}
28
Subrata Banik50b92582016-07-21 23:47:38 +053029void bootblock_mainboard_init(void)
Aaron Durbin849e4f52016-01-25 17:02:11 -060030{
31 /* Ensure the EC and PD are in the right mode for recovery */
32 google_chromeec_early_init();
33
34 early_config_gpio();
35}