This series is another collection of small fixes for the OnePlus 6 and 6T. Notably we finally have finally tracked down and fixed the reserved memory related crashes! We also enable UART as well as take Bjorns approach to working around the panel reset GPIO issue making the reset GPIO optional in the panel driver. Lastly we fix up the ipa firmware path now that firmware-names is supported for it in 5.14.
The patch ("drm/panel/samsung-sofef00: make gpio optional") is a reworked version of a patch from a previous series which was not accepted: ("drm: panel: sofef00: remove reset GPIO handling") https://lore.kernel.org/linux-arm-msm/20210502014146.85642-3-caleb@connolly....
Caleb Connolly (5): arm64: dts: qcom: sdm845-oneplus: fix reserved-mem dts: arm64: sdm845-oneplus-common: enable debug UART drm/panel/samsung-sofef00: make gpio optional arm64: dts: qcom: sdm845-oneplus-fajita: remove panel reset gpio arm64: dts: qcom: sdm845-oneplus: add ipa firmware names
.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 19 ++++++++++++++----- .../dts/qcom/sdm845-oneplus-enchilada.dts | 2 ++ drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++-- 3 files changed, 21 insertions(+), 7 deletions(-)
-- 2.32.0
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
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
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
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?
gpiod_set_value_cansleep(ctx->reset_gpio, 0); usleep_range(5000, 6000); gpiod_set_value_cansleep(ctx->reset_gpio, 1);return;
@@ -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
return ret; }gpiod_set_value_cansleep(ctx->reset_gpio, 1);
@@ -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
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...
gpiod_set_value_cansleep(ctx->reset_gpio, 0); usleep_range(5000, 6000); gpiod_set_value_cansleep(ctx->reset_gpio, 1);return;
@@ -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
return ret; }gpiod_set_value_cansleep(ctx->reset_gpio, 1);
@@ -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
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
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
dri-devel@lists.freedesktop.org