./usr/share/man/man4/sparc64/spif.4
./usr/share/man/man4/sparc64/ssm.4
./usr/share/man/man4/sparc64/tda.4
-./usr/share/man/man4/sparc64/timer.4
./usr/share/man/man4/sparc64/tvtwo.4
./usr/share/man/man4/sparc64/upa.4
./usr/share/man/man4/sparc64/uperf.4
-# $OpenBSD: Makefile,v 1.82 2019/04/25 16:47:56 denis Exp $
+# $OpenBSD: Makefile,v 1.83 2023/04/28 18:27:55 cheloha Exp $
MAN= agten.4 apio.4 asio.4 audioce.4 audiocs.4 autoconf.4 auxio.4 \
bbc.4 be.4 beeper.4 bpp.4 bwtwo.4 cbus.4 central.4 cgsix.4 cgthree.4 \
pcons.4 pmc.4 power.4 ppm.4 prtc.4 psycho.4 pyro.4 qe.4 qec.4 \
radeonfb.4 raptor.4 rfx.4 \
sab.4 sbbc.4 schizo.4 spif.4 ssm.4 \
- tda.4 timer.4 tvtwo.4 upa.4 uperf.4 \
+ tda.4 tvtwo.4 upa.4 uperf.4 \
vbus.4 vcc.4 vcons.4 vds.4 vdsk.4 vigra.4 vldc.4 vnet.4 vpci.4 \
vrng.4 vrtc.4 vsw.4 \
xbox.4 zs.4 zx.4
+++ /dev/null
-.\" $OpenBSD: timer.4,v 1.2 2007/05/31 19:19:57 jmc Exp $
-.\"
-.\" Copyright (c) 2004 Jason L. Wright (jason@thought.net)
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd $Mdocdate: May 31 2007 $
-.Dt TIMER 4 sparc64
-.Os
-.Sh NAME
-.Nm timer
-.Nd SPARC64 Timer
-.Sh SYNOPSIS
-.Cd "timer* at mainbus0"
-.Sh DESCRIPTION
-The
-.Nm
-device provides support for the onboard timer on SBus based
-UltraSPARC machines.
-The timers are used to control various time services in the
-kernel and are not user accessible.
-.Sh SEE ALSO
-.Xr intro 4
-# $OpenBSD: GENERIC,v 1.322 2022/01/02 23:14:27 jsg Exp $
+# $OpenBSD: GENERIC,v 1.323 2023/04/28 18:27:55 cheloha Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
## PROM clock -- if all else failse
prtc0 at mainbus0
-## Timer chip found on (some) sun4u systems.
-timer* at mainbus0
-
# Virtual devices for sun4v systems.
vcons0 at vbus?
vrtc0 at vbus?
-# $OpenBSD: RAMDISK,v 1.126 2021/07/15 15:37:55 deraadt Exp $
+# $OpenBSD: RAMDISK,v 1.127 2023/04/28 18:27:55 cheloha Exp $
machine sparc64
maxusers 4
clock* at ebus?
clock0 at fhc?
rtc* at ebus? # DS1287/M5819 clock
-timer* at mainbus0 # Timer chip
vcons0 at vbus?
vrtc0 at vbus?
-# $OpenBSD: RAMDISKU1,v 1.25 2020/04/02 06:07:05 otto Exp $
+# $OpenBSD: RAMDISKU1,v 1.26 2023/04/28 18:27:55 cheloha Exp $
machine sparc64
maxusers 4
sbus* at mainbus0 # Ultra 1
clock* at sbus? # Mostek clock
-timer* at mainbus0 # Timer chip
le* at sbus? # Lance Ethernet - AMD7990
ledma* at sbus?
-# $OpenBSD: RAMDISKU5,v 1.22 2020/04/02 06:07:05 otto Exp $
+# $OpenBSD: RAMDISKU5,v 1.23 2023/04/28 18:27:55 cheloha Exp $
machine sparc64
maxusers 4
pcons0 at mainbus0 # PROM console
-timer* at mainbus0 # Timer chip (some systems)
-
pciide* at pci? flags 0x0000
wd* at pciide? flags 0x0a00
atapiscsi* at pciide?
-/* $OpenBSD: autoconf.c,v 1.142 2023/03/08 04:43:07 guenther Exp $ */
+/* $OpenBSD: autoconf.c,v 1.143 2023/04/28 18:27:55 cheloha Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
#include <machine/pmap.h>
#include <machine/trap.h>
#include <sparc64/sparc64/cache.h>
-#include <sparc64/sparc64/timerreg.h>
#include <sparc64/dev/vbusvar.h>
#include <sparc64/dev/cbusvar.h>
-/* $OpenBSD: clock.c,v 1.76 2023/02/04 19:19:37 cheloha Exp $ */
+/* $OpenBSD: clock.c,v 1.77 2023/04/28 18:27:55 cheloha Exp $ */
/* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */
/*
#include <dev/ic/mk48txxreg.h>
#include <sparc64/sparc64/intreg.h>
-#include <sparc64/sparc64/timerreg.h>
#include <sparc64/dev/iommureg.h>
#include <sparc64/dev/sbusreg.h>
#include <dev/sbus/sbusvar.h>
extern todr_chip_handle_t todr_handle;
static struct idprom *idprom;
-static int timermatch(struct device *, void *, void *);
-static void timerattach(struct device *, struct device *, void *);
-
-struct timerreg_4u timerreg_4u; /* XXX - need more cleanup */
-
-const struct cfattach timer_ca = {
- sizeof(struct device), timermatch, timerattach
-};
-
-struct cfdriver timer_cd = {
- NULL, "timer", DV_DULL
-};
-
int clock_bus_wenable(struct todr_chip_handle *, int);
struct chiptime;
void myetheraddr(u_char *);
struct idprom *getidprom(void);
int chiptotime(int, int, int, int, int, int);
void timetochip(struct chiptime *);
-void stopcounter(struct timer_4u *);
int timerblurb = 10; /* Guess a value; used before clock is attached */
return (idp);
}
-/*
- * The sun4u OPENPROMs call the timer the "counter-timer", except for
- * the lame UltraSPARC IIi PCI machines that don't have them.
- */
-static int
-timermatch(struct device *parent, void *cf, void *aux)
-{
-#ifndef MULTIPROCESSOR
- struct mainbus_attach_args *ma = aux;
-
- if (!timerreg_4u.t_timer || !timerreg_4u.t_clrintr)
- return (strcmp("counter-timer", ma->ma_name) == 0);
- else
-#endif
- return (0);
-}
-
-static void
-timerattach(struct device *parent, struct device *self, void *aux)
-{
-#if 0
- struct mainbus_attach_args *ma = aux;
- u_int *va = ma->ma_address;
-
- /*
- * What we should have are 3 sets of registers that reside on
- * different parts of SYSIO or PSYCHO. We'll use the prom
- * mappings cause we can't get rid of them and set up appropriate
- * pointers on the timerreg_4u structure.
- */
- timerreg_4u.t_timer = (struct timer_4u *)(u_long)va[0];
- timerreg_4u.t_clrintr = (int64_t *)(u_long)va[1];
- timerreg_4u.t_mapintr = (int64_t *)(u_long)va[2];
-
- /* Install the appropriate interrupt vector here */
- level10.ih_number = INTVEC(ma->ma_interrupts[0]);
- level10.ih_clr = (void *)&timerreg_4u.t_clrintr[0];
- level10.ih_map = (void *)&timerreg_4u.t_mapintr[0];
- strlcpy(level10.ih_name, "clock", sizeof(level10.ih_name));
- intr_establish(10, &level10);
-
- level14.ih_number = INTVEC(ma->ma_interrupts[1]);
- level14.ih_clr = (void *)&timerreg_4u.t_clrintr[1];
- level14.ih_map = (void *)&timerreg_4u.t_mapintr[1];
- strlcpy(level14.ih_name, "prof", sizeof(level14.ih_name));
- intr_establish(14, &level14);
-
- printf(" ivec 0x%llx, 0x%llx\n", INTVEC(level10.ih_number),
- INTVEC(level14.ih_number));
-#endif
- printf("\n");
-}
-
-void
-stopcounter(struct timer_4u *creg)
-{
- /* Stop the clock */
- volatile int discard;
- discard = creg->t_limit;
- creg->t_limit = 0;
-}
-
/*
* XXX this belongs elsewhere
*/
-/* $OpenBSD: locore.s,v 1.200 2023/04/13 15:36:28 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.201 2023/04/28 18:27:55 cheloha Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
#include "ksyms.h"
#include <machine/param.h>
#include <sparc64/sparc64/intreg.h>
-#include <sparc64/sparc64/timerreg.h>
#include <machine/ctlreg.h>
#include <machine/psl.h>
#include <machine/signal.h>
+++ /dev/null
-/* $OpenBSD: timerreg.h,v 1.5 2007/05/29 09:54:23 sobrado Exp $ */
-/* $NetBSD: timerreg.h,v 1.3 1999/06/05 05:10:01 mrg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Lawrence Berkeley Laboratory.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)timerreg.h 8.1 (Berkeley) 6/11/93
- */
-
-/*
- * These timers work in a rather peculiar fashion. Most clock counters
- * run to 0 (as, e.g., on the VAX, where the ICR counts up to 0 from a
- * large unsigned number). On the Sun-4c, it counts up to a limit. But
- * for some reason, when it reaches the limit, it resets to 1, not 0.
- * Thus, if the limit is set to 4, the counter counts like this:
- *
- * 1, 2, 3, 1, 2, 3, ...
- *
- * and if we want to divide by N we must set the limit register to N+1.
- *
- * Sun-4u counters/timer are similar but:
- *
- * - the registers have been shuffled around once again. We need
- * to use offsets from the 3 addresses the ROM provides us.
- * - The counters are 29 bits wide with 1us accuracy.
- * - You can make them do funky things with the limit register
- * - They have standard 64-bit SBus control registers.
- *
- * There is a problem on the Ultra5 and Ultra10. As the PCI controller
- * doesn't include the timer, there are no `counter-timer' nodes here
- * and so we must use %tick.
- */
-#ifndef _LOCORE
-struct timer_4u {
- volatile int64_t t_count; /* counter reg */
- volatile int64_t t_limit; /* limit reg */
-
-#define TMR_LIM_IEN 0x80000000 /* interrupt enable bit */
-#define TMR_LIM_RELOAD 0x40000000 /* reload counter to 0 */
-#define TMR_LIM_PERIODIC 0x20000000 /* reset at limit */
-#define TMR_LIM_MASK 0x1fffffff
-};
-
-struct timerreg_4u {
- struct timer_4u *t_timer; /* There are two of them. */
- volatile int64_t *t_clrintr; /* There are two of these. */
- volatile int64_t *t_mapintr; /* Same here. */
-};
-
-#endif /* _LOCORE */
-
-/* Compute a limit that causes the timer to fire every n microseconds. */
-#define tmr_ustolim(n) (((n) - 1) & TMR_LIM_MASK)