2019-05-27 14:55:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-09-16 15:40:04 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
|
|
*/
|
|
|
|
|
2017-10-19 08:52:46 +08:00
|
|
|
#include <linux/stddef.h>
|
|
|
|
|
2016-09-16 15:40:04 +08:00
|
|
|
#include "clk-uniphier.h"
|
|
|
|
|
|
|
|
#define UNIPHIER_MIO_CLK_SD_FIXED \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-44m", -1, "sd-133m", 1, 3), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-33m", -1, "sd-200m", 1, 6), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-50m", -1, "sd-200m", 1, 4), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-67m", -1, "sd-200m", 1, 3), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-100m", -1, "sd-200m", 1, 2), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-40m", -1, "sd-200m", 1, 5), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-25m", -1, "sd-200m", 1, 8), \
|
|
|
|
UNIPHIER_CLK_FACTOR("sd-22m", -1, "sd-133m", 1, 6)
|
|
|
|
|
|
|
|
#define UNIPHIER_MIO_CLK_SD(_idx, ch) \
|
|
|
|
{ \
|
|
|
|
.name = "sd" #ch "-sel", \
|
|
|
|
.type = UNIPHIER_CLK_TYPE_MUX, \
|
|
|
|
.idx = -1, \
|
|
|
|
.data.mux = { \
|
|
|
|
.parent_names = { \
|
|
|
|
"sd-44m", \
|
|
|
|
"sd-33m", \
|
|
|
|
"sd-50m", \
|
|
|
|
"sd-67m", \
|
|
|
|
"sd-100m", \
|
|
|
|
"sd-40m", \
|
|
|
|
"sd-25m", \
|
|
|
|
"sd-22m", \
|
|
|
|
}, \
|
|
|
|
.num_parents = 8, \
|
|
|
|
.reg = 0x30 + 0x200 * (ch), \
|
|
|
|
.masks = { \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
}, \
|
|
|
|
.vals = { \
|
|
|
|
0x00000000, \
|
|
|
|
0x00010000, \
|
|
|
|
0x00020000, \
|
|
|
|
0x00030000, \
|
|
|
|
0x00001000, \
|
|
|
|
0x00001100, \
|
|
|
|
0x00001200, \
|
|
|
|
0x00001300, \
|
|
|
|
}, \
|
|
|
|
}, \
|
|
|
|
}, \
|
|
|
|
UNIPHIER_CLK_GATE("sd" #ch, (_idx), "sd" #ch "-sel", 0x20 + 0x200 * (ch), 8)
|
|
|
|
|
|
|
|
#define UNIPHIER_MIO_CLK_USB2(idx, ch) \
|
|
|
|
UNIPHIER_CLK_GATE("usb2" #ch, (idx), "usb2", 0x20 + 0x200 * (ch), 28)
|
|
|
|
|
|
|
|
#define UNIPHIER_MIO_CLK_USB2_PHY(idx, ch) \
|
|
|
|
UNIPHIER_CLK_GATE("usb2" #ch "-phy", (idx), "usb2", 0x20 + 0x200 * (ch), 29)
|
|
|
|
|
2017-07-26 11:34:35 +08:00
|
|
|
const struct uniphier_clk_data uniphier_ld4_mio_clk_data[] = {
|
2016-09-16 15:40:04 +08:00
|
|
|
UNIPHIER_MIO_CLK_SD_FIXED,
|
|
|
|
UNIPHIER_MIO_CLK_SD(0, 0),
|
|
|
|
UNIPHIER_MIO_CLK_SD(1, 1),
|
|
|
|
UNIPHIER_MIO_CLK_SD(2, 2),
|
2017-10-19 08:52:46 +08:00
|
|
|
UNIPHIER_CLK_GATE("miodmac", 7, NULL, 0x20, 25),
|
2016-09-16 15:40:04 +08:00
|
|
|
UNIPHIER_MIO_CLK_USB2(8, 0),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(9, 1),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(10, 2),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(12, 0),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(13, 1),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(14, 2),
|
|
|
|
{ /* sentinel */ }
|
|
|
|
};
|
|
|
|
|
2016-10-19 16:22:07 +08:00
|
|
|
const struct uniphier_clk_data uniphier_pro5_sd_clk_data[] = {
|
2016-09-16 15:40:04 +08:00
|
|
|
UNIPHIER_MIO_CLK_SD_FIXED,
|
|
|
|
UNIPHIER_MIO_CLK_SD(0, 0),
|
|
|
|
UNIPHIER_MIO_CLK_SD(1, 1),
|
|
|
|
{ /* sentinel */ }
|
|
|
|
};
|