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>
43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2014, STMicroelectronics - All Rights Reserved
|
|
* Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
|
|
*/
|
|
|
|
#include <asm/io.h>
|
|
#include <asm/arch/hardware.h>
|
|
#include <asm/arch/stv0991_cgu.h>
|
|
#include<asm/arch/stv0991_periph.h>
|
|
|
|
static struct stv0991_cgu_regs *const stv0991_cgu_regs = \
|
|
(struct stv0991_cgu_regs *) (CGU_BASE_ADDR);
|
|
|
|
void enable_pll1(void)
|
|
{
|
|
/* pll1 already configured for 1000Mhz, just need to enable it */
|
|
writel(readl(&stv0991_cgu_regs->pll1_ctrl) & ~(0x01),
|
|
&stv0991_cgu_regs->pll1_ctrl);
|
|
}
|
|
|
|
void clock_setup(int peripheral)
|
|
{
|
|
switch (peripheral) {
|
|
case UART_CLOCK_CFG:
|
|
writel(UART_CLK_CFG, &stv0991_cgu_regs->uart_freq);
|
|
break;
|
|
case ETH_CLOCK_CFG:
|
|
enable_pll1();
|
|
writel(ETH_CLK_CFG, &stv0991_cgu_regs->eth_freq);
|
|
|
|
/* Clock selection for ethernet tx_clk & rx_clk*/
|
|
writel((readl(&stv0991_cgu_regs->eth_ctrl) & ETH_CLK_MASK)
|
|
| ETH_CLK_CTRL, &stv0991_cgu_regs->eth_ctrl);
|
|
break;
|
|
case QSPI_CLOCK_CFG:
|
|
writel(QSPI_CLK_CTRL, &stv0991_cgu_regs->qspi_freq);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|