Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 1 | /* |
| 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 Yamada | 4770e41 | 2014-11-06 15:55:21 +0900 | [diff] [blame] | 28 | #if defined(CONFIG_CPU_SH3) |
Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 29 | struct 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 Yamada | 4770e41 | 2014-11-06 15:55:21 +0900 | [diff] [blame] | 48 | #endif /* CONFIG_CPU_SH3 */ |
Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 49 | |
Nobuhiro Iwamatsu | 7c11273 | 2015-10-10 05:58:28 +0900 | [diff] [blame^] | 50 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_RMOBILE) |
Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 51 | struct 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 Yamada | 4770e41 | 2014-11-06 15:55:21 +0900 | [diff] [blame] | 68 | #endif /* CONFIG_CPU_SH4 */ |
Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 69 | |
| 70 | static inline unsigned long get_tmu0_clk_rate(void) |
| 71 | { |
Nobuhiro Iwamatsu | aab319c | 2013-08-20 11:40:24 +0900 | [diff] [blame] | 72 | return CONFIG_SH_TMU_CLK_FREQ; |
Nobuhiro Iwamatsu | e763f1a | 2012-08-21 13:14:46 +0900 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | #endif /* __SH_TMU_H */ |