Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/arch Pull up following revision(s) (requested by jmcn...



details:   https://anonhg.NetBSD.org/src/rev/3be2d3abf059
branches:  netbsd-8
changeset: 434015:3be2d3abf059
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Jun 21 17:43:32 2017 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #43):
        sys/arch/arm/broadcom/bcm2835_bsc.c: revision 1.6
        sys/arch/evbarm/rpi/rpi_machdep.c: revision 1.71
        sys/arch/evbarm/rpi/vcprop.h: revision 1.16
Disable BSC0 on Raspberry Pi 3 and Zero W boards.

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc.c |  13 +++++++++++--
 sys/arch/evbarm/rpi/rpi_machdep.c   |  19 +++++++++++++++++--
 sys/arch/evbarm/rpi/vcprop.h        |  24 +++++++++++++++++++++++-
 3 files changed, 51 insertions(+), 5 deletions(-)

diffs (121 lines):

diff -r faceb29ba0cd -r 3be2d3abf059 sys/arch/arm/broadcom/bcm2835_bsc.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc.c       Wed Jun 21 17:41:50 2017 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc.c       Wed Jun 21 17:43:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $ */
+/*     $NetBSD: bcm2835_bsc.c,v 1.5.10.1 2017/06/21 17:43:32 snj Exp $ */
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.5.10.1 2017/06/21 17:43:32 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -99,8 +99,10 @@
 {
        struct bsciic_softc * const sc = device_private(self);
        struct amba_attach_args * const aaa = aux;
+       prop_dictionary_t prop = device_properties(self);
        struct i2cbus_attach_args iba;
        u_int bscunit = ~0;
+       bool disable = false;
        static ONCE_DECL(control);
 
        switch (aaa->aaa_addr) {
@@ -112,6 +114,13 @@
                break;
        }
 
+       prop_dictionary_get_bool(prop, "disable", &disable);
+       if (disable) {
+               aprint_naive(": disabled\n");
+               aprint_normal(": disabled\n");
+               return;
+       }
+
        aprint_naive("\n");
        aprint_normal(": BSC%u\n", bscunit);
 
diff -r faceb29ba0cd -r 3be2d3abf059 sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Wed Jun 21 17:41:50 2017 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Wed Jun 21 17:43:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.70 2017/01/06 14:55:37 skrll Exp $   */
+/*     $NetBSD: rpi_machdep.c,v 1.70.8.1 2017/06/21 17:43:33 snj Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.70 2017/01/06 14:55:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.70.8.1 2017/06/21 17:43:33 snj Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -1201,6 +1201,21 @@
                }
        }
 #endif
+
+       /* BSC0 is used internally on some boards */
+       if (device_is_a(dev, "bsciic") &&
+           ((struct amba_attach_args *)aux)->aaa_addr == BCM2835_BSC0_BASE) {
+               const uint32_t rev = vb.vbt_boardrev.rev;
+
+               if ((rev & VCPROP_REV_ENCFLAG) != 0) {
+                       switch (__SHIFTOUT(rev, VCPROP_REV_MODEL)) {
+                       case RPI_MODEL_B_PI3:
+                       case RPI_MODEL_ZERO_W:
+                               prop_dictionary_set_bool(dict, "disable", true);
+                               break;
+                       }
+               }
+       }
 }
 
 SYSCTL_SETUP(sysctl_machdep_rpi, "sysctl machdep subtree setup (rpi)")
diff -r faceb29ba0cd -r 3be2d3abf059 sys/arch/evbarm/rpi/vcprop.h
--- a/sys/arch/evbarm/rpi/vcprop.h      Wed Jun 21 17:41:50 2017 +0000
+++ b/sys/arch/evbarm/rpi/vcprop.h      Wed Jun 21 17:43:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vcprop.h,v 1.15 2016/04/03 11:02:17 mlelstv Exp $      */
+/*     $NetBSD: vcprop.h,v 1.15.10.1 2017/06/21 17:43:33 snj Exp $     */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -137,6 +137,28 @@
        uint32_t rev;
 } ;
 
+#define        VCPROP_REV_PCBREV       __BITS(3,0)
+#define        VCPROP_REV_MODEL        __BITS(11,4)
+#define         RPI_MODEL_A            0
+#define         RPI_MODEL_B            1
+#define         RPI_MODEL_A_PLUS       2
+#define         RPI_MODEL_B_PLUS       3
+#define         RPI_MODEL_B_PI2        4
+#define         RPI_MODEL_ALPHA        5
+#define         RPI_MODEL_COMPUTE      6
+#define         RPI_MODEL_ZERO         7
+#define         RPI_MODEL_B_PI3        8
+#define         RPI_MODEL_COMPUTE_PI3  9
+#define         RPI_MODEL_ZERO_W       10
+#define        VCPROP_REV_PROCESSOR    __BITS(15,12)
+#define         RPI_PROCESSOR_BCM2835  0
+#define         RPI_PROCESSOR_BCM2836  1
+#define         RPI_PROCESSOR_BCM2837  2
+#define        VCPROP_REV_MANUF        __BITS(19,16)
+#define        VCPROP_REV_MEMSIZE      __BITS(22,20)
+#define        VCPROP_REV_ENCFLAG      __BIT(23)
+#define        VCPROP_REV_WARRANTY     __BITS(25,24)
+
 struct vcprop_tag_macaddr {
        struct vcprop_tag tag;
        uint64_t addr;



Home | Main Index | Thread Index | Old Index