|
18 | 18 | #include "clk-pll.h" |
19 | 19 |
|
20 | 20 | #include <dt-bindings/clock/mt8192-clk.h> |
| 21 | +#include <dt-bindings/reset/mt8192-resets.h> |
21 | 22 |
|
22 | 23 | static DEFINE_SPINLOCK(mt8192_clk_lock); |
23 | 24 |
|
@@ -1114,6 +1115,30 @@ static const struct mtk_gate top_clks[] = { |
1114 | 1115 | GATE_TOP(CLK_TOP_SSUSB_PHY_REF, "ssusb_phy_ref", "clk26m", 25), |
1115 | 1116 | }; |
1116 | 1117 |
|
| 1118 | +static u16 infra_ao_rst_ofs[] = { |
| 1119 | + INFRA_RST0_SET_OFFSET, |
| 1120 | + INFRA_RST1_SET_OFFSET, |
| 1121 | + INFRA_RST2_SET_OFFSET, |
| 1122 | + INFRA_RST3_SET_OFFSET, |
| 1123 | + INFRA_RST4_SET_OFFSET, |
| 1124 | +}; |
| 1125 | + |
| 1126 | +static u16 infra_ao_idx_map[] = { |
| 1127 | + [MT8192_INFRA_RST0_THERM_CTRL_SWRST] = 0 * RST_NR_PER_BANK + 0, |
| 1128 | + [MT8192_INFRA_RST2_PEXTP_PHY_SWRST] = 2 * RST_NR_PER_BANK + 15, |
| 1129 | + [MT8192_INFRA_RST3_THERM_CTRL_PTP_SWRST] = 3 * RST_NR_PER_BANK + 5, |
| 1130 | + [MT8192_INFRA_RST4_PCIE_TOP_SWRST] = 4 * RST_NR_PER_BANK + 1, |
| 1131 | + [MT8192_INFRA_RST4_THERM_CTRL_MCU_SWRST] = 4 * RST_NR_PER_BANK + 12, |
| 1132 | +}; |
| 1133 | + |
| 1134 | +static const struct mtk_clk_rst_desc clk_rst_desc = { |
| 1135 | + .version = MTK_RST_SET_CLR, |
| 1136 | + .rst_bank_ofs = infra_ao_rst_ofs, |
| 1137 | + .rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs), |
| 1138 | + .rst_idx_map = infra_ao_idx_map, |
| 1139 | + .rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map), |
| 1140 | +}; |
| 1141 | + |
1117 | 1142 | #define MT8192_PLL_FMAX (3800UL * MHZ) |
1118 | 1143 | #define MT8192_PLL_FMIN (1500UL * MHZ) |
1119 | 1144 | #define MT8192_INTEGER_BITS 8 |
@@ -1240,6 +1265,10 @@ static int clk_mt8192_infra_probe(struct platform_device *pdev) |
1240 | 1265 | if (r) |
1241 | 1266 | goto free_clk_data; |
1242 | 1267 |
|
| 1268 | + r = mtk_register_reset_controller_with_dev(&pdev->dev, &clk_rst_desc); |
| 1269 | + if (r) |
| 1270 | + goto free_clk_data; |
| 1271 | + |
1243 | 1272 | r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); |
1244 | 1273 | if (r) |
1245 | 1274 | goto free_clk_data; |
|
0 commit comments