Module Name: src
Committed By: jdc
Date: Tue Sep 24 18:11:55 UTC 2013
Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c
Log Message:
If we're running on SPARCle, add spdmem entries on the i2c bus directly,
because they are not known by firmware. Idea from martin@.
To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/sparc64/sparc64/autoconf.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.191 src/sys/arch/sparc64/sparc64/autoconf.c:1.192
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.191 Fri Nov 2 17:47:29 2012
+++ src/sys/arch/sparc64/sparc64/autoconf.c Tue Sep 24 18:11:54 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.191 2012/11/02 17:47:29 jdc Exp $ */
+/* $NetBSD: autoconf.c,v 1.192 2013/09/24 18:11:54 jdc Exp $ */
/*
* Copyright (c) 1996
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.191 2012/11/02 17:47:29 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.192 2013/09/24 18:11:54 jdc Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -1088,6 +1088,31 @@ noether:
sizeof(cell_t));
}
}
+
+ /*
+ * Add SPARCle spdmem devices (0x50 and 0x51) that the
+ * firmware does not know about.
+ */
+ if (!strcmp(machine_model, "TAD,SPARCLE")) {
+ prop_dictionary_t props = device_properties(busdev);
+ prop_array_t cfg = prop_array_create();
+ int i;
+
+ DPRINTF(ACDB_PROBE, ("\nAdding spdmem for SPARCle "));
+ for (i = 0x50; i <= 0x51; i++) {
+ prop_dictionary_t spd =
+ prop_dictionary_create();
+ prop_dictionary_set_cstring(spd, "name",
+ "dimm-spd");
+ prop_dictionary_set_uint32(spd, "addr", i);
+ prop_dictionary_set_uint64(spd, "cookie", 0);
+ prop_array_add(cfg, spd);
+ prop_object_release(spd);
+ }
+ prop_dictionary_set(props, "i2c-child-devices", cfg);
+ prop_object_release(cfg);
+
+ }
}
/* set properties for PCI framebuffers */