Module Name:    src
Committed By:   jmcneill
Date:           Sun May 27 17:05:06 UTC 2018

Modified Files:
        src/sys/arch/arm/sunxi: sunxi_com.c
        src/sys/dev/ic: com.c comvar.h

Log Message:
Rename COM_TYPE_SUNXI -> COM_TYPE_DW_APB


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_com.c
cvs rdiff -u -r1.347 -r1.348 src/sys/dev/ic/com.c
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/ic/comvar.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/arch/arm/sunxi/sunxi_com.c
diff -u src/sys/arch/arm/sunxi/sunxi_com.c:1.4 src/sys/arch/arm/sunxi/sunxi_com.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_com.c:1.4	Sun Oct 29 14:07:11 2017
+++ src/sys/arch/arm/sunxi/sunxi_com.c	Sun May 27 17:05:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_com.c,v 1.4 2017/10/29 14:07:11 jmcneill Exp $ */
+/* $NetBSD: sunxi_com.c,v 1.5 2018/05/27 17:05:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sunxi_com.c,v 1.4 2017/10/29 14:07:11 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sunxi_com.c,v 1.5 2018/05/27 17:05:06 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -122,7 +122,7 @@ sunxi_com_attach(device_t parent, device
 	}
 
 	sc->sc_frequency = clk_get_rate(ssc->ssc_clk);
-	sc->sc_type = COM_TYPE_SUNXI;
+	sc->sc_type = COM_TYPE_DW_APB;
 
 	error = bus_space_map(bst, addr, size, 0, &bsh);
 	if (error) {
@@ -174,7 +174,7 @@ sunxi_com_console_consinit(struct fdt_at
 		speed = 115200;	/* default */
 	flags = fdtbus_get_stdout_flags();
 
-	if (comcnattach(bst, addr, speed, uart_freq, COM_TYPE_SUNXI, flags))
+	if (comcnattach(bst, addr, speed, uart_freq, COM_TYPE_DW_APB, flags))
 		panic("Cannot initialize sunxi com console");
 }
 

Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.347 src/sys/dev/ic/com.c:1.348
--- src/sys/dev/ic/com.c:1.347	Sun Apr  8 13:38:32 2018
+++ src/sys/dev/ic/com.c	Sun May 27 17:05:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.347 2018/04/08 13:38:32 jmcneill Exp $ */
+/* $NetBSD: com.c,v 1.348 2018/05/27 17:05:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.347 2018/04/08 13:38:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.348 2018/05/27 17:05:06 jmcneill Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -425,7 +425,7 @@ com_attach_subr(struct com_softc *sc)
 
 		switch (sc->sc_type) {
 		case COM_TYPE_16750:
-		case COM_TYPE_SUNXI:
+		case COM_TYPE_DW_APB:
 			/* Use in comintr(). */
  			sc->sc_lcr = cflag2lcr(comcons_info.cflag);
 			break;
@@ -1601,7 +1601,7 @@ com_iflush(struct com_softc *sc)
 
 	switch (sc->sc_type) {
 	case COM_TYPE_16750:
-	case COM_TYPE_SUNXI:
+	case COM_TYPE_DW_APB:
 		/*
 		 * Reset all Rx/Tx FIFO, preserve current FIFO length.
 		 * This should prevent triggering busy interrupt while
@@ -2059,8 +2059,8 @@ comintr(void *arg)
 		iir = CSR_READ_1(regsp, COM_REG_IIR);
 	}
 
-	/* Allwinner BUSY interrupt */
-	if (sc->sc_type == COM_TYPE_SUNXI &&
+	/* DesignWare APB UART BUSY interrupt */
+	if (sc->sc_type == COM_TYPE_DW_APB &&
 	    (iir & IIR_BUSY) == IIR_BUSY) {
 		if ((CSR_READ_1(regsp, COM_REG_USR) & 0x1) != 0) {
 			CSR_WRITE_1(regsp, COM_REG_HALT, HALT_CHCFG_EN);

Index: src/sys/dev/ic/comvar.h
diff -u src/sys/dev/ic/comvar.h:1.86 src/sys/dev/ic/comvar.h:1.87
--- src/sys/dev/ic/comvar.h:1.86	Mon Dec  4 09:55:37 2017
+++ src/sys/dev/ic/comvar.h	Sun May 27 17:05:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: comvar.h,v 1.86 2017/12/04 09:55:37 bouyer Exp $	*/
+/*	$NetBSD: comvar.h,v 1.87 2018/05/27 17:05:06 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -91,10 +91,10 @@ int com_is_console(bus_space_tag_t, bus_
 #define	COM_REG_MCR		9
 #define	COM_REG_LSR		10
 #define	COM_REG_MSR		11
-#define	COM_REG_USR		31	/* 16750/SUNXI */
-#define	COM_REG_TFL		com_tfl		/* SUNXI */
-#define	COM_REG_RFL		com_rfl		/* SUNXI */
-#define	COM_REG_HALT		com_halt	/* SUNXI */
+#define	COM_REG_USR		31	/* 16750/DW APB */
+#define	COM_REG_TFL		com_tfl		/* DW APB */
+#define	COM_REG_RFL		com_rfl		/* DW APB */
+#define	COM_REG_HALT		com_halt	/* DW APB */
 
 struct com_regs {
 	bus_space_tag_t		cr_iot;
@@ -131,10 +131,10 @@ extern const bus_size_t com_std_map[42];
 #define	COM_REG_TCR		com_msr
 #define	COM_REG_TLR		com_scratch
 #define	COM_REG_MDR1		8
-#define COM_REG_USR		com_usr		/* 16750/SUNXI */
-#define	COM_REG_TFL		com_tfl		/* SUNXI */
-#define	COM_REG_RFL		com_rfl		/* SUNXI */
-#define	COM_REG_HALT		com_halt	/* SUNXI */
+#define COM_REG_USR		com_usr		/* 16750/DW APB */
+#define	COM_REG_TFL		com_tfl		/* DW APB */
+#define	COM_REG_RFL		com_rfl		/* DW APB */
+#define	COM_REG_HALT		com_halt	/* DW APB */
 
 struct com_regs {
 	bus_space_tag_t		cr_iot;
@@ -230,7 +230,7 @@ struct com_softc {
 #define	COM_TYPE_BCMAUXUART	8	/* BCM2835 AUX UART */
 #define	COM_TYPE_16650		9
 #define	COM_TYPE_16750		10
-#define	COM_TYPE_SUNXI		11	/* Allwinner built-in */
+#define	COM_TYPE_DW_APB		11	/* DesignWare APB UART */
 
 	/* power management hooks */
 	int (*enable)(struct com_softc *);

Reply via email to