diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2007-11-15 15:52:42 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2007-11-15 15:52:42 +0000 |
commit | 70ab323ae61567a005058f6e7bdd1f6990e6e7fd (patch) | |
tree | d91d14376cc38436f3b51073737cce75b47262b9 /src/southbridge/via/k8t890 | |
parent | e13abe53b49fdd61fcf56bc21b578057c5f1c72f (diff) |
Various cosmetic fixes and improvements (trivial).
- Use 'static' where appropriate.
- Use 'const' where appropriate.
- Indentation fixes.
- Add comment wrt init code which is only valid for VT8237R.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2974 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/via/k8t890')
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_ctrl.c | 29 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_dram.c | 19 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_error.c | 16 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_host.c | 18 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_host_ctrl.c | 18 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_pcie.c | 67 | ||||
-rw-r--r-- | src/southbridge/via/k8t890/k8t890_traf_ctrl.c | 22 |
7 files changed, 95 insertions, 94 deletions
diff --git a/src/southbridge/via/k8t890/k8t890_ctrl.c b/src/southbridge/via/k8t890/k8t890_ctrl.c index c57c165195..128d50f1a7 100644 --- a/src/southbridge/via/k8t890/k8t890_ctrl.c +++ b/src/southbridge/via/k8t890/k8t890_ctrl.c @@ -41,12 +41,17 @@ * V-Link CKG Control 0xb0 0x05 0x05 0x06 0x03 * V-Link CKG Control 0xb1 0x05 0x05 0x01 0x03 */ -static void ctrl_init(struct device *dev) +static void ctrl_init_vt8237r(struct device *dev) { u8 reg; + + /* + * This init code is valid only for the VT8237R! For different + * sounthbridges (e.g. VT8237A, VT8237S, VT8237 (without plus R) + * and VT8251) a different init code is required. + */ device_t devsb = dev_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT8237R_LPC, 0); - if (!devsb) return; @@ -132,17 +137,17 @@ static void ctrl_enable(struct device *dev) pci_write_config8(dev, 0x63, regm3 | (regm & 0x3F)); } -static struct device_operations ctrl_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = ctrl_enable, - .init = ctrl_init, - .ops_pci = 0, +static const struct device_operations ctrl_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = ctrl_enable, + .init = ctrl_init_vt8237r, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &ctrl_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_7, + .ops = &ctrl_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_7, }; diff --git a/src/southbridge/via/k8t890/k8t890_dram.c b/src/southbridge/via/k8t890/k8t890_dram.c index 9d6517f775..e816594d92 100644 --- a/src/southbridge/via/k8t890/k8t890_dram.c +++ b/src/southbridge/via/k8t890/k8t890_dram.c @@ -19,7 +19,6 @@ #include <device/device.h> #include <device/pci.h> -#include <device/pci_ops.h> #include <device/pci_ids.h> #include <console/console.h> #include <cpu/x86/msr.h> @@ -63,16 +62,16 @@ static void dram_enable(struct device *dev) pci_write_config16(dev, 0x88, (msr.lo >> 24) | reg); } -static struct device_operations dram_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = dram_enable, - .ops_pci = 0, +static const struct device_operations dram_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = dram_enable, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &dram_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_3, + .ops = &dram_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_3, }; diff --git a/src/southbridge/via/k8t890/k8t890_error.c b/src/southbridge/via/k8t890/k8t890_error.c index 49d32bf903..7c0c744403 100644 --- a/src/southbridge/via/k8t890/k8t890_error.c +++ b/src/southbridge/via/k8t890/k8t890_error.c @@ -33,15 +33,15 @@ static void error_enable(struct device *dev) } static const struct device_operations error_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = error_enable, - .ops_pci = 0, + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = error_enable, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &error_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_1, + .ops = &error_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_1, }; diff --git a/src/southbridge/via/k8t890/k8t890_host.c b/src/southbridge/via/k8t890/k8t890_host.c index 980c85dea1..1ed9281a92 100644 --- a/src/southbridge/via/k8t890/k8t890_host.c +++ b/src/southbridge/via/k8t890/k8t890_host.c @@ -30,16 +30,16 @@ static void host_enable(struct device *dev) pci_write_config8(dev, K8T890_MULTIPLE_FN_EN, 0x01); } -static struct device_operations host_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = host_enable, - .ops_pci = 0, +static const struct device_operations host_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = host_enable, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &host_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_0, + .ops = &host_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_0, }; diff --git a/src/southbridge/via/k8t890/k8t890_host_ctrl.c b/src/southbridge/via/k8t890/k8t890_host_ctrl.c index e3e358b7ca..8c9f41871c 100644 --- a/src/southbridge/via/k8t890/k8t890_host_ctrl.c +++ b/src/southbridge/via/k8t890/k8t890_host_ctrl.c @@ -78,16 +78,16 @@ static void host_ctrl_enable(struct device *dev) dump_south(dev); } -static struct device_operations host_ctrl_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = host_ctrl_enable, - .ops_pci = 0, +static const struct device_operations host_ctrl_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = host_ctrl_enable, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &host_ctrl_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_2, + .ops = &host_ctrl_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_2, }; diff --git a/src/southbridge/via/k8t890/k8t890_pcie.c b/src/southbridge/via/k8t890/k8t890_pcie.c index 21acf16780..726d803873 100644 --- a/src/southbridge/via/k8t890/k8t890_pcie.c +++ b/src/southbridge/via/k8t890/k8t890_pcie.c @@ -21,10 +21,9 @@ #include <device/device.h> #include <device/pci.h> #include <device/pciexp.h> -#include <device/pci_ops.h> #include <device/pci_ids.h> -void peg_init(struct device *dev) +static void peg_init(struct device *dev) { u8 reg; @@ -78,7 +77,7 @@ void peg_init(struct device *dev) dump_south(dev); } -void pcie_init(struct device *dev) +static void pcie_init(struct device *dev) { u8 reg; @@ -113,52 +112,52 @@ void pcie_init(struct device *dev) dump_south(dev); } -static struct device_operations peg_ops = { - .read_resources = pci_bus_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_bus_enable_resources, - .enable = peg_init, - .scan_bus = pciexp_scan_bridge, - .reset_bus = pci_bus_reset, - .ops_pci = 0, +static const struct device_operations peg_ops = { + .read_resources = pci_bus_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_bus_enable_resources, + .enable = peg_init, + .scan_bus = pciexp_scan_bridge, + .reset_bus = pci_bus_reset, + .ops_pci = 0, }; -static struct device_operations pcie_ops = { - .read_resources = pci_bus_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_bus_enable_resources, - .enable = pcie_init, - .scan_bus = pciexp_scan_bridge, - .reset_bus = pci_bus_reset, - .ops_pci = 0, +static const struct device_operations pcie_ops = { + .read_resources = pci_bus_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_bus_enable_resources, + .enable = pcie_init, + .scan_bus = pciexp_scan_bridge, + .reset_bus = pci_bus_reset, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &peg_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_PEG, + .ops = &peg_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_PEG, }; static const struct pci_driver pcie_drvd3f0 __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX0, + .ops = &pcie_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX0, }; static const struct pci_driver pcie_drvd3f1 __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX1, + .ops = &pcie_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX1, }; static const struct pci_driver pcie_drvd3f2 __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX2, + .ops = &pcie_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX2, }; static const struct pci_driver pcie_drvd3f3 __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX3, + .ops = &pcie_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_PEX3, }; diff --git a/src/southbridge/via/k8t890/k8t890_traf_ctrl.c b/src/southbridge/via/k8t890/k8t890_traf_ctrl.c index 85ab5a0551..304dfaea7f 100644 --- a/src/southbridge/via/k8t890/k8t890_traf_ctrl.c +++ b/src/southbridge/via/k8t890/k8t890_traf_ctrl.c @@ -19,13 +19,11 @@ #include <device/device.h> #include <device/pci.h> -#include <device/pci_ops.h> #include <device/pci_ids.h> #include <console/console.h> - #include "k8t890.h" -void mmconfig_set_resources(device_t dev) +static void mmconfig_set_resources(device_t dev) { struct resource *resource; u8 reg; @@ -106,16 +104,16 @@ static void traf_ctrl_enable(struct device *dev) apic[4] = (data & 0xF0FFFF) | (K8T890_APIC_ID << 24); } -static struct device_operations traf_ctrl_ops = { - .read_resources = apic_mmconfig_read_resources, - .set_resources = mmconfig_set_resources, - .enable_resources = pci_dev_enable_resources, - .enable = traf_ctrl_enable, - .ops_pci = 0, +static const struct device_operations traf_ctrl_ops = { + .read_resources = apic_mmconfig_read_resources, + .set_resources = mmconfig_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = traf_ctrl_enable, + .ops_pci = 0, }; static const struct pci_driver northbridge_driver __pci_driver = { - .ops = &traf_ctrl_ops, - .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_K8T890CE_5, + .ops = &traf_ctrl_ops, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_K8T890CE_5, }; |