* [PATCH 1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
@ 2023-05-29 9:43 ` Luca Weiss
2023-05-29 18:22 ` Conor Dooley
2023-05-29 9:43 ` [PATCH 2/7] dt-bindings: display/msm: dsi-controller-main: Add " Luca Weiss
` (5 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:43 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
The MSM8226 SoC uses a slightly different 28nm dsi phy. Add a new
compatible for it.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml | 1 +
Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml | 1 +
2 files changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
index cf4a338c4661..bd70c3873ca9 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
@@ -18,6 +18,7 @@ properties:
- qcom,dsi-phy-28nm-hpm
- qcom,dsi-phy-28nm-hpm-fam-b
- qcom,dsi-phy-28nm-lp
+ - qcom,dsi-phy-28nm-8226
- qcom,dsi-phy-28nm-8960
reg:
diff --git a/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
index b0100105e428..db9f07c6142d 100644
--- a/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
+++ b/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
@@ -125,6 +125,7 @@ patternProperties:
- qcom,dsi-phy-14nm-660
- qcom,dsi-phy-14nm-8953
- qcom,dsi-phy-20nm
+ - qcom,dsi-phy-28nm-8226
- qcom,dsi-phy-28nm-hpm
- qcom,dsi-phy-28nm-lp
- qcom,hdmi-phy-8084
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible
2023-05-29 9:43 ` [PATCH 1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible Luca Weiss
@ 2023-05-29 18:22 ` Conor Dooley
0 siblings, 0 replies; 20+ messages in thread
From: Conor Dooley @ 2023-05-29 18:22 UTC (permalink / raw)
To: Luca Weiss
Cc: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]
On Mon, May 29, 2023 at 11:43:58AM +0200, Luca Weiss wrote:
> The MSM8226 SoC uses a slightly different 28nm dsi phy. Add a new
> compatible for it.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml | 1 +
> Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
> index cf4a338c4661..bd70c3873ca9 100644
> --- a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
> @@ -18,6 +18,7 @@ properties:
> - qcom,dsi-phy-28nm-hpm
> - qcom,dsi-phy-28nm-hpm-fam-b
> - qcom,dsi-phy-28nm-lp
> + - qcom,dsi-phy-28nm-8226
How come the order is different in both places?
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> - qcom,dsi-phy-28nm-8960
>
> reg:
> diff --git a/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
> index b0100105e428..db9f07c6142d 100644
> --- a/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
> +++ b/Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
> @@ -125,6 +125,7 @@ patternProperties:
> - qcom,dsi-phy-14nm-660
> - qcom,dsi-phy-14nm-8953
> - qcom,dsi-phy-20nm
> + - qcom,dsi-phy-28nm-8226
> - qcom,dsi-phy-28nm-hpm
> - qcom,dsi-phy-28nm-lp
> - qcom,hdmi-phy-8084
>
> --
> 2.40.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/7] dt-bindings: display/msm: dsi-controller-main: Add msm8226 compatible
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
2023-05-29 9:43 ` [PATCH 1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible Luca Weiss
@ 2023-05-29 9:43 ` Luca Weiss
2023-05-29 18:20 ` Conor Dooley
2023-05-29 9:44 ` [PATCH 3/7] dt-bindings: display/msm: qcom,mdp5: " Luca Weiss
` (4 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:43 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
Add the compatible for the DSI found on MSM8226.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index 130e16d025bc..660e0f496826 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -15,6 +15,7 @@ properties:
- items:
- enum:
- qcom,apq8064-dsi-ctrl
+ - qcom,msm8226-dsi-ctrl
- qcom,msm8916-dsi-ctrl
- qcom,msm8953-dsi-ctrl
- qcom,msm8974-dsi-ctrl
@@ -256,6 +257,7 @@ allOf:
compatible:
contains:
enum:
+ - qcom,msm8226-dsi-ctrl
- qcom,msm8974-dsi-ctrl
then:
properties:
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 2/7] dt-bindings: display/msm: dsi-controller-main: Add msm8226 compatible
2023-05-29 9:43 ` [PATCH 2/7] dt-bindings: display/msm: dsi-controller-main: Add " Luca Weiss
@ 2023-05-29 18:20 ` Conor Dooley
0 siblings, 0 replies; 20+ messages in thread
From: Conor Dooley @ 2023-05-29 18:20 UTC (permalink / raw)
To: Luca Weiss
Cc: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 237 bytes --]
On Mon, May 29, 2023 at 11:43:59AM +0200, Luca Weiss wrote:
> Add the compatible for the DSI found on MSM8226.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/7] dt-bindings: display/msm: qcom,mdp5: Add msm8226 compatible
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
2023-05-29 9:43 ` [PATCH 1/7] dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible Luca Weiss
2023-05-29 9:43 ` [PATCH 2/7] dt-bindings: display/msm: dsi-controller-main: Add " Luca Weiss
@ 2023-05-29 9:44 ` Luca Weiss
2023-05-29 18:20 ` Conor Dooley
2023-05-29 9:44 ` [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226 Luca Weiss
` (3 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:44 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
Add the compatible for the MDP5 found on MSM8226.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
Documentation/devicetree/bindings/display/msm/qcom,mdp5.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/display/msm/qcom,mdp5.yaml b/Documentation/devicetree/bindings/display/msm/qcom,mdp5.yaml
index a763cf8da122..2fe032d0e8f8 100644
--- a/Documentation/devicetree/bindings/display/msm/qcom,mdp5.yaml
+++ b/Documentation/devicetree/bindings/display/msm/qcom,mdp5.yaml
@@ -22,6 +22,7 @@ properties:
- items:
- enum:
- qcom,apq8084-mdp5
+ - qcom,msm8226-mdp5
- qcom,msm8916-mdp5
- qcom,msm8917-mdp5
- qcom,msm8953-mdp5
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 3/7] dt-bindings: display/msm: qcom,mdp5: Add msm8226 compatible
2023-05-29 9:44 ` [PATCH 3/7] dt-bindings: display/msm: qcom,mdp5: " Luca Weiss
@ 2023-05-29 18:20 ` Conor Dooley
0 siblings, 0 replies; 20+ messages in thread
From: Conor Dooley @ 2023-05-29 18:20 UTC (permalink / raw)
To: Luca Weiss
Cc: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 238 bytes --]
On Mon, May 29, 2023 at 11:44:00AM +0200, Luca Weiss wrote:
> Add the compatible for the MDP5 found on MSM8226.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
` (2 preceding siblings ...)
2023-05-29 9:44 ` [PATCH 3/7] dt-bindings: display/msm: qcom,mdp5: " Luca Weiss
@ 2023-05-29 9:44 ` Luca Weiss
2023-05-29 11:59 ` Konrad Dybcio
2023-05-29 12:56 ` [Freedreno] " Dmitry Baryshkov
2023-05-29 9:44 ` [PATCH 5/7] drm/msm/dsi: Add " Luca Weiss
` (2 subsequent siblings)
6 siblings, 2 replies; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:44 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
Add the required config for the v1.1 MDP5 found on MSM8226.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 82 ++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
index 2eec2d78f32a..694d54341337 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
@@ -103,6 +103,87 @@ static const struct mdp5_cfg_hw msm8x74v1_config = {
.max_clk = 200000000,
};
+static const struct mdp5_cfg_hw msm8x26_config = {
+ .name = "msm8x26",
+ .mdp = {
+ .count = 1,
+ .caps = MDP_CAP_SMP |
+ 0,
+ },
+ .smp = {
+ .mmb_count = 7,
+ .mmb_size = 4096,
+ .clients = {
+ [SSPP_VIG0] = 1,
+ [SSPP_DMA0] = 4,
+ [SSPP_RGB0] = 7,
+ },
+ },
+ .ctl = {
+ .count = 2,
+ .base = { 0x00500, 0x00600 },
+ .flush_hw_mask = 0x0003ffff,
+ },
+ .pipe_vig = {
+ .count = 1,
+ .base = { 0x01100 },
+ .caps = MDP_PIPE_CAP_HFLIP |
+ MDP_PIPE_CAP_VFLIP |
+ MDP_PIPE_CAP_SCALE |
+ MDP_PIPE_CAP_CSC |
+ 0,
+ },
+ .pipe_rgb = {
+ .count = 1,
+ .base = { 0x01d00 },
+ .caps = MDP_PIPE_CAP_HFLIP |
+ MDP_PIPE_CAP_VFLIP |
+ MDP_PIPE_CAP_SCALE |
+ 0,
+ },
+ .pipe_dma = {
+ .count = 1,
+ .base = { 0x02900 },
+ .caps = MDP_PIPE_CAP_HFLIP |
+ MDP_PIPE_CAP_VFLIP |
+ 0,
+ },
+ .lm = {
+ .count = 2,
+ .base = { 0x03100, 0x03d00 },
+ .instances = {
+ { .id = 0, .pp = 0, .dspp = 0,
+ .caps = MDP_LM_CAP_DISPLAY, },
+ { .id = 1, .pp = -1, .dspp = -1,
+ .caps = MDP_LM_CAP_WB },
+ },
+ .nb_stages = 2,
+ .max_width = 2048,
+ .max_height = 0xFFFF,
+ },
+ .dspp = {
+ .count = 1,
+ .base = { 0x04500 },
+ },
+ .pp = {
+ .count = 1,
+ .base = { 0x21a00 },
+ },
+ .intf = {
+ .base = { 0x00000, 0x21200 },
+ .connect = {
+ [0] = INTF_DISABLED,
+ [1] = INTF_DSI,
+ },
+ },
+ .perf = {
+ .ab_inefficiency = 100,
+ .ib_inefficiency = 200,
+ .clk_inefficiency = 125
+ },
+ .max_clk = 200000000,
+};
+
static const struct mdp5_cfg_hw msm8x74v2_config = {
.name = "msm8x74",
.mdp = {
@@ -1236,6 +1317,7 @@ static const struct mdp5_cfg_hw sdm660_config = {
static const struct mdp5_cfg_handler cfg_handlers_v1[] = {
{ .revision = 0, .config = { .hw = &msm8x74v1_config } },
+ { .revision = 1, .config = { .hw = &msm8x26_config } },
{ .revision = 2, .config = { .hw = &msm8x74v2_config } },
{ .revision = 3, .config = { .hw = &apq8084_config } },
{ .revision = 6, .config = { .hw = &msm8x16_config } },
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226
2023-05-29 9:44 ` [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226 Luca Weiss
@ 2023-05-29 11:59 ` Konrad Dybcio
2023-05-29 13:34 ` Dmitry Baryshkov
2023-05-29 12:56 ` [Freedreno] " Dmitry Baryshkov
1 sibling, 1 reply; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-29 11:59 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Dmitry Baryshkov, Sean Paul, David Airlie,
Daniel Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29.05.2023 11:44, Luca Weiss wrote:
> Add the required config for the v1.1 MDP5 found on MSM8226.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 82 ++++++++++++++++++++++++++++++++
> 1 file changed, 82 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
> index 2eec2d78f32a..694d54341337 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
> @@ -103,6 +103,87 @@ static const struct mdp5_cfg_hw msm8x74v1_config = {
> .max_clk = 200000000,
> };
>
> +static const struct mdp5_cfg_hw msm8x26_config = {
Luca, this patch looks good as-is (without diving into the values).
Dmitry, I see some things that we may improve here..
1. Rename msm8xab to msm89ab or something, it's really inconsistent
with other drivers
2. Some values seem very common / always constant.. perhaps we could
add some #defines like we do in DPU?
3. Can we add some magic defines to make flush_hw_mask non-cryptic?
4. We can probably use pointers in data structs and deduplicate identical
blocks!
Konrad
> + .name = "msm8x26",
> + .mdp = {
> + .count = 1,
> + .caps = MDP_CAP_SMP |
> + 0,
> + },
> + .smp = {
> + .mmb_count = 7,
> + .mmb_size = 4096,
> + .clients = {
> + [SSPP_VIG0] = 1,
> + [SSPP_DMA0] = 4,
> + [SSPP_RGB0] = 7,
> + },
> + },
> + .ctl = {
> + .count = 2,
> + .base = { 0x00500, 0x00600 },
> + .flush_hw_mask = 0x0003ffff,
> + },
> + .pipe_vig = {
> + .count = 1,
> + .base = { 0x01100 },
> + .caps = MDP_PIPE_CAP_HFLIP |
> + MDP_PIPE_CAP_VFLIP |
> + MDP_PIPE_CAP_SCALE |
> + MDP_PIPE_CAP_CSC |
> + 0,
> + },
> + .pipe_rgb = {
> + .count = 1,
> + .base = { 0x01d00 },
> + .caps = MDP_PIPE_CAP_HFLIP |
> + MDP_PIPE_CAP_VFLIP |
> + MDP_PIPE_CAP_SCALE |
> + 0,
> + },
> + .pipe_dma = {
> + .count = 1,
> + .base = { 0x02900 },
> + .caps = MDP_PIPE_CAP_HFLIP |
> + MDP_PIPE_CAP_VFLIP |
> + 0,
> + },
> + .lm = {
> + .count = 2,
> + .base = { 0x03100, 0x03d00 },
> + .instances = {
> + { .id = 0, .pp = 0, .dspp = 0,
> + .caps = MDP_LM_CAP_DISPLAY, },
> + { .id = 1, .pp = -1, .dspp = -1,
> + .caps = MDP_LM_CAP_WB },
> + },
> + .nb_stages = 2,
> + .max_width = 2048,
> + .max_height = 0xFFFF,
> + },
> + .dspp = {
> + .count = 1,
> + .base = { 0x04500 },
> + },
> + .pp = {
> + .count = 1,
> + .base = { 0x21a00 },
> + },
> + .intf = {
> + .base = { 0x00000, 0x21200 },
> + .connect = {
> + [0] = INTF_DISABLED,
> + [1] = INTF_DSI,
> + },
> + },
> + .perf = {
> + .ab_inefficiency = 100,
> + .ib_inefficiency = 200,
> + .clk_inefficiency = 125
> + },
> + .max_clk = 200000000,
> +};
> +
> static const struct mdp5_cfg_hw msm8x74v2_config = {
> .name = "msm8x74",
> .mdp = {
> @@ -1236,6 +1317,7 @@ static const struct mdp5_cfg_hw sdm660_config = {
>
> static const struct mdp5_cfg_handler cfg_handlers_v1[] = {
> { .revision = 0, .config = { .hw = &msm8x74v1_config } },
> + { .revision = 1, .config = { .hw = &msm8x26_config } },
> { .revision = 2, .config = { .hw = &msm8x74v2_config } },
> { .revision = 3, .config = { .hw = &apq8084_config } },
> { .revision = 6, .config = { .hw = &msm8x16_config } },
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226
2023-05-29 11:59 ` Konrad Dybcio
@ 2023-05-29 13:34 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-05-29 13:34 UTC (permalink / raw)
To: Konrad Dybcio, Luca Weiss, ~postmarketos/upstreaming, phone-devel,
Rob Clark, Abhinav Kumar, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29/05/2023 14:59, Konrad Dybcio wrote:
>
>
> On 29.05.2023 11:44, Luca Weiss wrote:
>> Add the required config for the v1.1 MDP5 found on MSM8226.
>>
>> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
>> ---
>> drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 82 ++++++++++++++++++++++++++++++++
>> 1 file changed, 82 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
>> index 2eec2d78f32a..694d54341337 100644
>> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
>> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
>> @@ -103,6 +103,87 @@ static const struct mdp5_cfg_hw msm8x74v1_config = {
>> .max_clk = 200000000,
>> };
>>
>> +static const struct mdp5_cfg_hw msm8x26_config = {
> Luca, this patch looks good as-is (without diving into the values).
>
> Dmitry, I see some things that we may improve here..
>
> 1. Rename msm8xab to msm89ab or something, it's really inconsistent
> with other drivers
>
> 2. Some values seem very common / always constant.. perhaps we could
> add some #defines like we do in DPU?
I really would not like to go the DPU way here. Maybe we can define the
'full-featured' masks, while leaving the older hardware intact.
> 3. Can we add some magic defines to make flush_hw_mask non-cryptic?
Sounds like a good idea, especially since we have all the defines. I'll
tend to it after landing 8226.
>
> 4. We can probably use pointers in data structs and deduplicate identical
> blocks!
Let's see.
>
> Konrad
>> + .name = "msm8x26",
>> + .mdp = {
>> + .count = 1,
>> + .caps = MDP_CAP_SMP |
>> + 0,
>> + },
>> + .smp = {
>> + .mmb_count = 7,
>> + .mmb_size = 4096,
>> + .clients = {
>> + [SSPP_VIG0] = 1,
>> + [SSPP_DMA0] = 4,
>> + [SSPP_RGB0] = 7,
>> + },
>> + },
>> + .ctl = {
>> + .count = 2,
>> + .base = { 0x00500, 0x00600 },
>> + .flush_hw_mask = 0x0003ffff,
>> + },
>> + .pipe_vig = {
>> + .count = 1,
>> + .base = { 0x01100 },
>> + .caps = MDP_PIPE_CAP_HFLIP |
>> + MDP_PIPE_CAP_VFLIP |
>> + MDP_PIPE_CAP_SCALE |
>> + MDP_PIPE_CAP_CSC |
>> + 0,
>> + },
>> + .pipe_rgb = {
>> + .count = 1,
>> + .base = { 0x01d00 },
>> + .caps = MDP_PIPE_CAP_HFLIP |
>> + MDP_PIPE_CAP_VFLIP |
>> + MDP_PIPE_CAP_SCALE |
>> + 0,
>> + },
>> + .pipe_dma = {
>> + .count = 1,
>> + .base = { 0x02900 },
>> + .caps = MDP_PIPE_CAP_HFLIP |
>> + MDP_PIPE_CAP_VFLIP |
>> + 0,
>> + },
>> + .lm = {
>> + .count = 2,
>> + .base = { 0x03100, 0x03d00 },
>> + .instances = {
>> + { .id = 0, .pp = 0, .dspp = 0,
>> + .caps = MDP_LM_CAP_DISPLAY, },
>> + { .id = 1, .pp = -1, .dspp = -1,
>> + .caps = MDP_LM_CAP_WB },
>> + },
>> + .nb_stages = 2,
>> + .max_width = 2048,
>> + .max_height = 0xFFFF,
>> + },
>> + .dspp = {
>> + .count = 1,
>> + .base = { 0x04500 },
>> + },
>> + .pp = {
>> + .count = 1,
>> + .base = { 0x21a00 },
>> + },
>> + .intf = {
>> + .base = { 0x00000, 0x21200 },
>> + .connect = {
>> + [0] = INTF_DISABLED,
>> + [1] = INTF_DSI,
>> + },
>> + },
>> + .perf = {
>> + .ab_inefficiency = 100,
>> + .ib_inefficiency = 200,
>> + .clk_inefficiency = 125
>> + },
>> + .max_clk = 200000000,
>> +};
>> +
>> static const struct mdp5_cfg_hw msm8x74v2_config = {
>> .name = "msm8x74",
>> .mdp = {
>> @@ -1236,6 +1317,7 @@ static const struct mdp5_cfg_hw sdm660_config = {
>>
>> static const struct mdp5_cfg_handler cfg_handlers_v1[] = {
>> { .revision = 0, .config = { .hw = &msm8x74v1_config } },
>> + { .revision = 1, .config = { .hw = &msm8x26_config } },
>> { .revision = 2, .config = { .hw = &msm8x74v2_config } },
>> { .revision = 3, .config = { .hw = &apq8084_config } },
>> { .revision = 6, .config = { .hw = &msm8x16_config } },
>>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Freedreno] [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226
2023-05-29 9:44 ` [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226 Luca Weiss
2023-05-29 11:59 ` Konrad Dybcio
@ 2023-05-29 12:56 ` Dmitry Baryshkov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-05-29 12:56 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: devicetree, linux-arm-msm, linux-kernel, dri-devel, freedreno
On 29/05/2023 12:44, Luca Weiss wrote:
> Add the required config for the v1.1 MDP5 found on MSM8226.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 82 ++++++++++++++++++++++++++++++++
> 1 file changed, 82 insertions(+)
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/7] drm/msm/dsi: Add configuration for MSM8226
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
` (3 preceding siblings ...)
2023-05-29 9:44 ` [PATCH 4/7] drm/msm/mdp5: Add MDP5 configuration for MSM8226 Luca Weiss
@ 2023-05-29 9:44 ` Luca Weiss
2023-05-29 12:08 ` Konrad Dybcio
2023-05-29 12:15 ` Dmitry Baryshkov
2023-05-29 9:44 ` [PATCH 6/7] drm/msm/dsi: Add phy " Luca Weiss
2023-05-29 9:44 ` [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes Luca Weiss
6 siblings, 2 replies; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:44 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
Add the config for the v1.0.2 DSI found on MSM8226. We can reuse
existing bits from other revisions that are identical for v1.0.2.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/gpu/drm/msm/dsi/dsi_cfg.c | 2 ++
drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index 29ccd755cc2e..8a5fb6df7210 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -245,6 +245,8 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
&apq8064_dsi_cfg, &msm_dsi_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_0,
&msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
+ {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_0_2,
+ &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1,
&msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1_1,
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index 91bdaf50bb1a..43f0dd74edb6 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -11,6 +11,7 @@
#define MSM_DSI_VER_MAJOR_V2 0x02
#define MSM_DSI_VER_MAJOR_6G 0x03
#define MSM_DSI_6G_VER_MINOR_V1_0 0x10000000
+#define MSM_DSI_6G_VER_MINOR_V1_0_2 0x10000002
#define MSM_DSI_6G_VER_MINOR_V1_1 0x10010000
#define MSM_DSI_6G_VER_MINOR_V1_1_1 0x10010001
#define MSM_DSI_6G_VER_MINOR_V1_2 0x10020000
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 5/7] drm/msm/dsi: Add configuration for MSM8226
2023-05-29 9:44 ` [PATCH 5/7] drm/msm/dsi: Add " Luca Weiss
@ 2023-05-29 12:08 ` Konrad Dybcio
2023-05-29 12:15 ` Dmitry Baryshkov
1 sibling, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-29 12:08 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Dmitry Baryshkov, Sean Paul, David Airlie,
Daniel Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29.05.2023 11:44, Luca Weiss wrote:
> Add the config for the v1.0.2 DSI found on MSM8226. We can reuse
> existing bits from other revisions that are identical for v1.0.2.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
> drivers/gpu/drm/msm/dsi/dsi_cfg.c | 2 ++
> drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
> index 29ccd755cc2e..8a5fb6df7210 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
> @@ -245,6 +245,8 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
> &apq8064_dsi_cfg, &msm_dsi_v2_host_ops},
> {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_0,
> &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
> + {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_0_2,
> + &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
> {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1,
> &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
> {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1_1,
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> index 91bdaf50bb1a..43f0dd74edb6 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> @@ -11,6 +11,7 @@
> #define MSM_DSI_VER_MAJOR_V2 0x02
> #define MSM_DSI_VER_MAJOR_6G 0x03
> #define MSM_DSI_6G_VER_MINOR_V1_0 0x10000000
> +#define MSM_DSI_6G_VER_MINOR_V1_0_2 0x10000002
> #define MSM_DSI_6G_VER_MINOR_V1_1 0x10010000
> #define MSM_DSI_6G_VER_MINOR_V1_1_1 0x10010001
> #define MSM_DSI_6G_VER_MINOR_V1_2 0x10020000
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 5/7] drm/msm/dsi: Add configuration for MSM8226
2023-05-29 9:44 ` [PATCH 5/7] drm/msm/dsi: Add " Luca Weiss
2023-05-29 12:08 ` Konrad Dybcio
@ 2023-05-29 12:15 ` Dmitry Baryshkov
1 sibling, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-05-29 12:15 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29/05/2023 12:44, Luca Weiss wrote:
> Add the config for the v1.0.2 DSI found on MSM8226. We can reuse
> existing bits from other revisions that are identical for v1.0.2.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> drivers/gpu/drm/msm/dsi/dsi_cfg.c | 2 ++
> drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 +
> 2 files changed, 3 insertions(+)
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/7] drm/msm/dsi: Add phy configuration for MSM8226
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
` (4 preceding siblings ...)
2023-05-29 9:44 ` [PATCH 5/7] drm/msm/dsi: Add " Luca Weiss
@ 2023-05-29 9:44 ` Luca Weiss
2023-05-29 10:25 ` Konrad Dybcio
2023-05-29 9:44 ` [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes Luca Weiss
6 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:44 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
MSM8226 uses a modified PLL lock sequence compared to MSM8974, which is
based on the function dsi_pll_enable_seq_m in the msm-3.10 kernel.
Worth noting that the msm-3.10 downstream kernel also will try other
sequences in case this one doesn't work, but during testing it has shown
that the _m sequence succeeds first time also:
.pll_enable_seqs[0] = dsi_pll_enable_seq_m,
.pll_enable_seqs[1] = dsi_pll_enable_seq_m,
.pll_enable_seqs[2] = dsi_pll_enable_seq_d,
.pll_enable_seqs[3] = dsi_pll_enable_seq_d,
.pll_enable_seqs[4] = dsi_pll_enable_seq_f1,
.pll_enable_seqs[5] = dsi_pll_enable_seq_c,
.pll_enable_seqs[6] = dsi_pll_enable_seq_e,
We may need to expand this in the future.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +
drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 3 +-
drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c | 97 ++++++++++++++++++++++++++++++
3 files changed, 101 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index bb09cbe8ff86..9d5795c58a98 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -541,6 +541,8 @@ static const struct of_device_id dsi_phy_dt_match[] = {
.data = &dsi_phy_28nm_hpm_famb_cfgs },
{ .compatible = "qcom,dsi-phy-28nm-lp",
.data = &dsi_phy_28nm_lp_cfgs },
+ { .compatible = "qcom,dsi-phy-28nm-8226",
+ .data = &dsi_phy_28nm_8226_cfgs },
#endif
#ifdef CONFIG_DRM_MSM_DSI_20NM_PHY
{ .compatible = "qcom,dsi-phy-20nm",
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
index 7137a17ae523..8b640d174785 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
@@ -46,8 +46,9 @@ struct msm_dsi_phy_cfg {
extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_famb_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs;
-extern const struct msm_dsi_phy_cfg dsi_phy_20nm_cfgs;
+extern const struct msm_dsi_phy_cfg dsi_phy_28nm_8226_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_28nm_8960_cfgs;
+extern const struct msm_dsi_phy_cfg dsi_phy_20nm_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_14nm_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_14nm_660_cfgs;
extern const struct msm_dsi_phy_cfg dsi_phy_14nm_2290_cfgs;
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
index 4c1bf55c5f38..f71308387566 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
@@ -37,6 +37,7 @@
/* v2.0.0 28nm LP implementation */
#define DSI_PHY_28NM_QUIRK_PHY_LP BIT(0)
+#define DSI_PHY_28NM_QUIRK_PHY_8226 BIT(1)
#define LPFR_LUT_SIZE 10
struct lpfr_cfg {
@@ -377,6 +378,74 @@ static int dsi_pll_28nm_vco_prepare_hpm(struct clk_hw *hw)
return ret;
}
+static int dsi_pll_28nm_vco_prepare_8226(struct clk_hw *hw)
+{
+ struct dsi_pll_28nm *pll_28nm = to_pll_28nm(hw);
+ struct device *dev = &pll_28nm->phy->pdev->dev;
+ void __iomem *base = pll_28nm->phy->pll_base;
+ u32 max_reads = 5, timeout_us = 100;
+ bool locked;
+ u32 val;
+ int i;
+
+ DBG("id=%d", pll_28nm->phy->id);
+
+ pll_28nm_software_reset(pll_28nm);
+
+ /*
+ * PLL power up sequence.
+ * Add necessary delays recommended by hardware.
+ */
+ dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_CAL_CFG1, 0x34);
+
+ val = DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRDN_B; // 1
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 200);
+
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRGEN_PWRDN_B; // 4
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 200);
+
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_LDO_PWRDN_B; // 2
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_ENABLE; // 8
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 600);
+
+ for (i = 0; i < 7; i++) {
+ /* DSI Uniphy lock detect setting */
+ dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2, 0x0d);
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2,
+ 0x0c, 100);
+ dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2, 0x0d);
+
+ /* poll for PLL ready status */
+ locked = pll_28nm_poll_for_ready(pll_28nm,
+ max_reads, timeout_us);
+ if (locked)
+ break;
+
+ pll_28nm_software_reset(pll_28nm);
+
+ /*
+ * PLL power up sequence.
+ * Add necessary delays recommended by hardware.
+ */
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_PWRGEN_CFG, 0x00, 50);
+
+ val = DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRDN_B; // 1
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRGEN_PWRDN_B; // 4
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 100);
+
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_LDO_PWRDN_B; // 2
+ val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_ENABLE; // 8
+ dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 600);
+ }
+
+ if (unlikely(!locked))
+ DRM_DEV_ERROR(dev, "DSI PLL lock failed\n");
+ else
+ DBG("DSI PLL Lock success");
+
+ return locked ? 0 : -EINVAL;
+}
+
static int dsi_pll_28nm_vco_prepare_lp(struct clk_hw *hw)
{
struct dsi_pll_28nm *pll_28nm = to_pll_28nm(hw);
@@ -471,6 +540,15 @@ static const struct clk_ops clk_ops_dsi_pll_28nm_vco_lp = {
.is_enabled = dsi_pll_28nm_clk_is_enabled,
};
+static const struct clk_ops clk_ops_dsi_pll_28nm_vco_8226 = {
+ .round_rate = dsi_pll_28nm_clk_round_rate,
+ .set_rate = dsi_pll_28nm_clk_set_rate,
+ .recalc_rate = dsi_pll_28nm_clk_recalc_rate,
+ .prepare = dsi_pll_28nm_vco_prepare_8226,
+ .unprepare = dsi_pll_28nm_vco_unprepare,
+ .is_enabled = dsi_pll_28nm_clk_is_enabled,
+};
+
/*
* PLL Callbacks
*/
@@ -536,6 +614,8 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
if (pll_28nm->phy->cfg->quirks & DSI_PHY_28NM_QUIRK_PHY_LP)
vco_init.ops = &clk_ops_dsi_pll_28nm_vco_lp;
+ else if (pll_28nm->phy->cfg->quirks & DSI_PHY_28NM_QUIRK_PHY_8226)
+ vco_init.ops = &clk_ops_dsi_pll_28nm_vco_8226;
else
vco_init.ops = &clk_ops_dsi_pll_28nm_vco_hpm;
@@ -820,3 +900,20 @@ const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs = {
.quirks = DSI_PHY_28NM_QUIRK_PHY_LP,
};
+const struct msm_dsi_phy_cfg dsi_phy_28nm_8226_cfgs = {
+ .has_phy_regulator = true,
+ .regulator_data = dsi_phy_28nm_regulators,
+ .num_regulators = ARRAY_SIZE(dsi_phy_28nm_regulators),
+ .ops = {
+ .enable = dsi_28nm_phy_enable,
+ .disable = dsi_28nm_phy_disable,
+ .pll_init = dsi_pll_28nm_init,
+ .save_pll_state = dsi_28nm_pll_save_state,
+ .restore_pll_state = dsi_28nm_pll_restore_state,
+ },
+ .min_pll_rate = VCO_MIN_RATE,
+ .max_pll_rate = VCO_MAX_RATE,
+ .io_start = { 0xfd922b00 },
+ .num_dsi_phy = 1,
+ .quirks = DSI_PHY_28NM_QUIRK_PHY_8226,
+};
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 6/7] drm/msm/dsi: Add phy configuration for MSM8226
2023-05-29 9:44 ` [PATCH 6/7] drm/msm/dsi: Add phy " Luca Weiss
@ 2023-05-29 10:25 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-29 10:25 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Dmitry Baryshkov, Sean Paul, David Airlie,
Daniel Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29.05.2023 11:44, Luca Weiss wrote:
> MSM8226 uses a modified PLL lock sequence compared to MSM8974, which is
> based on the function dsi_pll_enable_seq_m in the msm-3.10 kernel.
>
> Worth noting that the msm-3.10 downstream kernel also will try other
> sequences in case this one doesn't work, but during testing it has shown
> that the _m sequence succeeds first time also:
>
> .pll_enable_seqs[0] = dsi_pll_enable_seq_m,
> .pll_enable_seqs[1] = dsi_pll_enable_seq_m,
> .pll_enable_seqs[2] = dsi_pll_enable_seq_d,
> .pll_enable_seqs[3] = dsi_pll_enable_seq_d,
> .pll_enable_seqs[4] = dsi_pll_enable_seq_f1,
> .pll_enable_seqs[5] = dsi_pll_enable_seq_c,
> .pll_enable_seqs[6] = dsi_pll_enable_seq_e,
>
> We may need to expand this in the future.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +
> drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 3 +-
> drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c | 97 ++++++++++++++++++++++++++++++
> 3 files changed, 101 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
> index bb09cbe8ff86..9d5795c58a98 100644
> --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
> +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
> @@ -541,6 +541,8 @@ static const struct of_device_id dsi_phy_dt_match[] = {
> .data = &dsi_phy_28nm_hpm_famb_cfgs },
> { .compatible = "qcom,dsi-phy-28nm-lp",
> .data = &dsi_phy_28nm_lp_cfgs },
> + { .compatible = "qcom,dsi-phy-28nm-8226",
> + .data = &dsi_phy_28nm_8226_cfgs },
> #endif
> #ifdef CONFIG_DRM_MSM_DSI_20NM_PHY
> { .compatible = "qcom,dsi-phy-20nm",
> diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
> index 7137a17ae523..8b640d174785 100644
> --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
> +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
> @@ -46,8 +46,9 @@ struct msm_dsi_phy_cfg {
> extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_famb_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs;
> -extern const struct msm_dsi_phy_cfg dsi_phy_20nm_cfgs;
> +extern const struct msm_dsi_phy_cfg dsi_phy_28nm_8226_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_28nm_8960_cfgs;
> +extern const struct msm_dsi_phy_cfg dsi_phy_20nm_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_14nm_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_14nm_660_cfgs;
> extern const struct msm_dsi_phy_cfg dsi_phy_14nm_2290_cfgs;
> diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
> index 4c1bf55c5f38..f71308387566 100644
> --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
> +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c
> @@ -37,6 +37,7 @@
>
> /* v2.0.0 28nm LP implementation */
> #define DSI_PHY_28NM_QUIRK_PHY_LP BIT(0)
> +#define DSI_PHY_28NM_QUIRK_PHY_8226 BIT(1)
>
> #define LPFR_LUT_SIZE 10
> struct lpfr_cfg {
> @@ -377,6 +378,74 @@ static int dsi_pll_28nm_vco_prepare_hpm(struct clk_hw *hw)
> return ret;
> }
>
> +static int dsi_pll_28nm_vco_prepare_8226(struct clk_hw *hw)
> +{
> + struct dsi_pll_28nm *pll_28nm = to_pll_28nm(hw);
> + struct device *dev = &pll_28nm->phy->pdev->dev;
> + void __iomem *base = pll_28nm->phy->pll_base;
> + u32 max_reads = 5, timeout_us = 100;
> + bool locked;
> + u32 val;
> + int i;
> +
> + DBG("id=%d", pll_28nm->phy->id);
> +
> + pll_28nm_software_reset(pll_28nm);
> +
> + /*
> + * PLL power up sequence.
> + * Add necessary delays recommended by hardware.
> + */
> + dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_CAL_CFG1, 0x34);
> +
> + val = DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRDN_B; // 1
Did you send the correct revision?
Konrad
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 200);
> +
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRGEN_PWRDN_B; // 4
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 200);
> +
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_LDO_PWRDN_B; // 2
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_ENABLE; // 8
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 600);
> +
> + for (i = 0; i < 7; i++) {
> + /* DSI Uniphy lock detect setting */
> + dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2, 0x0d);
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2,
> + 0x0c, 100);
> + dsi_phy_write(base + REG_DSI_28nm_PHY_PLL_LKDET_CFG2, 0x0d);
> +
> + /* poll for PLL ready status */
> + locked = pll_28nm_poll_for_ready(pll_28nm,
> + max_reads, timeout_us);
> + if (locked)
> + break;
> +
> + pll_28nm_software_reset(pll_28nm);
> +
> + /*
> + * PLL power up sequence.
> + * Add necessary delays recommended by hardware.
> + */
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_PWRGEN_CFG, 0x00, 50);
> +
> + val = DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRDN_B; // 1
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_PWRGEN_PWRDN_B; // 4
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 100);
> +
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_LDO_PWRDN_B; // 2
> + val |= DSI_28nm_PHY_PLL_GLB_CFG_PLL_ENABLE; // 8
> + dsi_phy_write_udelay(base + REG_DSI_28nm_PHY_PLL_GLB_CFG, val, 600);
> + }
> +
> + if (unlikely(!locked))
> + DRM_DEV_ERROR(dev, "DSI PLL lock failed\n");
> + else
> + DBG("DSI PLL Lock success");
> +
> + return locked ? 0 : -EINVAL;
> +}
> +
> static int dsi_pll_28nm_vco_prepare_lp(struct clk_hw *hw)
> {
> struct dsi_pll_28nm *pll_28nm = to_pll_28nm(hw);
> @@ -471,6 +540,15 @@ static const struct clk_ops clk_ops_dsi_pll_28nm_vco_lp = {
> .is_enabled = dsi_pll_28nm_clk_is_enabled,
> };
>
> +static const struct clk_ops clk_ops_dsi_pll_28nm_vco_8226 = {
> + .round_rate = dsi_pll_28nm_clk_round_rate,
> + .set_rate = dsi_pll_28nm_clk_set_rate,
> + .recalc_rate = dsi_pll_28nm_clk_recalc_rate,
> + .prepare = dsi_pll_28nm_vco_prepare_8226,
> + .unprepare = dsi_pll_28nm_vco_unprepare,
> + .is_enabled = dsi_pll_28nm_clk_is_enabled,
> +};
> +
> /*
> * PLL Callbacks
> */
> @@ -536,6 +614,8 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
>
> if (pll_28nm->phy->cfg->quirks & DSI_PHY_28NM_QUIRK_PHY_LP)
> vco_init.ops = &clk_ops_dsi_pll_28nm_vco_lp;
> + else if (pll_28nm->phy->cfg->quirks & DSI_PHY_28NM_QUIRK_PHY_8226)
> + vco_init.ops = &clk_ops_dsi_pll_28nm_vco_8226;
> else
> vco_init.ops = &clk_ops_dsi_pll_28nm_vco_hpm;
>
> @@ -820,3 +900,20 @@ const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs = {
> .quirks = DSI_PHY_28NM_QUIRK_PHY_LP,
> };
>
> +const struct msm_dsi_phy_cfg dsi_phy_28nm_8226_cfgs = {
> + .has_phy_regulator = true,
> + .regulator_data = dsi_phy_28nm_regulators,
> + .num_regulators = ARRAY_SIZE(dsi_phy_28nm_regulators),
> + .ops = {
> + .enable = dsi_28nm_phy_enable,
> + .disable = dsi_28nm_phy_disable,
> + .pll_init = dsi_pll_28nm_init,
> + .save_pll_state = dsi_28nm_pll_save_state,
> + .restore_pll_state = dsi_28nm_pll_restore_state,
> + },
> + .min_pll_rate = VCO_MIN_RATE,
> + .max_pll_rate = VCO_MAX_RATE,
> + .io_start = { 0xfd922b00 },
> + .num_dsi_phy = 1,
> + .quirks = DSI_PHY_28NM_QUIRK_PHY_8226,
> +};
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes
2023-05-29 9:43 [PATCH 0/7] Display support for MSM8226 Luca Weiss
` (5 preceding siblings ...)
2023-05-29 9:44 ` [PATCH 6/7] drm/msm/dsi: Add phy " Luca Weiss
@ 2023-05-29 9:44 ` Luca Weiss
2023-05-29 12:10 ` Konrad Dybcio
6 siblings, 1 reply; 20+ messages in thread
From: Luca Weiss @ 2023-05-29 9:44 UTC (permalink / raw)
To: ~postmarketos/upstreaming, phone-devel, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel,
Luca Weiss
Add the nodes that describe the mdss so that display can work on
MSM8226.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
arch/arm/boot/dts/qcom-msm8226.dtsi | 118 ++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 42acb9ddb8cc..182d6405032f 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -636,6 +636,124 @@ smd-edge {
label = "lpass";
};
};
+
+ mdss: display-subsystem@fd900000 {
+ compatible = "qcom,mdss";
+ reg = <0xfd900000 0x100>, <0xfd924000 0x1000>;
+ reg-names = "mdss_phys", "vbif_phys";
+
+ power-domains = <&mmcc MDSS_GDSC>;
+
+ clocks = <&mmcc MDSS_AHB_CLK>,
+ <&mmcc MDSS_AXI_CLK>,
+ <&mmcc MDSS_VSYNC_CLK>;
+ clock-names = "iface", "bus", "vsync";
+
+ interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+
+ interrupt-controller;
+ #interrupt-cells = <1>;
+
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ mdp: display-controller@fd900000 {
+ compatible = "qcom,msm8226-mdp5", "qcom,mdp5";
+ reg = <0xfd900100 0x22000>;
+ reg-names = "mdp_phys";
+
+ interrupt-parent = <&mdss>;
+ interrupts = <0>;
+
+ clocks = <&mmcc MDSS_AHB_CLK>,
+ <&mmcc MDSS_AXI_CLK>,
+ <&mmcc MDSS_MDP_CLK>,
+ <&mmcc MDSS_VSYNC_CLK>;
+ clock-names = "iface", "bus", "core", "vsync";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ mdp5_intf1_out: endpoint {
+ remote-endpoint = <&dsi0_in>;
+ };
+ };
+ };
+ };
+
+ dsi0: dsi@fd922800 {
+ compatible = "qcom,msm8226-dsi-ctrl",
+ "qcom,mdss-dsi-ctrl";
+ reg = <0xfd922800 0x1f8>;
+ reg-names = "dsi_ctrl";
+
+ interrupt-parent = <&mdss>;
+ interrupts = <4>;
+
+ assigned-clocks = <&mmcc BYTE0_CLK_SRC>, <&mmcc PCLK0_CLK_SRC>;
+ assigned-clock-parents = <&dsi_phy0 0>, <&dsi_phy0 1>;
+
+ clocks = <&mmcc MDSS_MDP_CLK>,
+ <&mmcc MDSS_AHB_CLK>,
+ <&mmcc MDSS_AXI_CLK>,
+ <&mmcc MDSS_BYTE0_CLK>,
+ <&mmcc MDSS_PCLK0_CLK>,
+ <&mmcc MDSS_ESC0_CLK>,
+ <&mmcc MMSS_MISC_AHB_CLK>;
+ clock-names = "mdp_core",
+ "iface",
+ "bus",
+ "byte",
+ "pixel",
+ "core",
+ "core_mmss";
+
+ phys = <&dsi_phy0>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dsi0_in: endpoint {
+ remote-endpoint = <&mdp5_intf1_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dsi0_out: endpoint {
+ };
+ };
+ };
+ };
+
+ dsi_phy0: phy@fd922a00 {
+ compatible = "qcom,dsi-phy-28nm-8226";
+ reg = <0xfd922a00 0xd4>,
+ <0xfd922b00 0x280>,
+ <0xfd922d80 0x30>;
+ reg-names = "dsi_pll",
+ "dsi_phy",
+ "dsi_phy_regulator";
+
+ #clock-cells = <1>;
+ #phy-cells = <0>;
+
+ clocks = <&mmcc MDSS_AHB_CLK>, <&rpmcc RPM_SMD_XO_CLK_SRC>;
+ clock-names = "iface", "ref";
+ };
+ };
};
timer {
--
2.40.1
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes
2023-05-29 9:44 ` [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes Luca Weiss
@ 2023-05-29 12:10 ` Konrad Dybcio
2023-05-29 12:19 ` Dmitry Baryshkov
0 siblings, 1 reply; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-29 12:10 UTC (permalink / raw)
To: Luca Weiss, ~postmarketos/upstreaming, phone-devel, Rob Clark,
Abhinav Kumar, Dmitry Baryshkov, Sean Paul, David Airlie,
Daniel Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29.05.2023 11:44, Luca Weiss wrote:
> Add the nodes that describe the mdss so that display can work on
> MSM8226.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> arch/arm/boot/dts/qcom-msm8226.dtsi | 118 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 118 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
> index 42acb9ddb8cc..182d6405032f 100644
> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
> @@ -636,6 +636,124 @@ smd-edge {
> label = "lpass";
> };
> };
> +
> + mdss: display-subsystem@fd900000 {
> + compatible = "qcom,mdss";
> + reg = <0xfd900000 0x100>, <0xfd924000 0x1000>;
> + reg-names = "mdss_phys", "vbif_phys";
> +
> + power-domains = <&mmcc MDSS_GDSC>;
> +
> + clocks = <&mmcc MDSS_AHB_CLK>,
> + <&mmcc MDSS_AXI_CLK>,
> + <&mmcc MDSS_VSYNC_CLK>;
> + clock-names = "iface", "bus", "vsync";
One per line, please
> +
> + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
> +
> + interrupt-controller;
> + #interrupt-cells = <1>;
We're not using the irq cell, is that necessary/should that be 0?
> +
> + status = "disabled";
status should go last
> +
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + mdp: display-controller@fd900000 {
> + compatible = "qcom,msm8226-mdp5", "qcom,mdp5";
> + reg = <0xfd900100 0x22000>;
> + reg-names = "mdp_phys";
> +
> + interrupt-parent = <&mdss>;
> + interrupts = <0>;
> +
> + clocks = <&mmcc MDSS_AHB_CLK>,
> + <&mmcc MDSS_AXI_CLK>,
> + <&mmcc MDSS_MDP_CLK>,
> + <&mmcc MDSS_VSYNC_CLK>;
> + clock-names = "iface", "bus", "core", "vsync";
One per line, please
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
Would port { work here? I remember one mdss component's bindings
didn't allow it but don't recall which one
> +
> + port@0 {
> + reg = <0>;
> + mdp5_intf1_out: endpoint {
> + remote-endpoint = <&dsi0_in>;
> + };
> + };
> + };
> + };
> +
> + dsi0: dsi@fd922800 {
> + compatible = "qcom,msm8226-dsi-ctrl",
> + "qcom,mdss-dsi-ctrl";
> + reg = <0xfd922800 0x1f8>;
> + reg-names = "dsi_ctrl";
> +
> + interrupt-parent = <&mdss>;
> + interrupts = <4>;
> +
> + assigned-clocks = <&mmcc BYTE0_CLK_SRC>, <&mmcc PCLK0_CLK_SRC>;
> + assigned-clock-parents = <&dsi_phy0 0>, <&dsi_phy0 1>;
One per line, please
> +
> + clocks = <&mmcc MDSS_MDP_CLK>,
> + <&mmcc MDSS_AHB_CLK>,
> + <&mmcc MDSS_AXI_CLK>,
> + <&mmcc MDSS_BYTE0_CLK>,
> + <&mmcc MDSS_PCLK0_CLK>,
> + <&mmcc MDSS_ESC0_CLK>,
> + <&mmcc MMSS_MISC_AHB_CLK>;
> + clock-names = "mdp_core",
> + "iface",
> + "bus",
> + "byte",
> + "pixel",
> + "core",
> + "core_mmss";
> +
> + phys = <&dsi_phy0>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + dsi0_in: endpoint {
> + remote-endpoint = <&mdp5_intf1_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + dsi0_out: endpoint {
> + };
> + };
> + };
> + };
> +
> + dsi_phy0: phy@fd922a00 {
> + compatible = "qcom,dsi-phy-28nm-8226";
> + reg = <0xfd922a00 0xd4>,
> + <0xfd922b00 0x280>,
> + <0xfd922d80 0x30>;
> + reg-names = "dsi_pll",
> + "dsi_phy",
> + "dsi_phy_regulator";
> +
> + #clock-cells = <1>;
> + #phy-cells = <0>;
> +
> + clocks = <&mmcc MDSS_AHB_CLK>, <&rpmcc RPM_SMD_XO_CLK_SRC>;
One per line, please
Konrad
> + clock-names = "iface", "ref";
> + };
> + };
> };
>
> timer {
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes
2023-05-29 12:10 ` Konrad Dybcio
@ 2023-05-29 12:19 ` Dmitry Baryshkov
2023-05-29 12:22 ` Konrad Dybcio
0 siblings, 1 reply; 20+ messages in thread
From: Dmitry Baryshkov @ 2023-05-29 12:19 UTC (permalink / raw)
To: Konrad Dybcio, Luca Weiss, ~postmarketos/upstreaming, phone-devel,
Rob Clark, Abhinav Kumar, Sean Paul, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29/05/2023 15:10, Konrad Dybcio wrote:
>
>
> On 29.05.2023 11:44, Luca Weiss wrote:
>> Add the nodes that describe the mdss so that display can work on
>> MSM8226.
>>
>> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
>> ---
>> arch/arm/boot/dts/qcom-msm8226.dtsi | 118 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 118 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
>> index 42acb9ddb8cc..182d6405032f 100644
>> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
>> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
>> @@ -636,6 +636,124 @@ smd-edge {
>> label = "lpass";
>> };
>> };
>> +
>> + mdss: display-subsystem@fd900000 {
>> + compatible = "qcom,mdss";
>> + reg = <0xfd900000 0x100>, <0xfd924000 0x1000>;
>> + reg-names = "mdss_phys", "vbif_phys";
>> +
>> + power-domains = <&mmcc MDSS_GDSC>;
>> +
>> + clocks = <&mmcc MDSS_AHB_CLK>,
>> + <&mmcc MDSS_AXI_CLK>,
>> + <&mmcc MDSS_VSYNC_CLK>;
>> + clock-names = "iface", "bus", "vsync";
> One per line, please
>
>> +
>> + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> + interrupt-controller;
>> + #interrupt-cells = <1>;
> We're not using the irq cell, is that necessary/should that be 0?
No. With 0 it would mean that there is a single interrupt for mdss
source, which clearly is not the case.
>
>> +
>> + status = "disabled";
> status should go last
>
>> +
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + ranges;
>> +
>> + mdp: display-controller@fd900000 {
>> + compatible = "qcom,msm8226-mdp5", "qcom,mdp5";
>> + reg = <0xfd900100 0x22000>;
>> + reg-names = "mdp_phys";
>> +
>> + interrupt-parent = <&mdss>;
>> + interrupts = <0>;
>> +
>> + clocks = <&mmcc MDSS_AHB_CLK>,
>> + <&mmcc MDSS_AXI_CLK>,
>> + <&mmcc MDSS_MDP_CLK>,
>> + <&mmcc MDSS_VSYNC_CLK>;
>> + clock-names = "iface", "bus", "core", "vsync";
> One per line, please
>
>> +
>> + ports {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
> Would port { work here? I remember one mdss component's bindings
> didn't allow it but don't recall which one
Let's use ports /port@0 for uniformity even if there is just a single
port always.
>
>> +
>> + port@0 {
>> + reg = <0>;
>> + mdp5_intf1_out: endpoint {
>> + remote-endpoint = <&dsi0_in>;
>> + };
>> + };
>> + };
>> + };
>> +--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH 7/7] ARM: dts: qcom: msm8226: Add mdss nodes
2023-05-29 12:19 ` Dmitry Baryshkov
@ 2023-05-29 12:22 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2023-05-29 12:22 UTC (permalink / raw)
To: Dmitry Baryshkov, Luca Weiss, ~postmarketos/upstreaming,
phone-devel, Rob Clark, Abhinav Kumar, Sean Paul, David Airlie,
Daniel Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krishna Manikandan, Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, dri-devel, freedreno, devicetree, linux-kernel
On 29.05.2023 14:19, Dmitry Baryshkov wrote:
> On 29/05/2023 15:10, Konrad Dybcio wrote:
>>
>>
>> On 29.05.2023 11:44, Luca Weiss wrote:
>>> Add the nodes that describe the mdss so that display can work on
>>> MSM8226.
>>>
>>> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
>>> ---
>>> arch/arm/boot/dts/qcom-msm8226.dtsi | 118 ++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 118 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
>>> index 42acb9ddb8cc..182d6405032f 100644
>>> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
>>> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
>>> @@ -636,6 +636,124 @@ smd-edge {
>>> label = "lpass";
>>> };
>>> };
>>> +
>>> + mdss: display-subsystem@fd900000 {
>>> + compatible = "qcom,mdss";
>>> + reg = <0xfd900000 0x100>, <0xfd924000 0x1000>;
>>> + reg-names = "mdss_phys", "vbif_phys";
>>> +
>>> + power-domains = <&mmcc MDSS_GDSC>;
>>> +
>>> + clocks = <&mmcc MDSS_AHB_CLK>,
>>> + <&mmcc MDSS_AXI_CLK>,
>>> + <&mmcc MDSS_VSYNC_CLK>;
>>> + clock-names = "iface", "bus", "vsync";
>> One per line, please
>>
>>> +
>>> + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
>>> +
>>> + interrupt-controller;
>>> + #interrupt-cells = <1>;
>> We're not using the irq cell, is that necessary/should that be 0?
>
> No. With 0 it would mean that there is a single interrupt for mdss source, which clearly is not the case.
Obviously. Derp, sorry.
Konrad
>
>>
>>> +
>>> + status = "disabled";
>> status should go last
>>
>>> +
>>> + #address-cells = <1>;
>>> + #size-cells = <1>;
>>> + ranges;
>>> +
>>> + mdp: display-controller@fd900000 {
>>> + compatible = "qcom,msm8226-mdp5", "qcom,mdp5";
>>> + reg = <0xfd900100 0x22000>;
>>> + reg-names = "mdp_phys";
>>> +
>>> + interrupt-parent = <&mdss>;
>>> + interrupts = <0>;
>>> +
>>> + clocks = <&mmcc MDSS_AHB_CLK>,
>>> + <&mmcc MDSS_AXI_CLK>,
>>> + <&mmcc MDSS_MDP_CLK>,
>>> + <&mmcc MDSS_VSYNC_CLK>;
>>> + clock-names = "iface", "bus", "core", "vsync";
>> One per line, please
>>
>>> +
>>> + ports {
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>> Would port { work here? I remember one mdss component's bindings
>> didn't allow it but don't recall which one
>
> Let's use ports /port@0 for uniformity even if there is just a single port always.
>
>>
>>> +
>>> + port@0 {
>>> + reg = <0>;
>>> + mdp5_intf1_out: endpoint {
>>> + remote-endpoint = <&dsi0_in>;
>>> + };
>>> + };
>>> + };
>>> + };
>>> +--
> With best wishes
> Dmitry
>
^ permalink raw reply [flat|nested] 20+ messages in thread