Module Name: src
Committed By: phx
Date: Sun Aug 8 11:58:26 UTC 2010
Modified Files:
src/sys/arch/sandpoint/stand/netboot: dsk.c siisata.c
Log Message:
Erroneously committed test code. Reverted to previous revision.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/netboot/dsk.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sandpoint/stand/netboot/siisata.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sandpoint/stand/netboot/dsk.c
diff -u src/sys/arch/sandpoint/stand/netboot/dsk.c:1.4 src/sys/arch/sandpoint/stand/netboot/dsk.c:1.5
--- src/sys/arch/sandpoint/stand/netboot/dsk.c:1.4 Sun Aug 8 11:54:45 2010
+++ src/sys/arch/sandpoint/stand/netboot/dsk.c Sun Aug 8 11:58:26 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.4 2010/08/08 11:54:45 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.5 2010/08/08 11:58:26 phx Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -365,7 +365,6 @@
const char *err;
int error;
-return EIO; /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
l = d->dvops;
n = d->unittag;
p = (uint16_t *)buf;
Index: src/sys/arch/sandpoint/stand/netboot/siisata.c
diff -u src/sys/arch/sandpoint/stand/netboot/siisata.c:1.12 src/sys/arch/sandpoint/stand/netboot/siisata.c:1.13
--- src/sys/arch/sandpoint/stand/netboot/siisata.c:1.12 Sun Aug 8 11:54:46 2010
+++ src/sys/arch/sandpoint/stand/netboot/siisata.c Sun Aug 8 11:58:26 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.12 2010/08/08 11:54:46 phx Exp $ */
+/* $NetBSD: siisata.c,v 1.13 2010/08/08 11:58:26 phx Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,10 +58,9 @@
void *
siisata_init(unsigned tag, void *data)
{
- unsigned val, cls;
+ unsigned val;
int nchan, n;
struct dkdev_ata *l;
- static int ba5bccregs[] = { 0x40, 0x44, 0x240, 0x244 };
l = alloc(sizeof(struct dkdev_ata));
memset(l, 0, sizeof(struct dkdev_ata));
@@ -78,24 +77,17 @@
val = pcicfgread(tag, PCI_ID_REG);
if ((PCI_PRODUCT(val) & 0xf) == 0x2) {
/* 3112/3512 */
- /* reset BA5 indirect access enable */
- val = pcicfgread(tag, 0x40);
- pcicfgwrite(tag, 0x40, val & ~02);
- /* reset everything, enable BA5 access */
- pcicfgwrite(tag, 0x88, 0x100f3);
- delay(50 * 1000);
- pcicfgwrite(tag, 0x88, 0x10000);
- delay(50 * 1000);
l->chan[0].cmd = l->bar[0];
l->chan[0].ctl = l->chan[0].alt = l->bar[1] | 02;
l->chan[0].dma = l->bar[4] + 0x0;
l->chan[1].cmd = l->bar[2];
l->chan[1].ctl = l->chan[1].alt = l->bar[3] | 02;
l->chan[1].dma = l->bar[4] + 0x8;
+ /* assume BA5 access is possible */
nchan = 2;
}
else {
- /* 3114 - assume BA5 access is possible */
+ /* 3114 */
l->chan[0].cmd = l->bar[5] + 0x080;
l->chan[0].ctl = l->chan[0].alt = (l->bar[5] + 0x088) | 02;
l->chan[1].cmd = l->bar[5] + 0x0c0;
@@ -106,40 +98,10 @@
l->chan[3].ctl = l->chan[3].alt = (l->bar[5] + 0x2c8) | 02;
nchan = 4;
}
-
- /* fixup cache line */
- cls = (pcicfgread(tag, 0xc) & 0xff) << 2;
- if (cls > 224) {
- cls = (pcicfgread(tag, 0xc) & 0xff) | (224>>2);
- pcicfgwrite(tag, 0xc, cls);
- cls = 224;
- } else if (cls < 32)
- cls = 32;
- cls = (cls + 31) / 32;
- for (n = 0; n < nchan; n++) {
- val = in32rb(l->bar[5] + ba5bccregs[n]);
- if ((val & 0x7) < cls)
- out32rb(l->bar[5] + ba5bccregs[n], (val & 0x07) | cls);
- }
-
- /* detect presence */
for (n = 0; n < nchan; n++) {
l->presense[n] = satapresense(l, n);
if (l->presense[n])
printf("port %d device present\n", n);
}
-
- out32rb(l->bar[5] + 0xb4, 01);
- out32rb(l->bar[5] + 0xf4, 01);
- out32rb(l->bar[5] + 0xa4, 0x328a);
- out32rb(l->bar[5] + 0xe4, 0x328a);
-
- for (val=0; val<0x100; val+=4) {
- if ((val & 0xf) == 0)
- printf("0x%02x:",val);
- printf(" 0x%08x",pcicfgread(tag,val));
- if ((val & 0xf) == 0xc)
- printf("\n");
- }
return l;
}