* arch/arm/src/armv7-a/gtm.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
* Cortex™-A9 MPCore, Revision: r4p1, Technical Reference Manual, ARM DDI
* 0407I (ID091612).
*/
#ifndef __ARCH_ARM_SRC_ARMV7_A_GTM_H
#define __ARCH_ARM_SRC_ARMV7_A_GTM_H
* Included Files
****************************************************************************/
#include "nuttx/config.h"
#include <stdint.h>
#include "mpcore.h"
#ifdef CONFIG_ARMV7A_HAVE_GTM
* Pre-processor Definitions
****************************************************************************/
#define GTM_COUNT0_OFFSET 0x0000
#define GTM_COUNT1_OFFSET 0x0004
#define GTM_CTRL_OFFSET 0x0008
#define GTM_STA_OFFSET 0x000c
#define GTM_COMP0_OFFSET 0x0010
#define GTM_COMP1_OFFSET 0x0014
#define GTM_AUTO_OFFSET 0x0018
#define GTM_COUNT0 (MPCORE_GTM_VBASE+GTM_COUNT0_OFFSET)
#define GTM_COUNT1 (MPCORE_GTM_VBASE+GTM_COUNT1_OFFSET)
#define GTM_CTRL (MPCORE_GTM_VBASE+GTM_CTRL_OFFSET)
#define GTM_STA (MPCORE_GTM_VBASE+GTM_STA_OFFSET)
#define GTM_COMP0 (MPCORE_GTM_VBASE+GTM_COMP0_OFFSET)
#define GTM_COMP1 (MPCORE_GTM_VBASE+GTM_COMP1_OFFSET)
#define GTM_AUTO (MPCORE_GTM_VBASE+GTM_AUTO_OFFSET)
#define GTM_CTRL_TIMEN (1 << 0)
#define GTM_CTRL_CMPEN (1 << 1)
#define GTM_CTRL_INTEN (1 << 2)
#define GTM_CTRL_AUTO (1 << 3)
#define GTM_CTRL_PRESC_SHIFT (8)
#define GTM_CTRL_PRESC_MASK (0xff << GTM_CTRL_PRESC_SHIFT)
# define GTM_CTRL_PRESC(n) ((uint32_t)(n) << GTM_CTRL_PRESC_SHIFT)
#define GTM_STA_EVENT (1 << 0)
* Public Function Prototypes
****************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
* CLK - This is the main clock of the Cortex-A9 processor. All Cortex-A9
* processors in the Cortex-A9 MPCore processor and the SCU are clocked
* with a distributed version of CLK.
* PERIPHCLK - The Interrupt Controller, global timer, private timers, and
* watchdogs are clocked with PERIPHCLK. PERIPHCLK must be synchronous
* with CLK, and the PERIPHCLK clock period, N, must be configured as a
* multiple of the CLK clock period. This multiple N must be equal to,
* or greater than two.
*/
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif
#endif