From f4728349c8df74da920ab951aca17a2d0da33df0 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sun, 20 Jan 2019 16:02:32 +0000 Subject: [PATCH] Re-add support for awge0.mac-address, fb.scale, and fb.depth cmdline options --- sys/arch/arm/amlogic/meson_platform.c | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm/amlogic/meson_platform.c b/sys/arch/arm/amlogic/meson_platform.c index 2b3e98fdc1a0..3d79d136ec6c 100644 --- a/sys/arch/arm/amlogic/meson_platform.c +++ b/sys/arch/arm/amlogic/meson_platform.c @@ -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 @@ -33,7 +33,7 @@ #include "arml2cc.h" #include -__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 #include @@ -58,6 +58,8 @@ __KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.1 2019/01/19 20:56:03 jmcneill #include #include +#include + #include #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