From owner-freebsd-current Sat Jan 2 06:13:21 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20949 for freebsd-current-outgoing; Sat, 2 Jan 1999 06:13:21 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from hda.hda.com (hda-bicnet.bicnet.net [209.244.238.132] (may be forged)) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA20920 for ; Sat, 2 Jan 1999 06:13:18 -0800 (PST) (envelope-from dufault@hda.hda.com) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id JAA18234 for current@freebsd.org; Sat, 2 Jan 1999 09:09:43 -0500 (EST) From: Peter Dufault Message-Id: <199901021409.JAA18234@hda.hda.com> Subject: if_ep probe failures related to reading back settings To: current@FreeBSD.ORG Date: Sat, 2 Jan 1999 09:09:42 -0500 (EST) X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have trouble properly reading the settings back from a 3C509 on a 180MHz Cyrix MediaGX crash box. The result is that it won't always probe in at boot. I find that by increasing the DELAY by a factor of 10 and more importantly adding a delay before reading each serial bit of data (I assume we're reading back a serial EEPROM): Before: > outb(id_port, 0x80 + offset); > DELAY(1000); > for (i = 0; i < 16; i++) > data = (data << 1) | (inw(id_port) & 1); After: >#define DELAY_MULTIPLE 10 > outb(id_port, 0x80 + offset); > for (i = 0; i < 16; i++) { > DELAY(DELAY_MULTIPLE * 1000); > data = (data << 1) | (inw(id_port) & 1); > } that it always works. Without this I get signs of not reading back the data properly - for example, sometimes it will boot with a corrupt hardware address so that on another system I'll see this: > arp: 198.252.184.2 moved from 00:20:ff:ff:af:a0 to 00:20:eb:e8:96:3a > arp: 198.252.184.2 moved from 00:20:eb:e8:96:3a to e0:00:af:a0:96:3a > de0: receive: e0:00:af:a0:96:3a: bad crc > arp: 198.252.184.2 moved from e0:00:af:a0:96:3a to 00:20:af:a0:e5:8e > arp: 198.252.184.2 moved from 00:20:af:a0:e5:8e to 00:20:af:a0:96:3a Can someone check if we may be violating timings on reading that serial bus, or is it likely that this Cyrix has an inw that is too fast and I have to monkey with some BIOS settings? Peter -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Safety critical systems, Agency approval To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message