2 * (C) Copyright 2009 ST-Ericsson
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/hardware.h>
11 DECLARE_GLOBAL_DATA_PTR;
20 static unsigned int clkrst_base[] = {
27 U8500_CLKRST7_BASE, /* ED only */
30 /* Turn on peripheral clock at PRCC level */
31 void u8500_clock_enable(int periph, int cluster, int kern)
33 struct clkrst *clkrst = (struct clkrst *) clkrst_base[periph - 1];
36 writel(1 << kern, &clkrst->kcken);
39 writel(1 << cluster, &clkrst->pcken);
42 void db8500_clocks_init(void)
45 * Enable all clocks. This is u-boot, we can enable it all. There is no
46 * powersave in u-boot.
49 u8500_clock_enable(1, 9, -1); /* GPIO0 */
50 u8500_clock_enable(2, 11, -1);/* GPIO1 */
51 u8500_clock_enable(3, 8, -1); /* GPIO2 */
52 u8500_clock_enable(5, 1, -1); /* GPIO3 */
53 u8500_clock_enable(3, 6, 6); /* UART2 */
54 u8500_clock_enable(3, 3, 3); /* I2C0 */
55 u8500_clock_enable(1, 5, 5); /* SDI0 */
56 u8500_clock_enable(2, 4, 2); /* SDI4 */
57 u8500_clock_enable(6, 6, -1); /* MTU0 */
58 u8500_clock_enable(3, 4, 4); /* SDI2 */
61 * Enabling clocks for all devices which are AMBA devices in the
62 * kernel. Otherwise they will not get probe()'d because the
63 * peripheral ID register will not be powered.
66 /* XXX: some of these differ between ED/V1 */
68 u8500_clock_enable(1, 1, 1); /* UART1 */
69 u8500_clock_enable(1, 0, 0); /* UART0 */
70 u8500_clock_enable(3, 2, 2); /* SSP1 */
71 u8500_clock_enable(3, 1, 1); /* SSP0 */
72 u8500_clock_enable(2, 8, -1); /* SPI0 */
73 u8500_clock_enable(2, 5, 3); /* MSP2 */