Module Name: src
Committed By: simonb
Date: Sun May 31 14:05:21 UTC 2020
Modified Files:
src/sys/arch/evbmips/cavium: machdep.c
src/sys/arch/mips/cavium: octeon1p_iobus.c
src/sys/arch/mips/cavium/dev: octeon_uart.c
Log Message:
Finish rename of all Cavium Octeon device driver functions, structs etc from
"octeon_foo" to "octfoo" (missed octeon_uart + entries in iobus config).
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbmips/cavium/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/octeon1p_iobus.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_uart.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/evbmips/cavium/machdep.c
diff -u src/sys/arch/evbmips/cavium/machdep.c:1.10 src/sys/arch/evbmips/cavium/machdep.c:1.11
--- src/sys/arch/evbmips/cavium/machdep.c:1.10 Wed Dec 28 03:27:08 2016
+++ src/sys/arch/evbmips/cavium/machdep.c Sun May 31 14:05:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.10 2016/12/28 03:27:08 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.11 2020/05/31 14:05:21 simonb Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -115,7 +115,7 @@
#include "opt_cavium.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2016/12/28 03:27:08 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2020/05/31 14:05:21 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -314,7 +314,7 @@ mach_init_console(void)
#if NCOM > 0
struct octeon_config *mcp = &octeon_configuration;
int status;
- extern int octeon_uart_com_cnattach(bus_space_tag_t, int, int);
+ extern int octuart_com_cnattach(bus_space_tag_t, int, int);
/*
* Delay to allow firmware putchars to complete.
@@ -323,7 +323,7 @@ mach_init_console(void)
*/
delay(640000000 / comcnrate);
- status = octeon_uart_com_cnattach(
+ status = octuart_com_cnattach(
&mcp->mc_iobus_bust,
0, /* XXX port 0 */
comcnrate);
Index: src/sys/arch/mips/cavium/octeon1p_iobus.c
diff -u src/sys/arch/mips/cavium/octeon1p_iobus.c:1.3 src/sys/arch/mips/cavium/octeon1p_iobus.c:1.4
--- src/sys/arch/mips/cavium/octeon1p_iobus.c:1.3 Sun May 31 04:56:35 2020
+++ src/sys/arch/mips/cavium/octeon1p_iobus.c Sun May 31 14:05:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: octeon1p_iobus.c,v 1.3 2020/05/31 04:56:35 simonb Exp $ */
+/* $NetBSD: octeon1p_iobus.c,v 1.4 2020/05/31 14:05:21 simonb Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.3 2020/05/31 04:56:35 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.4 2020/05/31 14:05:21 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -43,7 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: octeon1p_iob
/* ---- UART */
#include <mips/cavium/dev/octeon_uartreg.h>
-static const struct iobus_unit iobus_units_octeon_uart[] = {
+static const struct iobus_unit iobus_units_octuart[] = {
{
.addr = MIO_UART0_BASE
},
@@ -52,95 +52,95 @@ static const struct iobus_unit iobus_uni
}
};
-static const struct iobus_dev iobus_dev_octeon_uart = {
+static const struct iobus_dev iobus_dev_octuart = {
.name = "com",
.nunits = 2,
- .units = iobus_units_octeon_uart
+ .units = iobus_units_octuart
};
/* ---- RNM */
#include <mips/cavium/dev/octeon_rnmreg.h>
-static const struct iobus_unit iobus_units_octeon_rnm[] = {
+static const struct iobus_unit iobus_units_octrnm[] = {
{
.addr = RNM_BASE
}
};
-static const struct iobus_dev iobus_dev_octeon_rnm = {
+static const struct iobus_dev iobus_dev_octrnm = {
.name = "octrnm",
.nunits = RNM_NUNITS,
- .units = iobus_units_octeon_rnm
+ .units = iobus_units_octrnm
};
/* ---- TWSI */
#include <mips/cavium/dev/octeon_twsireg.h>
-static const struct iobus_unit iobus_units_octeon_twsi[] = {
+static const struct iobus_unit iobus_units_octtwsi[] = {
{
.addr = MIO_TWS_BASE_0
}
};
-static const struct iobus_dev iobus_dev_octeon_twsi = {
+static const struct iobus_dev iobus_dev_octtwsi = {
.name = "octtwsi",
.nunits = MIO_TWS_NUNITS,
- .units = iobus_units_octeon_twsi
+ .units = iobus_units_octtwsi
};
/* ---- MPI/SPI */
#include <mips/cavium/dev/octeon_mpireg.h>
-static const struct iobus_unit iobus_units_octeon_mpi[] = {
+static const struct iobus_unit iobus_units_octmpi[] = {
{
.addr = MPI_BASE
}
};
-static const struct iobus_dev iobus_dev_octeon_mpi = {
+static const struct iobus_dev iobus_dev_octmpi = {
.name = "octmpi",
.nunits = MPI_NUNITS,
- .units = iobus_units_octeon_mpi
+ .units = iobus_units_octmpi
};
/* ---- GMX */
#include <mips/cavium/dev/octeon_gmxreg.h>
-static const struct iobus_unit iobus_units_octeon_gmx[] = {
+static const struct iobus_unit iobus_units_octgmx[] = {
{
.addr = GMX0_BASE_IF0
}
};
-static const struct iobus_dev iobus_dev_octeon_gmx = {
+static const struct iobus_dev iobus_dev_octgmx = {
.name = "octgmx",
.nunits = GMX_IF_NUNITS,
- .units = iobus_units_octeon_gmx
+ .units = iobus_units_octgmx
};
/* ---- USBN */
#include <mips/cavium/dev/octeon_usbnreg.h>
-static const struct iobus_unit iobus_units_octeon_usbn[] = {
+static const struct iobus_unit iobus_units_octusbn[] = {
{
.addr = USBN_BASE
}
};
-static const struct iobus_dev iobus_dev_octeon_usbn = {
+static const struct iobus_dev iobus_dev_octusbn = {
.name = "dwctwo",
.nunits = USBN_NUNITS,
- .units = iobus_units_octeon_usbn
+ .units = iobus_units_octusbn
};
/* ---- global */
const struct iobus_dev * const iobus_devs[] = {
- &iobus_dev_octeon_uart,
- &iobus_dev_octeon_rnm,
- &iobus_dev_octeon_twsi,
- &iobus_dev_octeon_mpi,
- &iobus_dev_octeon_gmx,
- &iobus_dev_octeon_usbn,
+ &iobus_dev_octuart,
+ &iobus_dev_octrnm,
+ &iobus_dev_octtwsi,
+ &iobus_dev_octmpi,
+ &iobus_dev_octgmx,
+ &iobus_dev_octusbn,
};
const size_t iobus_ndevs = __arraycount(iobus_devs);
Index: src/sys/arch/mips/cavium/dev/octeon_uart.c
diff -u src/sys/arch/mips/cavium/dev/octeon_uart.c:1.4 src/sys/arch/mips/cavium/dev/octeon_uart.c:1.5
--- src/sys/arch/mips/cavium/dev/octeon_uart.c:1.4 Sun May 31 04:56:35 2020
+++ src/sys/arch/mips/cavium/dev/octeon_uart.c Sun May 31 14:05:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: octeon_uart.c,v 1.4 2020/05/31 04:56:35 simonb Exp $ */
+/* $NetBSD: octeon_uart.c,v 1.5 2020/05/31 14:05:21 simonb Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: octeon_uart.c,v 1.4 2020/05/31 04:56:35 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_uart.c,v 1.5 2020/05/31 14:05:21 simonb Exp $");
#include "opt_octeon.h"
@@ -48,30 +48,30 @@ __KERNEL_RCSID(0, "$NetBSD: octeon_uart.
#include <mips/cavium/dev/octeon_uartreg.h>
#include <mips/cavium/dev/octeon_ciureg.h>
-struct octeon_uart_iobus_softc {
+struct octuart_iobus_softc {
struct com_softc sc_com;
int sc_irq;
void *sc_ih;
};
-static int octeon_uart_iobus_match(device_t, struct cfdata *, void *);
-static void octeon_uart_iobus_attach(device_t, device_t, void *);
-static int octeon_uart_com_enable(struct com_softc *);
-static void octeon_uart_com_disable(struct com_softc *);
+static int octuart_iobus_match(device_t, struct cfdata *, void *);
+static void octuart_iobus_attach(device_t, device_t, void *);
+static int octuart_com_enable(struct com_softc *);
+static void octuart_com_disable(struct com_softc *);
#define CN30XXUART_BUSYDETECT 0x7
/* XXX */
-int octeon_uart_com_cnattach(bus_space_tag_t, int, int);
+int octuart_com_cnattach(bus_space_tag_t, int, int);
/* XXX */
-const bus_addr_t octeon_uart_com_bases[] = {
+const bus_addr_t octuart_com_bases[] = {
MIO_UART0_BASE,
MIO_UART1_BASE
};
-const struct com_regs octeon_uart_com_regs = {
+const struct com_regs octuart_com_regs = {
.cr_nports = COM_NPORTS,
.cr_map = {
[COM_REG_RXDATA] = MIO_UART_RBR_OFFSET,
@@ -93,11 +93,11 @@ const struct com_regs octeon_uart_com_re
}
};
-CFATTACH_DECL_NEW(com_iobus, sizeof(struct octeon_uart_iobus_softc),
- octeon_uart_iobus_match, octeon_uart_iobus_attach, NULL, NULL);
+CFATTACH_DECL_NEW(com_iobus, sizeof(struct octuart_iobus_softc),
+ octuart_iobus_match, octuart_iobus_attach, NULL, NULL);
int
-octeon_uart_iobus_match(device_t parent, struct cfdata *cf, void *aux)
+octuart_iobus_match(device_t parent, struct cfdata *cf, void *aux)
{
struct iobus_attach_args *aa = aux;
int result = 0;
@@ -113,15 +113,15 @@ out:
}
void
-octeon_uart_iobus_attach(device_t parent, device_t self, void *aux)
+octuart_iobus_attach(device_t parent, device_t self, void *aux)
{
- struct octeon_uart_iobus_softc *sc = device_private(self);
+ struct octuart_iobus_softc *sc = device_private(self);
struct com_softc *sc_com = &sc->sc_com;
struct iobus_attach_args *aa = aux;
int status;
sc_com->sc_dev = self;
- sc_com->sc_regs = octeon_uart_com_regs;
+ sc_com->sc_regs = octuart_com_regs;
sc_com->sc_regs.cr_iot = aa->aa_bust;
sc_com->sc_regs.cr_iobase = aa->aa_unit->addr;
@@ -140,10 +140,10 @@ octeon_uart_iobus_attach(device_t parent
sc_com->sc_type = COM_TYPE_16550_NOERS;
sc_com->sc_frequency = curcpu()->ci_cpu_freq;
- sc_com->enable = octeon_uart_com_enable;
- sc_com->disable = octeon_uart_com_disable;
+ sc_com->enable = octuart_com_enable;
+ sc_com->disable = octuart_com_disable;
- octeon_uart_com_enable(sc_com);
+ octuart_com_enable(sc_com);
sc_com->enabled = 1;
com_attach_subr(sc_com);
@@ -160,16 +160,16 @@ octeon_uart_iobus_attach(device_t parent
#if 0
void
-octeon_uart_iobus_detach(device_t self, ...)
+octuart_iobus_detach(device_t self, ...)
{
- struct octeon_uart_iobus_softc *sc = (void *)self;
+ struct octuart_iobus_softc *sc = (void *)self;
octeon_intr_disestablish(sc->ih);
}
#endif
int
-octeon_uart_com_enable(struct com_softc *sc_com)
+octuart_com_enable(struct com_softc *sc_com)
{
struct com_regs *regsp = &sc_com->sc_regs;
@@ -181,7 +181,7 @@ octeon_uart_com_enable(struct com_softc
}
void
-octeon_uart_com_disable(struct com_softc *sc_com)
+octuart_com_disable(struct com_softc *sc_com)
{
/*
* XXX chip specific procedure
@@ -194,13 +194,13 @@ octeon_uart_com_disable(struct com_softc
#endif
int
-octeon_uart_com_cnattach(bus_space_tag_t bust, int portno, int speed)
+octuart_com_cnattach(bus_space_tag_t bust, int portno, int speed)
{
struct com_regs regs;
- (void)memcpy(®s, &octeon_uart_com_regs, sizeof(regs));
+ (void)memcpy(®s, &octuart_com_regs, sizeof(regs));
regs.cr_iot = bust;
- regs.cr_iobase = octeon_uart_com_bases[portno];
+ regs.cr_iobase = octuart_com_bases[portno];
return comcnattach1(
®s,