blob: e22956992014d29a32c05a9d67cf46d459a711ba [file] [log] [blame]
George Hilliarde59d7fe2021-07-25 19:16:23 -04001// SPDX-License-Identifier: (GPL-2.0+)
2/*
3 * Copyright (C) 2019 George Hilliard <thirtythreeforty@gmail.com>.
4 */
5
George Hilliarde59d7fe2021-07-25 19:16:23 -04006#include <clk-uclass.h>
7#include <dm.h>
8#include <errno.h>
9#include <clk/sunxi.h>
10#include <dt-bindings/clock/suniv-ccu-f1c100s.h>
11#include <dt-bindings/reset/suniv-ccu-f1c100s.h>
12
13static struct ccu_clk_gate f1c100s_gates[] = {
14 [CLK_BUS_MMC0] = GATE(0x060, BIT(8)),
15 [CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
16 [CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
17 [CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
18 [CLK_BUS_OTG] = GATE(0x060, BIT(24)),
19
20 [CLK_BUS_I2C0] = GATE(0x068, BIT(16)),
21 [CLK_BUS_I2C1] = GATE(0x068, BIT(17)),
22 [CLK_BUS_I2C2] = GATE(0x068, BIT(18)),
23 [CLK_BUS_PIO] = GATE(0x068, BIT(19)),
24
25 [CLK_BUS_UART0] = GATE(0x06c, BIT(20)),
26 [CLK_BUS_UART1] = GATE(0x06c, BIT(21)),
27 [CLK_BUS_UART2] = GATE(0x06c, BIT(22)),
28
29 [CLK_USB_PHY0] = GATE(0x0cc, BIT(1)),
30};
31
32static struct ccu_reset f1c100s_resets[] = {
33 [RST_USB_PHY0] = RESET(0x0cc, BIT(0)),
34
35 [RST_BUS_MMC0] = RESET(0x2c0, BIT(8)),
36 [RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
37 [RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
38 [RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
39 [RST_BUS_OTG] = RESET(0x2c0, BIT(24)),
40
41 [RST_BUS_I2C0] = RESET(0x2d0, BIT(16)),
42 [RST_BUS_I2C1] = RESET(0x2d0, BIT(17)),
43 [RST_BUS_I2C2] = RESET(0x2d0, BIT(18)),
44 [RST_BUS_UART0] = RESET(0x2d0, BIT(20)),
45 [RST_BUS_UART1] = RESET(0x2d0, BIT(21)),
46 [RST_BUS_UART2] = RESET(0x2d0, BIT(22)),
47};
48
Samuel Holland751c6c62022-05-09 00:29:34 -050049const struct ccu_desc f1c100s_ccu_desc = {
George Hilliarde59d7fe2021-07-25 19:16:23 -040050 .gates = f1c100s_gates,
51 .resets = f1c100s_resets,
Samuel Holland84436502022-05-09 00:29:31 -050052 .num_gates = ARRAY_SIZE(f1c100s_gates),
53 .num_resets = ARRAY_SIZE(f1c100s_resets),
George Hilliarde59d7fe2021-07-25 19:16:23 -040054};