Patchwork [2/7] ASUS M2V support (v2): VT8237A LPC device id (unchanged)

login
register
about
Submitter Tobias Diedrich
Date 2010-10-29 11:58:38
Message ID <20101029115838.GJ31684@yumi.tdiedrich.de>
Download mbox | patch
Permalink /patch/2202/
State Superseded
Headers show

Comments

Tobias Diedrich - 2010-10-29 11:58:38
This adds the VT8237A LPC device id and corresponding pci_locate_device
calls in vt8237r_early_smbus.c plus the pci_driver struct in
vt8237r_lpc.c

Signed-off-by: Tobias Diedrich <ranma+coreboot@tdiedrich.de>

---
Rudolf Marek - 2010-11-02 21:04:58
Hi,

I think following is not true. The VT8237A has something else at 0x50, so 
vt8237_sb_enable_fid_vid should not be neccessary to call. Do you call it or 
not? If not then we either need to fix it for the "old" location 0x11 iirc or 
not to put there any test for A version.
>
> +static const struct device_operations vt8237r_lpc_ops_a = {
> +	.read_resources		= vt8237r_read_resources,
> +	.set_resources		= pci_dev_set_resources,
> +	.enable_resources	= pci_dev_enable_resources,
> +	.init			= vt8237r_init,
> +	.scan_bus		= scan_static_bus,
> +};
> +


I think you dont need this for now, if you use "r" init version you can cange it 
directly:


> +static const struct pci_driver lpc_driver_a __pci_driver = {
> +	.ops	=&vt8237r_lpc_ops_a,

_r here.

Thanks,
Rudolf

Patch

Index: src/southbridge/via/vt8237r/vt8237r_early_smbus.c
===================================================================
--- src/southbridge/via/vt8237r/vt8237r_early_smbus.c.orig	2010-10-27 11:34:19.000000000 +0200
+++ src/southbridge/via/vt8237r/vt8237r_early_smbus.c	2010-10-27 11:55:50.000000000 +0200
@@ -149,6 +149,11 @@ 
 		/* Power management controller */
 		dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
 					PCI_DEVICE_ID_VIA_VT8237S_LPC), 0);
+		if (dev == PCI_DEV_INVALID) {
+			/* Power management controller */
+			dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
+						PCI_DEVICE_ID_VIA_VT8237A_LPC), 0);
+		}
 		if (dev == PCI_DEV_INVALID)
 			die("Power management controller not found\n");
 	}
@@ -243,6 +248,11 @@ 
 		/* Power management controller */
 		dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
 					PCI_DEVICE_ID_VIA_VT8237S_LPC), 0);
+		if (dev == PCI_DEV_INVALID) {
+			/* Power management controller */
+			dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
+						PCI_DEVICE_ID_VIA_VT8237A_LPC), 0);
+		}
 		if (dev == PCI_DEV_INVALID)
 			return;
 
@@ -298,6 +308,11 @@ 
 		/* Power management controller */
 		dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
 					PCI_DEVICE_ID_VIA_VT8237S_LPC), 0);
+		if (dev == PCI_DEV_INVALID) {
+			/* Power management controller */
+			dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
+						PCI_DEVICE_ID_VIA_VT8237A_LPC), 0);
+		}
 		if (dev == PCI_DEV_INVALID)
 			return;
 	}
@@ -322,6 +337,11 @@ 
 		/* Power management controller */
 		dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
 					PCI_DEVICE_ID_VIA_VT8237S_LPC), 0);
+		if (dev == PCI_DEV_INVALID) {
+			/* Power management controller */
+			dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
+						PCI_DEVICE_ID_VIA_VT8237A_LPC), 0);
+		}
 		if (dev == PCI_DEV_INVALID)
 			die("Power management controller not found\n");
 	}
Index: src/southbridge/via/vt8237r/vt8237r_lpc.c
===================================================================
--- src/southbridge/via/vt8237r/vt8237r_lpc.c.orig	2010-10-27 11:34:19.000000000 +0200
+++ src/southbridge/via/vt8237r/vt8237r_lpc.c	2010-10-27 11:48:47.000000000 +0200
@@ -537,12 +537,26 @@ 
 	.scan_bus		= scan_static_bus,
 };
 
+static const struct device_operations vt8237r_lpc_ops_a = {
+	.read_resources		= vt8237r_read_resources,
+	.set_resources		= pci_dev_set_resources,
+	.enable_resources	= pci_dev_enable_resources,
+	.init			= vt8237r_init,
+	.scan_bus		= scan_static_bus,
+};
+
 static const struct pci_driver lpc_driver_r __pci_driver = {
 	.ops	= &vt8237r_lpc_ops_r,
 	.vendor	= PCI_VENDOR_ID_VIA,
 	.device	= PCI_DEVICE_ID_VIA_VT8237R_LPC,
 };
 
+static const struct pci_driver lpc_driver_a __pci_driver = {
+	.ops	= &vt8237r_lpc_ops_a,
+	.vendor	= PCI_VENDOR_ID_VIA,
+	.device	= PCI_DEVICE_ID_VIA_VT8237A_LPC,
+};
+
 static const struct pci_driver lpc_driver_s __pci_driver = {
 	.ops	= &vt8237r_lpc_ops_s,
 	.vendor	= PCI_VENDOR_ID_VIA,
Index: src/include/device/pci_ids.h
===================================================================
--- src/include/device/pci_ids.h.orig	2010-10-27 11:40:16.000000000 +0200
+++ src/include/device/pci_ids.h	2010-10-27 11:48:47.000000000 +0200
@@ -1226,6 +1226,7 @@ 
 #define PCI_DEVICE_ID_VIA_K8T890CE_BR	0xb188
 #define PCI_DEVICE_ID_VIA_VT6420_SATA	0x3149
 #define PCI_DEVICE_ID_VIA_VT8237R_LPC	0x3227
+#define PCI_DEVICE_ID_VIA_VT8237A_LPC	0x3337
 #define PCI_DEVICE_ID_VIA_VT8237S_LPC	0x3372
 #define PCI_DEVICE_ID_VIA_VT8237_SATA	0x5372
 #define PCI_DEVICE_ID_VIA_VT8237_VLINK	0x287e