diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-02 18:19:17 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-02 18:19:17 +0000 |
commit | 7f3d48c9afd8f3397f7ce85148d802082ccc9de9 (patch) | |
tree | e44ed0ce259beff8993ace0f25ccf2fa5808f966 /src/southbridge/nvidia/ck804/ck804_sata.c | |
parent | 5107174459f581ff9a2f548768df6e1eef3c2d79 (diff) |
CK804 coding-style fixed based on an 'indent' run (trivial).
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@3631 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/nvidia/ck804/ck804_sata.c')
-rw-r--r-- | src/southbridge/nvidia/ck804/ck804_sata.c | 109 |
1 files changed, 56 insertions, 53 deletions
diff --git a/src/southbridge/nvidia/ck804/ck804_sata.c b/src/southbridge/nvidia/ck804/ck804_sata.c index 33ec3d66e1..9dabd662d1 100644 --- a/src/southbridge/nvidia/ck804/ck804_sata.c +++ b/src/southbridge/nvidia/ck804/ck804_sata.c @@ -2,6 +2,7 @@ * Copyright 2004 Tyan Computer * by yhlu@tyan.com */ + #include <console/console.h> #include <device/device.h> #include <delay.h> @@ -10,7 +11,6 @@ #include <device/pci_ops.h> #include "ck804.h" - static void sata_com_reset(struct device *dev, unsigned reset) // reset = 1 : reset // reset = 0 : clear @@ -23,12 +23,12 @@ static void sata_com_reset(struct device *dev, unsigned reset) printk_debug("base = %08x\r\n", base); - if(reset) { - *(base + 4) = 0xffffffff; - *(base + 0x44) = 0xffffffff; + if (reset) { + *(base + 4) = 0xffffffff; + *(base + 0x44) = 0xffffffff; } - dword = *(base +8); + dword = *(base + 8); dword &= ~(0xf); dword |= reset; @@ -42,87 +42,89 @@ static void sata_com_reset(struct device *dev, unsigned reset) *(base + 0x48) = dword; #endif - if(reset) return; + if (reset) + return; - dword = *(base+ 0); - printk_debug("*(base+0)=%08x\r\n",dword); - if(dword == 0x113) { - loop = 200000;// 2 + dword = *(base + 0); + printk_debug("*(base+0)=%08x\r\n", dword); + if (dword == 0x113) { + loop = 200000; // 2 do { - dword = *(base + 4); - if((dword & 0x10000)!=0) break; + dword = *(base + 4); + if ((dword & 0x10000) != 0) + break; udelay(10); - } while (--loop>0); - printk_debug("loop=%d, *(base+4)=%08x\r\n",loop, dword); + } while (--loop > 0); + printk_debug("loop=%d, *(base+4)=%08x\r\n", loop, dword); } - dword = *(base+ 0x40); - printk_debug("*(base+0x40)=%08x\r\n",dword); - if(dword == 0x113) { - loop = 200000;//2 - do { - dword = *(base + 0x44); - if((dword & 0x10000)!=0) break; + dword = *(base + 0x40); + printk_debug("*(base+0x40)=%08x\r\n", dword); + if (dword == 0x113) { + loop = 200000; //2 + do { + dword = *(base + 0x44); + if ((dword & 0x10000) != 0) + break; udelay(10); - } while (--loop>0); - printk_debug("loop=%d, *(base+0x44)=%08x\r\n",loop, dword); + } while (--loop > 0); + printk_debug("loop=%d, *(base+0x44)=%08x\r\n", loop, dword); } } static void sata_init(struct device *dev) { - uint32_t dword; - struct southbridge_nvidia_ck804_config *conf; + conf = dev->chip_info; dword = pci_read_config32(dev, 0x50); - /* Ensure prefetch is disabled */ + /* Ensure prefetch is disabled. */ dword &= ~((1 << 15) | (1 << 13)); if (conf->sata1_enable) { - /* Enable secondary SATA interface */ - dword |= (1<<0); - printk_debug("SATA S \t"); + /* Enable secondary SATA interface. */ + dword |= (1 << 0); + printk_debug("SATA S \t"); } if (conf->sata0_enable) { - /* Enable primary SATA interface */ - dword |= (1<<1); - printk_debug("SATA P \n"); + /* Enable primary SATA interface. */ + dword |= (1 << 1); + printk_debug("SATA P \n"); } #if 0 -// write back - dword |= (1<<12); - dword |= (1<<14); + /* Write back */ + dword |= (1 << 12); + dword |= (1 << 14); #endif #if 0 -// ADMA - dword |= (1<<16); - dword |= (1<<17); + /* ADMA */ + dword |= (1 << 16); + dword |= (1 << 17); #endif #if 1 -//DO NOT relay OK and PAGE_FRNDLY_DTXFR_CNT. - dword &= ~(0x1f<<24); - dword |= (0x15<<24); + /* DO NOT relay OK and PAGE_FRNDLY_DTXFR_CNT. */ + dword &= ~(0x1f << 24); + dword |= (0x15 << 24); #endif pci_write_config32(dev, 0x50, dword); #if 0 -//SLUMBER_DURING_D3. + /* SLUMBER_DURING_D3 */ dword = pci_read_config32(dev, 0x7c); - dword &= ~(1<<4); + dword &= ~(1 << 4); pci_write_config32(dev, 0x7c, dword); dword = pci_read_config32(dev, 0xd0); - dword &= ~(0xff<<24); - dword |= (0x68<<24); + dword &= ~(0xff << 24); + dword |= (0x68 << 24); pci_write_config32(dev, 0xd0, dword); dword = pci_read_config32(dev, 0xe0); - dword &= ~(0xff<<24); - dword |= (0x68<<24); + dword &= ~(0xff << 24); + dword |= (0x68 << 24); pci_write_config32(dev, 0xe0, dword); #endif @@ -132,11 +134,11 @@ static void sata_init(struct device *dev) #if 0 dword = pci_read_config32(dev, 0xac); - dword &= ~((1<<13)|(1<<14)); - dword |= (1<<13)|(0<<14); + dword &= ~((1 << 13) | (1 << 14)); + dword |= (1 << 13) | (0 << 14); pci_write_config32(dev, 0xac, dword); - sata_com_reset(dev, 1); // for discover some s-atapi device + sata_com_reset(dev, 1); /* For discover some s-atapi device. */ #endif } @@ -144,17 +146,18 @@ static void sata_init(struct device *dev) static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) { pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); + ((device & 0xffff) << 16) | (vendor & 0xffff)); } + static struct pci_operations lops_pci = { .set_subsystem = lpci_set_subsystem, }; -static struct device_operations sata_ops = { +static struct device_operations sata_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, -// .enable = ck804_enable, + // .enable = ck804_enable, .init = sata_init, .scan_bus = 0, .ops_pci = &lops_pci, |