Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h

Note : SH has TIMER_FREQ defined to CPU_FREQ, so any code wanting it must include #config.h before #cpu.h

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21560 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2009-06-29 14:30:12 +00:00
parent c5dedd7d76
commit ffefe0c08b
32 changed files with 54 additions and 353 deletions

View File

@ -497,4 +497,7 @@ interface */
/* PCM addresses for obtaining buffers will be what DMA is using (physical) */
#define HAVE_PCM_DMA_ADDRESS
/* Timer frequency */
#define TIMER_FREQ (24000000 / 16)
#endif /*__AS3525_H__*/

View File

@ -676,3 +676,7 @@ base address */
#define AT91C_EBI_SDRAM_32BIT (0x20000000) /* SDRAM on EBI Chip Select 1
base address */
#define AT91C_BASE_AIC 0xFFFFF000 /* (AIC) Base Address */
/* Timer frequency */
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (49156800/2)

View File

@ -1016,4 +1016,8 @@ extern unsigned long _ttbstart;
#define VENC_DCLKCTL_DCKIH (1 << 8)
#define VENC_DCLKCTL_DCKPW(x) (x << 0)
/* Timer frequency */
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (27000000)
#endif

View File

@ -1754,4 +1754,8 @@
#define UART_FIFO_CTRL 0x881
#define TIMEOUT 1000
/* Timer frequency */
/* timer is based on ipg_clk */
#define TIMER_FREQ (66000000)
#endif /* __IMX31L_H__ */

View File

@ -5209,4 +5209,7 @@ struct Ration2m
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
/* Timer frequency */
#define TIMER_FREQ (CFG_EXTAL) /* For full precision! */
#endif /* __JZ4740_H__ */

View File

@ -279,5 +279,8 @@
#define DMA1_REQ_AUDIO_1 0x8000
#define DMA1_REQ_AUDIO_2 0x8100
/* Timer frequency */
/* timer is based on busclk == cpuclk/2 */
#define TIMER_FREQ (CPU_FREQ/2)
#endif

View File

@ -262,4 +262,7 @@ struct pnx0101_audio {
#endif /* ASM */
/* Timer frequency */
#define TIMER_FREQ 3000000
#endif

View File

@ -248,4 +248,8 @@
#define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018))
#define MMAP3_PHYSICAL (*(volatile unsigned long *)(0xf000f01c))
/* Timer frequency */
/* Portalplayer chips use a microsecond timer. */
#define TIMER_FREQ 1000000
#endif

View File

@ -690,4 +690,8 @@
#define DMA_INCR_WIDTH_32BIT (0x2 << 28)
/* All other values reserved? */
/* Timer frequency */
/* Portalplayer chips use a microsecond timer. */
#define TIMER_FREQ 1000000
#endif /* __PP5020_H__ */

View File

@ -550,4 +550,11 @@
#define DRAM1 0x31000000
#define BOOTRAM 0x40000000
/* Timer frequency */
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (49156800/2)
#define TIMER234_PRESCALE 21
#endif /* __S3C2440_H__ */

View File

@ -370,4 +370,7 @@
#define SCI_MPB 0x02 /* Multiprocessor bit */
#define SCI_MPBT 0x01 /* Multiprocessor bit transfer */
/* Timer frequency */
#define TIMER_FREQ CPU_FREQ
#endif

View File

@ -261,4 +261,8 @@
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
/* Timer frequency */
/* timers are based on XIN (12Mhz) */
#define TIMER_FREQ (12000000)
#endif

View File

@ -249,4 +249,8 @@
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
/* Timer frequency */
/* Timer is based on PCK_TCT (set to 2Mhz in system.c) */
#define TIMER_FREQ (2000000)
#endif

View File

@ -24,21 +24,10 @@
#include <stdbool.h>
#include "config.h"
#include "cpu.h"
#if defined(SIMULATOR)
#define TIMER_FREQ 1000000
#elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 || CONFIG_CPU == TCC7801 \
|| defined(CPU_TCC77X) || CONFIG_CPU == AS3525 || CONFIG_CPU == IMX31L \
|| CONFIG_CPU == JZ4732 || CONFIG_CPU == PNX0101 \
|| defined(CPU_COLDFIRE) || CONFIG_CPU == SH7034 || defined(CPU_PP)
#include "timer-target.h"
#else
#warning "Target without timer-target.h"
#endif
#ifndef TIMER_FREQ
#warning "TIMER_FREQ not defined"
#define TIMER_FREQ CPU_FREQ
#define TIMER_FREQ 1000000
#endif
bool timer_register(int reg_prio, void (*unregister_callback)(void),

View File

@ -22,7 +22,7 @@
#include "system.h"
#include "kernel.h"
#include "panic.h"
#include "timer-target.h"
#include "timer.h"
#ifdef HAVE_SCROLLWHEEL
/* let the timer interrupt twice as often for the scrollwheel polling */

View File

@ -1,26 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2008 Rafaël Carré
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
#define TIMER_FREQ (24000000 / 16)
#endif /* TIMER_TARGET_H */

View File

@ -1,28 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
*
*
* Copyright (C) 2009 by Jorge Pinto
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (49156800/2)
#endif /* TIMER_TARGET_H */

View File

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2009 by Michael Sevakis
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timer is based on ipg_clk */
#define TIMER_FREQ (66000000)
#endif /* TIMER_TARGET_H */

View File

@ -19,7 +19,6 @@
*
****************************************************************************/
#include "timer-target.h"
#include "system.h"
#include "timer.h"

View File

@ -1,26 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 Tomasz Malesinski
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
#define TIMER_FREQ 3000000
#endif /* TIMER_TARGET_H */

View File

@ -1,28 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Michael Sevakis
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (49156800/2)
#define TIMER234_PRESCALE 21
#endif /* TIMER_TARGET_H */

View File

@ -30,7 +30,7 @@
#include "sound.h"
#include "i2c-meg-fx.h"
#include "system-target.h"
#include "timer-target.h"
#include "timer.h"
#include "wmcodec.h"
#ifdef HAVE_HARDWARE_BEEP

View File

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timers are based on XIN (12Mhz) */
#define TIMER_FREQ (12000000)
#endif /* TIMER_TARGET_H */

View File

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* Timer is based on PCK_TCT (set to 2Mhz in system.c) */
#define TIMER_FREQ (2000000)
#endif /* TIMER_TARGET_H */

View File

@ -22,7 +22,6 @@
#include "cpu.h"
#include "system.h"
#include "timer.h"
#include "timer-target.h"
static long SHAREDBSS_ATTR cycles_new = 0;

View File

@ -1,34 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2006 Thom Johansen
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
#include "config.h"
/* FIXME : this header is PP specific */
#ifndef CPU_PP
#error "PP specific header"
#endif
/* Portalplayer chips use a microsecond timer. */
#define TIMER_FREQ 1000000
#endif /* TIMER_TARGET_H */

View File

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timer is based on PCLK and minimum division is 2 */
#define TIMER_FREQ (27000000)
#endif /* TIMER_TARGET_H */

View File

@ -25,7 +25,6 @@
#include "system.h"
#include "cpu.h"
#include "timer.h"
#include "timer-target.h"
static int base_prescale;

View File

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 Jens Arnold
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
/* timer is based on busclk == cpuclk/2 */
#define TIMER_FREQ (CPU_FREQ/2)
#endif /* TIMER_TARGET_H */

View File

@ -1,29 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2008 by Maurus Cuelenaere
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef __TIMER_H_
#define __TIMER_H_
#include "config.h"
#define TIMER_FREQ (CFG_EXTAL) /* For full precision! */
#endif /* __TIMER_H_ */

View File

@ -22,7 +22,6 @@
#include "cpu.h"
#include "system.h"
#include "timer.h"
#include "timer-target.h"
void IMIA4(void) __attribute__((interrupt_handler));
void IMIA4(void)

View File

@ -1,28 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 Jens Arnold
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef TIMER_TARGET_H
#define TIMER_TARGET_H
#include "config.h"
#define TIMER_FREQ CPU_FREQ
#endif /* TIMER_TARGET_H */