2 * Copyright (C) 2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include "clk-uniphier.h"
18 #define UNIPHIER_MIO_CLK_SD_FIXED \
19 UNIPHIER_CLK_FACTOR("sd-44m", -1, "sd-133m", 1, 3), \
20 UNIPHIER_CLK_FACTOR("sd-33m", -1, "sd-200m", 1, 6), \
21 UNIPHIER_CLK_FACTOR("sd-50m", -1, "sd-200m", 1, 4), \
22 UNIPHIER_CLK_FACTOR("sd-67m", -1, "sd-200m", 1, 3), \
23 UNIPHIER_CLK_FACTOR("sd-100m", -1, "sd-200m", 1, 2), \
24 UNIPHIER_CLK_FACTOR("sd-40m", -1, "sd-200m", 1, 5), \
25 UNIPHIER_CLK_FACTOR("sd-25m", -1, "sd-200m", 1, 8), \
26 UNIPHIER_CLK_FACTOR("sd-22m", -1, "sd-133m", 1, 6)
28 #define UNIPHIER_MIO_CLK_SD(_idx, ch) \
30 .name = "sd" #ch "-sel", \
31 .type = UNIPHIER_CLK_TYPE_MUX, \
45 .reg = 0x30 + 0x200 * (ch), \
68 UNIPHIER_CLK_GATE("sd" #ch, (_idx), "sd" #ch "-sel", 0x20 + 0x200 * (ch), 8)
70 #define UNIPHIER_MIO_CLK_USB2(idx, ch) \
71 UNIPHIER_CLK_GATE("usb2" #ch, (idx), "usb2", 0x20 + 0x200 * (ch), 28)
73 #define UNIPHIER_MIO_CLK_USB2_PHY(idx, ch) \
74 UNIPHIER_CLK_GATE("usb2" #ch "-phy", (idx), "usb2", 0x20 + 0x200 * (ch), 29)
76 #define UNIPHIER_MIO_CLK_DMAC(idx) \
77 UNIPHIER_CLK_GATE("miodmac", (idx), "stdmac", 0x20, 25)
79 const struct uniphier_clk_data uniphier_sld3_mio_clk_data
[] = {
80 UNIPHIER_MIO_CLK_SD_FIXED
,
81 UNIPHIER_MIO_CLK_SD(0, 0),
82 UNIPHIER_MIO_CLK_SD(1, 1),
83 UNIPHIER_MIO_CLK_SD(2, 2),
84 UNIPHIER_MIO_CLK_DMAC(7),
85 UNIPHIER_MIO_CLK_USB2(8, 0),
86 UNIPHIER_MIO_CLK_USB2(9, 1),
87 UNIPHIER_MIO_CLK_USB2(10, 2),
88 UNIPHIER_MIO_CLK_USB2(11, 3),
89 UNIPHIER_MIO_CLK_USB2_PHY(12, 0),
90 UNIPHIER_MIO_CLK_USB2_PHY(13, 1),
91 UNIPHIER_MIO_CLK_USB2_PHY(14, 2),
92 UNIPHIER_MIO_CLK_USB2_PHY(15, 3),
96 const struct uniphier_clk_data uniphier_pro5_sd_clk_data
[] = {
97 UNIPHIER_MIO_CLK_SD_FIXED
,
98 UNIPHIER_MIO_CLK_SD(0, 0),
99 UNIPHIER_MIO_CLK_SD(1, 1),