static void setup_pm(device_t dev)
{
u16 tmp;
+ struct southbridge_via_vt8237r_config *cfg;
+
+ cfg = dev->chip_info;
+
/* Debounce LID and PWRBTN# Inputs for 16ms. */
pci_write_config8(dev, 0x80, 0x20);
* 5 = Internal PLL reset from susp disabled
* 2 = GPO2 is SUSA#
*/
- pci_write_config8(dev, 0x94, 0xa0);
+ tmp = 0xa0;
+ if (cfg && cfg->enable_gpo3)
+ tmp |= 0x10;
+ pci_write_config8(dev, 0x94, tmp);
/*
* 7 = stp to sust delay 1msec
#if CONFIG_EPIA_VT8237R_INIT
pci_write_config8(dev, 0x95, 0xc2);
#else
- pci_write_config8(dev, 0x95, 0xcc);
+ tmp = 0xcc;
+ if (cfg) {
+ if (cfg->disable_gpo26_gpo27)
+ tmp &= ~0x08;
+ if (cfg->enable_aol_2_smb_slave)
+ tmp &= ~0x04;
+ }
+ pci_write_config8(dev, 0x95, tmp);
#endif
/* Disable GP3 timer. */
static void vt8237r_init(struct device *dev)
{
u8 enables;
+ struct southbridge_via_vt8237r_config *cfg;
+
+ cfg = dev->chip_info;
#if CONFIG_EPIA_VT8237R_INIT
printk(BIOS_SPEW, "Entering vt8237r_init, for EPIA.\n");
*/
pci_write_config8(dev, 0xe5, 0x09);
+ enables = 0x4;
+ if (cfg) {
+ if (cfg->enable_gpo5)
+ enables |= 0x01;
+ if (cfg->gpio15_12_dir_output)
+ enables |= 0x10;
+ }
/* REQ5 as PCI request input - should be together with INTE-INTH. */
- pci_write_config8(dev, 0xe4, 0x4);
+ pci_write_config8(dev, 0xe4, enables);
#endif
/* Set bit 3 of 0x4f (use INIT# as CPU reset). */
pci_write_config8(dev, 0x48, 0x0c);
#else
- #if CONFIG_SOUTHBRIDGE_VIA_K8T800 || CONFIG_SOUTHBRIDGE_VIA_K8T800_OLD
+ #if CONFIG_SOUTHBRIDGE_VIA_SUBTYPE_K8T800 || CONFIG_SOUTHBRIDGE_VIA_SUBTYPE_K8T800_OLD
/* It seems that when we pair with the K8T800, we need to disable
* the A2 mask
*/
init_keyboard(dev);
}
+
+static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ pci_write_config16(dev, 0x70, vendor);
+ pci_write_config16(dev, 0x72, device);
+}
+
+static struct pci_operations lops_pci = {
+ .set_subsystem = vt8237_set_subsystem,
+};
+
static const struct device_operations vt8237r_lpc_ops_s = {
.read_resources = vt8237r_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = vt8237s_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct device_operations vt8237r_lpc_ops_r = {
.enable_resources = pci_dev_enable_resources,
.init = vt8237r_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct device_operations vt8237r_lpc_ops_a = {
.enable_resources = pci_dev_enable_resources,
.init = vt8237a_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver_r __pci_driver = {