* [PATCH 1/5] arm64: dts: qcom: sdm845-oneplus: fix reserved-mem
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
@ 2021-07-20 15:33 ` Caleb Connolly
2021-07-20 15:33 ` [PATCH 2/5] dts: arm64: sdm845-oneplus-common: enable debug UART Caleb Connolly
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 15:33 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Bjorn Andersson, Rob Herring, Thierry Reding,
Sam Ravnborg, David Airlie, Daniel Vetter, linux-arm-msm,
devicetree, dri-devel
Fix the upper guard and the "removed_region", this fixes the random
crashes which used to occur in memory intensive loads. I'm not sure WHY
the upper guard being 0x2000 instead of 0x1000 doesn't fix this, but it
HAS to be 0x1000.
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
Fixes: e60fd5ac1f68 ("arm64: dts: qcom: sdm845-oneplus-common: guard
rmtfs-mem")
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 4d052e39b348..eb6b1d15293d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -69,7 +69,7 @@ rmtfs_mem: memory@f5b01000 {
};
rmtfs_upper_guard: memory@f5d01000 {
no-map;
- reg = <0 0xf5d01000 0 0x2000>;
+ reg = <0 0xf5d01000 0 0x1000>;
};
/*
@@ -78,7 +78,7 @@ rmtfs_upper_guard: memory@f5d01000 {
*/
removed_region: memory@88f00000 {
no-map;
- reg = <0 0x88f00000 0 0x200000>;
+ reg = <0 0x88f00000 0 0x1c00000>;
};
ramoops: ramoops@ac300000 {
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] dts: arm64: sdm845-oneplus-common: enable debug UART
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
2021-07-20 15:33 ` [PATCH 1/5] arm64: dts: qcom: sdm845-oneplus: fix reserved-mem Caleb Connolly
@ 2021-07-20 15:33 ` Caleb Connolly
2021-07-20 15:33 ` [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Caleb Connolly
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 15:33 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Bjorn Andersson, Rob Herring, Thierry Reding,
Sam Ravnborg, David Airlie, Daniel Vetter, linux-arm-msm,
devicetree, dri-devel
A labelled diagram showing the location of the Rx and Tx testpoints for
the OnePlus 6 is available on the postmarketOS wiki:
https://wiki.postmarketos.org/wiki/Serial_debugging:Cable_schematics
The device uses 1.8v UART at a baud rate of 115200, bootloader output is
also available here.
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index eb6b1d15293d..e81f5cc9f26d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -19,9 +19,14 @@
/ {
aliases {
+ serial0 = &uart9;
hsuart0 = &uart6;
};
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
gpio-keys {
compatible = "gpio-keys";
label = "Volume keys";
@@ -526,6 +531,11 @@ bluetooth {
};
};
+&uart9 {
+ label = "LS-UART1";
+ status = "okay";
+};
+
&ufs_mem_hc {
status = "okay";
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
2021-07-20 15:33 ` [PATCH 1/5] arm64: dts: qcom: sdm845-oneplus: fix reserved-mem Caleb Connolly
2021-07-20 15:33 ` [PATCH 2/5] dts: arm64: sdm845-oneplus-common: enable debug UART Caleb Connolly
@ 2021-07-20 15:33 ` Caleb Connolly
2021-07-20 16:03 ` Bjorn Andersson
2021-07-20 15:33 ` [PATCH 4/5] arm64: dts: qcom: sdm845-oneplus-fajita: remove panel reset gpio Caleb Connolly
2021-07-20 15:33 ` [PATCH 5/5] arm64: dts: qcom: sdm845-oneplus: add ipa firmware names Caleb Connolly
4 siblings, 1 reply; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 15:33 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Bjorn Andersson, Rob Herring, Thierry Reding,
Sam Ravnborg, David Airlie, Daniel Vetter, linux-arm-msm,
devicetree, dri-devel
The OnePlus 6T panel fails to initialise if it has been reset,
workaround this by allowing panels to not specify a reset GPIO.
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
---
drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
index 8cb1853574bb..a20a5af14653 100644
--- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
@@ -44,6 +44,8 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
static void sofef00_panel_reset(struct sofef00_panel *ctx)
{
+ if (!ctx->reset_gpio)
+ return;
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
@@ -137,7 +139,8 @@ static int sofef00_panel_prepare(struct drm_panel *panel)
ret = sofef00_panel_on(ctx);
if (ret < 0) {
dev_err(dev, "Failed to initialize panel: %d\n", ret);
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ if (ctx->reset_gpio)
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
return ret;
}
@@ -276,7 +279,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
return ret;
}
- ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio)) {
ret = PTR_ERR(ctx->reset_gpio);
dev_warn(dev, "Failed to get reset-gpios: %d\n", ret);
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional
2021-07-20 15:33 ` [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Caleb Connolly
@ 2021-07-20 16:03 ` Bjorn Andersson
2021-07-20 16:24 ` Caleb Connolly
0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Andersson @ 2021-07-20 16:03 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Rob Herring, Thierry Reding, Sam Ravnborg,
David Airlie, Daniel Vetter, linux-arm-msm, devicetree,
dri-devel
On Tue 20 Jul 10:33 CDT 2021, Caleb Connolly wrote:
> The OnePlus 6T panel fails to initialise if it has been reset,
> workaround this by allowing panels to not specify a reset GPIO.
>
> Signed-off-by: Caleb Connolly <caleb@connolly.tech>
> ---
> drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> index 8cb1853574bb..a20a5af14653 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> @@ -44,6 +44,8 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
>
> static void sofef00_panel_reset(struct sofef00_panel *ctx)
> {
> + if (!ctx->reset_gpio)
gpiod_set_value_cansleep(NULL, 1) is a perfectly valid nop, so I don't
think you need to make this conditional.
That said, don't you need this to get the panel out of reset once you
apply power after it being powered off?
> + return;
> gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> usleep_range(5000, 6000);
> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> @@ -137,7 +139,8 @@ static int sofef00_panel_prepare(struct drm_panel *panel)
> ret = sofef00_panel_on(ctx);
> if (ret < 0) {
> dev_err(dev, "Failed to initialize panel: %d\n", ret);
> - gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + if (ctx->reset_gpio)
Ditto.
Regards,
Bjorn
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> return ret;
> }
>
> @@ -276,7 +279,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
> return ret;
> }
>
> - ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
> + ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> if (IS_ERR(ctx->reset_gpio)) {
> ret = PTR_ERR(ctx->reset_gpio);
> dev_warn(dev, "Failed to get reset-gpios: %d\n", ret);
> --
> 2.32.0
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional
2021-07-20 16:03 ` Bjorn Andersson
@ 2021-07-20 16:24 ` Caleb Connolly
0 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 16:24 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Rob Herring, Thierry Reding, Sam Ravnborg,
David Airlie, Daniel Vetter, linux-arm-msm, devicetree,
dri-devel
Hi Bjorn,
On 20/07/2021 17:03, Bjorn Andersson wrote:
> On Tue 20 Jul 10:33 CDT 2021, Caleb Connolly wrote:
>
>> The OnePlus 6T panel fails to initialise if it has been reset,
>> workaround this by allowing panels to not specify a reset GPIO.
>>
>> Signed-off-by: Caleb Connolly <caleb@connolly.tech>
>> ---
>> drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
>> index 8cb1853574bb..a20a5af14653 100644
>> --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
>> +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
>> @@ -44,6 +44,8 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
>>
>> static void sofef00_panel_reset(struct sofef00_panel *ctx)
>> {
>> + if (!ctx->reset_gpio)
> gpiod_set_value_cansleep(NULL, 1) is a perfectly valid nop, so I don't
> think you need to make this conditional.
Ah thanks, will revise.
>
> That said, don't you need this to get the panel out of reset once you
> apply power after it being powered off?
It seems like the panel is out of reset by default, my best guess for
this whole issue is that the bootloader does some initialisation
of the panel which we aren't able to reproduce, as the panel is left
initialised (for cont splash) we're able to just make use of it as is.
With these patches supplied the OnePlus 6T is able to boot and function
as expected, in the future it would be good to find a way to
properly set up the panel so that we aren't dependent on the bootloader...
>
>> + return;
>> gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>> usleep_range(5000, 6000);
>> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> @@ -137,7 +139,8 @@ static int sofef00_panel_prepare(struct drm_panel *panel)
>> ret = sofef00_panel_on(ctx);
>> if (ret < 0) {
>> dev_err(dev, "Failed to initialize panel: %d\n", ret);
>> - gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> + if (ctx->reset_gpio)
> Ditto.
>
>
> Regards,
> Bjorn
>
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> return ret;
>> }
>>
>> @@ -276,7 +279,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
>> return ret;
>> }
>>
>> - ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
>> + ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>> if (IS_ERR(ctx->reset_gpio)) {
>> ret = PTR_ERR(ctx->reset_gpio);
>> dev_warn(dev, "Failed to get reset-gpios: %d\n", ret);
>> --
>> 2.32.0
>>
>>
Kind Regards,
Caleb
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/5] arm64: dts: qcom: sdm845-oneplus-fajita: remove panel reset gpio
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
` (2 preceding siblings ...)
2021-07-20 15:33 ` [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Caleb Connolly
@ 2021-07-20 15:33 ` Caleb Connolly
2021-07-20 15:33 ` [PATCH 5/5] arm64: dts: qcom: sdm845-oneplus: add ipa firmware names Caleb Connolly
4 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 15:33 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Bjorn Andersson, Rob Herring, Thierry Reding,
Sam Ravnborg, David Airlie, Daniel Vetter, linux-arm-msm,
devicetree, dri-devel
Don't specify the reset GPIO for the OnePlus 6T, the panel in the 6T
will refuse to initialise if it has been reset so use this as a
workaround.
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 +---
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 ++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index e81f5cc9f26d..1339bac8afc2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -331,8 +331,6 @@ display_panel: panel@0 {
vddio-supply = <&vreg_l14a_1p88>;
- reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
-
pinctrl-names = "default";
pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>;
@@ -615,7 +613,7 @@ mux {
pins = "gpio6", "gpio25", "gpio26";
function = "gpio";
drive-strength = <8>;
- bias-disable = <0>;
+ bias-disable;
};
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
index 72842c887617..5c728c1555f3 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
@@ -16,4 +16,6 @@ &display_panel {
status = "okay";
compatible = "samsung,sofef00";
+
+ reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
};
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] arm64: dts: qcom: sdm845-oneplus: add ipa firmware names
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
` (3 preceding siblings ...)
2021-07-20 15:33 ` [PATCH 4/5] arm64: dts: qcom: sdm845-oneplus-fajita: remove panel reset gpio Caleb Connolly
@ 2021-07-20 15:33 ` Caleb Connolly
4 siblings, 0 replies; 8+ messages in thread
From: Caleb Connolly @ 2021-07-20 15:33 UTC (permalink / raw)
To: Caleb Connolly
Cc: Andy Gross, Bjorn Andersson, Rob Herring, Thierry Reding,
Sam Ravnborg, David Airlie, Daniel Vetter, linux-arm-msm,
devicetree, dri-devel
Add the correct patch to the ipa firmware now that custom paths are
supported.
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 1339bac8afc2..96304f8688ed 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -406,6 +406,7 @@ &ipa {
status = "okay";
memory-region = <&ipa_fw_mem>;
+ firmware-name = "qcom/sdm845/oneplus6/ipa_fws.mbn";
};
&mdss {
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread