sis/sis966: Clean up sata.c

Wow, this one is disliked by clang for the empty for() loop, but
looking at the file just makes my eyes bleed a little bit. I remember
the circumstances under which we let this code go in. It was supposed
to save contributions from a vendor, but that never worked out.
Just to keep the little chunks down, here's an indent run and some of
the cruft removed that doesn't actually contribute to functionality in
any way.

Change-Id: Ie82166ca82f09c4b66decfde5ad194a2d70b0708
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20386
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Stefan Reinauer 2017-06-27 00:38:32 +02:00
parent f968a4c970
commit cb3205d153
1 changed files with 96 additions and 110 deletions

View File

@ -73,7 +73,6 @@ uint8_t SiS_SiS1183_init[68][3]={
{0xA2, 0x00, 0x15},
{0xA3, 0x00, 0x15},
{0xD8, 0xFE, 0x01}, // Com reset
{0xC8, 0xFE, 0x01},
{0xE8, 0xFE, 0x01},
@ -84,7 +83,6 @@ uint8_t SiS_SiS1183_init[68][3]={
{0xE8, 0xFE, 0x00},
{0xF8, 0xFE, 0x00},
{0xC4, 0xFF, 0xFF}, // Clear status
{0xC5, 0xFF, 0xFF},
{0xC6, 0xFF, 0xFF},
@ -108,14 +106,15 @@ uint8_t SiS_SiS1183_init[68][3]={
static void sata_init(struct device *dev)
{
struct southbridge_sis_sis966_config *conf;
int i;
uint32_t temp32;
uint8_t temp8;
conf = dev->chip_info;
printk(BIOS_DEBUG, "SATA_INIT:---------->\n");
//-------------- enable IDE (SiS1183) -------------------------
{
uint8_t temp8;
int i=0;
/* Enable IDE (SiS1183) */
i = 0;
while (SiS_SiS1183_init[i][0] != 0) {
temp8 = pci_read_config8(dev, SiS_SiS1183_init[i][0]);
temp8 &= SiS_SiS1183_init[i][1];
@ -123,27 +122,15 @@ static void sata_init(struct device *dev)
pci_write_config8(dev, SiS_SiS1183_init[i][0], temp8);
i++;
};
}
//-----------------------------------------------------------
{
uint32_t i,j;
uint32_t temp32;
for (i = 0; i < 10; i++) {
temp32=0;
temp32 = pci_read_config32(dev, 0xC0);
for ( j=0;j<0xFFFF;j++);
printk(BIOS_DEBUG, "status= %x\n", temp32);
if (((temp32&0xF) == 0x3) || ((temp32&0xF) == 0x0)) break;
}
if (((temp32 & 0xF) == 0x3) || ((temp32 & 0xF) == 0x0))
break;
}
#if DEBUG_SATA
{
int i;
printk(BIOS_DEBUG, "****** SATA PCI config ******");
printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C");
@ -153,11 +140,9 @@ for (i=0;i<10;i++) {
printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev, i));
}
printk(BIOS_DEBUG, "\n");
}
#endif
printk(BIOS_DEBUG, "SATA_INIT:<----------\n");
}
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
@ -165,6 +150,7 @@ static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
pci_write_config32(dev, 0x40,
((device & 0xffff) << 16) | (vendor & 0xffff));
}
static struct pci_operations lops_pci = {
.set_subsystem = lpci_set_subsystem,
};