LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH v5 09/16] soc: mediatek: mmsys: modify reset controller for MT8195 vdosys1
[not found] ` <20210906071539.12953-10-nancy.lin@mediatek.com>
@ 2021-09-06 7:29 ` Philipp Zabel
0 siblings, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2021-09-06 7:29 UTC (permalink / raw)
To: Nancy.Lin, CK Hu
Cc: Chun-Kuang Hu, David Airlie, Daniel Vetter, Rob Herring,
Matthias Brugger, jason-jh . lin, Yongqiang Niu, dri-devel,
linux-mediatek, devicetree, linux-kernel, linux-arm-kernel,
singo.chang, srv_heupstream
Hi Nancy,
On Mon, 2021-09-06 at 15:15 +0800, Nancy.Lin wrote:
> MT8195 vdosys1 has more than 32 reset bits and a different reset base
> than other chips. Modify mmsys for support 64 bit and different reset
> base.
>
> Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com>
> ---
> drivers/soc/mediatek/mt8195-mmsys.h | 1 +
> drivers/soc/mediatek/mtk-mmsys.c | 15 ++++++++++++---
> drivers/soc/mediatek/mtk-mmsys.h | 1 +
> 3 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mt8195-mmsys.h b/drivers/soc/mediatek/mt8195-mmsys.h
> index 648baaec112b..f67801c42fd9 100644
> --- a/drivers/soc/mediatek/mt8195-mmsys.h
> +++ b/drivers/soc/mediatek/mt8195-mmsys.h
> @@ -123,6 +123,7 @@
> #define MT8195_VDO1_MIXER_SOUT_SEL_IN 0xf68
> #define MT8195_MIXER_SOUT_SEL_IN_FROM_DISP_MIXER (0 << 0)
>
> +#define MT8195_VDO1_SW0_RST_B 0x1d0
> #define MT8195_VDO1_MERGE0_ASYNC_CFG_WD 0xe30
> #define MT8195_VDO1_MERGE1_ASYNC_CFG_WD 0xe40
> #define MT8195_VDO1_MERGE2_ASYNC_CFG_WD 0xe50
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 060065501b8a..97cb26339ef6 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -18,6 +18,8 @@
> #include "mt8365-mmsys.h"
> #include "mt8195-mmsys.h"
>
> +#define MMSYS_SW_RESET_PER_REG 32
> +
> static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
> .clk_driver = "clk-mt2701-mm",
> .routes = mmsys_default_routing_table,
> @@ -48,12 +50,14 @@ static const struct mtk_mmsys_driver_data mt8173_mmsys_driver_data = {
> .clk_driver = "clk-mt8173-mm",
> .routes = mmsys_default_routing_table,
> .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
> + .sw_reset_start = MMSYS_SW0_RST_B,
> };
>
> static const struct mtk_mmsys_driver_data mt8183_mmsys_driver_data = {
> .clk_driver = "clk-mt8183-mm",
> .routes = mmsys_mt8183_routing_table,
> .num_routes = ARRAY_SIZE(mmsys_mt8183_routing_table),
> + .sw_reset_start = MMSYS_SW0_RST_B,
> };
>
> static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
> @@ -74,6 +78,7 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
> .num_routes = ARRAY_SIZE(mmsys_mt8195_routing_table),
> .config = mmsys_mt8195_config_table,
> .num_configs = ARRAY_SIZE(mmsys_mt8195_config_table),
> + .sw_reset_start = MT8195_VDO1_SW0_RST_B,
> };
>
> struct mtk_mmsys {
> @@ -126,19 +131,23 @@ static int mtk_mmsys_reset_update(struct reset_controller_dev *rcdev, unsigned l
> {
> struct mtk_mmsys *mmsys = container_of(rcdev, struct mtk_mmsys, rcdev);
> unsigned long flags;
> + u32 offset;
> u32 reg;
> int i;
>
> + offset = (id / MMSYS_SW_RESET_PER_REG) * sizeof(u32);
> + id = id % MMSYS_SW_RESET_PER_REG;
> +
> spin_lock_irqsave(&mmsys->lock, flags);
>
> - reg = readl_relaxed(mmsys->regs + MMSYS_SW0_RST_B);
> + reg = readl_relaxed(mmsys->regs + mmsys->data->sw_reset_start + offset);
>
> if (assert)
> reg &= ~BIT(id);
> else
> reg |= BIT(id);
>
> - writel_relaxed(reg, mmsys->regs + MMSYS_SW0_RST_B);
> + writel_relaxed(reg, mmsys->regs + mmsys->data->sw_reset_start + offset);
>
> spin_unlock_irqrestore(&mmsys->lock, flags);
>
> @@ -237,7 +246,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
> spin_lock_init(&mmsys->lock);
>
> mmsys->rcdev.owner = THIS_MODULE;
> - mmsys->rcdev.nr_resets = 32;
> + mmsys->rcdev.nr_resets = 64;
If only MT8195 vdosys1 has more than 32 reset bits, this should be kept
at 32 for the others.
regards
Philipp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 01/16] dt-bindings: mediatek: add vdosys1 RDMA definition for mt8195
[not found] ` <20210906071539.12953-2-nancy.lin@mediatek.com>
@ 2021-09-06 23:42 ` Chun-Kuang Hu
0 siblings, 0 replies; 4+ messages in thread
From: Chun-Kuang Hu @ 2021-09-06 23:42 UTC (permalink / raw)
To: Nancy.Lin
Cc: CK Hu, Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
Rob Herring, Matthias Brugger, jason-jh . lin, Yongqiang Niu,
DRI Development, moderated list:ARM/Mediatek SoC support, DTML,
linux-kernel, Linux ARM, singo.chang, srv_heupstream
Hi, Nancy:
Nancy.Lin <nancy.lin@mediatek.com> 於 2021年9月6日 週一 下午3:15寫道:
>
> Add vdosys1 RDMA definition.
>
> Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com>
> ---
> .../display/mediatek/mediatek,mdp-rdma.yaml | 77 +++++++++++++++++++
> 1 file changed, 77 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml
> new file mode 100644
> index 000000000000..3610093848e1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml
I've compared the rdma driver in mdp [1] with the rdma driver in
display [2], both are similar. The difference are like merge0 versus
merge5. So I would like both binding document are placed together. In
display folder? In media folder? In SoC folder? I've no idea which one
is better, but at lease put together.
[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20210824100027.25989-6-moudy.ho@mediatek.com/
[2] https://patchwork.kernel.org/project/linux-mediatek/patch/20210906071539.12953-12-nancy.lin@mediatek.com/
Regards,
Chun-Kuang.
> @@ -0,0 +1,77 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/mediatek/mediatek,mdp-rdma.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: mediatek display MDP RDMA
> +
> +maintainers:
> + - CK Hu <ck.hu@mediatek.com>
> +
> +description: |
> + The mediatek display MDP RDMA stands for Read Direct Memory Access.
> + It provides real time data to the back-end panel driver, such as DSI,
> + DPI and DP_INTF.
> + It contains one line buffer to store the sufficient pixel data.
> + RDMA device node must be siblings to the central MMSYS_CONFIG node.
> + For a description of the MMSYS_CONFIG binding, see
> + Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml for details.
> +
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - const: mediatek,mt8195-vdo1-rdma
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + power-domains:
> + description: A phandle and PM domain specifier as defined by bindings of
> + the power controller specified by phandle. See
> + Documentation/devicetree/bindings/power/power-domain.yaml for details.
> +
> + clocks:
> + items:
> + - description: RDMA Clock
> +
> + iommus:
> + description:
> + This property should point to the respective IOMMU block with master port as argument,
> + see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.
> +
> + mediatek,gce-client-reg:
> + description:
> + The register of display function block to be set by gce. There are 4 arguments,
> + such as gce node, subsys id, offset and register size. The subsys id that is
> + mapping to the register of display function blocks is defined in the gce header
> + include/include/dt-bindings/gce/<chip>-gce.h of each chips.
> + $ref: /schemas/types.yaml#/definitions/phandle-array
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - power-domains
> + - clocks
> + - iommus
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> +
> + vdo1_rdma0: vdo1_rdma@1c104000 {
> + compatible = "mediatek,mt8195-vdo1-rdma";
> + reg = <0 0x1c104000 0 0x1000>;
> + interrupts = <GIC_SPI 495 IRQ_TYPE_LEVEL_HIGH 0>;
> + clocks = <&vdosys1 CLK_VDO1_MDP_RDMA0>;
> + power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
> + iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA0>;
> + mediatek,gce-client-reg = <&gce1 SUBSYS_1c10XXXX 0x4000 0x1000>;
> + };
> +
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 04/16] dt-bindings: reset: mt8195: add vdosys1 reset control bit
[not found] ` <20210906071539.12953-5-nancy.lin@mediatek.com>
@ 2021-09-07 16:06 ` Chun-Kuang Hu
0 siblings, 0 replies; 4+ messages in thread
From: Chun-Kuang Hu @ 2021-09-07 16:06 UTC (permalink / raw)
To: Nancy.Lin
Cc: CK Hu, Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
Rob Herring, Matthias Brugger, jason-jh . lin, Yongqiang Niu,
DRI Development, moderated list:ARM/Mediatek SoC support, DTML,
linux-kernel, Linux ARM, singo.chang, srv_heupstream
Hi, Nancy:
Nancy.Lin <nancy.lin@mediatek.com> 於 2021年9月6日 週一 下午3:15寫道:
>
> Add vdosys1 reset control bit for MT8195 platform.
>
> Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com>
> ---
> include/dt-bindings/reset/mt8195-resets.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/dt-bindings/reset/mt8195-resets.h b/include/dt-bindings/reset/mt8195-resets.h
> index a26bccc8b957..eaaa882c09bd 100644
> --- a/include/dt-bindings/reset/mt8195-resets.h
> +++ b/include/dt-bindings/reset/mt8195-resets.h
> @@ -26,4 +26,16 @@
>
> #define MT8195_TOPRGU_SW_RST_NUM 16
>
> +/* VDOSYS1 */
> +#define MT8195_VDOSYS1_SW0_RST_B_MERGE0_DL_ASYNC 25
> +#define MT8195_VDOSYS1_SW0_RST_B_MERGE1_DL_ASYNC 26
> +#define MT8195_VDOSYS1_SW0_RST_B_MERGE2_DL_ASYNC 27
> +#define MT8195_VDOSYS1_SW0_RST_B_MERGE3_DL_ASYNC 28
> +#define MT8195_VDOSYS1_SW0_RST_B_MERGE4_DL_ASYNC 29
> +#define MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE0_DL_ASYNC 51
> +#define MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE1_DL_ASYNC 52
> +#define MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE0_DL_ASYNC 53
> +#define MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE1_DL_ASYNC 54
> +#define MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_BE_DL_ASYNC 55
Maybe you should align the indent style with TOPRGU.
Regards,
Chun-Kuang.
> +
> #endif /* _DT_BINDINGS_RESET_CONTROLLER_MT8195 */
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 00/16] Add MediaTek SoC DRM (vdosys1) support for mt8195
[not found] <20210906071539.12953-1-nancy.lin@mediatek.com>
` (2 preceding siblings ...)
[not found] ` <20210906071539.12953-5-nancy.lin@mediatek.com>
@ 2021-09-18 8:34 ` Markus Schneider-Pargmann
3 siblings, 0 replies; 4+ messages in thread
From: Markus Schneider-Pargmann @ 2021-09-18 8:34 UTC (permalink / raw)
To: Nancy.Lin
Cc: CK Hu, Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
Rob Herring, Matthias Brugger, jason-jh . lin, Yongqiang Niu,
dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, singo.chang, srv_heupstream
Hi Nancy,
On Mon, Sep 06, 2021 at 03:15:23PM +0800, Nancy.Lin wrote:
> The hardware path of vdosys1 with DPTx output need to go through by several modules, such as, OVL_ADAPTOR and MERGE.
>
> Add DRM and these modules support by the patches below:
>
> Changes in v5:
> - add mmsys reset controller reference.
>
> Changes in v4:
> - use merge common driver for merge1~4.
> - refine ovl_adaptor rdma driver.
> - use ovl_adaptor ddp_comp function instead of ethdr.
> - modify for reviewer's comment in v3.
>
> Changes in v3:
> - modify for reviewer's comment in v2.
> - add vdosys1 2 pixels align limit.
> - add mixer odd offset support.
>
> Changes in v2:
> - Merge PSEUDO_OVL and ETHDR into one DRM component.
> - Add mmsys config API for vdosys1 hardware setting.
> - Add mmsys reset control using linux reset framework.
>
> Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com>
>
> This series are based on the following patch:
> [1] arm64: dts: Add Mediatek SoC MT8195 and evaluation board dts and Makefile
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210601075350.31515-2-seiya.wang@mediatek.com/
> [2] arm64: dts: mt8195: add IOMMU and smi nodes
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210615173233.26682-15-tinghan.shen@mediatek.com/
> [3] [01/24] dt-bindings: mediatek: mt8195: Add binding for MM IOMMU
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210630023504.18177-2-yong.wu@mediatek.com/
> [4] Add gce support for mt8195
> https://patchwork.kernel.org/project/linux-mediatek/list/?series=537069
> [5] Add MediaTek SoC DRM (vdosys0) support for mt8195
> https://patchwork.kernel.org/project/linux-mediatek/list/?series=537225
> [6] [v8,1/2] dt-bindings: reset: mt8195: add toprgu reset-controller header file
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210806023606.16867-2-Christine.Zhu@mediatek.com/
> [7] [v3,2/7] dt-bindings: mediatek: Add #reset-cells to mmsys system controller
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210825122613.v3.2.I3f7f1c9a8e46be07d1757ddf4e0097535f3a7d41@changeid/
> [8] [v3,6/7] soc: mediatek: mmsys: Add reset controller support
> https://patchwork.kernel.org/project/linux-mediatek/patch/20210825122613.v3.6.I15e2419141a69b2e5c7e700c34d92a69df47e04d@changeid/
My work is currently based on this patch series. Unfortunately with 5.15
I have a bit of trouble picking all the dependencies and run into many
merge conflicts (probably I am missing pieces). I am trying to pick
everything so that I have a good base for my patch. Do you by any chance
have a public git branch with your patch series vdosys1 and all its
dependencies on 5.15? That would make it a lot easier for me to work on
top of it.
Thanks,
Markus
>
> Nancy.Lin (16):
> dt-bindings: mediatek: add vdosys1 RDMA definition for mt8195
> dt-bindings: mediatek: add vdosys1 MERGE property for mt8195
> dt-bindings: mediatek: add ethdr definition for mt8195
> dt-bindings: reset: mt8195: add vdosys1 reset control bit
> arm64: dts: mt8195: add display node for vdosys1
> soc: mediatek: add mtk-mmsys support for mt8195 vdosys1
> soc: mediatek: add mtk-mmsys config API for mt8195 vdosys1
> soc: mediatek: add cmdq support of mtk-mmsys config API for mt8195
> vdosys1
> soc: mediatek: mmsys: modify reset controller for MT8195 vdosys1
> soc: mediatek: add mtk-mutex support for mt8195 vdosys1
> drm/mediatek: add display MDP RDMA support for MT8195
> drm/mediatek: add display merge api support for MT8195
> drm/mediatek: add ETHDR support for MT8195
> drm/mediatek: add ovl_adaptor support for MT8195
> drm/mediatek: modify mediatek-drm for mt8195 multi mmsys support
> drm/mediatek: add mediatek-drm of vdosys1 support for MT8195
>
> .../display/mediatek/mediatek,ethdr.yaml | 144 ++++++
> .../display/mediatek/mediatek,mdp-rdma.yaml | 77 ++++
> .../display/mediatek/mediatek,merge.yaml | 3 +
> arch/arm64/boot/dts/mediatek/mt8195.dtsi | 221 +++++++++
> drivers/gpu/drm/mediatek/Makefile | 5 +-
> drivers/gpu/drm/mediatek/mtk_disp_drv.h | 29 ++
> drivers/gpu/drm/mediatek/mtk_disp_merge.c | 78 +++-
> .../gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 408 +++++++++++++++++
> drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 25 +-
> drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 3 +-
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 15 +
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 1 +
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 377 +++++++++++++---
> drivers/gpu/drm/mediatek/mtk_drm_drv.h | 9 +-
> drivers/gpu/drm/mediatek/mtk_ethdr.c | 424 ++++++++++++++++++
> drivers/gpu/drm/mediatek/mtk_ethdr.h | 25 ++
> drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 301 +++++++++++++
> drivers/gpu/drm/mediatek/mtk_mdp_rdma.h | 37 ++
> drivers/soc/mediatek/mt8195-mmsys.h | 199 ++++++++
> drivers/soc/mediatek/mtk-mmsys.c | 76 +++-
> drivers/soc/mediatek/mtk-mmsys.h | 11 +
> drivers/soc/mediatek/mtk-mutex.c | 270 ++++++-----
> include/dt-bindings/reset/mt8195-resets.h | 12 +
> include/linux/soc/mediatek/mtk-mmsys.h | 22 +
> 24 files changed, 2574 insertions(+), 198 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml
> create mode 100644 drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> create mode 100644 drivers/gpu/drm/mediatek/mtk_ethdr.c
> create mode 100644 drivers/gpu/drm/mediatek/mtk_ethdr.h
> create mode 100644 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> create mode 100644 drivers/gpu/drm/mediatek/mtk_mdp_rdma.h
>
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-18 8:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210906071539.12953-1-nancy.lin@mediatek.com>
[not found] ` <20210906071539.12953-10-nancy.lin@mediatek.com>
2021-09-06 7:29 ` [PATCH v5 09/16] soc: mediatek: mmsys: modify reset controller for MT8195 vdosys1 Philipp Zabel
[not found] ` <20210906071539.12953-2-nancy.lin@mediatek.com>
2021-09-06 23:42 ` [PATCH v5 01/16] dt-bindings: mediatek: add vdosys1 RDMA definition for mt8195 Chun-Kuang Hu
[not found] ` <20210906071539.12953-5-nancy.lin@mediatek.com>
2021-09-07 16:06 ` [PATCH v5 04/16] dt-bindings: reset: mt8195: add vdosys1 reset control bit Chun-Kuang Hu
2021-09-18 8:34 ` [PATCH v5 00/16] Add MediaTek SoC DRM (vdosys1) support for mt8195 Markus Schneider-Pargmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).