xref: /rk3399_rockchip-uboot/arch/arm/mach-at91/include/mach/at91_pit.h (revision b9cb64825b5e6efeb715abd8b48d9b12f98973e9)
1*af930827SMasahiro Yamada /*
2*af930827SMasahiro Yamada  * [origin: Linux kernel include/asm-arm/arch-at91/at91_pit.h]
3*af930827SMasahiro Yamada  *
4*af930827SMasahiro Yamada  * Copyright (C) 2007 Andrew Victor
5*af930827SMasahiro Yamada  * Copyright (C) 2007 Atmel Corporation.
6*af930827SMasahiro Yamada  *
7*af930827SMasahiro Yamada  * Periodic Interval Timer (PIT) - System peripherals regsters.
8*af930827SMasahiro Yamada  * Based on AT91SAM9261 datasheet revision D.
9*af930827SMasahiro Yamada  *
10*af930827SMasahiro Yamada  * SPDX-License-Identifier:	GPL-2.0+
11*af930827SMasahiro Yamada  */
12*af930827SMasahiro Yamada 
13*af930827SMasahiro Yamada #ifndef AT91_PIT_H
14*af930827SMasahiro Yamada #define AT91_PIT_H
15*af930827SMasahiro Yamada 
16*af930827SMasahiro Yamada typedef struct at91_pit {
17*af930827SMasahiro Yamada 	u32	mr;	/* 0x00 Mode Register */
18*af930827SMasahiro Yamada 	u32	sr;	/* 0x04 Status Register */
19*af930827SMasahiro Yamada 	u32	pivr;	/* 0x08 Periodic Interval Value Register */
20*af930827SMasahiro Yamada 	u32	piir;	/* 0x0C Periodic Interval Image Register */
21*af930827SMasahiro Yamada } at91_pit_t;
22*af930827SMasahiro Yamada 
23*af930827SMasahiro Yamada #define		AT91_PIT_MR_IEN		0x02000000
24*af930827SMasahiro Yamada #define		AT91_PIT_MR_EN		0x01000000
25*af930827SMasahiro Yamada #define		AT91_PIT_MR_PIV_MASK(x)	(x & 0x000fffff)
26*af930827SMasahiro Yamada #define		AT91_PIT_MR_PIV(x)	(x & AT91_PIT_MR_PIV_MASK)
27*af930827SMasahiro Yamada 
28*af930827SMasahiro Yamada #endif
29