Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/amlogic Re-add support for awge0.mac-address, f...



details:   https://anonhg.NetBSD.org/src/rev/26325216090a
branches:  trunk
changeset: 447651:26325216090a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jan 20 16:02:32 2019 +0000

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

diffstat:

 sys/arch/arm/amlogic/meson_platform.c |  31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diffs (59 lines):

diff -r b23dd2645f5a -r 26325216090a sys/arch/arm/amlogic/meson_platform.c
--- a/sys/arch/arm/amlogic/meson_platform.c     Sun Jan 20 15:56:40 2019 +0000
+++ b/sys/arch/arm/amlogic/meson_platform.c     Sun Jan 20 16:02:32 2019 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
 #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 @@
 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



Home | Main Index | Thread Index | Old Index