]> Git Repo - J-u-boot.git/blob - arch/sh/lib/time.c
common: Drop linux/bitops.h from common header
[J-u-boot.git] / arch / sh / lib / time.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2009
4  * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
5  *
6  * (C) Copyright 2007-2012
7  * Nobobuhiro Iwamatsu <[email protected]>
8  *
9  * (C) Copyright 2003
10  * Wolfgang Denk, DENX Software Engineering, [email protected].
11  */
12
13 #include <common.h>
14 #include <init.h>
15 #include <asm/processor.h>
16 #include <asm/io.h>
17 #include <linux/bitops.h>
18
19 #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_RMOBILE)
20 #define TSTR    0x4
21 #define TCR0    0x10
22 #endif /* CONFIG_CPU_SH4 */
23
24 #define TCR_TPSC        0x07
25 #define TSTR_STR0       BIT(0)
26
27 int timer_init(void)
28 {
29         writew(readw(TMU_BASE + TCR0) & ~TCR_TPSC, TMU_BASE + TCR0);
30         writeb(readb(TMU_BASE + TSTR) & ~TSTR_STR0, TMU_BASE + TSTR);
31         writeb(readb(TMU_BASE + TSTR) | TSTR_STR0, TMU_BASE + TSTR);
32
33         return 0;
34 }
35
This page took 0.029146 seconds and 4 git commands to generate.