Module Name:    src
Committed By:   jmcneill
Date:           Sun Oct 21 18:31:14 UTC 2018

Modified Files:
        src/sys/dev/ic: pl061.c pl061var.h

Log Message:
Allow bus glue to reserve pins for private use


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/pl061.c src/sys/dev/ic/pl061var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/pl061.c
diff -u src/sys/dev/ic/pl061.c:1.1 src/sys/dev/ic/pl061.c:1.2
--- src/sys/dev/ic/pl061.c:1.1	Mon Oct 15 23:50:48 2018
+++ src/sys/dev/ic/pl061.c	Sun Oct 21 18:31:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pl061.c,v 1.1 2018/10/15 23:50:48 jmcneill Exp $ */
+/* $NetBSD: pl061.c,v 1.2 2018/10/21 18:31:14 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pl061.c,v 1.1 2018/10/15 23:50:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl061.c,v 1.2 2018/10/21 18:31:14 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -55,7 +55,8 @@ plgpio_attach(struct plgpio_softc *sc)
 	sc->sc_gc.gp_pin_write = plgpio_pin_write;
 	sc->sc_gc.gp_pin_ctl = plgpio_pin_ctl;
 
-	const uint32_t cnf = PLGPIO_READ(sc, PL061_GPIOAFSEL_REG);
+	const uint32_t cnf = PLGPIO_READ(sc, PL061_GPIOAFSEL_REG) |
+	    sc->sc_reserved_mask;
 
 	for (pin = 0; pin < 8; pin++) {
 		sc->sc_pins[pin].pin_num = pin;
Index: src/sys/dev/ic/pl061var.h
diff -u src/sys/dev/ic/pl061var.h:1.1 src/sys/dev/ic/pl061var.h:1.2
--- src/sys/dev/ic/pl061var.h:1.1	Mon Oct 15 23:50:48 2018
+++ src/sys/dev/ic/pl061var.h	Sun Oct 21 18:31:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pl061var.h,v 1.1 2018/10/15 23:50:48 jmcneill Exp $ */
+/* $NetBSD: pl061var.h,v 1.2 2018/10/21 18:31:14 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -36,6 +36,8 @@ struct plgpio_softc {
 
 	struct gpio_chipset_tag	sc_gc;
 	gpio_pin_t		sc_pins[8];
+
+	uint32_t		sc_reserved_mask;
 };
 
 void	plgpio_attach(struct plgpio_softc *);

Reply via email to