Module Name:    src
Committed By:   jdc
Date:           Sun Oct 11 19:39:23 UTC 2020

Modified Files:
        src/sys/arch/sparc64/conf: files.sparc64
        src/sys/arch/sparc64/sparc64: autoconf.c
Added Files:
        src/sys/arch/sparc64/sparc64: static_edid.c static_edid.h

Log Message:
Add a static EDID entry for the Mesostation-999.
Use the same logic as macppc for adding the entry.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/arch/sparc64/conf/files.sparc64
cvs rdiff -u -r1.222 -r1.223 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/sparc64/static_edid.c \
    src/sys/arch/sparc64/sparc64/static_edid.h

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/conf/files.sparc64
diff -u src/sys/arch/sparc64/conf/files.sparc64:1.159 src/sys/arch/sparc64/conf/files.sparc64:1.160
--- src/sys/arch/sparc64/conf/files.sparc64:1.159	Mon May 11 15:56:15 2020
+++ src/sys/arch/sparc64/conf/files.sparc64	Sun Oct 11 19:39:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sparc64,v 1.159 2020/05/11 15:56:15 jdc Exp $
+#	$NetBSD: files.sparc64,v 1.160 2020/10/11 19:39:22 jdc Exp $
 
 # @(#)files.sparc64	8.1 (Berkeley) 7/19/93
 # sparc64-specific configuration info
@@ -257,6 +257,7 @@ file	arch/sparc64/sparc64/kobj_machdep.c
 file	arch/sparc64/sparc64/machdep.c
 file	arch/sparc64/sparc64/process_machdep.c
 file	arch/sparc64/sparc64/procfs_machdep.c	procfs
+file	arch/sparc64/sparc64/static_edid.c
 file	arch/sparc/sparc/openprom.c
 file	arch/sparc/sparc/openfirm.c
 file	arch/sparc64/sparc64/ofw_machdep.c

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.222 src/sys/arch/sparc64/sparc64/autoconf.c:1.223
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.222	Thu Jul 23 16:08:02 2020
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sun Oct 11 19:39:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.222 2020/07/23 16:08:02 jdc Exp $ */
+/*	$NetBSD: autoconf.c,v 1.223 2020/10/11 19:39:22 jdc Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.222 2020/07/23 16:08:02 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.223 2020/10/11 19:39:22 jdc Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -92,6 +92,7 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include <machine/pmap.h>
 #include <machine/bootinfo.h>
 #include <sparc64/sparc64/cache.h>
+#include <sparc64/sparc64/static_edid.h>
 #include <sparc64/sparc64/timerreg.h>
 #include <sparc64/dev/cbusvar.h>
 
@@ -1205,6 +1206,21 @@ set_hw_props(device_t dev)
 	}
 }
 
+/* Static EDID definitions */
+static void
+set_static_edid(prop_dictionary_t dict)
+{
+	if (!strcmp(machine_model, "NATE,Meso-999")) {
+		prop_data_t edid;
+
+		DPRINTF(ACDB_PROBE, ("\nAdding EDID for Meso-999 "));
+		edid = prop_data_create_copy(edid_meso999,
+		    sizeof(edid_meso999));
+		prop_dictionary_set(dict, "EDID:1", edid);
+		prop_object_release(edid);
+	}
+}
+
 /*
  * Called back during autoconfiguration for each device found
  */
@@ -1508,7 +1524,10 @@ noether:
 			if (OF_getprop(node, "width", &width, sizeof(width))
 			    != 4) {
 				instance = OF_open(name);
+			}
+		}
 #endif
+		set_static_edid(dict);
 	}
 
 	set_hw_props(dev);

Added files:

Index: src/sys/arch/sparc64/sparc64/static_edid.c
diff -u /dev/null src/sys/arch/sparc64/sparc64/static_edid.c:1.1
--- /dev/null	Sun Oct 11 19:39:23 2020
+++ src/sys/arch/sparc64/sparc64/static_edid.c	Sun Oct 11 19:39:22 2020
@@ -0,0 +1,58 @@
+/*	$NetBSD: static_edid.c,v 1.1 2020/10/11 19:39:22 jdc Exp $ */
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Julian Coleman.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: static_edid.c,v 1.1 2020/10/11 19:39:22 jdc Exp $");
+#include <sys/param.h>
+
+/* EDID blocks for some known hardware that doesn't provide its own */
+
+/*
+ * Naturetech Mesostation 999
+ * Based on VESA DMT 1E, but with slight adjustment to the horizontal timing
+ */
+uint8_t edid_meso999[128] = {
+/* 00 */	0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+/* 08 */	0x38, 0x34, 0x99, 0x09, 0x00, 0x00, 0x00, 0x00,
+/* 10 */	0xff, 0x0f, 0x01, 0x03, 0x68, 0x25, 0x17, 0x78,
+/* 18 */	0x2a, 0x3c, 0x40, 0x9c, 0x56, 0x4d, 0x98, 0x26,
+/* 20 */	0x16, 0x50, 0x54, 0xa5, 0x4a, 0x80, 0x81, 0x40,
+/* 28 */	0x81, 0x80, 0x81, 0x8f, 0x95, 0x00, 0x01, 0x01,
+/* 30 */	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xab, 0x22,
+/* 38 */	0xa0, 0xa0, 0x50, 0x84, 0x1a, 0x30, 0x38, 0x20,
+/* 40 */	0x36, 0x00, 0x9a, 0x01, 0x11, 0x00, 0x00, 0x1a,
+/* 48 */	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* 50 */	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* 58 */	0x00, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x4e,
+/* 60 */	0x41, 0x74, 0x75, 0x72, 0x65, 0x74, 0x65, 0x63,
+/* 68 */	0x68, 0x0a, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfe,
+/* 70 */	0x00, 0x4d, 0x65, 0x73, 0x6f, 0x20, 0x39, 0x39,
+/* 78 */	0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x00, 0xed
+};
Index: src/sys/arch/sparc64/sparc64/static_edid.h
diff -u /dev/null src/sys/arch/sparc64/sparc64/static_edid.h:1.1
--- /dev/null	Sun Oct 11 19:39:23 2020
+++ src/sys/arch/sparc64/sparc64/static_edid.h	Sun Oct 11 19:39:22 2020
@@ -0,0 +1,36 @@
+/*	$NetBSD: static_edid.h,v 1.1 2020/10/11 19:39:22 jdc Exp $ */
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Julian Coleman.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef STATIC_EDID_H
+#define STATIC_EDID_H
+
+extern uint8_t edid_meso999[128];
+
+#endif /* STATIC_EDID_H */

Reply via email to