Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 3 | * |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * 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. |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 17 | /* __PRE_RAM__ means: use "unsigned" for device, not a struct. */ |
Stefan Reinauer | 5e32823 | 2010-03-29 19:19:16 +0000 | [diff] [blame] | 18 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 19 | #include <stdint.h> |
| 20 | #include <string.h> |
| 21 | #include <arch/io.h> |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 22 | #include <device/pci_def.h> |
| 23 | #include <device/pnp_def.h> |
| 24 | #include <cpu/x86/lapic.h> |
Patrick Georgi | d083595 | 2010-10-05 09:07:10 +0000 | [diff] [blame] | 25 | #include <lib.h> |
Kyösti Mälkki | 12d681b | 2014-06-14 18:51:34 +0300 | [diff] [blame] | 26 | #include <arch/acpi.h> |
Kyösti Mälkki | a7c9611 | 2013-10-13 20:41:57 +0300 | [diff] [blame] | 27 | #include <cbmem.h> |
Edwin Beasant | eb50c7d | 2010-07-06 21:05:04 +0000 | [diff] [blame] | 28 | #include <pc80/mc146818rtc.h> |
Stefan Reinauer | 8a7d34b | 2010-02-22 09:15:13 +0000 | [diff] [blame] | 29 | #include <console/console.h> |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 30 | #include <cpu/x86/bist.h> |
Kyösti Mälkki | 15fa992 | 2016-06-17 10:00:28 +0300 | [diff] [blame] | 31 | #include <cpu/intel/romstage.h> |
Patrick Georgi | 546953c | 2014-11-29 10:38:17 +0100 | [diff] [blame] | 32 | #include <halt.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 33 | #include <northbridge/intel/i945/i945.h> |
| 34 | #include <northbridge/intel/i945/raminit.h> |
| 35 | #include <southbridge/intel/i82801gx/i82801gx.h> |
Patrick Georgi | a470019 | 2011-01-27 07:39:38 +0000 | [diff] [blame] | 36 | #include "option_table.h" |
Patrick Georgi | d083595 | 2010-10-05 09:07:10 +0000 | [diff] [blame] | 37 | |
Patrick Georgi | d083595 | 2010-10-05 09:07:10 +0000 | [diff] [blame] | 38 | void setup_ich7_gpios(void) |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 39 | { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 40 | printk(BIOS_DEBUG, " GPIOS..."); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 41 | /* General Registers */ |
| 42 | outl(0xbfc0f7c0, DEFAULT_GPIOBASE + 0x00); /* GPIO_USE_SEL */ |
| 43 | outl(0x70a87d83, DEFAULT_GPIOBASE + 0x04); /* GP_IO_SEL */ |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 44 | /* ------------------------------------------------------------ |
| 45 | * 0 - GPO6 - Enable power of SATA channel 0 |
| 46 | * 0 - GPO9 - Wireless LAN power on |
| 47 | * 0 - GPO15 - FAN on |
| 48 | * 1 - GPO22 - FWH WP |
| 49 | * 1 - GPO24 - GPS on |
| 50 | * 0 - GPO25 - External Antenna Mux on |
| 51 | * 0 - GPO26 - BT on |
| 52 | * 0 - GPO27 - GSM on |
| 53 | */ |
Patrick Georgi | ef32965 | 2011-01-14 07:41:42 +0000 | [diff] [blame] | 54 | outl(0x01400000, DEFAULT_GPIOBASE + 0x0c); /* GP_LVL */ |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 55 | /* ------------------------------------------------------------ */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 56 | /* Output Control Registers */ |
| 57 | outl(0x00000000, DEFAULT_GPIOBASE + 0x18); /* GPO_BLINK */ |
| 58 | /* Input Control Registers */ |
| 59 | outl(0x00002180, DEFAULT_GPIOBASE + 0x2c); /* GPI_INV */ |
| 60 | outl(0x000100e8, DEFAULT_GPIOBASE + 0x30); /* GPIO_USE_SEL2 */ |
| 61 | outl(0x00000030, DEFAULT_GPIOBASE + 0x34); /* GP_IO_SEL2 */ |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 62 | /* ------------------------------------------------------------ */ |
| 63 | /* 1 - GPO48 - FWH TBL# */ |
Patrick Georgi | ef32965 | 2011-01-14 07:41:42 +0000 | [diff] [blame] | 64 | outl(0x00010000, DEFAULT_GPIOBASE + 0x38); /* GP_LVL */ |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 65 | /* ------------------------------------------------------------ */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 66 | } |
| 67 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 68 | static void ich7_enable_lpc(void) |
| 69 | { |
Patrick Georgi | a470019 | 2011-01-27 07:39:38 +0000 | [diff] [blame] | 70 | int lpt_en = 0; |
Patrick Georgi | b251753 | 2011-05-10 21:53:13 +0000 | [diff] [blame] | 71 | if (read_option(lpt, 0) != 0) { |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 72 | lpt_en = 1 << 2; /* enable LPT */ |
Patrick Georgi | a470019 | 2011-01-27 07:39:38 +0000 | [diff] [blame] | 73 | } |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 74 | /* Enable Serial IRQ */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 75 | pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x64, 0xd0); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 76 | /* decode range */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 77 | pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0007); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 78 | /* decode range */ |
Patrick Georgi | a470019 | 2011-01-27 07:39:38 +0000 | [diff] [blame] | 79 | pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3f0b | lpt_en); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 80 | /* Enable 0x02e0 */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 81 | pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x84, 0x02e1); |
| 82 | pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x86, 0x001c); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 83 | /* COM3 decode */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 84 | pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x88, 0x00fc0601); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 85 | /* COM4 decode */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 86 | pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x8c, 0x00040069); |
| 87 | } |
| 88 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 89 | /* This box has two superios, so enabling serial becomes slightly excessive. |
| 90 | * We disable a lot of stuff to make sure that there are no conflicts between |
| 91 | * the two. Also set up the GPIOs from the beginning. This is the "no schematic |
| 92 | * but safe anyways" method. |
| 93 | */ |
| 94 | static inline void pnp_enter_ext_func_mode(device_t dev) |
| 95 | { |
| 96 | unsigned int port = dev >> 8; |
| 97 | outb(0x55, port); |
| 98 | } |
| 99 | |
| 100 | static void pnp_exit_ext_func_mode(device_t dev) |
| 101 | { |
| 102 | unsigned int port = dev >> 8; |
| 103 | outb(0xaa, port); |
| 104 | } |
| 105 | |
| 106 | static void pnp_write_register(device_t dev, int reg, int val) |
| 107 | { |
| 108 | unsigned int port = dev >> 8; |
| 109 | outb(reg, port); |
| 110 | outb(val, port+1); |
| 111 | } |
| 112 | |
| 113 | static void early_superio_config(void) |
| 114 | { |
| 115 | device_t dev; |
| 116 | |
Elyes HAOUAS | a5aad2e | 2016-09-19 09:47:16 -0600 | [diff] [blame] | 117 | dev = PNP_DEV(0x2e, 0x00); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 118 | |
| 119 | pnp_enter_ext_func_mode(dev); |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 120 | pnp_write_register(dev, 0x01, 0x94); /* Extended Parport modes */ |
| 121 | pnp_write_register(dev, 0x02, 0x88); /* UART power on */ |
| 122 | pnp_write_register(dev, 0x03, 0x72); /* Floppy */ |
| 123 | pnp_write_register(dev, 0x04, 0x01); /* EPP + SPP */ |
| 124 | pnp_write_register(dev, 0x14, 0x03); /* Floppy */ |
| 125 | pnp_write_register(dev, 0x20, (0x3f0 >> 2)); /* Floppy */ |
| 126 | pnp_write_register(dev, 0x23, (0x378 >> 2)); /* PP base */ |
| 127 | pnp_write_register(dev, 0x24, (0x3f8 >> 2)); /* UART1 base */ |
| 128 | pnp_write_register(dev, 0x25, (0x2f8 >> 2)); /* UART2 base */ |
| 129 | pnp_write_register(dev, 0x26, (2 << 4) | 0); /* FDC + PP DMA */ |
| 130 | pnp_write_register(dev, 0x27, (6 << 4) | 7); /* FDC + PP DMA */ |
| 131 | pnp_write_register(dev, 0x28, (4 << 4) | 3); /* UART1,2 IRQ */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 132 | /* These are the SMI status registers in the SIO: */ |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 133 | pnp_write_register(dev, 0x30, (0x600 >> 4)); /* Runtime Register Block Base */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 134 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 135 | pnp_write_register(dev, 0x31, 0x00); /* GPIO1 DIR */ |
| 136 | pnp_write_register(dev, 0x32, 0x00); /* GPIO1 POL */ |
| 137 | pnp_write_register(dev, 0x33, 0x40); /* GPIO2 DIR */ |
| 138 | pnp_write_register(dev, 0x34, 0x00); /* GPIO2 POL */ |
| 139 | pnp_write_register(dev, 0x35, 0xff); /* GPIO3 DIR */ |
| 140 | pnp_write_register(dev, 0x36, 0x00); /* GPIO3 POL */ |
| 141 | pnp_write_register(dev, 0x37, 0xe0); /* GPIO4 DIR */ |
| 142 | pnp_write_register(dev, 0x38, 0x00); /* GPIO4 POL */ |
| 143 | pnp_write_register(dev, 0x39, 0x80); /* GPIO4 POL */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 144 | |
| 145 | pnp_exit_ext_func_mode(dev); |
| 146 | } |
| 147 | |
| 148 | static void rcba_config(void) |
| 149 | { |
| 150 | /* Set up virtual channel 0 */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 151 | |
| 152 | /* Device 1f interrupt pin register */ |
| 153 | RCBA32(0x3100) = 0x00042220; |
| 154 | /* Device 1d interrupt pin register */ |
| 155 | RCBA32(0x310c) = 0x00214321; |
| 156 | |
| 157 | /* dev irq route register */ |
| 158 | RCBA16(0x3140) = 0x0232; |
| 159 | RCBA16(0x3142) = 0x3246; |
| 160 | RCBA16(0x3144) = 0x0237; |
| 161 | RCBA16(0x3146) = 0x3201; |
| 162 | RCBA16(0x3148) = 0x3216; |
| 163 | |
| 164 | /* Enable IOAPIC */ |
| 165 | RCBA8(0x31ff) = 0x03; |
| 166 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 167 | /* Disable unused devices */ |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 168 | RCBA32(0x3418) = FD_PCIE6 | FD_PCIE5 | FD_PCIE3 | FD_PCIE2 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 169 | FD_INTLAN | FD_ACMOD | FD_HDAUD | FD_PATA; |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 170 | RCBA32(0x3418) |= (1 << 0); /* Required. */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 171 | |
| 172 | /* This should probably go into the ACPI OS Init trap */ |
| 173 | |
| 174 | /* Set up I/O Trap #0 for 0xfe00 (SMIC) */ |
| 175 | RCBA32(0x1e84) = 0x00020001; |
| 176 | RCBA32(0x1e80) = 0x0000fe01; |
| 177 | |
| 178 | /* Set up I/O Trap #3 for 0x800-0x80c (Trap) */ |
| 179 | RCBA32(0x1e9c) = 0x000200f0; |
| 180 | RCBA32(0x1e98) = 0x000c0801; |
| 181 | } |
| 182 | |
| 183 | static void early_ich7_init(void) |
| 184 | { |
| 185 | uint8_t reg8; |
| 186 | uint32_t reg32; |
| 187 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 188 | /* program secondary mlt XXX byte? */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 189 | pci_write_config8(PCI_DEV(0, 0x1e, 0), 0x1b, 0x20); |
| 190 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 191 | /* reset rtc power status */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 192 | reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xa4); |
| 193 | reg8 &= ~(1 << 2); |
| 194 | pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xa4, reg8); |
| 195 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 196 | /* usb transient disconnect */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 197 | reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xad); |
| 198 | reg8 |= (3 << 0); |
| 199 | pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xad, reg8); |
| 200 | |
| 201 | reg32 = pci_read_config32(PCI_DEV(0, 0x1d, 7), 0xfc); |
| 202 | reg32 |= (1 << 29) | (1 << 17); |
| 203 | pci_write_config32(PCI_DEV(0, 0x1d, 7), 0xfc, reg32); |
| 204 | |
| 205 | reg32 = pci_read_config32(PCI_DEV(0, 0x1d, 7), 0xdc); |
| 206 | reg32 |= (1 << 31) | (1 << 27); |
| 207 | pci_write_config32(PCI_DEV(0, 0x1d, 7), 0xdc, reg32); |
| 208 | |
| 209 | RCBA32(0x0088) = 0x0011d000; |
| 210 | RCBA16(0x01fc) = 0x060f; |
| 211 | RCBA32(0x01f4) = 0x86000040; |
| 212 | RCBA32(0x0214) = 0x10030549; |
| 213 | RCBA32(0x0218) = 0x00020504; |
| 214 | RCBA8(0x0220) = 0xc5; |
| 215 | reg32 = RCBA32(0x3410); |
| 216 | reg32 |= (1 << 6); |
| 217 | RCBA32(0x3410) = reg32; |
| 218 | reg32 = RCBA32(0x3430); |
| 219 | reg32 &= ~(3 << 0); |
| 220 | reg32 |= (1 << 0); |
| 221 | RCBA32(0x3430) = reg32; |
| 222 | RCBA32(0x3418) |= (1 << 0); |
| 223 | RCBA16(0x0200) = 0x2008; |
| 224 | RCBA8(0x2027) = 0x0d; |
| 225 | RCBA16(0x3e08) |= (1 << 7); |
| 226 | RCBA16(0x3e48) |= (1 << 7); |
| 227 | RCBA32(0x3e0e) |= (1 << 7); |
| 228 | RCBA32(0x3e4e) |= (1 << 7); |
| 229 | |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 230 | /* next step only on ich7m b0 and later: */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 231 | reg32 = RCBA32(0x2034); |
| 232 | reg32 &= ~(0x0f << 16); |
| 233 | reg32 |= (5 << 16); |
| 234 | RCBA32(0x2034) = reg32; |
| 235 | } |
| 236 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 237 | static void init_artec_dongle(void) |
| 238 | { |
Elyes HAOUAS | ec16e93 | 2016-10-07 18:22:44 +0200 | [diff] [blame^] | 239 | /* Enable 4MB decoding */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 240 | outb(0xf1, 0x88); |
| 241 | outb(0xf4, 0x88); |
| 242 | } |
| 243 | |
Kyösti Mälkki | 15fa992 | 2016-06-17 10:00:28 +0300 | [diff] [blame] | 244 | void mainboard_romstage_entry(unsigned long bist) |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 245 | { |
Vladimir Serbinenko | 5560188 | 2014-10-15 20:17:51 +0200 | [diff] [blame] | 246 | int s3resume = 0; |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 247 | |
Uwe Hermann | 7b99705 | 2010-11-21 22:47:22 +0000 | [diff] [blame] | 248 | if (bist == 0) |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 249 | enable_lapic(); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 250 | |
Stefan Reinauer | bf264e9 | 2010-05-14 19:09:20 +0000 | [diff] [blame] | 251 | /* Force PCIRST# */ |
| 252 | pci_write_config16(PCI_DEV(0, 0x1e, 0), BCTRL, SBR); |
Stefan Reinauer | bc8613e | 2010-08-25 18:35:42 +0000 | [diff] [blame] | 253 | udelay(200 * 1000); |
| 254 | pci_write_config16(PCI_DEV(0, 0x1e, 0), BCTRL, 0); |
Stefan Reinauer | bf264e9 | 2010-05-14 19:09:20 +0000 | [diff] [blame] | 255 | |
Stefan Reinauer | bc8613e | 2010-08-25 18:35:42 +0000 | [diff] [blame] | 256 | ich7_enable_lpc(); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 257 | early_superio_config(); |
| 258 | |
| 259 | /* Set up the console */ |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 260 | console_init(); |
| 261 | |
| 262 | /* Halt if there was a built in self test failure */ |
| 263 | report_bist_failure(bist); |
| 264 | |
| 265 | if (MCHBAR16(SSKPD) == 0xCAFE) { |
Stefan Reinauer | bf264e9 | 2010-05-14 19:09:20 +0000 | [diff] [blame] | 266 | printk(BIOS_DEBUG, "soft reset detected, rebooting properly\n"); |
| 267 | outb(0x6, 0xcf9); |
Patrick Georgi | 546953c | 2014-11-29 10:38:17 +0100 | [diff] [blame] | 268 | halt(); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | /* Perform some early chipset initialization required |
| 272 | * before RAM initialization can work |
| 273 | */ |
| 274 | i945_early_initialization(); |
| 275 | |
| 276 | /* This has to happen after i945_early_initialization() */ |
| 277 | init_artec_dongle(); |
| 278 | |
Vladimir Serbinenko | 5560188 | 2014-10-15 20:17:51 +0200 | [diff] [blame] | 279 | s3resume = southbridge_detect_s3_resume(); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 280 | |
| 281 | /* Enable SPD ROMs and DDR-II DRAM */ |
| 282 | enable_smbus(); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 283 | |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 284 | #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 8 |
| 285 | dump_spd_registers(); |
| 286 | #endif |
| 287 | |
Vladimir Serbinenko | 5560188 | 2014-10-15 20:17:51 +0200 | [diff] [blame] | 288 | sdram_initialize(s3resume ? 2 : 0, NULL); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 289 | |
| 290 | /* Perform some initialization that must run before stage2 */ |
| 291 | early_ich7_init(); |
| 292 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 293 | /* This should probably go away. Until now it is required |
| 294 | * and mainboard specific |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 295 | */ |
| 296 | rcba_config(); |
| 297 | |
| 298 | /* Chipset Errata! */ |
| 299 | fixup_i945_errata(); |
| 300 | |
| 301 | /* Initialize the internal PCIe links before we go into stage2 */ |
Vladimir Serbinenko | 5560188 | 2014-10-15 20:17:51 +0200 | [diff] [blame] | 302 | i945_late_initialization(s3resume); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 303 | } |