Module Name:    src
Committed By:   jmcneill
Date:           Fri Oct 12 22:18:38 UTC 2018

Modified Files:
        src/sys/arch/evbarm/dev: plcom.c

Log Message:
If rate or frequency are unspecified, assume "use firmware configuration" for 
clocks


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/dev/plcom.c

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

Modified files:

Index: src/sys/arch/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.53 src/sys/arch/evbarm/dev/plcom.c:1.54
--- src/sys/arch/evbarm/dev/plcom.c:1.53	Tue Nov  7 07:21:13 2017
+++ src/sys/arch/evbarm/dev/plcom.c	Fri Oct 12 22:18:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.53 2017/11/07 07:21:13 skrll Exp $	*/
+/*	$NetBSD: plcom.c,v 1.54 2018/10/12 22:18:38 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.53 2017/11/07 07:21:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.54 2018/10/12 22:18:38 jmcneill Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -2367,18 +2367,22 @@ plcominit(struct plcom_instance *pi, int
 	case PLCOM_TYPE_PL010:
 		PWRITE1(pi, PL010COM_CR, 0);
 
-		rate = pl010comspeed(rate, frequency);
-		PWRITE1(pi, PL010COM_DLBL, (rate & 0xff));
-		PWRITE1(pi, PL010COM_DLBH, ((rate >> 8) & 0xff));
+		if (rate && frequency) {
+			rate = pl010comspeed(rate, frequency);
+			PWRITE1(pi, PL010COM_DLBL, (rate & 0xff));
+			PWRITE1(pi, PL010COM_DLBH, ((rate >> 8) & 0xff));
+		}
 		PWRITE1(pi, PL010COM_LCR, lcr);
 		PWRITE1(pi, PL010COM_CR, PL01X_CR_UARTEN);
 		break;
 	case PLCOM_TYPE_PL011:
 		PWRITE4(pi, PL011COM_CR, 0);
 
-		rate = pl011comspeed(rate, frequency);
-		PWRITE1(pi, PL011COM_FBRD, rate & ((1 << 6) - 1));
-		PWRITE4(pi, PL011COM_IBRD, rate >> 6);
+		if (rate && frequency) {
+			rate = pl011comspeed(rate, frequency);
+			PWRITE1(pi, PL011COM_FBRD, rate & ((1 << 6) - 1));
+			PWRITE4(pi, PL011COM_IBRD, rate >> 6);
+		}
 		PWRITE1(pi, PL011COM_LCRH, lcr);
 		PWRITE4(pi, PL011COM_CR,
 		    PL01X_CR_UARTEN | PL011_CR_RXE | PL011_CR_TXE);

Reply via email to