Skip to content

Commit 3b3ec20

Browse files
mtk-rex-bc-chenbebarino
authored andcommitted
clk: mediatek: reset: Add infra_ao reset support for MT8186
The infra_ao reset is needed for MT8186. - Add mtk_clk_rst_desc for MT8186. - Add register reset controller function for MT8186 infra_ao. - Add infra_ao_idx_map for MT8186. Signed-off-by: Rex-BC Chen <[email protected]> Reviewed-by: Nícolas F. R. A. Prado <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 2336db6 commit 3b3ec20

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/clk/mediatek/clk-mt8186-infra_ao.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/clk-provider.h>
77
#include <linux/platform_device.h>
88
#include <dt-bindings/clock/mt8186-clk.h>
9+
#include <dt-bindings/reset/mt8186-resets.h>
910

1011
#include "clk-gate.h"
1112
#include "clk-mtk.h"
@@ -191,9 +192,31 @@ static const struct mtk_gate infra_ao_clks[] = {
191192
GATE_INFRA_AO3(CLK_INFRA_AO_FLASHIF_66M, "infra_ao_flashif_66m", "top_axi", 29),
192193
};
193194

195+
static u16 infra_ao_rst_ofs[] = {
196+
INFRA_RST0_SET_OFFSET,
197+
INFRA_RST1_SET_OFFSET,
198+
INFRA_RST2_SET_OFFSET,
199+
INFRA_RST3_SET_OFFSET,
200+
INFRA_RST4_SET_OFFSET,
201+
};
202+
203+
static u16 infra_ao_idx_map[] = {
204+
[MT8186_INFRA_THERMAL_CTRL_RST] = 0 * RST_NR_PER_BANK + 0,
205+
[MT8186_INFRA_PTP_CTRL_RST] = 1 * RST_NR_PER_BANK + 0,
206+
};
207+
208+
static struct mtk_clk_rst_desc infra_ao_rst_desc = {
209+
.version = MTK_RST_SET_CLR,
210+
.rst_bank_ofs = infra_ao_rst_ofs,
211+
.rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs),
212+
.rst_idx_map = infra_ao_idx_map,
213+
.rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map),
214+
};
215+
194216
static const struct mtk_clk_desc infra_ao_desc = {
195217
.clks = infra_ao_clks,
196218
.num_clks = ARRAY_SIZE(infra_ao_clks),
219+
.rst_desc = &infra_ao_rst_desc,
197220
};
198221

199222
static const struct of_device_id of_match_clk_mt8186_infra_ao[] = {

0 commit comments

Comments
 (0)