[coreboot-gerrit] New patch to review for coreboot: southbridge/sis/sis966: transition away from device_t

Antonello Dettori (dev@dettori.io) gerrit at coreboot.org
Sat Sep 3 11:43:08 CEST 2016


Antonello Dettori (dev at dettori.io) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16488

-gerrit

commit fe63ff0d7f1644a8c2a60e9c2cf3107cb4c83937
Author: Antonello Dettori <dev at dettori.io>
Date:   Sat Sep 3 10:45:33 2016 +0200

    southbridge/sis/sis966: transition away from device_t
    
    Replace the use of the old device_t definition inside
    southbridge/sis/sis966.
    
    Change-Id: I9e731fedc6f21eaa2685f794ea2172eb4800628b
    Signed-off-by: Antonello Dettori <dev at dettori.io>
---
 src/southbridge/sis/sis966/early_ctrl.c  |  2 +-
 src/southbridge/sis/sis966/early_smbus.c | 16 +++++++++-------
 src/southbridge/sis/sis966/sis966.h      |  2 ++
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/southbridge/sis/sis966/early_ctrl.c b/src/southbridge/sis/sis966/early_ctrl.c
index fc311ae..74ae1fa 100644
--- a/src/southbridge/sis/sis966/early_ctrl.c
+++ b/src/southbridge/sis/sis966/early_ctrl.c
@@ -19,7 +19,7 @@
 
 static unsigned get_sbdn(unsigned bus)
 {
-	device_t dev;
+	pci_devfn_t dev;
 
 	/* Find the device. */
 	dev = pci_locate_device_on_bus(
diff --git a/src/southbridge/sis/sis966/early_smbus.c b/src/southbridge/sis/sis966/early_smbus.c
index 4a2b867..5ccceda 100644
--- a/src/southbridge/sis/sis966/early_smbus.c
+++ b/src/southbridge/sis/sis966/early_smbus.c
@@ -510,10 +510,12 @@ static const uint8_t	SiS_SiS1183_init[44][3]={
  */
 static void Init_Share_Memory(uint8_t ShareSize)
 {
-    device_t dev;
+	pci_devfn_t dev;
 
-    dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_SIS, PCI_DEVICE_ID_SIS_SIS761), 0);
-    pci_write_config8(dev, 0x4C, (pci_read_config8(dev, 0x4C) & 0x1F) | (ShareSize << 5));
+	dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_SIS,
+				PCI_DEVICE_ID_SIS_SIS761), 0);
+	pci_write_config8(dev, 0x4C, (pci_read_config8(dev, 0x4C) & 0x1F) |
+			(ShareSize << 5));
 }
 
 /* In:     => Aperture size
@@ -526,7 +528,7 @@ static void Init_Share_Memory(uint8_t ShareSize)
  */
 static void Init_Aper_Size(uint8_t AperSize)
 {
-	device_t dev;
+	pci_devfn_t dev;
 	uint16_t SiSAperSizeTable[]={0x0F38, 0x0F30, 0x0F20, 0x0F00, 0x0E00};
 
 	dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_AMD, 0x1103), 0);
@@ -538,7 +540,7 @@ static void Init_Aper_Size(uint8_t AperSize)
 
 static void sis_init_stage1(void)
 {
-	device_t dev;
+	pci_devfn_t dev;
 	uint8_t temp8;
 	int	i;
 	uint8_t	GUI_En;
@@ -600,7 +602,7 @@ static void sis_init_stage1(void)
 
 static void sis_init_stage2(void)
 {
-	device_t dev;
+	pci_devfn_t dev;
 	msr_t	msr;
 	int	i;
 	uint8_t temp8;
@@ -711,7 +713,7 @@ static void sis_init_stage2(void)
 
 static void enable_smbus(void)
 {
-	device_t dev;
+	pci_devfn_t dev;
 	uint8_t temp8;
 	printk(BIOS_DEBUG, "enable_smbus -------->\n");
 
diff --git a/src/southbridge/sis/sis966/sis966.h b/src/southbridge/sis/sis966/sis966.h
index 31af002..61bf0ee 100644
--- a/src/southbridge/sis/sis966/sis966.h
+++ b/src/southbridge/sis/sis966/sis966.h
@@ -31,6 +31,8 @@
 #define DEBUG_USB 0
 #define DEBUG_USB2 0
 
+#ifndef __SIMPLE_DEVICE__
 void sis966_enable(device_t dev);
+#endif
 
 #endif /* SIS966_H */



More information about the coreboot-gerrit mailing list