[RESEND,v2,3/6] ARM: dts: stm32: support display on stm32f746-disco board

Message ID 20230607063139.621351-4-dario.binacchi@amarulasolutions.com
State New
Headers
Series Add display support on the stm32f746-disco board |

Commit Message

Dario Binacchi June 7, 2023, 6:31 a.m. UTC
  Add support to Rocktech RK043FN48H display on stm32f746-disco board.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

(no changes since v1)

 arch/arm/boot/dts/stm32f746-disco.dts | 51 +++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
  

Comments

Jagan Teki June 7, 2023, 6:42 a.m. UTC | #1
On Wed, Jun 7, 2023 at 12:01 PM Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> Add support to Rocktech RK043FN48H display on stm32f746-disco board.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>
> (no changes since v1)
>
>  arch/arm/boot/dts/stm32f746-disco.dts | 51 +++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>
> diff --git a/arch/arm/boot/dts/stm32f746-disco.dts b/arch/arm/boot/dts/stm32f746-disco.dts
> index c11616ed5fc6..cda423b6a874 100644
> --- a/arch/arm/boot/dts/stm32f746-disco.dts
> +++ b/arch/arm/boot/dts/stm32f746-disco.dts
> @@ -60,10 +60,41 @@ memory@c0000000 {
>                 reg = <0xC0000000 0x800000>;
>         };
>
> +       reserved-memory {
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               ranges;
> +
> +               linux,cma {
> +                       compatible = "shared-dma-pool";
> +                       no-map;
> +                       size = <0x80000>;
> +                       linux,dma-default;
> +               };
> +       };

This looks unrelated to display enablement, isn't it?

Jagan.
  
Dario Binacchi June 7, 2023, 12:49 p.m. UTC | #2
Hi Jagan,

On Wed, Jun 7, 2023 at 8:43 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Wed, Jun 7, 2023 at 12:01 PM Dario Binacchi
> <dario.binacchi@amarulasolutions.com> wrote:
> >
> > Add support to Rocktech RK043FN48H display on stm32f746-disco board.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >
> > (no changes since v1)
> >
> >  arch/arm/boot/dts/stm32f746-disco.dts | 51 +++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/stm32f746-disco.dts b/arch/arm/boot/dts/stm32f746-disco.dts
> > index c11616ed5fc6..cda423b6a874 100644
> > --- a/arch/arm/boot/dts/stm32f746-disco.dts
> > +++ b/arch/arm/boot/dts/stm32f746-disco.dts
> > @@ -60,10 +60,41 @@ memory@c0000000 {
> >                 reg = <0xC0000000 0x800000>;
> >         };
> >
> > +       reserved-memory {
> > +               #address-cells = <1>;
> > +               #size-cells = <1>;
> > +               ranges;
> > +
> > +               linux,cma {
> > +                       compatible = "shared-dma-pool";
> > +                       no-map;
> > +                       size = <0x80000>;
> > +                       linux,dma-default;
> > +               };
> > +       };
>
> This looks unrelated to display enablement, isn't it?

Without the "reserved-memory" node, it is not possible to allocate
memory for the framebuffer.
I got this error:
stm32-display 40016800.display-controller: [drm] *ERROR* failed to
allocate buffer with size 139264

Thanks and regards,
Dario

>
> Jagan.



--

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com
  

Patch

diff --git a/arch/arm/boot/dts/stm32f746-disco.dts b/arch/arm/boot/dts/stm32f746-disco.dts
index c11616ed5fc6..cda423b6a874 100644
--- a/arch/arm/boot/dts/stm32f746-disco.dts
+++ b/arch/arm/boot/dts/stm32f746-disco.dts
@@ -60,10 +60,41 @@  memory@c0000000 {
 		reg = <0xC0000000 0x800000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,cma {
+			compatible = "shared-dma-pool";
+			no-map;
+			size = <0x80000>;
+			linux,dma-default;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
 
+	backlight: backlight {
+		compatible = "gpio-backlight";
+		gpios = <&gpiok 3 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};
+
+	panel_rgb: panel-rgb {
+		compatible = "rocktech,rk043fn48h";
+		backlight = <&backlight>;
+		enable-gpios = <&gpioi 12 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+		port {
+			panel_in_rgb: endpoint {
+				remote-endpoint = <&ltdc_out_rgb>;
+			};
+		};
+	};
+
 	usbotg_hs_phy: usb-phy {
 		#phy-cells = <0>;
 		compatible = "usb-nop-xceiv";
@@ -99,6 +130,26 @@  &i2c1 {
 	status = "okay";
 };
 
+&dma1 {
+	status = "okay";
+};
+
+&dma2 {
+	status = "okay";
+};
+
+&ltdc {
+	pinctrl-0 = <&ltdc_pins_a>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	port {
+		ltdc_out_rgb: endpoint {
+			remote-endpoint = <&panel_in_rgb>;
+		};
+	};
+};
+
 &sdio1 {
 	status = "okay";
 	vmmc-supply = <&mmc_vcard>;