From patchwork Thu Jun 1 17:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13264305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9DA3C7EE2E for ; Thu, 1 Jun 2023 17:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s/Yn5htyeRvN52oplZokMF0W+RSr8/ZNJejmyrC44ps=; b=ayxtgSWkosPDOO HkIXcKscQLDX3cnPWgAHcO4cAGglK8l5957MyHUylkY9WJEdq6b1ql7tQEvoBFP6eeX6TrdXFwjTu izDL1eoCyr6fXDY8h2IZ+9y+/MslGsvL7f/wWeXvtZqyPzMsS+mUPdyqXaXE94RcRHfpPWfHUoHHi 3RgIdhIl5bUJ6ipJzItDB2Ytn+ekZwUg0NgxHPoVCRNR/lOnxON2QqkAnQy1RS1m9/b3DVB5L8k1d 52TCzaMm1zVHVXxZdcz+05bOVqePkeHv1GMzK7trhbiI2rfcRSmNdDjYZKzyhysx1+0XiPeX9q8Mm giExjIHgfheSoK2rOUqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4liJ-004Liu-0c; Thu, 01 Jun 2023 17:03:51 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4liG-004LhY-0v for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 17:03:49 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b1a3fa2cd2so11620771fa.1 for ; Thu, 01 Jun 2023 10:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685639026; x=1688231026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AYXAD9NgGprUIQkhXdsDo3LP+5BIf2ORjzEhEoh2Q0k=; b=YEyE4MplOuffKToNXoByaO0YIRahiBQrlXYzMq3NE7mD9SvEWvtIpQ4QjKuUjOkj1T U4ul77rYN2OwXiwDemsBFLPmcJRebNTIAm5Kwkux5fhC6HvvbvE+lDFgsh0rMaXTPln/ Y4fjlsmXpHr9EpCjwT0j/eKuVIyvv6ArA2k8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685639026; x=1688231026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AYXAD9NgGprUIQkhXdsDo3LP+5BIf2ORjzEhEoh2Q0k=; b=NQCEqzU1awj8V2yVl5tuoW7qOfVNrsO1nXF3yXhMRgnK0NQlydgIfl8cNgY5/9jGbg qnxfa4MxVt09mHaCZ5q9lxFpuROtelG2BGIT5xwdleVADLFbL5t1W1sLGfYqQn6CPBeY Kjy1UdvmK9M/mBe1kcOkqG3rQtEvnfAINdhAOJRdQnHatl4LI+MlxkM0BJ2ezyVBY2ns i+4WyByevLOLaPPTHdtusIM/4N0vUYG30rE+IulLWO53mCHpdV8/5O9Mj1ZAj/ZeOtQr j3lj+aLgsKulTjYprLXFo7Xg+Uxuzq9F1nu4wJlBwb40ZUyPbupAdzz99gtIDJN7Z9CF 1P1g== X-Gm-Message-State: AC+VfDx1bJGtkg40ynfb+uo/Uu/etZqjnqVNKSHn4IP7TVORgZRv2n40 uuLjsUYWm6mlmSztIAX93rGnrQ== X-Google-Smtp-Source: ACHHUZ7y/MadAmcG8+tiTZ3xPXcxTCxSt8Z6tfaDt1Gboo+wMV/9REfMseHNxiYgmiOmCfOJtQKSNA== X-Received: by 2002:a2e:8eca:0:b0:2b0:5a04:a5b6 with SMTP id e10-20020a2e8eca000000b002b05a04a5b6mr69305ljl.8.1685639026117; Thu, 01 Jun 2023 10:03:46 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id bh25-20020a170906a0d900b0096165b2703asm10658522ejb.110.2023.06.01.10.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:03:45 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Conor Dooley , Krzysztof Kozlowski , Maxime Coquelin , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 1/6] ARM: dts: stm32: add ltdc support on stm32f746 MCU Date: Thu, 1 Jun 2023 19:03:15 +0200 Message-Id: <20230601170320.2845218-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> References: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230601_100348_322725_EEF4C871 X-CRM114-Status: GOOD ( 10.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add LTDC (Lcd-tft Display Controller) support. Signed-off-by: Dario Binacchi --- arch/arm/boot/dts/stm32f746.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/stm32f746.dtsi b/arch/arm/boot/dts/stm32f746.dtsi index dc868e6da40e..9c4ba0b7f239 100644 --- a/arch/arm/boot/dts/stm32f746.dtsi +++ b/arch/arm/boot/dts/stm32f746.dtsi @@ -507,6 +507,16 @@ pwm { }; }; + ltdc: display-controller@40016800 { + compatible = "st,stm32-ltdc"; + reg = <0x40016800 0x200>; + interrupts = <88>, <89>; + resets = <&rcc STM32F7_APB2_RESET(LTDC)>; + clocks = <&rcc 1 CLK_LCD>; + clock-names = "lcd"; + status = "disabled"; + }; + pwrcfg: power-config@40007000 { compatible = "st,stm32-power-config", "syscon"; reg = <0x40007000 0x400>; From patchwork Thu Jun 1 17:03:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13264306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7EFDC7EE2A for ; Thu, 1 Jun 2023 17:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r5oCW/JqV2IB1lqvpeUSEnRYQXD7bq3Ia02pENCAF28=; b=Z/Xez+8VLG2RsL aPNR9CBf6fejZahZFL+ZrJsiajb/7v5r+H6VVTjnlYQ6w3aCM49RyLsnFj8dUnYGyy9XkTSO3bWmJ +/u9TWku74r71UKJK8Dd7awdcCbciIFltzZc6MzNq3HNJdjTQswNPEYV1tkV9mdACikwKAeZj4Ska TQf3MgO+h/ZGUhkCRR6yiFg3z6BH1qKOa5AHYfmMT8zaSKeMkuP5ZMB+u35kpBpC+Xmn+49SX1dun W+5HKzq6SGuAhw8pufRlRz8iH/WhiHNPEy7a4A5L71TXvPwYmtbC4TsC+LwKgnXFfs8cdw1U6VYFk JKx7J0BIgQ3AyyH+tThw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4liJ-004LjI-2M; Thu, 01 Jun 2023 17:03:51 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4liH-004Lhy-15 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 17:03:50 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-97000a039b2so157121266b.2 for ; Thu, 01 Jun 2023 10:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685639028; x=1688231028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mcKcmUUCIxd110zie+CjXE9D2AXIydaNegCcV+6SNq0=; b=ONctjRxH7/blw2xSSjhjyNIP779YSdcSYRkUGkesaThER6cV4joKdyYdDD6JLkHkFT 9dPXPnNYVmtgtNsGmTVl5DwIAtdk9wF9Xdre4IvLfFtPZWvq1RutMaiLGPlmUPKE75ZQ kYi7DRj72VsybHu0nM8m82iG42xdjhwGoGEFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685639028; x=1688231028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mcKcmUUCIxd110zie+CjXE9D2AXIydaNegCcV+6SNq0=; b=D7rLaQD3bWq2CJGx7ZIj6WiFlFd2hr6YR2c2Wj63HojqxECJyLjUyU4liG4jPNzV8z ET9qidGjI9+ZOjLQlSLlf1Bbqb/opAXB2OFre6htEQDKfJKpUP4O2UKC3XBVLej6Yo2D QM2m4tPMmn8nHsXRMBN2eOuK9h8pvL+WS4rX2/CzfaPCroCYpXnOaO/+Q/px03g/g0cs eonD6X3BOUedZRP/LRiMGks25h0N1zWxLzyfO954N0TN2l/bosMditpeGOkEImsNvIoD t0WMFw5fiyTRD3cKW8KRmd8dfZCn57xpQGjc50AH+Elms6I11njeWpmHFyXU1m7vgfld 0eBg== X-Gm-Message-State: AC+VfDyu0a+xwZD4TFk9KhwJJAFviYUteBXNspGxkswoMmA4ABZnmAOC tFFa2xRVFFj3XK5IJ+Gu97kbqw== X-Google-Smtp-Source: ACHHUZ5N3WWPiRYSAdp/Ws29GdL2rHIl5xREti1d8ZGXwyjdXbJK4oZ3W/krDLTO2yi+qhwVPxLgog== X-Received: by 2002:a17:907:ea4:b0:94f:2852:1d2b with SMTP id ho36-20020a1709070ea400b0094f28521d2bmr9669112ejc.72.1685639027798; Thu, 01 Jun 2023 10:03:47 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id bh25-20020a170906a0d900b0096165b2703asm10658522ejb.110.2023.06.01.10.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:03:47 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Conor Dooley , Krzysztof Kozlowski , Maxime Coquelin , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 2/6] ARM: dts: stm32: add pin map for LTDC on stm32f7 Date: Thu, 1 Jun 2023 19:03:16 +0200 Message-Id: <20230601170320.2845218-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> References: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230601_100349_371723_ABC3FED3 X-CRM114-Status: GOOD ( 11.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add pin configurations for using LTDC (LCD-tft Display Controller) on stm32f746-disco board. Signed-off-by: Dario Binacchi --- arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi index 9f65403295ca..f3f90b9bcd61 100644 --- a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi +++ b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi @@ -365,6 +365,41 @@ pins2 { bias-pull-up; }; }; + + + ltdc_pins_a: ltdc-pins-a-0 { + pins { + pinmux = , /* LCD_B0 */ + , /* LCD_B4 */ + , /* LCD_VSYNC */ + , /* LCD_HSYNC */ + , /* LCD_CLK */ + , /* LCD_R0 */ + , /* LCD_R1 */ + , /* LCD_R2 */ + , /* LCD_R3 */ + , /* LCD_R4 */ + , /* LCD_R5 */ + , /* LCD_R6 */ + , /* LCD_R7 */ + , /* LCD_G0 */ + , /* LCD_G1 */ + , /* LCD_G2 */ + , /* LCD_G3 */ + , /* LCD_G4 */ + , /* LCD_B1 */ + , /* LCD_B2 */ + , /* LCD_B3 */ + , /* LCD_G5 */ + , /* LCD_G6 */ + , /* LCD_G7 */ + , /* LCD_B5 */ + , /* LCD_B6 */ + , /* LCD_B7 */ + ; /* LCD_DE */ + slew-rate = <2>; + }; + }; }; }; }; From patchwork Thu Jun 1 17:03:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13264304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1360C77B7E for ; Thu, 1 Jun 2023 17:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XjKMCDx2mw0kE27ZlVfWJrvPTidS1lHZBBDszdHLvU0=; b=dY9Or2ZCJkbV5z WHo/TovuzxeoQKOpZhOAvrZrAHT/YKZVjx/j8u/kXUCf0sbf0f8tbCPV63pCOfa4ZbC1F9ODXADs2 YpRlNHlpCURQwfifTlfABmFNkcrINU2Zt/LxuNECyl8OSEusO0UYoGY83WDsctW/qk9uVbzt9wfI6 sx/YOB22giZB2RBXR/93URtBVn2T+mj96vHmR3ze0x6ZW+SODK89Q1sfq+Gypub+yXChbm4747Hv7 K3VyIHT2kVjm/ndIXBhse3E3km82QQOauCoZGhtN0Wx2ytBjGY6+JvKDi2K5nD6lTdHra0k1bZiHn hMLCJ7TY/72owZ3pHP7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4liM-004LkU-1y; Thu, 01 Jun 2023 17:03:54 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4liJ-004LiZ-21 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 17:03:52 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-96f7bf29550so152085766b.3 for ; Thu, 01 Jun 2023 10:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685639029; x=1688231029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UONz0K3nwm2zifFBUhCTgrepWK1oSDUw2LPUignW7i8=; b=UnYYUWSClBb0BsXFi3i7XAaGAFEzebmE7vqQAMf3PJ8WPIcuaZOHiSHB4JLYadsI56 KHjENvXyzXiGTZ8X2bUEIk9Hm+14AsxYTKsb0vOCfREuWnqw8cFzb98VTRnaZSv9Jmkh IMZz5GcmGNMrLNsbBUBQRucQhVPF0n+MOjoNs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685639029; x=1688231029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UONz0K3nwm2zifFBUhCTgrepWK1oSDUw2LPUignW7i8=; b=PlN7M3oA2h/lfCSumZwIShZu9/kdQE6mYh2tZIGrxO9nrW1FJUQGhoyqJdWbo5eNH9 Us3Wmk3+g5SnWyUH+sbb4ZQv/dMuCZuxlbwhO0//rOefEUMgewPrQrgofPsWsavffGOe KSMwwc1j6y7l604aM0iAwioD71E6mW4rnyYjhiPcHHTDJKS74HP1++luuDztncmfzj6s 8tuXjJqNMERJNsB9b9US2B+XUxaCyWS4D+qz9Ju4svTYtKo+0BPoeJe8zsajjarbjbIs SBOchPvwlgPx7Gvg0j2DonrZ2RTs1kfIc3Y2SS+IT8ZU/7iYNWh7/qj//vIV24WPZ2WQ bUvA== X-Gm-Message-State: AC+VfDz799cmz9nwi7VddQtXugyVZIBpuXwunDy06pAshygJF7BGGLXl vsriV/RimcEtNUyYyFmqtziTrA== X-Google-Smtp-Source: ACHHUZ6q1AhVcxAlVz48b3Tk70s/OoY6OFc2SmdEUmp6hlYZs/bMvPFWf/VyyMQIDAXjCuBoS1i1rQ== X-Received: by 2002:a17:907:9495:b0:94e:43ce:95f6 with SMTP id dm21-20020a170907949500b0094e43ce95f6mr7856974ejc.47.1685639029478; Thu, 01 Jun 2023 10:03:49 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id bh25-20020a170906a0d900b0096165b2703asm10658522ejb.110.2023.06.01.10.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:03:48 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Conor Dooley , Krzysztof Kozlowski , Maxime Coquelin , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 3/6] ARM: dts: stm32: support display on stm32f746-disco board Date: Thu, 1 Jun 2023 19:03:17 +0200 Message-Id: <20230601170320.2845218-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> References: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230601_100351_663020_A31FA8E0 X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to Rocktech RK043FN48H display on stm32f746-disco board. Signed-off-by: Dario Binacchi --- 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; + }; + }; + 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 = <<dc_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"; +}; + +<dc { + pinctrl-0 = <<dc_pins_a>; + pinctrl-names = "default"; + status = "okay"; + + port { + ltdc_out_rgb: endpoint { + remote-endpoint = <&panel_in_rgb>; + }; + }; +}; + &sdio1 { status = "okay"; vmmc-supply = <&mmc_vcard>; From patchwork Thu Jun 1 17:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13264307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D420C77B7A for ; Thu, 1 Jun 2023 17:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IZ6GyTmXm4z5x0zkzLXFxQSACH6rt1scJv6fPa4WOZE=; b=GaCmAnqLoIodV8 M3HPnuig9qFn0GMFRj5Cr48D4qaE/4sFgoxU22Gyt26kSYIUeEQLdbkg8aaWyNV6Q/lSkTMxkBfPS Uif8Qi55mTibIAU/PADfArK8iBnAELIYE5FmprOyRtQF0hXQ4U5EKiYaRrcZB69TW0Gt8+1spTGZk wAmFDaviWzh10pVGGSPlkiKFOuxT4Hmpg9lBlho3uDwCp4A7xQ1iDmR8MvSqddtbqFMI1g6InasC+ /5e1gT7359T4QROdRaCVZza05RRLwazqxtW45++LrLxukjdHCUU1a5V7DtXS0a9uuIt0yeujXODfi EVi8zpY7un6HNV6jbFYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4liQ-004Lm3-0u; Thu, 01 Jun 2023 17:03:58 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4liO-004Lkn-1O for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 17:03:57 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-96f850b32caso162955666b.3 for ; Thu, 01 Jun 2023 10:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685639034; x=1688231034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ftjev7ny28lvJRfWKN2KXX1gaG/LDneackQ782m2++c=; b=RXpREj32QF9glE5vpN59wgL/+UV12KKLNYA9IA5/BKkN5MgZGAFTz0Twq/Y4ZK8Udq 3MKAomKMltBYpKajAE7tTaJq0jTEmWFCGs2ZhQaB1L+TuroGqIzUDmhiCBh2XBcq0rQR wyY6MJzAzVQZ1h79fJtF4m08kX4kf4xEXSOBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685639034; x=1688231034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ftjev7ny28lvJRfWKN2KXX1gaG/LDneackQ782m2++c=; b=Xoh/jkqkeV0nW+URNPF6+hOsWnHYmsp8XETTkCeKFNKC316RjHqvN4J8QGfdopC76W 0XDwDd5bgsT/OyBXPw0jMP3wjDXqhtPu7SwS9L2R83mn3G32Pn6vQEoz1b3qQhntPtQE JzkvJW9X1K+DayWMPxwYAa38eMOKDBvsk1kfCOWuGR+V9cYu2E0sL0/z6yUeVleLtwXl 4vcKHWyZrYHnZLh1sHSObDLcJBHrD128nHtPla9lxKXdYeKrTEZFj3dXcD8jZfpNDZUI Ayo2ME9xD5VLYT/2SrxAbHXET9rITKMXEoro6BUB5XGn2UuCJ4FqD4rOxHJ4B5XOXqii 58Pg== X-Gm-Message-State: AC+VfDy4UNYi0swv94amhIKCAKOMtDi/z4KYAwP5uue/uzY80LGLfp7w sROQlSo0SNDPJtyEEEeOQNhsSw== X-Google-Smtp-Source: ACHHUZ5oUVMAwFD6jXFbU87iuAQJMHlHZ+OpaWeKz6pu4pcRR1a2Pb6wyFg0KLbejd0vnRuywS3xIQ== X-Received: by 2002:a17:907:da3:b0:973:d2b6:f536 with SMTP id go35-20020a1709070da300b00973d2b6f536mr9135641ejc.21.1685639034375; Thu, 01 Jun 2023 10:03:54 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id bh25-20020a170906a0d900b0096165b2703asm10658522ejb.110.2023.06.01.10.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:03:54 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Daniel Vetter , David Airlie , Maxime Coquelin , Philippe Cornu , Raphael Gallais-Pou , Yannick Fertre , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 6/6] drm/stm: add an option to change FB bpp Date: Thu, 1 Jun 2023 19:03:20 +0200 Message-Id: <20230601170320.2845218-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> References: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230601_100356_467491_825D5486 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Boards that use the STM32F{4,7} series have limited amounts of RAM. The added parameter allows users to size, within certain limits, the memory footprint required by the framebuffer. Signed-off-by: Dario Binacchi --- drivers/gpu/drm/stm/drv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 422220df7d8c..65be2b442a6a 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -30,6 +30,11 @@ #define STM_MAX_FB_WIDTH 2048 #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ +static uint stm_bpp = 16; + +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); +module_param_named(bpp, stm_bpp, uint, 0644); + static const struct drm_mode_config_funcs drv_mode_config_funcs = { .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) ddev->mode_config.min_height = 0; ddev->mode_config.max_width = STM_MAX_FB_WIDTH; ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; + ddev->mode_config.preferred_depth = stm_bpp; ddev->mode_config.funcs = &drv_mode_config_funcs; ddev->mode_config.normalize_zpos = true; @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) if (ret) goto err_put; - drm_fbdev_dma_setup(ddev, 16); + drm_fbdev_dma_setup(ddev, stm_bpp); return 0;