c61c65cdcd
This patch contains the following possible cleanups: - make the following needlessly global code static: - apc.c: apc_swift_idle() - ebus.c: ebus_blacklist_irq() - ebus.c: fill_ebus_child() - ebus.c: fill_ebus_device() - entry.S: syscall_is_too_hard - etra: tsetup_sun4c_stackchk - head.S: cputyp - head.S: prom_vector_p - idprom.c: Sun_Machines[] - ioport.c: _sparc_find_resource() - ioport.c: create_proc_read_entry() - irq.c: struct sparc_irq[] - rtrap.S: sun4c_rett_stackchk - setup.c: prom_sync_me() - setup.c: boot_flags - sun4c_irq.c: sun4c_sbint_to_irq() - sun4d_irq.c: sbus_tid[] - sun4d_irq.c: struct sbus_actions - sun4d_irq.c: sun4d_sbint_to_irq() - sun4m_irq.c: sun4m_sbint_to_irq() - sun4m_irq.c: sun4m_get_irqmask() - sun4m_irq.c: sun4m_timers - sun4m_smp.c: smp4m_cross_call() - sun4m_smp.c: smp4m_blackbox_id() - sun4m_smp.c: smp4m_blackbox_current() - time.c: sp_clock_typ - time.c: sbus_time_init() - traps.c: instruction_dump() - wof.S: spwin_sun4c_stackchk - wuf.S: sun4c_fwin_stackchk - #if 0 the following unused code: - process.c: sparc_backtrace_lock - process.c: __show_backtrace() - process.c: show_backtrace() - process.c: smp_show_backtrace_all_cpus() - remove the following unused code: - entry.S: __handle_exception - smp.c: smp_num_cpus - smp.c: smp_activated - smp.c: __cpu_number_map[] - smp.c: __cpu_logical_map[] - smp.c: bitops_spinlock - traps.c: trap_curbuf - traps.c: trapbuf[] - traps.c: linux_smp_still_initting - traps.c: thiscpus_tbr - traps.c: thiscpus_mid Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
107 lines
3.5 KiB
C
107 lines
3.5 KiB
C
/*
|
|
* timer.h: Definitions for the timer chips on the Sparc.
|
|
*
|
|
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
|
*/
|
|
|
|
|
|
#ifndef _SPARC_TIMER_H
|
|
#define _SPARC_TIMER_H
|
|
|
|
#include <asm/system.h> /* For SUN4M_NCPUS */
|
|
#include <asm/sun4paddr.h>
|
|
#include <asm/btfixup.h>
|
|
|
|
/* Timer structures. The interrupt timer has two properties which
|
|
* are the counter (which is handled in do_timer in sched.c) and the limit.
|
|
* This limit is where the timer's counter 'wraps' around. Oddly enough,
|
|
* the sun4c timer when it hits the limit wraps back to 1 and not zero
|
|
* thus when calculating the value at which it will fire a microsecond you
|
|
* must adjust by one. Thanks SUN for designing such great hardware ;(
|
|
*/
|
|
|
|
/* Note that I am only going to use the timer that interrupts at
|
|
* Sparc IRQ 10. There is another one available that can fire at
|
|
* IRQ 14. Currently it is left untouched, we keep the PROM's limit
|
|
* register value and let the prom take these interrupts. This allows
|
|
* L1-A to work.
|
|
*/
|
|
|
|
struct sun4c_timer_info {
|
|
__volatile__ unsigned int cur_count10;
|
|
__volatile__ unsigned int timer_limit10;
|
|
__volatile__ unsigned int cur_count14;
|
|
__volatile__ unsigned int timer_limit14;
|
|
};
|
|
|
|
#define SUN4C_TIMER_PHYSADDR 0xf3000000
|
|
#ifdef CONFIG_SUN4
|
|
#define SUN_TIMER_PHYSADDR SUN4_300_TIMER_PHYSADDR
|
|
#else
|
|
#define SUN_TIMER_PHYSADDR SUN4C_TIMER_PHYSADDR
|
|
#endif
|
|
|
|
/* A sun4m has two blocks of registers which are probably of the same
|
|
* structure. LSI Logic's L64851 is told to _decrement_ from the limit
|
|
* value. Aurora behaves similarly but its limit value is compacted in
|
|
* other fashion (it's wider). Documented fields are defined here.
|
|
*/
|
|
|
|
/* As with the interrupt register, we have two classes of timer registers
|
|
* which are per-cpu and master. Per-cpu timers only hit that cpu and are
|
|
* only level 14 ticks, master timer hits all cpus and is level 10.
|
|
*/
|
|
|
|
#define SUN4M_PRM_CNT_L 0x80000000
|
|
#define SUN4M_PRM_CNT_LVALUE 0x7FFFFC00
|
|
|
|
struct sun4m_timer_percpu_info {
|
|
__volatile__ unsigned int l14_timer_limit; /* Initial value is 0x009c4000 */
|
|
__volatile__ unsigned int l14_cur_count;
|
|
|
|
/* This register appears to be write only and/or inaccessible
|
|
* on Uni-Processor sun4m machines.
|
|
*/
|
|
__volatile__ unsigned int l14_limit_noclear; /* Data access error is here */
|
|
|
|
__volatile__ unsigned int cntrl; /* =1 after POST on Aurora */
|
|
__volatile__ unsigned char space[PAGE_SIZE - 16];
|
|
};
|
|
|
|
struct sun4m_timer_regs {
|
|
struct sun4m_timer_percpu_info cpu_timers[SUN4M_NCPUS];
|
|
volatile unsigned int l10_timer_limit;
|
|
volatile unsigned int l10_cur_count;
|
|
|
|
/* Again, this appears to be write only and/or inaccessible
|
|
* on uni-processor sun4m machines.
|
|
*/
|
|
volatile unsigned int l10_limit_noclear;
|
|
|
|
/* This register too, it must be magic. */
|
|
volatile unsigned int foobar;
|
|
|
|
volatile unsigned int cfg; /* equals zero at boot time... */
|
|
};
|
|
|
|
#define SUN4D_PRM_CNT_L 0x80000000
|
|
#define SUN4D_PRM_CNT_LVALUE 0x7FFFFC00
|
|
|
|
struct sun4d_timer_regs {
|
|
volatile unsigned int l10_timer_limit;
|
|
volatile unsigned int l10_cur_countx;
|
|
volatile unsigned int l10_limit_noclear;
|
|
volatile unsigned int ctrl;
|
|
volatile unsigned int l10_cur_count;
|
|
};
|
|
|
|
extern struct sun4d_timer_regs *sun4d_timers;
|
|
|
|
extern __volatile__ unsigned int *master_l10_counter;
|
|
extern __volatile__ unsigned int *master_l10_limit;
|
|
|
|
/* FIXME: Make do_[gs]ettimeofday btfixup calls */
|
|
BTFIXUPDEF_CALL(int, bus_do_settimeofday, struct timespec *tv)
|
|
#define bus_do_settimeofday(tv) BTFIXUP_CALL(bus_do_settimeofday)(tv)
|
|
|
|
#endif /* !(_SPARC_TIMER_H) */
|