Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/dev Add cn_halt function, disable interrupts...



details:   https://anonhg.NetBSD.org/src/rev/90e17566e9fd
branches:  trunk
changeset: 457872:90e17566e9fd
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jul 23 15:56:14 2019 +0000

description:
Add cn_halt function, disable interrupts when halting

diffstat:

 sys/arch/evbarm/dev/plcom.c |  24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r fc477a1f07c6 -r 90e17566e9fd sys/arch/evbarm/dev/plcom.c
--- a/sys/arch/evbarm/dev/plcom.c       Tue Jul 23 15:55:49 2019 +0000
+++ b/sys/arch/evbarm/dev/plcom.c       Tue Jul 23 15:56:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $ */
+/*     $NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -178,6 +178,7 @@
 int    plcomcngetc     (dev_t);
 void   plcomcnputc     (dev_t, int);
 void   plcomcnpollc    (dev_t, int);
+void   plcomcnhalt     (dev_t);
 
 #define        integrate       static inline
 void   plcomsoft       (void *);
@@ -2407,7 +2408,7 @@
  */
 struct consdev plcomcons = {
        NULL, NULL, plcomcngetc, plcomcnputc, plcomcnpollc, NULL,
-       NULL, NULL, NODEV, CN_NORMAL
+       plcomcnhalt, NULL, NODEV, CN_NORMAL
 };
 
 int
@@ -2466,6 +2467,23 @@
        plcom_readaheadcount = 0;
 }
 
+void
+plcomcnhalt(dev_t dev)
+{
+       struct plcom_instance *pi = &plcomcons_info;
+
+       switch (pi->pi_type) {
+       case PLCOM_TYPE_PL010:
+               PWRITE1(pi, PL010COM_CR, PL01X_CR_UARTEN);
+               break;
+       case PLCOM_TYPE_PL011:
+               PWRITE4(pi, PL011COM_CR,
+                   PL01X_CR_UARTEN | PL011_CR_RXE | PL011_CR_TXE);
+               PWRITE4(pi, PL011COM_IMSC, 0);
+               break;
+       }
+}
+
 #ifdef KGDB
 int
 plcom_kgdb_attach(struct plcom_instance *pi, int rate, int frequency,



Home | Main Index | Thread Index | Old Index