1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2010-2015, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __GP_TIMER_LOCAL_H_INCLUDED__
17#define  __GP_TIMER_LOCAL_H_INCLUDED__
18
19#include "gp_timer_global.h" /*GP_TIMER_SEL
20				GP_TIMER_SIGNAL_SELECT*/
21
22#include "gp_timer_defs.h"    /*HIVE_GP_TIMER_xxx registers*/
23#include "hive_isp_css_defs.h" /*HIVE_GP_TIMER_NUM_COUNTERS
24				 HIVE_GP_TIMER_NUM_IRQS*/
25
26#define _REG_GP_TIMER_RESET_REG HIVE_GP_TIMER_RESET_REG_IDX
27#define _REG_GP_TIMER_OVERALL_ENABLE HIVE_GP_TIMER_OVERALL_ENABLE_REG_IDX
28
29/*Register offsets for timers [1,7] can be obtained
30 * by adding (GP_TIMERx_ID * sizeof(uint32_t))*/
31#define _REG_GP_TIMER_ENABLE_ID(timer_id)        HIVE_GP_TIMER_ENABLE_REG_IDX(timer_id)
32#define _REG_GP_TIMER_VALUE_ID(timer_id)	 HIVE_GP_TIMER_VALUE_REG_IDX(timer_id, HIVE_GP_TIMER_NUM_COUNTERS)
33#define _REG_GP_TIMER_COUNT_TYPE_ID(timer_id)    HIVE_GP_TIMER_COUNT_TYPE_REG_IDX(timer_id, HIVE_GP_TIMER_NUM_COUNTERS)
34#define _REG_GP_TIMER_SIGNAL_SELECT_ID(timer_id) HIVE_GP_TIMER_SIGNAL_SELECT_REG_IDX(timer_id, HIVE_GP_TIMER_NUM_COUNTERS)
35
36#define _REG_GP_TIMER_IRQ_TRIGGER_VALUE_ID(irq_id) HIVE_GP_TIMER_IRQ_TRIGGER_VALUE_REG_IDX(irq_id, HIVE_GP_TIMER_NUM_COUNTERS)
37
38#define _REG_GP_TIMER_IRQ_TIMER_SELECT_ID(irq_id)   \
39	HIVE_GP_TIMER_IRQ_TIMER_SELECT_REG_IDX(irq_id, HIVE_GP_TIMER_NUM_COUNTERS, HIVE_GP_TIMER_NUM_IRQS)
40
41#define _REG_GP_TIMER_IRQ_ENABLE_ID(irq_id) \
42	HIVE_GP_TIMER_IRQ_ENABLE_REG_IDX(irq_id, HIVE_GP_TIMER_NUM_COUNTERS, HIVE_GP_TIMER_NUM_IRQS)
43
44#endif  /*__GP_TIMER_LOCAL_H_INCLUDED__*/
45