blob: c201f818fc78497bb9f0ba58006982511f7a7da8 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamadae4dfb052016-02-02 21:11:32 +09002/*
Masahiro Yamadafa1f73f2016-07-19 21:56:13 +09003 * Copyright (C) 2016 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadae4dfb052016-02-02 21:11:32 +09005 */
6
Masahiro Yamadae4dfb052016-02-02 21:11:32 +09007#include "clk-uniphier.h"
8
Masahiro Yamada49806682017-10-13 19:21:59 +09009#define UNIPHIER_MIO_CLK_SD_FIXED \
10 UNIPHIER_CLK_RATE(128, 44444444), \
11 UNIPHIER_CLK_RATE(129, 33333333), \
12 UNIPHIER_CLK_RATE(130, 50000000), \
13 UNIPHIER_CLK_RATE(131, 66666667), \
14 UNIPHIER_CLK_RATE(132, 100000000), \
15 UNIPHIER_CLK_RATE(133, 40000000), \
16 UNIPHIER_CLK_RATE(134, 25000000), \
17 UNIPHIER_CLK_RATE(135, 22222222)
18
19#define UNIPHIER_MIO_CLK_SD(_id, ch) \
20 { \
21 .type = UNIPHIER_CLK_TYPE_MUX, \
22 .id = (_id) + 32, \
23 .data.mux = { \
24 .parent_ids = { \
25 128, \
26 129, \
27 130, \
28 131, \
29 132, \
30 133, \
31 134, \
32 135, \
33 }, \
34 .num_parents = 8, \
35 .reg = 0x30 + 0x200 * (ch), \
36 .masks = { \
37 0x00031000, \
38 0x00031000, \
39 0x00031000, \
40 0x00031000, \
41 0x00001300, \
42 0x00001300, \
43 0x00001300, \
44 0x00001300, \
45 }, \
46 .vals = { \
47 0x00000000, \
48 0x00010000, \
49 0x00020000, \
50 0x00030000, \
51 0x00001000, \
52 0x00001100, \
53 0x00001200, \
54 0x00001300, \
55 }, \
56 }, \
57 }, \
58 UNIPHIER_CLK_GATE((_id), (_id) + 32, 0x20 + 0x200 * (ch), 8)
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090059
Masahiro Yamada8bdfe0a2016-10-17 22:18:01 +090060#define UNIPHIER_MIO_CLK_USB2(id, ch) \
Masahiro Yamada49806682017-10-13 19:21:59 +090061 UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 28)
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090062
Masahiro Yamada8bdfe0a2016-10-17 22:18:01 +090063#define UNIPHIER_MIO_CLK_USB2_PHY(id, ch) \
Masahiro Yamada49806682017-10-13 19:21:59 +090064 UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 29)
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090065
Masahiro Yamada8bdfe0a2016-10-17 22:18:01 +090066#define UNIPHIER_MIO_CLK_DMAC(id) \
Masahiro Yamada49806682017-10-13 19:21:59 +090067 UNIPHIER_CLK_GATE_SIMPLE((id), 0x20, 25)
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090068
Masahiro Yamada49806682017-10-13 19:21:59 +090069const struct uniphier_clk_data uniphier_mio_clk_data[] = {
70 UNIPHIER_MIO_CLK_SD_FIXED,
71 UNIPHIER_MIO_CLK_SD(0, 0),
72 UNIPHIER_MIO_CLK_SD(1, 1),
73 UNIPHIER_MIO_CLK_SD(2, 2),
Masahiro Yamada8bdfe0a2016-10-17 22:18:01 +090074 UNIPHIER_MIO_CLK_DMAC(7),
75 UNIPHIER_MIO_CLK_USB2(8, 0),
76 UNIPHIER_MIO_CLK_USB2(9, 1),
77 UNIPHIER_MIO_CLK_USB2(10, 2),
Masahiro Yamada8bdfe0a2016-10-17 22:18:01 +090078 UNIPHIER_MIO_CLK_USB2_PHY(12, 0),
79 UNIPHIER_MIO_CLK_USB2_PHY(13, 1),
80 UNIPHIER_MIO_CLK_USB2_PHY(14, 2),
Masahiro Yamada49806682017-10-13 19:21:59 +090081 { /* sentinel */ }
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090082};