1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+ 248264d9bSMasahiro Yamada /* 34e3d8406SMasahiro Yamada * Copyright (C) 2016 Socionext Inc. 44e3d8406SMasahiro Yamada * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 548264d9bSMasahiro Yamada */ 648264d9bSMasahiro Yamada 748264d9bSMasahiro Yamada #include "clk-uniphier.h" 848264d9bSMasahiro Yamada 9d6c7ee7dSMasahiro Yamada #define UNIPHIER_MIO_CLK_SD_FIXED \ 10d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(128, 44444444), \ 11d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(129, 33333333), \ 12d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(130, 50000000), \ 13d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(131, 66666667), \ 14d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(132, 100000000), \ 15d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(133, 40000000), \ 16d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(134, 25000000), \ 17d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_RATE(135, 22222222) 1848264d9bSMasahiro Yamada 19d6c7ee7dSMasahiro Yamada #define UNIPHIER_MIO_CLK_SD(_id, ch) \ 2048264d9bSMasahiro Yamada { \ 21d6c7ee7dSMasahiro Yamada .type = UNIPHIER_CLK_TYPE_MUX, \ 22d6c7ee7dSMasahiro Yamada .id = (_id) + 32, \ 23d6c7ee7dSMasahiro Yamada .data.mux = { \ 24d6c7ee7dSMasahiro Yamada .parent_ids = { \ 25d6c7ee7dSMasahiro Yamada 128, \ 26d6c7ee7dSMasahiro Yamada 129, \ 27d6c7ee7dSMasahiro Yamada 130, \ 28d6c7ee7dSMasahiro Yamada 131, \ 29d6c7ee7dSMasahiro Yamada 132, \ 30d6c7ee7dSMasahiro Yamada 133, \ 31d6c7ee7dSMasahiro Yamada 134, \ 32d6c7ee7dSMasahiro Yamada 135, \ 33d6c7ee7dSMasahiro Yamada }, \ 34d6c7ee7dSMasahiro Yamada .num_parents = 8, \ 35805dc44cSMasahiro Yamada .reg = 0x30 + 0x200 * (ch), \ 36805dc44cSMasahiro Yamada .masks = { \ 37805dc44cSMasahiro Yamada 0x00031000, \ 38805dc44cSMasahiro Yamada 0x00031000, \ 39805dc44cSMasahiro Yamada 0x00031000, \ 40805dc44cSMasahiro Yamada 0x00031000, \ 41805dc44cSMasahiro Yamada 0x00001300, \ 42805dc44cSMasahiro Yamada 0x00001300, \ 43805dc44cSMasahiro Yamada 0x00001300, \ 44805dc44cSMasahiro Yamada 0x00001300, \ 4548264d9bSMasahiro Yamada }, \ 46805dc44cSMasahiro Yamada .vals = { \ 47805dc44cSMasahiro Yamada 0x00000000, \ 48805dc44cSMasahiro Yamada 0x00010000, \ 49805dc44cSMasahiro Yamada 0x00020000, \ 50805dc44cSMasahiro Yamada 0x00030000, \ 51805dc44cSMasahiro Yamada 0x00001000, \ 52805dc44cSMasahiro Yamada 0x00001100, \ 53805dc44cSMasahiro Yamada 0x00001200, \ 54805dc44cSMasahiro Yamada 0x00001300, \ 55805dc44cSMasahiro Yamada }, \ 56805dc44cSMasahiro Yamada }, \ 57d6c7ee7dSMasahiro Yamada }, \ 58d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_GATE((_id), (_id) + 32, 0x20 + 0x200 * (ch), 8) 5948264d9bSMasahiro Yamada 60d6c7ee7dSMasahiro Yamada #define UNIPHIER_MIO_CLK_USB2(id, ch) \ 61d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 28) 62d6c7ee7dSMasahiro Yamada 63d6c7ee7dSMasahiro Yamada #define UNIPHIER_MIO_CLK_USB2_PHY(id, ch) \ 64d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_GATE_SIMPLE((id), 0x20 + 0x200 * (ch), 29) 65d6c7ee7dSMasahiro Yamada 66d6c7ee7dSMasahiro Yamada #define UNIPHIER_MIO_CLK_DMAC(id) \ 67d6c7ee7dSMasahiro Yamada UNIPHIER_CLK_GATE_SIMPLE((id), 0x20, 25) 68d6c7ee7dSMasahiro Yamada 69d6c7ee7dSMasahiro Yamada const struct uniphier_clk_data uniphier_mio_clk_data[] = { 70d6c7ee7dSMasahiro Yamada UNIPHIER_MIO_CLK_SD_FIXED, 71d6c7ee7dSMasahiro Yamada UNIPHIER_MIO_CLK_SD(0, 0), 72d6c7ee7dSMasahiro Yamada UNIPHIER_MIO_CLK_SD(1, 1), 73d6c7ee7dSMasahiro Yamada UNIPHIER_MIO_CLK_SD(2, 2), 74805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_DMAC(7), 75805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2(8, 0), 76805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2(9, 1), 77805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2(10, 2), 78805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2_PHY(12, 0), 79805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2_PHY(13, 1), 80805dc44cSMasahiro Yamada UNIPHIER_MIO_CLK_USB2_PHY(14, 2), 81d6c7ee7dSMasahiro Yamada { /* sentinel */ } 8248264d9bSMasahiro Yamada }; 83