| 1 |
|
| 2 |
|
| 3 |
#include <arch/io.h> |
| 4 |
#include <bootblock_common.h> |
| 5 |
#include <console/console.h> |
| 6 |
#include <device/pnp_ops.h> |
| 7 |
#include <device/pci_ops.h> |
| 8 |
#include <gpio.h> |
| 9 |
#include <northbridge/intel/i945/i945.h> |
| 10 |
#include <option.h> |
| 11 |
#include <stdint.h> |
| 12 |
#include <southbridge/intel/i82801gx/i82801gx.h> |
| 13 |
|
| 14 |
void mainboard_pre_raminit_config(int s3_resume) |
| 15 |
{ |
| 16 |
printk(BIOS_SPEW, "\n Initializing drive bay...\n"); |
| 17 |
gpio_set(33, 1); |
| 18 |
gpio_set(34, 1); |
| 19 |
gpio_set(13, 0); |
| 20 |
|
| 21 |
printk(BIOS_SPEW, "\n Initializing Ethernet NIC...\n"); |
| 22 |
gpio_set(24, 0); |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
void mainboard_lpc_decode(void) |
| 27 |
{ |
| 28 |
int lpt_en = 0; |
| 29 |
|
| 30 |
if (get_uint_option("lpt", 0)) |
| 31 |
lpt_en = LPT_LPC_EN; |
| 32 |
|
| 33 |
|
| 34 |
pci_write_config16(PCI_DEV(0, 0x1f, 0), LPC_IO_DEC, 0x0007); |
| 35 |
|
| 36 |
pci_update_config32(PCI_DEV(0, 0x1f, 0), LPC_EN, ~LPT_LPC_EN, lpt_en); |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
static void pnp_enter_ext_func_mode(pnp_devfn_t dev) |
| 45 |
{ |
| 46 |
unsigned int port = dev >> 8; |
| 47 |
outb(0x55, port); |
| 48 |
} |
| 49 |
|
| 50 |
static void pnp_exit_ext_func_mode(pnp_devfn_t dev) |
| 51 |
{ |
| 52 |
unsigned int port = dev >> 8; |
| 53 |
outb(0xaa, port); |
| 54 |
} |
| 55 |
|
| 56 |
void bootblock_mainboard_early_init(void) |
| 57 |
{ |
| 58 |
const pnp_devfn_t dev = PNP_DEV(0x4e, 0x00); |
| 59 |
|
| 60 |
pnp_enter_ext_func_mode(dev); |
| 61 |
pnp_write_config(dev, 0x02, 0x0e); |
| 62 |
pnp_write_config(dev, 0x1b, (0x3e8 >> 2)); |
| 63 |
pnp_write_config(dev, 0x1c, (0x2e8 >> 2)); |
| 64 |
pnp_write_config(dev, 0x1d, (5 << 4) | 11); |
| 65 |
pnp_write_config(dev, 0x1e, 1); |
| 66 |
pnp_write_config(dev, 0x24, (0x3f8 >> 2)); |
| 67 |
pnp_write_config(dev, 0x28, (4 << 4) | 0); |
| 68 |
pnp_write_config(dev, 0x2c, 0); |
| 69 |
pnp_write_config(dev, 0x30, (0x600 >> 4)); |
| 70 |
|
| 71 |
pnp_write_config(dev, 0x31, 0xce); |
| 72 |
pnp_write_config(dev, 0x32, 0x00); |
| 73 |
pnp_write_config(dev, 0x33, 0x0f); |
| 74 |
pnp_write_config(dev, 0x34, 0x00); |
| 75 |
pnp_write_config(dev, 0x35, 0xa8); |
| 76 |
pnp_write_config(dev, 0x36, 0x00); |
| 77 |
pnp_write_config(dev, 0x37, 0xa8); |
| 78 |
pnp_write_config(dev, 0x38, 0x00); |
| 79 |
|
| 80 |
pnp_write_config(dev, 0x39, 0x00); |
| 81 |
pnp_write_config(dev, 0x40, 0x80); |
| 82 |
pnp_write_config(dev, 0x41, 0x00); |
| 83 |
pnp_write_config(dev, 0x42, 0xa8); |
| 84 |
pnp_write_config(dev, 0x43, 0x00); |
| 85 |
pnp_write_config(dev, 0x44, 0x00); |
| 86 |
pnp_write_config(dev, 0x45, 0x50); |
| 87 |
pnp_write_config(dev, 0x46, 0x00); |
| 88 |
|
| 89 |
pnp_write_config(dev, 0x48, 0x55); |
| 90 |
pnp_write_config(dev, 0x49, 0x55); |
| 91 |
pnp_write_config(dev, 0x4a, 0x55); |
| 92 |
pnp_write_config(dev, 0x4b, 0x55); |
| 93 |
pnp_write_config(dev, 0x4c, 0x55); |
| 94 |
pnp_write_config(dev, 0x4d, 0x55); |
| 95 |
|
| 96 |
pnp_exit_ext_func_mode(dev); |
| 97 |
} |
| 98 |
|
| 99 |
void mainboard_late_rcba_config(void) |
| 100 |
{ |
| 101 |
|
| 102 |
RCBA32(D31IP) = 0x00042220; |
| 103 |
|
| 104 |
RCBA32(D28IP) = 0x00214321; |
| 105 |
|
| 106 |
|
| 107 |
RCBA16(D31IR) = 0x0232; |
| 108 |
RCBA16(D30IR) = 0x3246; |
| 109 |
RCBA16(D29IR) = 0x0237; |
| 110 |
RCBA16(D28IR) = 0x3201; |
| 111 |
RCBA16(D27IR) = 0x3216; |
| 112 |
|
| 113 |
|
| 114 |
RCBA32(FD) |= FD_INTLAN; |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
RCBA32(0x1e9c) = 0x000200f0; |
| 120 |
RCBA32(0x1e98) = 0x000c0801; |
| 121 |
} |