Support MediaTek devapc for MT8186
Subsystems (2)
cover Support MediaTek devapc for MT8186
This series is for supporting devapc implementation in MT8186.
V1:
- Add dt-binding and add devapc data for MT8186.
Rex-BC Chen (2):
dt-bindings: soc: mediatek: devapc: Add bindings for MT8186
soc: mediatek: devapc: Add support for MT8186
.../devicetree/bindings/soc/mediatek/devapc.yaml | 1 + drivers/soc/mediatek/mtk-devapc.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
Signature · 1 line
2.18.0
PATCH 1/2 dt-bindings: soc: mediatek: devapc: Add bindings for MT8186
Add the dt-binding to support MT8186 devapc.
--- Documentation/devicetree/bindings/soc/mediatek/devapc.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/soc/mediatek/devapc.yaml +1 -0
@@ -20,6 +20,7 @@ properties: compatible: enum: - mediatek,mt6779-devapc + - mediatek,mt8186-devapc reg: description: The base address of devapc register bank
Signature · 1 line
2.18.0
Re: [PATCH 1/2] dt-bindings: soc: mediatek: devapc: Add bindings for MT8186
Quoted 3 lines · Rex-BC Chen
Add the dt-binding to support MT8186 devapc.
Signed-off-by Rex-BC Chen <[email protected]>
Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: soc: mediatek: devapc: Add bindings for MT8186
In reply to Rex-BC ChenIl 29/04/22 08:54, Rex-BC Chen ha scritto:
Quoted 4 lines
Add the dt-binding to support MT8186 devapc.
Signed-off-by Rex-BC Chen <[email protected]>
Chun-Kuang Hu
Reviewed-byRe: [PATCH 1/2] dt-bindings: soc: mediatek: devapc: Add bindings for MT8186
AngeloGioacchino Del Regno <[email protected]> 於 2022年5月4日 週三 下午5:53寫道:
Quoted 8 lines
Il 29/04/22 08:54, Rex-BC Chen ha scritto:
Quoted 4 lines
Add the dt-binding to support MT8186 devapc.
Signed-off-by Rex-BC Chen <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>
Quoted 6 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH 2/2 soc: mediatek: devapc: Add support for MT8186
In reply to Rex-BC ChenAdd devapc data and compatible to support MT8186 devapc.
--- drivers/soc/mediatek/mtk-devapc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/soc/mediatek/mtk-devapc.c +15 -0
@@ -227,10 +227,25 @@ static const struct mtk_devapc_data devapc_mt6779 = { .vio_shift_con_offset = 0xF20, }; +static const struct mtk_devapc_data devapc_mt8186 = { + .vio_idx_num =519 , + .vio_mask_offset =0x0 , + .vio_sta_offset =0x400 , + .vio_dbg0_offset =0x900 , + .vio_dbg1_offset =0x904 , + .apc_con_offset =0xF00 , + .vio_shift_sta_offset =0xF10 , + .vio_shift_sel_offset =0xF14 , + .vio_shift_con_offset =0xF20 , +}; +static const struct of_device_id mtk_devapc_dt_match[] = { { .compatible ="mediatek,mt6779-devapc" , .data = &devapc_mt6779, + }, { + .compatible ="mediatek,mt8186-devapc" , + .data = &devapc_mt8186, }, { }, };
Signature · 1 line
2.18.0
AngeloGioacchino Del Regno
maintainerRe: [PATCH 2/2] soc: mediatek: devapc: Add support for MT8186
Il 29/04/22 08:54, Rex-BC Chen ha scritto:
Quoted 17 lines
Add devapc data and compatible to support MT8186 devapc.
Signed-off-by Runyang Chen <[email protected]>Signed-off-by Rex-BC Chen <[email protected]>--- drivers/soc/mediatek/mtk-devapc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/soc/mediatek/mtk-devapc.c +1
-0@@ -227,10 +227,25 @@ static const struct mtk_devapc_data devapc_mt6779 = { .vio_shift_con_offset = 0xF20, }; +static const struct mtk_devapc_data devapc_mt8186 = {
drivers/soc/mediatek/mtk-devapc.c static const struct mtk_devapc_data devapc_mt6779 = { · line 240
Quoted 10 lines
drivers/soc/mediatek/mtk-devapc.c +10
-0+ .vio_idx_num = 519, + .vio_mask_offset = 0x0, + .vio_sta_offset = 0x400, + .vio_dbg0_offset = 0x900, + .vio_dbg1_offset = 0x904, + .apc_con_offset = 0xF00, + .vio_shift_sta_offset = 0xF10, + .vio_shift_sel_offset = 0xF14, + .vio_shift_con_offset = 0xF20, +};
Hello Rex,
since the register layout is common across a lot of MediaTek SoCs and basically only the vio_idx_num wildly varies between them, can you separate this parameter from the mtk_devapc_data struct?
I propose the following:
struct mtk_devapc_regs {
/* reg offset */
u32 vio_mask_offset;
u32 ... etc
};struct mtk_devapc_data {
u32 vio_idx_num;
const struct mtk_devapc_regs *regs;
};static const struct mtk_devapc_regs devapc_regs_mt6779 = {
.vio_mask_offset = 0x0,
.vio...etc
};static const struct mtk_devapc_data devapc_mt6779 = {
.vio_idx_num = 511,
.regs = devapc_regs_mt6779,
};static const struct mtk_devapc_data devapc_mt8186 = {
.vio_idx_num = 519,
.regs = devapc_regs_mt6779,
};Regards,
Angelo
Re: [PATCH 2/2] soc: mediatek: devapc: Add support for MT8186
Quoted 61 lines · AngeloGioacchino Del Regno
Il 29/04/22 08:54, Rex-BC Chen ha scritto:
Quoted 19 lines
Add devapc data and compatible to support MT8186 devapc.
Signed-off-by Runyang Chen <[email protected]>Signed-off-by Rex-BC Chen <[email protected]>--- drivers/soc/mediatek/mtk-devapc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/soc/mediatek/mtk-devapc.c +1
-0@@ -227,10 +227,25 @@ static const struct mtk_devapc_data devapc_mt6779 = { .vio_shift_con_offset = 0xF20, }; +static const struct mtk_devapc_data devapc_mt8186 = {drivers/soc/mediatek/mtk-devapc.c static const struct mtk_devapc_data · line 241
Quoted 10 lines
drivers/soc/mediatek/mtk-devapc.c +10
-0+ .vio_idx_num = 519, + .vio_mask_offset = 0x0, + .vio_sta_offset = 0x400, + .vio_dbg0_offset = 0x900, + .vio_dbg1_offset = 0x904, + .apc_con_offset = 0xF00, + .vio_shift_sta_offset = 0xF10, + .vio_shift_sel_offset = 0xF14, + .vio_shift_con_offset = 0xF20, +};Hello Rex,
since the register layout is common across a lot of MediaTek SoCs and basically
only thevio_idx_numwildly varies between them, can you separate this parameter
from themtk_devapc_datastruct?I propose the following:
struct mtk_devapc_regs { /* reg offset */ u32 vio_mask_offset; u32 ... etc };struct mtk_devapc_data { u32 vio_idx_num; const struct mtk_devapc_regs *regs; };static const struct mtk_devapc_regs devapc_regs_mt6779 = { .vio_mask_offset = 0x0, .vio...etc };static const struct mtk_devapc_data devapc_mt6779 = { .vio_idx_num = 511, .regs = devapc_regs_mt6779, };
Quoted 8 lines
static const struct mtk_devapc_data devapc_mt8186 = { .vio_idx_num = 519, .regs = devapc_regs_mt6779, };Regards,
Angelo
Hello Angelo,
Thanks for your advise.
I will separate vio_idx_num and register offsets in next version.
BRs,
Rex