diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-04-07 01:44:04 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-04-07 01:44:04 +0000 |
commit | c51dc44bf2b76ac47b83ee76bee3357ce4b173de (patch) | |
tree | bd9810f58fb58e10e7a32e1e0299a7ba9ec7a3da /src/southbridge/broadcom/bcm5785/bcm5785_sata.c | |
parent | 39162f7b47c9258980e08d05038d79d1ff925372 (diff) |
"no warnings day"
last round for today. still warnings - help appreciated.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5363 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/broadcom/bcm5785/bcm5785_sata.c')
-rw-r--r-- | src/southbridge/broadcom/bcm5785/bcm5785_sata.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/southbridge/broadcom/bcm5785/bcm5785_sata.c b/src/southbridge/broadcom/bcm5785/bcm5785_sata.c index e82fa3ca8e..ec92ecf7e9 100644 --- a/src/southbridge/broadcom/bcm5785/bcm5785_sata.c +++ b/src/southbridge/broadcom/bcm5785/bcm5785_sata.c @@ -12,17 +12,13 @@ #include <arch/io.h> #include "bcm5785.h" - static void sata_init(struct device *dev) { - uint8_t byte; - uint8_t *base; - uint8_t *mmio; + u32 mmio; struct resource *res; - unsigned int mmio_base; - volatile unsigned int *mmio_reg; + u32 mmio_base; int i; if(!(dev->path.pci.devfn & 7)) { // only set it in Func0 @@ -31,27 +27,24 @@ static void sata_init(struct device *dev) pci_write_config8(dev, 0x78, byte); res = find_resource(dev, 0x24); - base = res->base; - - mmio_base = base; + mmio_base = res->base; mmio_base &= 0xfffffffc; - mmio_reg = (unsigned int *)( mmio_base + 0x10f0 ); - * mmio_reg = 0x40000001; - mmio_reg = ( unsigned int *)( mmio_base + 0x8c ); - * mmio_reg = 0x00ff2007; + + write32(mmio_base + 0x10f0, 0x40000001); + write32(mmio_base + 0x8c, 0x00ff2007); mdelay( 10 ); - * mmio_reg = 0x78592009; + write32(mmio_base + 0x8c, 0x78592009); mdelay( 10 ); - * mmio_reg = 0x00082004; + write32(mmio_base + 0x8c, 0x00082004); mdelay( 10 ); - * mmio_reg = 0x00002004; + write32(mmio_base + 0x8c, 0x00002004); mdelay( 10 ); //init PHY printk(BIOS_DEBUG, "init PHY...\n"); for(i=0; i<4; i++) { - mmio = base + 0x100 * i; + mmio = res->base + 0x100 * i; byte = read8(mmio + 0x40); printk(BIOS_DEBUG, "port %d PHY status = %02x\n", i, byte); if(byte & 0x4) {// bit 2 is set @@ -62,10 +55,7 @@ static void sata_init(struct device *dev) printk(BIOS_DEBUG, "after reset port %d PHY status = %02x\n", i, byte); } } - } - - } static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) |