mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-10 23:03:29 +09:00
![Tom Rini](/assets/img/avatar_default.png)
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>
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2002
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
* Marius Groeger <mgroeger@sysgo.de>
|
|
*
|
|
* (C) Copyright 2002
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
* Alex Zuepke <azu@sysgo.de>
|
|
*
|
|
* (C) Copyright 2002
|
|
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
|
*
|
|
* (C) Copyright 2009
|
|
* Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
|
|
*
|
|
* (C) Copyright 2009 DENX Software Engineering
|
|
* Author: John Rigby <jrigby@gmail.com>
|
|
* Add support for MX25
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/imx-regs.h>
|
|
|
|
/* nothing really to do with interrupts, just starts up a counter. */
|
|
/* The 32KHz 32-bit timer overruns in 134217 seconds */
|
|
int timer_init(void)
|
|
{
|
|
int i;
|
|
struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE;
|
|
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
|
|
|
/* setup GP Timer 1 */
|
|
writel(GPT_CTRL_SWR, &gpt->ctrl);
|
|
|
|
writel(readl(&ccm->cgr1) | CCM_CGR1_GPT1, &ccm->cgr1);
|
|
|
|
for (i = 0; i < 100; i++)
|
|
writel(0, &gpt->ctrl); /* We have no udelay by now */
|
|
writel(0, &gpt->pre); /* prescaler = 1 */
|
|
/* Freerun Mode, 32KHz input */
|
|
writel(readl(&gpt->ctrl) | GPT_CTRL_CLKSOURCE_32 | GPT_CTRL_FRR,
|
|
&gpt->ctrl);
|
|
writel(readl(&gpt->ctrl) | GPT_CTRL_TEN, &gpt->ctrl);
|
|
|
|
return 0;
|
|
}
|