1 #include <arch/romcc_io.h>
3 static void mch_reset(void)
6 unsigned long value, base;
7 dev = pci_locate_device(PCI_ID(0x8086, 0x24d0), 0);
8 if (dev != PCI_DEV_INVALID) {
9 /* I/O space is always enables */
12 pci_write_config32(dev, 0x58, ICH5_GPIOBASE | 1);
16 value = pci_read_config32(dev, 0x5c);
18 pci_write_config32(dev, 0x5c, value);
20 /* Set GPIO 19 mux to IO usage */
25 /* Pull GPIO 19 low */
26 value = inl(base + 0x0c);
28 outl(value, base + 0x0c);
35 static void mainboard_set_e7520_pll(unsigned bits)
41 /* currently only handle the Jarrell/PC87427 case */
42 dev = PC87427_GPIO_DEV;
45 pnp_set_logical_device(dev);
46 gpio_index = pnp_read_iobase(dev, 0x60);
48 /* select SIO GPIO port 4, pin 2 */
49 pnp_write_config(dev, PC87427_GPSEL, ((pnp_read_config(dev, PC87427_GPSEL) & 0x88) | 0x42));
50 /* set to push-pull, enable output */
51 pnp_write_config(dev, PC87427_GPCFG1, 0x03);
53 /* select SIO GPIO port 4, pin 4 */
54 pnp_write_config(dev, PC87427_GPSEL, ((pnp_read_config(dev, PC87427_GPSEL) & 0x88) | 0x44));
55 /* set to push-pull, enable output */
56 pnp_write_config(dev, PC87427_GPCFG1, 0x03);
58 /* set gpio 42,44 signal levels */
59 data = inb(gpio_index + PC87427_GPDO_4);
60 if ((data & 0x14) == (0xff & (((bits&2)?0:1)<<4 | ((bits&1)?0:1)<<2))) {
61 print_debug("set_pllsel: correct settings detected!\r\n");
62 return; /* settings already configured */
64 outb((data & 0xeb) | ((bits&2)?0:1)<<4 | ((bits&1)?0:1)<<2, gpio_index + PC87427_GPDO_4);
66 print_debug("set_pllsel: settings adjusted, now resetting...\r\n");
67 // hard_reset(); /* should activate a PCI_RST, which should reset MCH, but it doesn't seem to work ???? */
75 static void mainboard_set_e7520_leds(void)
81 /* currently only handle the Jarrell/PC87427 case */
82 dev = PC87427_GPIO_DEV;
84 pnp_set_logical_device(dev);
92 /* Set auto mode for dimm leds and post */
106 /* Turn the leds off */
110 /* Disable the ports */