mb/asus/p5gc-mx: Add mainboard
[coreboot.git] / src / mainboard / google / rikku / romstage.c
blob5f06ed9f129bce63dc75940a549a53b64880413e
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2010 coresystems GmbH
5 * Copyright (C) 2015 Google Inc.
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.
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.
17 #include <cbfs.h>
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 <mainboard/google/rikku/spd/spd.h>
26 #include <superio/ite/common/ite.h>
27 #include <superio/ite/it8772f/it8772f.h>
28 #include "gpio.h"
29 #include "onboard.h"
31 void mainboard_romstage_entry(struct romstage_params *rp)
33 struct pei_data pei_data;
35 post_code(0x32);
37 /* Initialize GPIOs */
38 init_gpios(mainboard_gpio_config);
40 /* Fill out PEI DATA */
41 memset(&pei_data, 0, sizeof(pei_data));
42 mainboard_fill_pei_data(&pei_data);
43 mainboard_fill_spd_data(&pei_data);
44 rp->pei_data = &pei_data;
46 /* Call into the real romstage main with this board's attributes. */
47 romstage_common(rp);
50 void mainboard_pre_console_init(void)
52 /* Early SuperIO setup */
53 ite_kill_watchdog(IT8772F_GPIO_DEV);
54 it8772f_ac_resume_southbridge(IT8772F_DUMMY_DEV);
55 ite_enable_serial(IT8772F_SERIAL_DEV, CONFIG_TTYS0_BASE);
57 /* Turn On GPIO10.LED */
58 it8772f_gpio_led(IT8772F_GPIO_DEV, 1 /* set */, 0x01 /* select */,
59 0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
60 0x01 /* output */, 0x01 /* 1=Simple IO function */,
61 SIO_GPIO_BLINK_GPIO10, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);