예제 #1
0
 */

#include "startup.h"
#include "arm/ixp1200.h"

uintptr_t	ixp1200_timer_base;

/*
 * The IXP1200 timers are driven from the 3.6864MHz clock
 */
#define	IXP1200_CLOCK_FREQ	3686400UL
#define	IXP1200_CLOCK_RATE	271267361UL
#define	IXP1200_CLOCK_SCALE	-15

static const struct callout_slot	timer_callouts[] = {
    { CALLOUT_SLOT(timer_load, _ixp1200) },
    { CALLOUT_SLOT(timer_value, _ixp1200) },
    { CALLOUT_SLOT(timer_reload, _ixp1200) },
};

static unsigned
timer_start_ixp1200()
{
    return in32(ixp1200_timer_base + IXP1200_TIMER_1_VALUE);
}

static unsigned
timer_diff_ixp1200(unsigned start)
{
    unsigned now = in32(ixp1200_timer_base + IXP1200_TIMER_1_VALUE);
예제 #2
0
 */

#include "startup.h"
#include <arm/ixp23xx.h>

uintptr_t	ixp23xx_timer_base;

/*
 * The IXP23XX timers are driven from a 75MHz clock
 */
#define	IXP23XX_CLOCK_FREQ	75000000UL
#define	IXP23XX_CLOCK_RATE	13333333UL
#define	IXP23XX_CLOCK_SCALE	-15

static const struct callout_slot	timer_callouts[] = {
	{ CALLOUT_SLOT(timer_load, _ixp23xx) },
	{ CALLOUT_SLOT(timer_value, _ixp23xx) },
	{ CALLOUT_SLOT(timer_reload, _ixp23xx) },
};

static unsigned
timer_start_ixp23xx()
{
	return in32(ixp23xx_timer_base + IXP23XX_OST_TIM0);
}

static unsigned
timer_diff_ixp23xx(unsigned start)
{
	unsigned now = in32(ixp23xx_timer_base + IXP23XX_OST_TIM0);
예제 #3
0
 */

#include "startup.h"
#include "arm/pxa250.h"

uintptr_t	pxa270_timer_base;

/*
 * The PXA270 timers are driven from the 3.25MHz clock
 */
#define	PXA270_CLOCK_FREQ	3250000UL
#define	PXA270_CLOCK_RATE	307692307UL
#define	PXA270_CLOCK_SCALE	-15

static const struct callout_slot	timer_callouts[] = {
	{ CALLOUT_SLOT(timer_load, _pxa250) },
	{ CALLOUT_SLOT(timer_value, _pxa250) },
	{ CALLOUT_SLOT(timer_reload, _pxa250) },
};

static unsigned
timer_start_pxa270()
{
	return in32(pxa270_timer_base + PXA250_OSCR);
}

static unsigned
timer_diff_pxa270(unsigned start)
{
	unsigned now = in32(pxa270_timer_base + PXA250_OSCR);
예제 #4
0
uintptr_t	ixp425_timer_base;


/*
 * The IXP425 timers are driven from a 66.66MHz clock
 *
 *	RATE = (1/10^SCALE)/FREQ
 */

#define IXP425_CLOCK_FREQ	66660000UL
#define IXP425_CLOCK_RATE	15001500UL
#define	IXP425_CLOCK_SCALE	-15

static const struct callout_slot	timer_callouts[] = {
	{ CALLOUT_SLOT(timer_load, _ixp425) },
	{ CALLOUT_SLOT(timer_value, _ixp425) },
	{ CALLOUT_SLOT(timer_reload, _ixp425) },
};

static unsigned
timer_start_ixp425()
{
	return in32(ixp425_timer_base + IXP425_TIMER0_VAL);
}

static unsigned
timer_diff_ixp425(unsigned start)
{
	unsigned now = in32(ixp425_timer_base + IXP425_TIMER0_VAL) & ~0x3;
예제 #5
0
 * TI OMAP3530 specific timer support.
 * GPT1 is used.
 */

#include "startup.h"
#include <arm/omap3530.h>


extern struct callout_rtn   timer_load_omap3530;
extern struct callout_rtn   timer_value_omap3530;
extern struct callout_rtn   timer_reload_omap3530;

static uintptr_t	timer_base;

static const struct callout_slot	timer_callouts[] = {
	{ CALLOUT_SLOT(timer_load, _omap3530) },
	{ CALLOUT_SLOT(timer_value, _omap3530) },
	{ CALLOUT_SLOT(timer_reload, _omap3530) },
};

static unsigned
timer_start_omap3530()
{
	out32(timer_base + OMAP3530_GPT_TCLR, 
		in32(timer_base + OMAP3530_GPT_TCLR) | 1);

	return in32(timer_base + OMAP3530_GPT_TCRR);
}

static unsigned
timer_diff_omap3530(unsigned start)
*/

#include "startup.h"
#include <arm/ep93xx.h>
#include <sys/hwinfo.h>
#include <drvr/hwinfo.h>
#include <errno.h>

extern struct callout_rtn	timer_load_ep93xx;
extern struct callout_rtn	timer_value_ep93xx;
extern struct callout_rtn	timer_reload_ep93xx;

static uintptr_t	timer_base;

static const struct callout_slot	timer_callouts[] = {
	{ CALLOUT_SLOT(timer_load, _ep93xx) },
	{ CALLOUT_SLOT(timer_value, _ep93xx) },
	{ CALLOUT_SLOT(timer_reload, _ep93xx) },
};

/*
 * timer_start_ep93xx
 *
 * Start the timer.
 * We don't assume that the timer is enabled and so will re-start it if it is.
 * This requires disabling, re-writing the LOAD register (we use its current
 * value or UINT32_MAX if its zero) as instructed in the doc for the Control
 * register EN bit and then re-enable.
 * 
 * Returns: the current value of the counter (ie. the VALUE register)
*/