Sun Jun 21 07:17:25 2020 UTC ()
Update to new proplib api


(skrll)
diff -r1.37 -r1.38 src/sys/arch/arm/broadcom/bcm283x_platform.c

cvs diff -r1.37 -r1.38 src/sys/arch/arm/broadcom/bcm283x_platform.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm283x_platform.c 2020/02/22 00:28:35 1.37
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c 2020/06/21 07:17:25 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm283x_platform.c,v 1.37 2020/02/22 00:28:35 jmcneill Exp $ */ 1/* $NetBSD: bcm283x_platform.c,v 1.38 2020/06/21 07:17:25 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.37 2020/02/22 00:28:35 jmcneill Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.38 2020/06/21 07:17:25 skrll Exp $");
31 31
32#include "opt_arm_debug.h" 32#include "opt_arm_debug.h"
33#include "opt_bcm283x.h" 33#include "opt_bcm283x.h"
34#include "opt_cpuoptions.h" 34#include "opt_cpuoptions.h"
35#include "opt_ddb.h" 35#include "opt_ddb.h"
36#include "opt_evbarm_boardtype.h" 36#include "opt_evbarm_boardtype.h"
37#include "opt_kgdb.h" 37#include "opt_kgdb.h"
38#include "opt_fdt.h" 38#include "opt_fdt.h"
39#include "opt_rpi.h" 39#include "opt_rpi.h"
40#include "opt_vcprop.h" 40#include "opt_vcprop.h"
41 41
42#include "sdhc.h" 42#include "sdhc.h"
43#include "bcmsdhost.h" 43#include "bcmsdhost.h"
@@ -1418,34 +1418,28 @@ bcm283x_platform_device_register(device_ @@ -1418,34 +1418,28 @@ bcm283x_platform_device_register(device_
1418 if ((device_is_a(dev, "usmsc") || 1418 if ((device_is_a(dev, "usmsc") ||
1419 device_is_a(dev, "mue") || 1419 device_is_a(dev, "mue") ||
1420 device_is_a(dev, "genet")) && 1420 device_is_a(dev, "genet")) &&
1421 vcprop_tag_success_p(&vb.vbt_macaddr.tag)) { 1421 vcprop_tag_success_p(&vb.vbt_macaddr.tag)) {
1422 const uint8_t enaddr[ETHER_ADDR_LEN] = { 1422 const uint8_t enaddr[ETHER_ADDR_LEN] = {
1423 (vb.vbt_macaddr.addr >> 0) & 0xff, 1423 (vb.vbt_macaddr.addr >> 0) & 0xff,
1424 (vb.vbt_macaddr.addr >> 8) & 0xff, 1424 (vb.vbt_macaddr.addr >> 8) & 0xff,
1425 (vb.vbt_macaddr.addr >> 16) & 0xff, 1425 (vb.vbt_macaddr.addr >> 16) & 0xff,
1426 (vb.vbt_macaddr.addr >> 24) & 0xff, 1426 (vb.vbt_macaddr.addr >> 24) & 0xff,
1427 (vb.vbt_macaddr.addr >> 32) & 0xff, 1427 (vb.vbt_macaddr.addr >> 32) & 0xff,
1428 (vb.vbt_macaddr.addr >> 40) & 0xff 1428 (vb.vbt_macaddr.addr >> 40) & 0xff
1429 }; 1429 };
1430 1430
1431 prop_data_t pd = prop_data_create_data(enaddr, ETHER_ADDR_LEN); 1431 prop_dictionary_set_data(dict, "mac-address", enaddr,
1432 KASSERT(pd != NULL); 1432 ETHER_ADDR_LEN);
1433 if (prop_dictionary_set(device_properties(dev), "mac-address", 
1434 pd) == false) { 
1435 aprint_error_dev(dev, 
1436 "WARNING: Unable to set mac-address property\n"); 
1437 } 
1438 prop_object_release(pd); 
1439 } 1433 }
1440 1434
1441#if NGENFB > 0 1435#if NGENFB > 0
1442 if (device_is_a(dev, "genfb")) { 1436 if (device_is_a(dev, "genfb")) {
1443 char *ptr; 1437 char *ptr;
1444 1438
1445 bcmgenfb_set_console_dev(dev); 1439 bcmgenfb_set_console_dev(dev);
1446 bcmgenfb_set_ioctl(&rpi_ioctl); 1440 bcmgenfb_set_ioctl(&rpi_ioctl);
1447#ifdef DDB 1441#ifdef DDB
1448 db_trap_callback = bcmgenfb_ddb_trap_callback; 1442 db_trap_callback = bcmgenfb_ddb_trap_callback;
1449#endif 1443#endif
1450 if (rpi_fb_init(dict, aux) == false) 1444 if (rpi_fb_init(dict, aux) == false)
1451 return; 1445 return;