2016-02-02 12:11:32 +00:00
|
|
|
/*
|
2016-07-19 12:56:13 +00:00
|
|
|
* Copyright (C) 2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
2016-02-02 12:11:32 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "clk-uniphier.h"
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_MIO_CLK_SD_GATE(id, ch) \
|
|
|
|
UNIPHIER_CLK_GATE((id), 0x20 + 0x200 * (ch), 8)
|
2016-02-02 12:11:32 +00:00
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_MIO_CLK_USB2(id, ch) \
|
|
|
|
UNIPHIER_CLK_GATE((id), 0x20 + 0x200 * (ch), 28)
|
2016-02-02 12:11:32 +00:00
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_MIO_CLK_USB2_PHY(id, ch) \
|
|
|
|
UNIPHIER_CLK_GATE((id), 0x20 + 0x200 * (ch), 29)
|
|
|
|
|
|
|
|
#define UNIPHIER_MIO_CLK_DMAC(id) \
|
|
|
|
UNIPHIER_CLK_GATE((id), 0x20, 25)
|
2016-02-02 12:11:32 +00:00
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_MIO_CLK_SD_MUX(_id, ch) \
|
|
|
|
{ \
|
|
|
|
.id = (_id), \
|
|
|
|
.nr_muxs = 8, \
|
|
|
|
.reg = 0x30 + 0x200 * (ch), \
|
|
|
|
.masks = { \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00031000, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
0x00001300, \
|
|
|
|
}, \
|
|
|
|
.vals = { \
|
|
|
|
0x00000000, \
|
|
|
|
0x00010000, \
|
|
|
|
0x00020000, \
|
|
|
|
0x00030000, \
|
|
|
|
0x00001000, \
|
|
|
|
0x00001100, \
|
|
|
|
0x00001200, \
|
|
|
|
0x00001300, \
|
|
|
|
}, \
|
|
|
|
.rates = { \
|
|
|
|
44444444, \
|
|
|
|
33333333, \
|
|
|
|
50000000, \
|
|
|
|
66666666, \
|
|
|
|
100000000, \
|
|
|
|
40000000, \
|
|
|
|
25000000, \
|
|
|
|
22222222, \
|
|
|
|
}, \
|
2016-02-02 12:11:32 +00:00
|
|
|
}
|
|
|
|
|
2016-09-21 22:42:20 +00:00
|
|
|
static const struct uniphier_clk_gate_data uniphier_mio_clk_gate[] = {
|
2016-10-17 13:18:01 +00:00
|
|
|
UNIPHIER_MIO_CLK_SD_GATE(0, 0),
|
|
|
|
UNIPHIER_MIO_CLK_SD_GATE(1, 1),
|
|
|
|
UNIPHIER_MIO_CLK_SD_GATE(2, 2), /* for PH1-Pro4 only */
|
|
|
|
UNIPHIER_MIO_CLK_DMAC(7),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(8, 0),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(9, 1),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(10, 2),
|
|
|
|
UNIPHIER_MIO_CLK_USB2(11, 3), /* for PH1-sLD3 only */
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(12, 0),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(13, 1),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(14, 2),
|
|
|
|
UNIPHIER_MIO_CLK_USB2_PHY(15, 3), /* for PH1-sLD3 only */
|
|
|
|
UNIPHIER_CLK_END
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
static const struct uniphier_clk_mux_data uniphier_mio_clk_mux[] = {
|
|
|
|
UNIPHIER_MIO_CLK_SD_MUX(0, 0),
|
|
|
|
UNIPHIER_MIO_CLK_SD_MUX(1, 1),
|
|
|
|
UNIPHIER_MIO_CLK_SD_MUX(2, 2), /* for PH1-Pro4 only */
|
|
|
|
UNIPHIER_CLK_END
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
const struct uniphier_clk_data uniphier_mio_clk_data = {
|
2016-02-02 12:11:32 +00:00
|
|
|
.gate = uniphier_mio_clk_gate,
|
2016-10-17 13:18:01 +00:00
|
|
|
.mux = uniphier_mio_clk_mux,
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|