Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 2 | /* |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 3 | * Copyright (C) 2016 Socionext Inc. |
| 4 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 7 | #include "clk-uniphier.h" |
| 8 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 9 | #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 Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 59 | |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 60 | #define UNIPHIER_MIO_CLK_USB2(id, ch) \ |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 61 | UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 28) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 62 | |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 63 | #define UNIPHIER_MIO_CLK_USB2_PHY(id, ch) \ |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 64 | UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 29) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 65 | |
Masahiro Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 66 | #define UNIPHIER_MIO_CLK_DMAC(id) \ |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 67 | UNIPHIER_CLK_GATE_SIMPLE((id), 0x20, 25) |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 68 | |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 69 | const 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 Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 74 | 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 Yamada | 8bdfe0a | 2016-10-17 22:18:01 +0900 | [diff] [blame] | 78 | UNIPHIER_MIO_CLK_USB2_PHY(12, 0), |
| 79 | UNIPHIER_MIO_CLK_USB2_PHY(13, 1), |
| 80 | UNIPHIER_MIO_CLK_USB2_PHY(14, 2), |
Masahiro Yamada | 4980668 | 2017-10-13 19:21:59 +0900 | [diff] [blame] | 81 | { /* sentinel */ } |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 82 | }; |