aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/t530/romstage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/lenovo/t530/romstage.c')
-rw-r--r--src/mainboard/lenovo/t530/romstage.c116
1 files changed, 20 insertions, 96 deletions
diff --git a/src/mainboard/lenovo/t530/romstage.c b/src/mainboard/lenovo/t530/romstage.c
index ad2ae644d9..115f83bdbc 100644
--- a/src/mainboard/lenovo/t530/romstage.c
+++ b/src/mainboard/lenovo/t530/romstage.c
@@ -20,30 +20,14 @@
*/
#include <stdint.h>
-#include <string.h>
-#include <lib.h>
-#include <timestamp.h>
#include <arch/byteorder.h>
#include <arch/io.h>
#include <device/pci_def.h>
-#include <device/pnp_def.h>
-#include <cpu/x86/lapic.h>
-#include <pc80/mc146818rtc.h>
-#include <arch/acpi.h>
-#include <cbmem.h>
#include <console/console.h>
-#include "northbridge/intel/sandybridge/sandybridge.h"
#include "northbridge/intel/sandybridge/raminit_native.h"
#include "southbridge/intel/bd82x6x/pch.h"
-#include "southbridge/intel/bd82x6x/gpio.h"
-#include <arch/cpu.h>
-#include <cpu/x86/bist.h>
-#include <cpu/x86/msr.h>
-#include "gpio.h"
-#include <cbfs.h>
-#include <cpu/intel/romstage.h>
-static void pch_enable_lpc(void)
+void pch_enable_lpc(void)
{
/* X230 EC Decode Range Port60/64, Port62/66 */
/* Enable EC, PS/2 Keyboard/Mouse */
@@ -61,7 +45,7 @@ static void pch_enable_lpc(void)
0x80010000);
}
-static void rcba_config(void)
+void rcba_config(void)
{
/*
* GFX INTA -> PIRQA (MSI)
@@ -110,84 +94,24 @@ static void rcba_config(void)
RCBA32(BUC) = 0;
}
-void main(unsigned long bist)
-{
- int s3resume = 0;
- spd_raw_data spd[4];
-
- if (MCHBAR16(SSKPD) == 0xCAFE) {
- outb(0x6, 0xcf9);
- hlt ();
- }
-
- timestamp_init(get_initial_timestamp());
- timestamp_add_now(TS_START_ROMSTAGE);
-
- if (bist == 0)
- enable_lapic();
-
- pch_enable_lpc();
-
- /* Enable GPIOs */
- pci_write_config32(PCH_LPC_DEV, GPIO_BASE, DEFAULT_GPIOBASE|1);
- pci_write_config8(PCH_LPC_DEV, GPIO_CNTL, 0x10);
-
- setup_pch_gpios(&t530_gpio_map);
-
- early_usb_init((struct southbridge_usb_port []) {
- { 1, 1, 0 },
- { 1, 1, 1 },
- { 1, 2, 3 },
- { 1, 1, -1 },
- { 1, 1, -1 },
- { 1, 0, -1 },
- { 0, 0, -1 },
- { 1, 2, -1 },
- { 1, 0, -1 },
- { 1, 1, 5 },
- { 1, 0, -1 },
- { 1, 0, -1 },
- { 1, 3, -1 },
- { 1, 1, -1 },
- });
-
- /* Initialize console device(s) */
- console_init();
-
- /* Halt if there was a built in self test failure */
- report_bist_failure(bist);
-
- /* Perform some early chipset initialization required
- * before RAM initialization can work
- */
- sandybridge_early_initialization(SANDYBRIDGE_MOBILE);
- printk(BIOS_DEBUG, "Back from sandybridge_early_initialization()\n");
-
- s3resume = southbridge_detect_s3_resume();
-
- post_code(0x38);
- /* Enable SPD ROMs and DDR-III DRAM */
- enable_smbus();
-
- post_code(0x39);
-
- post_code(0x3a);
- timestamp_add_now(TS_BEFORE_INITRAM);
-
- memset (spd, 0, sizeof (spd));
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 1, 0 },
+ { 1, 1, 1 },
+ { 1, 2, 3 },
+ { 1, 1, -1 },
+ { 1, 1, -1 },
+ { 1, 0, -1 },
+ { 0, 0, -1 },
+ { 1, 2, -1 },
+ { 1, 0, -1 },
+ { 1, 1, 5 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 3, -1 },
+ { 1, 1, -1 },
+};
+
+void mainboard_get_spd(spd_raw_data *spd) {
read_spd (&spd[0], 0x50);
read_spd (&spd[2], 0x51);
-
- init_dram_ddr3 (spd, 1, TCK_800MHZ, s3resume);
-
- timestamp_add_now(TS_AFTER_INITRAM);
- post_code(0x3c);
-
- rcba_config();
- post_code(0x3d);
-
- northbridge_romstage_finalize(s3resume);
-
- post_code(0x3f);
- timestamp_add_now(TS_END_ROMSTAGE);
}