summaryrefslogtreecommitdiff
path: root/drivers/clk/mediatek/clk-mt8183.c
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-05-23 12:33:34 +0300
committerStephen Boyd <sboyd@kernel.org>2022-06-16 03:24:12 +0300
commit723e367114dec95abe8bba4118c4c7c3542a463f (patch)
treec849163e4c82a05ead01bd55361052cc473c9cf5 /drivers/clk/mediatek/clk-mt8183.c
parent2d2a2900588cabe2ff3abd552d1683e5f1ce398b (diff)
downloadlinux-723e367114dec95abe8bba4118c4c7c3542a463f.tar.xz
clk: mediatek: reset: Support nonsequence base offsets of reset registers
The bank offsets are not serial for all reset registers. For example, there are five infra reset banks for MT8192: 0x120, 0x130, 0x140, 0x150 and 0x730. To support this, - Change reg_ofs to rst_bank_ofs which is a pointer to base offsets of the reset register. - Add a new define RST_NR_PER_BANK to define reset number for each reset bank. Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/20220523093346.28493-8-rex-bc.chen@mediatek.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/mediatek/clk-mt8183.c')
-rw-r--r--drivers/clk/mediatek/clk-mt8183.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/clk/mediatek/clk-mt8183.c b/drivers/clk/mediatek/clk-mt8183.c
index 5708c5d8b300..5bc738f4d0e7 100644
--- a/drivers/clk/mediatek/clk-mt8183.c
+++ b/drivers/clk/mediatek/clk-mt8183.c
@@ -20,6 +20,9 @@
/* Infra global controller reset set register */
#define INFRA_RST0_SET_OFFSET 0x120
+#define INFRA_RST1_SET_OFFSET 0x130
+#define INFRA_RST2_SET_OFFSET 0x140
+#define INFRA_RST3_SET_OFFSET 0x150
static DEFINE_SPINLOCK(mt8183_clk_lock);
@@ -1153,10 +1156,17 @@ static const struct mtk_pll_data plls[] = {
0, 0, 32, 8, 0x02B4, 1, 0x02BC, 0x0014, 1, 0x02B8, 0, 0x02B4),
};
+static u16 infra_rst_ofs[] = {
+ INFRA_RST0_SET_OFFSET,
+ INFRA_RST1_SET_OFFSET,
+ INFRA_RST2_SET_OFFSET,
+ INFRA_RST3_SET_OFFSET,
+};
+
static const struct mtk_clk_rst_desc clk_rst_desc = {
.version = MTK_RST_SET_CLR,
- .rst_bank_nr = 4,
- .reg_ofs = INFRA_RST0_SET_OFFSET,
+ .rst_bank_ofs = infra_rst_ofs,
+ .rst_bank_nr = ARRAY_SIZE(infra_rst_ofs),
};
static int clk_mt8183_apmixed_probe(struct platform_device *pdev)