2002-11-03 09:24:07 +09:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
|
|
* Marius Groeger <mgroeger@sysgo.de>
|
|
|
|
*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
|
|
* Alex Zuepke <azu@sysgo.de>
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2004-02-24 05:48:38 +09:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2002-11-03 09:24:07 +09:00
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/proc-armv/ptrace.h>
|
2004-07-02 01:30:44 +09:00
|
|
|
#include <asm/hardware.h>
|
2002-11-03 09:24:07 +09:00
|
|
|
|
|
|
|
/* we always count down the max. */
|
|
|
|
#define TIMER_LOAD_VAL 0xffff
|
|
|
|
/* macro to read the 16 bit timer */
|
|
|
|
#define READ_TIMER (IO_TC1D & 0xffff)
|
2007-01-24 20:16:56 +09:00
|
|
|
|
2002-11-03 09:24:07 +09:00
|
|
|
#ifdef CONFIG_USE_IRQ
|
|
|
|
void do_irq (struct pt_regs *pt_regs)
|
|
|
|
{
|
2012-10-03 17:54:09 +09:00
|
|
|
#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
|
2005-10-07 00:08:18 +09:00
|
|
|
/* No do_irq() for IntegratorAP/CM720T as yet */
|
2004-07-12 07:19:26 +09:00
|
|
|
#else
|
|
|
|
#error do_irq() not defined for this CPU type
|
|
|
|
#endif
|
|
|
|
}
|
2008-01-14 18:06:52 +09:00
|
|
|
#endif
|
2004-07-12 07:19:26 +09:00
|
|
|
|
2005-10-07 00:08:18 +09:00
|
|
|
#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
|
|
|
|
/* Use IntegratorAP routines in board/integratorap.c */
|
|
|
|
#else
|
|
|
|
|
2005-10-09 07:22:48 +09:00
|
|
|
static ulong timestamp;
|
|
|
|
static ulong lastdec;
|
|
|
|
|
2009-05-16 06:47:02 +09:00
|
|
|
int timer_init (void)
|
|
|
|
{
|
2012-10-03 17:54:10 +09:00
|
|
|
#if defined(CONFIG_TEGRA)
|
2012-08-31 17:30:09 +09:00
|
|
|
/* No timer routines for tegra as yet */
|
|
|
|
lastdec = 0;
|
2004-07-02 01:30:44 +09:00
|
|
|
#else
|
2009-05-16 06:47:02 +09:00
|
|
|
#error No timer_init() defined for this CPU type
|
* Patch by Thomas Elste, 10 Feb 2004:
Add support for NET+50 CPU and ModNET50 board
* Patch by Sam Song, 10 Feb 2004:
Fix typos in cfi_flash.c
* Patch by Leon Kukovec, 10 Feb 2004
Fixed long dir entry slot id calculation in get_vfatname
* Patch by Robin Gilks, 10 Feb 2004:
add "itest" command (operators: -eq, -ne, -lt, -gt, -le, -ge, ==,
!=, <>, <, >, <=, >=)
2004-02-24 04:30:57 +09:00
|
|
|
#endif
|
2002-11-03 09:24:07 +09:00
|
|
|
timestamp = 0;
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
2005-10-07 00:08:18 +09:00
|
|
|
#endif /* ! IntegratorAP */
|
|
|
|
|
2002-11-03 09:24:07 +09:00
|
|
|
/*
|
|
|
|
* timer without interrupts
|
|
|
|
*/
|
|
|
|
|
2004-07-02 01:30:44 +09:00
|
|
|
|
2012-10-03 17:54:10 +09:00
|
|
|
#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
|
2005-10-07 00:08:18 +09:00
|
|
|
/* No timer routines for IntegratorAP/CM720T as yet */
|
2012-08-31 17:30:09 +09:00
|
|
|
#elif defined(CONFIG_TEGRA)
|
|
|
|
/* No timer routines for tegra as yet */
|
2004-07-02 01:30:44 +09:00
|
|
|
#else
|
|
|
|
#error Timer routines not defined for this CPU type
|
|
|
|
#endif
|