- note a comment about a discovery of viaide BAR read value weirdness.

- have RAID and SATA PCI storage subclass.
- cosmetics around NIC drivers.
This commit is contained in:
nisimura 2008-04-08 23:59:03 +00:00
parent 3f466bce48
commit 7c716f683a
11 changed files with 43 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fxp.c,v 1.6 2007/11/29 04:00:17 nisimura Exp $ */
/* $NetBSD: fxp.c,v 1.7 2008/04/08 23:59:03 nisimura Exp $ */
/*
* most of the following code was imported from dev/ic/i82557.c; the
@ -190,11 +190,11 @@ fxp_init(unsigned tag, void *data)
unsigned v, i;
v = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(v) != 0x8086 ||
(PCI_PRODUCT(v) != 0x1209 && PCI_PRODUCT(v) != 0x1229))
if (PCI_DEVICE(0x8086, 0x1209) != v
&& PCI_DEVICE(0x8086, 0x1229) != v)
return NULL;
sc = ALLOC(struct local, sizeof(struct txdesc));
sc = ALLOC(struct local, sizeof(struct txdesc)); /* desc alignment */
memset(sc, 0, sizeof(struct local));
sc->iobase = DEVTOV(pcicfgread(tag, 0x10)); /* use mem space */

View File

@ -1,4 +1,4 @@
/* $NetBSD: globals.h,v 1.5 2008/04/07 15:46:25 nisimura Exp $ */
/* $NetBSD: globals.h,v 1.6 2008/04/08 23:59:03 nisimura Exp $ */
/* clock feed */
#ifndef TICKS_PER_SEC
@ -41,6 +41,8 @@ void pcicfgwrite(unsigned, int, unsigned);
#define PCI_CLASS_PPB 0x0604
#define PCI_CLASS_ETH 0x0200
#define PCI_CLASS_IDE 0x0101
#define PCI_CLASS_RAID 0x0104
#define PCI_CLASS_SATA 0x0106
#define PCI_BHLC_REG 0x0c
#define PCI_HDRTYPE_TYPE(r) (((r) >> 16) & 0x7f)
#define PCI_HDRTYPE_MULTIFN(r) ((r) & (0x80 << 16))

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.12 2008/04/07 15:20:19 nisimura Exp $ */
/* $NetBSD: main.c,v 1.13 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -104,11 +104,11 @@ main()
case BRD_ENCOREPP1:
printf("Encore PP1"); break;
}
printf(", %dMB SDRAM, ", memsize >> 20);
printf(", %dMB SDRAM\n", memsize >> 20);
n = pcilookup(PCI_CLASS_IDE, lata, sizeof(lata)/sizeof(lata[0]));
if (n == 0)
printf("no IDE found, ");
printf("no IDE found\n");
else {
tag = lata[0][1];
pcidecomposetag(tag, &b, &d, &f);
@ -679,14 +679,23 @@ pcifixup()
val |= (0x8a << 8);
pcicfgwrite(ide, 0x08, val);
/* ide: 0x10-20 - in this mode HW ignores these addresses */
/* ide: 0x10-20 */
experiment shows writing ide: 0x09 changes these
register behaviour. The pcicfgwrite() above writes
0x8a at ide: 0x09 to make sure legacy IDE. Then
reading BAR0-3 is to return value 0s even though
pcisetup() has written range assignments. Value
overwrite makes no effect. Having 0x8f for native
PCIIDE doesn't change register values and brings no
weirdness.
*/
/* ide: 0x40 - use primary only */
val = pcicfgread(ide, 0x40) &~ 03;
val |= 02;
pcicfgwrite(ide, 0x40, val);
/* ide: 0x3d/3c - turn off PCI pin */
/* ide: 0x3d/3c - turn off PCI pin */
val = pcicfgread(ide, 0x3c) & 0xffff00ff;
pcicfgwrite(ide, 0x3c, val);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: nvt.c,v 1.10 2008/04/07 13:25:31 nisimura Exp $ */
/* $NetBSD: nvt.c,v 1.11 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -174,11 +174,11 @@ nvt_init(unsigned tag, void *data)
uint8_t *en;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x1106 ||
(PCI_PRODUCT(val) != 0x3053 && PCI_PRODUCT(val) != 0x3065))
if (PCI_DEVICE(0x1106, 0x3053) != val
&& PCI_DEVICE(0x1106, 0x3065) != val)
return NULL;
l = ALLOC(struct local, sizeof(struct desc));
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = DEVTOV(pcicfgread(tag, 0x14)); /* use mem space */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcn.c,v 1.9 2007/11/12 14:03:35 nisimura Exp $ */
/* $NetBSD: pcn.c,v 1.10 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -153,10 +153,10 @@ pcn_init(unsigned tag, void *data)
struct pcninit initblock, *ib;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x1022 && PCI_PRODUCT(val) != 0x2000)
if (PCI_DEVICE(0x1022, 0x2000) != val)
return NULL;
l = ALLOC(struct local, sizeof(struct desc));
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = DEVTOV(pcicfgread(tag, 0x14)); /* use mem space */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rge.c,v 1.8 2007/12/09 09:55:58 nisimura Exp $ */
/* $NetBSD: rge.c,v 1.9 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -168,7 +168,7 @@ rge_init(unsigned tag, void *data)
uint8_t *en = data;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x10ec && PCI_PRODUCT(val) != 0x8169)
if (PCI_DEVICE(0x10ec, 0x8169) != val)
return NULL;
l = ALLOC(struct local, 256); /* desc alignment */

View File

@ -1,4 +1,4 @@
/* $NetBSD: siisata.c,v 1.3 2008/04/07 15:20:19 nisimura Exp $ */
/* $NetBSD: siisata.c,v 1.4 2008/04/08 23:59:03 nisimura Exp $ */
#include <sys/param.h>
#include <sys/disklabel.h>
@ -36,6 +36,7 @@ siisata_init(unsigned tag, unsigned data)
break;
case PCI_DEVICE(0x1095, 0x3114): /* SiI 3114 SATALink */
chvalid = 0xf;
break;
default:
return NULL;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sip.c,v 1.10 2007/12/09 09:55:59 nisimura Exp $ */
/* $NetBSD: sip.c,v 1.11 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -138,10 +138,10 @@ sip_init(unsigned tag, void *data)
uint8_t *en;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x100b && PCI_PRODUCT(val) != 0x0020)
if (PCI_DEVICE(0x100b, 0x0020) != val)
return NULL;
l = ALLOC(struct local, sizeof(struct desc));
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = DEVTOV(pcicfgread(tag, 0x14)); /* use mem space */

View File

@ -1,4 +1,4 @@
/* $NetBSD: tlp.c,v 1.13 2008/04/07 02:02:39 nisimura Exp $ */
/* $NetBSD: tlp.c,v 1.14 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -136,10 +136,10 @@ tlp_init(unsigned tag, void *data)
val = pcicfgread(tag, PCI_ID_REG);
/* genuine DE500 */
if (PCI_VENDOR(val) != 0x1011 && PCI_PRODUCT(val) != 0x0009)
if (PCI_DEVICE(0x1011, 0x0009) != val)
return NULL;
l = ALLOC(struct local, sizeof(struct desc));
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = DEVTOV(pcicfgread(tag, 0x14)); /* use mem space */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vge.c,v 1.11 2008/04/07 13:25:31 nisimura Exp $ */
/* $NetBSD: vge.c,v 1.12 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -222,7 +222,7 @@ vge_init(unsigned tag, void *data)
uint8_t *en;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x1106 && PCI_PRODUCT(val) != 0x3119)
if (PCI_DEVICE(0x1106, 0x3119) != val)
return NULL;
l = ALLOC(struct local, 64); /* desc alignment */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wm.c,v 1.2 2007/12/09 09:55:58 nisimura Exp $ */
/* $NetBSD: wm.c,v 1.3 2008/04/08 23:59:03 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -141,11 +141,10 @@ wm_init(unsigned tag, void *data)
uint8_t *en;
val = pcicfgread(tag, PCI_ID_REG);
if (PCI_VENDOR(val) != 0x8086
&& PCI_PRODUCT(val) != 0x107c)
if (PCI_DEVICE(0x8086, 0x107c) != val)
return NULL;
l = ALLOC(struct local, 16);
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = pcicfgread(tag, 0x10); /* use mem space */