Module Name:    src
Committed By:   jmcneill
Date:           Sun Jan 20 16:02:33 UTC 2019

Modified Files:
        src/sys/arch/arm/amlogic: meson_platform.c

Log Message:
Re-add support for awge0.mac-address, fb.scale, and fb.depth cmdline options


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/meson_platform.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/arm/amlogic/meson_platform.c
diff -u src/sys/arch/arm/amlogic/meson_platform.c:1.1 src/sys/arch/arm/amlogic/meson_platform.c:1.2
--- src/sys/arch/arm/amlogic/meson_platform.c:1.1	Sat Jan 19 20:56:03 2019
+++ src/sys/arch/arm/amlogic/meson_platform.c	Sun Jan 20 16:02:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_platform.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $ */
+/* $NetBSD: meson_platform.c,v 1.2 2019/01/20 16:02:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <[email protected]>
@@ -33,7 +33,7 @@
 #include "arml2cc.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.2 2019/01/20 16:02:32 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -58,6 +58,8 @@ __KERNEL_RCSID(0, "$NetBSD: meson_platfo
 #include <evbarm/fdt/platform.h>
 #include <evbarm/fdt/machdep.h>
 
+#include <net/if_ether.h>
+
 #include <libfdt.h>
 
 #define	MESON_CORE_APB3_VBASE	KERNEL_IO_VBASE
@@ -168,6 +170,31 @@ meson_platform_early_putchar(char c)
 static void
 meson_platform_device_register(device_t self, void *aux)
 {
+	prop_dictionary_t dict = device_properties(self);
+
+	if (device_is_a(self, "awge") && device_unit(self) == 0) {
+		uint8_t enaddr[ETHER_ADDR_LEN];
+		if (get_bootconf_option(boot_args, "awge0.mac-address",
+		    BOOTOPT_TYPE_MACADDR, enaddr)) {
+			prop_data_t pd = prop_data_create_data(enaddr,
+			    sizeof(enaddr));
+			prop_dictionary_set(dict, "mac-address", pd);
+			prop_object_release(pd);
+		}
+	}
+
+	if (device_is_a(self, "genfb")) {
+		int scale, depth;
+
+		if (get_bootconf_option(boot_args, "fb.scale",
+		    BOOTOPT_TYPE_INT, &scale) && scale > 0) {
+			prop_dictionary_set_uint32(dict, "scale", scale);
+		}
+		if (get_bootconf_option(boot_args, "fb.depth",
+		    BOOTOPT_TYPE_INT, &depth)) {
+			prop_dictionary_set_uint32(dict, "depth", depth);
+		}
+	}
 }
 
 static u_int

Reply via email to