summaryrefslogtreecommitdiffstats
path: root/plat/imx/common/imx7_clock.c
blob: 6bd2e0e88efbc1ca4193fcdc28e7d46f7d1aa331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
#include <imx_regs.h>
#include <imx_clock.h>

static void imx7_clock_uart_init(void)
{
	unsigned int i;

	for (i = 0; i < MXC_MAX_UART_NUM; i++)
		imx_clock_disable_uart(i);
}

static void imx7_clock_wdog_init(void)
{
	unsigned int i;

	for (i = 0; i < MXC_MAX_WDOG_NUM; i++)
		imx_clock_disable_wdog(i);
}

static void imx7_clock_usb_init(void)
{
	/* Disable the clock root */
	imx_clock_target_clr(CCM_TRT_ID_USB_HSIC_CLK_ROOT, 0xFFFFFFFF);
}

void imx_clock_init(void)
{
	/*
	 * The BootROM hands off to the next stage with the internal 24 MHz XTAL
	 * crystal already clocking the main PLL, which is very handy.
	 * Here we should enable whichever peripherals are required for ATF and
	 * OPTEE.
	 *
	 * Subsequent stages in the boot process such as u-boot and Linux
	 * already have a significant and mature code-base around clocks, so our
	 * objective should be to enable what we need for ATF/OPTEE without
	 * breaking any existing upstream code in Linux and u-boot.
	 */

	/* Initialize UART clocks */
	imx7_clock_uart_init();

	/* Watchdog clocks */

	imx7_clock_wdog_init();

	/* USB clocks */
	imx7_clock_usb_init();

}