|
14 | 14 | #include "clk-gate.h"
|
15 | 15 | #include "clk-mux.h"
|
16 | 16 | #include <dt-bindings/clock/mediatek,mt7988-clk.h>
|
| 17 | +#include <dt-bindings/reset/mediatek,mt7988-resets.h> |
| 18 | + |
| 19 | +#define MT7988_INFRA_RST0_SET_OFFSET 0x70 |
| 20 | +#define MT7988_INFRA_RST1_SET_OFFSET 0x80 |
17 | 21 |
|
18 | 22 | static DEFINE_SPINLOCK(mt7988_clk_lock);
|
19 | 23 |
|
@@ -249,12 +253,31 @@ static const struct mtk_gate infra_clks[] = {
|
249 | 253 | GATE_INFRA3(CLK_INFRA_133M_PCIE_CK_P3, "infra_133m_pcie_ck_p3", "sysaxi_sel", 31),
|
250 | 254 | };
|
251 | 255 |
|
| 256 | +static u16 infra_rst_ofs[] = { |
| 257 | + MT7988_INFRA_RST0_SET_OFFSET, |
| 258 | + MT7988_INFRA_RST1_SET_OFFSET, |
| 259 | +}; |
| 260 | + |
| 261 | +static u16 infra_idx_map[] = { |
| 262 | + [MT7988_INFRA_RST0_PEXTP_MAC_SWRST] = 0 * RST_NR_PER_BANK + 6, |
| 263 | + [MT7988_INFRA_RST1_THERM_CTRL_SWRST] = 1 * RST_NR_PER_BANK + 9, |
| 264 | +}; |
| 265 | + |
| 266 | +static struct mtk_clk_rst_desc infra_rst_desc = { |
| 267 | + .version = MTK_RST_SET_CLR, |
| 268 | + .rst_bank_ofs = infra_rst_ofs, |
| 269 | + .rst_bank_nr = ARRAY_SIZE(infra_rst_ofs), |
| 270 | + .rst_idx_map = infra_idx_map, |
| 271 | + .rst_idx_map_nr = ARRAY_SIZE(infra_idx_map), |
| 272 | +}; |
| 273 | + |
252 | 274 | static const struct mtk_clk_desc infra_desc = {
|
253 | 275 | .clks = infra_clks,
|
254 | 276 | .num_clks = ARRAY_SIZE(infra_clks),
|
255 | 277 | .mux_clks = infra_muxes,
|
256 | 278 | .num_mux_clks = ARRAY_SIZE(infra_muxes),
|
257 | 279 | .clk_lock = &mt7988_clk_lock,
|
| 280 | + .rst_desc = &infra_rst_desc, |
258 | 281 | };
|
259 | 282 |
|
260 | 283 | static const struct of_device_id of_match_clk_mt7988_infracfg[] = {
|
|
0 commit comments