Add subsystem callbacks for VT8237x and VT890 family of chipsets

Change-Id: Id34615f0c229d276d72cdf984cf82ea8cc1a85bb
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/523
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Rudolf Marek 2011-04-22 20:48:21 +02:00 committed by Stefan Reinauer
parent de64b8b6db
commit 0f1dc4eb5b
8 changed files with 69 additions and 12 deletions

View File

@ -181,12 +181,16 @@ static void ctrl_init(struct device *dev)
} }
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static const struct device_operations ctrl_ops = { static const struct device_operations ctrl_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = ctrl_init, .init = ctrl_init,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_t800 __pci_driver = { static const struct pci_driver northbridge_driver_t800 __pci_driver = {

View File

@ -153,12 +153,16 @@ static void dram_init_fb(struct device *dev)
#endif #endif
} }
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static const struct device_operations dram_ops_t = { static const struct device_operations dram_ops_t = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = dram_enable, .enable = dram_enable,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct device_operations dram_ops_m = { static const struct device_operations dram_ops_m = {
@ -167,7 +171,7 @@ static const struct device_operations dram_ops_m = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = dram_enable_k8m890, .enable = dram_enable_k8m890,
.init = dram_init_fb, .init = dram_init_fb,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_t800 __pci_driver = { static const struct pci_driver northbridge_driver_t800 __pci_driver = {

View File

@ -41,12 +41,16 @@ static void error_enable(struct device *dev)
dump_south(dev); dump_south(dev);
} }
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static const struct device_operations error_ops = { static const struct device_operations error_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = error_enable, .enable = error_enable,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_t800 __pci_driver = { static const struct pci_driver northbridge_driver_t800 __pci_driver = {

View File

@ -95,12 +95,16 @@ static const struct device_operations host_ops_old = {
.ops_pci = 0, .ops_pci = 0,
}; };
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static const struct device_operations host_ops_t = { static const struct device_operations host_ops_t = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = host_enable, .enable = host_enable,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct device_operations host_ops_m = { static const struct device_operations host_ops_m = {
@ -109,7 +113,7 @@ static const struct device_operations host_ops_m = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = host_enable, .enable = host_enable,
.init = host_init, .init = host_init,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_t800_old __pci_driver = { static const struct pci_driver northbridge_driver_t800_old __pci_driver = {

View File

@ -122,12 +122,16 @@ void set_cbmem_toc(struct cbmem_entry *toc) {
outl((u32) toc, K8T890_NVRAM_IO_BASE+K8T890_NVRAM_CBMEM_TOC); outl((u32) toc, K8T890_NVRAM_IO_BASE+K8T890_NVRAM_CBMEM_TOC);
} }
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static const struct device_operations host_ctrl_ops_t = { static const struct device_operations host_ctrl_ops_t = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = host_ctrl_enable_k8t8xx, .enable = host_ctrl_enable_k8t8xx,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct device_operations host_ctrl_ops_m = { static const struct device_operations host_ctrl_ops_m = {
@ -135,7 +139,7 @@ static const struct device_operations host_ctrl_ops_m = {
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = host_ctrl_enable_k8m8xx, .enable = host_ctrl_enable_k8m8xx,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_t800 __pci_driver = { static const struct pci_driver northbridge_driver_t800 __pci_driver = {

View File

@ -639,12 +639,24 @@ static void southbridge_init_common(struct device *dev)
init_keyboard(dev); 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 = { static const struct device_operations vt8237r_lpc_ops_s = {
.read_resources = vt8237r_read_resources, .read_resources = vt8237r_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = vt8237s_init, .init = vt8237s_init,
.scan_bus = scan_static_bus, .scan_bus = scan_static_bus,
.ops_pci = &lops_pci,
}; };
static const struct device_operations vt8237r_lpc_ops_r = { static const struct device_operations vt8237r_lpc_ops_r = {
@ -653,6 +665,7 @@ static const struct device_operations vt8237r_lpc_ops_r = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = vt8237r_init, .init = vt8237r_init,
.scan_bus = scan_static_bus, .scan_bus = scan_static_bus,
.ops_pci = &lops_pci,
}; };
static const struct device_operations vt8237r_lpc_ops_a = { static const struct device_operations vt8237r_lpc_ops_a = {
@ -661,6 +674,7 @@ static const struct device_operations vt8237r_lpc_ops_a = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = vt8237a_init, .init = vt8237a_init,
.scan_bus = scan_static_bus, .scan_bus = scan_static_bus,
.ops_pci = &lops_pci,
}; };
static const struct pci_driver lpc_driver_r __pci_driver = { static const struct pci_driver lpc_driver_r __pci_driver = {

View File

@ -95,13 +95,24 @@ static void sata_ii_init(struct device *dev)
} }
} }
static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
{
pci_write_config16(dev, 0xd4, vendor);
pci_write_config16(dev, 0xd6, device);
}
static struct pci_operations lops_pci = {
.set_subsystem = vt8237_set_subsystem,
};
static const struct device_operations sata_i_ops = { static const struct device_operations sata_i_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = sata_i_init, .init = sata_i_init,
.enable = 0, .enable = 0,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct device_operations sata_ii_ops = { static const struct device_operations sata_ii_ops = {
@ -110,7 +121,7 @@ static const struct device_operations sata_ii_ops = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = sata_ii_init, .init = sata_ii_init,
.enable = 0, .enable = 0,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver northbridge_driver_ii __pci_driver = { static const struct pci_driver northbridge_driver_ii __pci_driver = {

View File

@ -158,13 +158,25 @@ static void vt8237_usb_ii_read_resources(struct device *dev)
return; return;
} }
static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
{
pci_write_config32(dev, 0x42, pci_read_config32(dev, 0x42) | 0x10);
pci_write_config16(dev, 0x2c, vendor);
pci_write_config16(dev, 0x2e, device);
pci_write_config32(dev, 0x42, pci_read_config32(dev, 0x42) & ~0x10);
}
static struct pci_operations lops_pci = {
.set_subsystem = vt8237_set_subsystem,
};
static const struct device_operations usb_i_ops = { static const struct device_operations usb_i_ops = {
.read_resources = vt8237_usb_i_read_resources, .read_resources = vt8237_usb_i_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = usb_i_init, .init = usb_i_init,
.enable = 0, .enable = 0,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct device_operations usb_ii_ops = { static const struct device_operations usb_ii_ops = {
@ -173,7 +185,7 @@ static const struct device_operations usb_ii_ops = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = usb_ii_init, .init = usb_ii_init,
.enable = 0, .enable = 0,
.ops_pci = 0, .ops_pci = &lops_pci,
}; };
static const struct pci_driver vt8237r_driver_usbii __pci_driver = { static const struct pci_driver vt8237r_driver_usbii __pci_driver = {