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