Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2001 16:44:27 -0600 (CST)
From:      Chris Dillon <cdillon@wolves.k12.mo.us>
To:        Chris Sears <cbsears@ix.netcom.com>
Cc:        <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: ecc kld for FreeBSD 4.2
Message-ID:  <Pine.BSF.4.32.0103131631580.52535-100000@mail.wolves.k12.mo.us>
In-Reply-To: <3AAD4752.9C40CE34@ix.netcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 12 Mar 2001, Chris Sears wrote:

>
> Linux has some support for ECC error detection:
>
>         http://www.anime.net/~goemon/linux-ecc/
>
> I've ported ECC 0.12 to a FreeBSD kld and it seems to work.
>
> A  couple of minor changes:
>
>    commented out probe_450gx because the compiler was
>    giving some plausible warnings
>
>    check if ecc_mode == ECC_NONE before installing the timer
>
> I've attached it and would welcome any comments. I've also
> posted it back to the Linux ECC people.

Excellent!! I've just compiled it and loaded it on my 4.2-STABLE
system with a 440BX-based board.  I even have an enhancement already,
which is pretty much just a cut-n-paste from the Linux bits with a
little bit of style enhancement, though you'll want to change it to
your liking, and since I'm not an avid C programmer, make sure I've
done the right stuff...  (it DOES work, at least):

--- ecc.c.orig	Tue Mar 13 15:17:57 2001
+++ ecc.c	Tue Mar 13 16:31:02 2001
@@ -1040,6 +1040,26 @@
 	int		type,
 	void*		data)
 {
+        char *ecc[] = {
+		"None",
+		"Reserved",
+		"Parity checking",
+		"ECC detection",
+		"ECC detection and correction",
+		"ECC with hardware scrubber"
+	};
+        char *dram[] = {
+		"Empty",
+		"Reserved",
+		"FPM",
+		"EDO",
+		"BEDO",
+		"SDR",
+		"DDR",
+		"RDR"
+	};
+	unsigned long mem_end = 0;
+	unsigned long last_mem = 0;
 	static int	attached = 0;
 	int		loop;

@@ -1068,6 +1088,25 @@
 		if (cs.ecc_mode == ECC_NONE) {
 			printf("ECC: no ECC memory\n");
 			return -ENODEV;
+		} else {
+			printf("ECC: Chipset ECC capability - %s\n",
+				ecc[cs.ecc_cap]);
+			printf("ECC: Current ECC mode - %s\n",
+				ecc[cs.ecc_mode]);
+			printf("ECC:\tBank\tSize\tType\tECC\tSBE\tMBE\n");
+			for (loop = 0; loop < 8; loop++) {
+				last_mem = bank[loop].endaddr;
+				if (last_mem > mem_end) {
+					printf("ECC:\t%d\t", loop);
+					printf("%dM\t", (int)(last_mem - mem_end) / 1048576);
+					printf("%s\t", dram[bank[loop].mtype]);
+					printf("%s\t", bank[loop].eccmode ? "Y" : "N");
+					printf("%d\t", bank[loop].sbecount);
+					printf("%d\n", bank[loop].mbecount);
+					mem_end = last_mem;
+				}
+			}
+			printf("ECC: Total\t%dM\n", (int)mem_end / 1048576);
 		}
 		attached = 1;
 		break;


I also have something that I can hopefully just plug the bits into to
get this working for the ServerWorks III chipset, as well, assuming I
can find the right info about it...


-- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net
   FreeBSD: The fastest and most stable server OS on the planet.
   For IA32 and Alpha architectures. IA64, PPC, and ARM under development.
   http://www.freebsd.org



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.32.0103131631580.52535-100000>