u-boot/arch/arm/include/asm/arch-aspeed/timer.h
Tom Rini 83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07 09:34:12 -04:00

53 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (c) 2016 Google, Inc
*/
#ifndef _ASM_ARCH_TIMER_H
#define _ASM_ARCH_TIMER_H
/* Each timer has 4 control bits in ctrl1 register.
* Timer1 uses bits 0:3, Timer2 uses bits 4:7 and so on,
* such that timer X uses bits (4 * X - 4):(4 * X - 1)
* If the timer does not support PWM, bit 4 is reserved.
*/
#define AST_TMC_EN (1 << 0)
#define AST_TMC_1MHZ (1 << 1)
#define AST_TMC_OVFINTR (1 << 2)
#define AST_TMC_PWM (1 << 3)
/* Timers are counted from 1 in the datasheet. */
#define AST_TMC_CTRL1_SHIFT(n) (4 * ((n) - 1))
#define AST_TMC_RATE (1000*1000)
#ifndef __ASSEMBLY__
/*
* All timers share control registers, which makes it harder to make them
* separate devices. Since only one timer is needed at the moment, making
* it this just one device.
*/
struct ast_timer_counter {
u32 status;
u32 reload_val;
u32 match1;
u32 match2;
};
struct ast_timer {
struct ast_timer_counter timers1[3];
u32 ctrl1;
u32 ctrl2;
#ifdef CONFIG_ASPEED_AST2500
u32 ctrl3;
u32 ctrl1_clr;
#else
u32 reserved[2];
#endif
struct ast_timer_counter timers2[5];
};
#endif /* __ASSEMBLY__ */
#endif /* _ASM_ARCH_TIMER_H */