mainboards: align on using ACPI_Sx definitions
[coreboot.git] / src / mainboard / google / samus / romstage.c
blob2306a2942c61d11617bf449b0cb037e7961adb44
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2010 coresystems GmbH
5 * Copyright (C) 2014 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 <arch/acpi.h>
18 #include <cbfs.h>
19 #include <console/console.h>
20 #include <string.h>
21 #include <ec/google/chromeec/ec.h>
22 #include <soc/cpu.h>
23 #include <soc/gpio.h>
24 #include <soc/pei_data.h>
25 #include <soc/pei_wrapper.h>
26 #include <soc/pm.h>
27 #include <soc/romstage.h>
28 #include <mainboard/google/samus/spd/spd.h>
29 #include <mainboard/google/samus/gpio.h>
30 #include <ec/google/chromeec/ec.h>
31 #include "board_version.h"
33 void mainboard_romstage_entry(struct romstage_params *rp)
35 struct pei_data pei_data;
37 post_code(0x31);
39 if (rp->power_state->prev_sleep_state != ACPI_S3)
40 google_chromeec_kbbacklight(100);
42 printk(BIOS_INFO, "MLB: board version %s\n", samus_board_version());
44 /* Ensure the EC and PD are in the right mode for recovery */
45 google_chromeec_early_init();
47 /* Initialize GPIOs */
48 init_gpios(mainboard_gpio_config);
50 /* Fill out PEI DATA */
51 memset(&pei_data, 0, sizeof(pei_data));
52 mainboard_fill_pei_data(&pei_data);
53 mainboard_fill_spd_data(&pei_data);
54 rp->pei_data = &pei_data;
56 /* Initalize memory */
57 romstage_common(rp);
59 /* Bring SSD out of reset */
60 set_gpio(SAMUS_GPIO_SSD_RESET_L, GPIO_OUT_HIGH);
63 * Enable PP3300_AUTOBAHN_EN after initial GPIO setup
64 * to prevent possible brownout.
66 set_gpio(SAMUS_GPIO_PP3300_AUTOBAHN_EN, GPIO_OUT_HIGH);