blob: aa60c98750a0311eb4675cd71a96cde7b1f170c4 [file] [log] [blame]
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +09001/*
2 * Copyright (C) 2012 Renesas Solutions Corp.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23#ifndef __SH_TMU_H
24#define __SH_TMU_H
25
26#include <asm/types.h>
27
Masahiro Yamada7d236662014-11-06 15:55:21 +090028#if defined(CONFIG_CPU_SH3)
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +090029struct tmu_regs {
30 u8 tocr;
31 u8 reserved0;
32 u8 tstr;
33 u8 reserved1;
34 u32 tcor0;
35 u32 tcnt0;
36 u16 tcr0;
37 u16 reserved2;
38 u32 tcor1;
39 u32 tcnt1;
40 u16 tcr1;
41 u16 reserved3;
42 u32 tcor2;
43 u32 tcnt2;
44 u16 tcr2;
45 u16 reserved4;
46 u32 tcpr2;
47};
Masahiro Yamada7d236662014-11-06 15:55:21 +090048#endif /* CONFIG_CPU_SH3 */
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +090049
Nobuhiro Iwamatsu1cc95f62015-10-10 05:58:28 +090050#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_RMOBILE)
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +090051struct tmu_regs {
52 u32 reserved;
53 u8 tstr;
54 u8 reserved2[3];
55 u32 tcor0;
56 u32 tcnt0;
57 u16 tcr0;
58 u16 reserved3;
59 u32 tcor1;
60 u32 tcnt1;
61 u16 tcr1;
62 u16 reserved4;
63 u32 tcor2;
64 u32 tcnt2;
65 u16 tcr2;
66 u16 reserved5;
67};
Masahiro Yamada7d236662014-11-06 15:55:21 +090068#endif /* CONFIG_CPU_SH4 */
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +090069
70static inline unsigned long get_tmu0_clk_rate(void)
71{
Nobuhiro Iwamatsu857febf2013-08-20 11:40:24 +090072 return CONFIG_SH_TMU_CLK_FREQ;
Nobuhiro Iwamatsu73f35e02012-08-21 13:14:46 +090073}
74
75#endif /* __SH_TMU_H */