summaryrefslogtreecommitdiffstats
path: root/sys/arm/s3c2xx0
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-01-19 19:36:11 +0000
committerimp <imp@FreeBSD.org>2014-01-19 19:36:11 +0000
commitda5df765d5b2dcffd55c078fbb36f27310d0751e (patch)
tree76518547e862bbe70161720988a5bae5fd6a90ab /sys/arm/s3c2xx0
parent13c3304ef662d70494a0b84b14a9b3548ec34229 (diff)
downloadFreeBSD-src-da5df765d5b2dcffd55c078fbb36f27310d0751e.zip
FreeBSD-src-da5df765d5b2dcffd55c078fbb36f27310d0751e.tar.gz
Introduce grab and ungrab upcalls. When the kernel desires to grab the
console, it calls the grab functions. These functions should turn off the RX interrupts, and any others that interfere. This makes mountroot prompt work again. If there's more generalized need other than prompting, many of these routines should be expanded to do those new things. Reviewed by: bde (with reservations)
Diffstat (limited to 'sys/arm/s3c2xx0')
-rw-r--r--sys/arm/s3c2xx0/uart_dev_s3c2410.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/arm/s3c2xx0/uart_dev_s3c2410.c b/sys/arm/s3c2xx0/uart_dev_s3c2410.c
index 0f9f798..aadd835 100644
--- a/sys/arm/s3c2xx0/uart_dev_s3c2410.c
+++ b/sys/arm/s3c2xx0/uart_dev_s3c2410.c
@@ -203,7 +203,6 @@ s3c2410_getc(struct uart_bas *bas, struct mtx *mtx)
return sscom_getc(bas->bst, bas->bsh);
}
-
static int s3c2410_bus_probe(struct uart_softc *sc);
static int s3c2410_bus_attach(struct uart_softc *sc);
static int s3c2410_bus_flush(struct uart_softc *, int);
@@ -214,6 +213,8 @@ static int s3c2410_bus_param(struct uart_softc *, int, int, int, int);
static int s3c2410_bus_receive(struct uart_softc *);
static int s3c2410_bus_setsig(struct uart_softc *, int);
static int s3c2410_bus_transmit(struct uart_softc *);
+static void s3c2410_bus_grab(struct uart_softc *);
+static void s3c2410_bus_ungrab(struct uart_softc *);
static kobj_method_t s3c2410_methods[] = {
KOBJMETHOD(uart_probe, s3c2410_bus_probe),
@@ -226,6 +227,8 @@ static kobj_method_t s3c2410_methods[] = {
KOBJMETHOD(uart_receive, s3c2410_bus_receive),
KOBJMETHOD(uart_setsig, s3c2410_bus_setsig),
KOBJMETHOD(uart_transmit, s3c2410_bus_transmit),
+ KOBJMETHOD(uart_grab, s3c2410_bus_grab),
+ KOBJMETHOD(uart_ungrab, s3c2410_bus_ungrab),
{0, 0 }
};
@@ -373,6 +376,25 @@ s3c2410_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)
return (EINVAL);
}
+
+static void
+s3c2410_bus_grab(struct uart_softc *sc)
+{
+ uintptr_t irq;
+
+ irq = rman_get_start(sc->sc_ires);
+ arm_mask_irq(get_sub_irq(irq, RX_OFF));
+}
+
+static void
+s3c2410_bus_ungrab(struct uart_softc *sc)
+{
+ uintptr_t irq;
+
+ irq = rman_get_start(sc->sc_ires);
+ arm_unmask_irq(get_sub_irq(irq, RX_OFF));
+}
+
struct uart_class uart_s3c2410_class = {
"s3c2410 class",
s3c2410_methods,
OpenPOWER on IntegriCloud