From patchwork Sun Jul 4 14:11:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1500427 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2021 header.b=yXhZWCkE; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GHrNK4f10z9sSs for ; Mon, 5 Jul 2021 00:11:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E3EB3402CC; Sun, 4 Jul 2021 14:11:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oT1GmZwY_02q; Sun, 4 Jul 2021 14:11:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 1B27B402AE; Sun, 4 Jul 2021 14:11:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E2E6D1BF964 for ; Sun, 4 Jul 2021 14:11:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D1CBF40323 for ; Sun, 4 Jul 2021 14:11:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=libero.it Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OreQPesPkwss for ; Sun, 4 Jul 2021 14:11:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) by smtp4.osuosl.org (Postfix) with ESMTPS id 48599402B0 for ; Sun, 4 Jul 2021 14:11:23 +0000 (UTC) Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([79.17.119.101]) by smtp-35.iol.local with ESMTPA id 02q2myKHt8HOx02q8mmXmV; Sun, 04 Jul 2021 16:11:21 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1625407881; bh=G4ZEarVVjlBA3wHcrTLk1hUJgAuUSk679yjkuEr84x4=; h=From; b=yXhZWCkElyvXjm0KMIZ2Nth+pdMuiXIn3KLE+qR5IUH+OBGkY/CEifQpNiFSilUwj hIU5CUVG6hgYq/ZLUNJhHBD3lLMOPpAusz6IJxaLShtqZKE+tPdj4VXKQjiIC0Y+Sr xQYg8emhtSdbSi5CGyFRbcQQXOHTkJEd/TL2AuVxlOhBGM6sDMD7eCTBQKCDQhsucl b0lKxQ+B2egCr5/iLchT0vzEPQLnJjccp7V54pNc6SRPj2EC1gKMOpKYpYhQqKMSZ6 z1YIDvDuRMfvJtiReNKghXy9JGjJRqNLNV/BRMd7FSj/x6wCNyKkWFdtMDQybZDNW7 pwPkJ9cMsrmEg== X-CNFS-Analysis: v=2.4 cv=LfD5VhTi c=1 sm=1 tr=0 ts=60e1c189 cx=a_exe a=do1bHx4A/kh2kuTIUQHSxQ==:117 a=do1bHx4A/kh2kuTIUQHSxQ==:17 a=VwQbUJbxAAAA:8 a=PXhH_-FEaopKX7Iku1AA:9 a=AjGcO6oz07-iQ99wixmX:22 To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 16:11:04 +0200 Message-Id: <20210704141106.1746-1-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4xfEbIz40fxWVW95XVTV12nQbjUz5kK/AZa0qkcW8T+h6NRSGwZymtUUSsKLLsmZmNqlH/mJmTE0wECMTPuz2SRO9fLZaz06dX07Q0ENhyOmcicd9cR2Se qZTtOwBtsELAVHYbDQ9TtuWcGghHZ+e56KAEhbjPzVyIk6ArR2/eEdBcm3Mgxn0x29VaSVkq9Il6N64pq0svp/mtZNCH/s5jJ2RuLzj8B8yipTAssx6ktrkC OrHvy72kbr2LbvdV1J4sFooZjLQ2KTa/EzCGzwOqz6bGFis/0HnB0oekHzc1YlUdwQkaowI5JBD9IIuTR/muXw== Subject: [Buildroot] [PATCH 1/2] configs/stm32f469_disco: enable Linux DRM support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dario Binacchi via buildroot Reply-To: Dario Binacchi Cc: Christophe Priouzeau , Dario Binacchi MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The patch to be applied to the Kernel has been informally approved by an ST maintainer as can be seen from [1] and [2]. After Linux boots, /dev/fb0 will be accessible. You can control the brightness of the display after enabling the framebuffer by running the following commands: ~ # echo 0 0 > /sys/class/graphics/fb0/pan ~ # echo 255 >/sys/class/backlight/40016c00.dsi.0/brightness The brightness ranges from 0 to 255, as you can see running the command: ~ # cat /sys/class/backlight/40016c00.dsi.0/max_brightness [1] https://lore.kernel.org/patchwork/patch/1450524/ [2] https://lore.kernel.org/patchwork/patch/1450964/ Signed-off-by: Dario Binacchi --- .../stm32f469-disco/linux.fragment | 7 +- ...-post-divisor-setup-for-I2S-SAI-PLLs.patch | 86 +++++++++++++++++++ configs/stm32f469_disco_defconfig | 1 + 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0001-clk-stm32f4-fix-post-divisor-setup-for-I2S-SAI-PLLs.patch diff --git a/board/stmicroelectronics/stm32f469-disco/linux.fragment b/board/stmicroelectronics/stm32f469-disco/linux.fragment index 90f5e8a8ff..ffa4d6205f 100644 --- a/board/stmicroelectronics/stm32f469-disco/linux.fragment +++ b/board/stmicroelectronics/stm32f469-disco/linux.fragment @@ -1 +1,6 @@ -# CONFIG_XIP_KERNEL is not set \ No newline at end of file +# CONFIG_XIP_KERNEL is not set +CONFIG_DRM=y +CONFIG_DRM_STM=y +CONFIG_DRM_STM_DSI=y +CONFIG_DRM_PANEL_ORISETECH_OTM8009A=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y diff --git a/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-clk-stm32f4-fix-post-divisor-setup-for-I2S-SAI-PLLs.patch b/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-clk-stm32f4-fix-post-divisor-setup-for-I2S-SAI-PLLs.patch new file mode 100644 index 0000000000..34e398b81d --- /dev/null +++ b/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-clk-stm32f4-fix-post-divisor-setup-for-I2S-SAI-PLLs.patch @@ -0,0 +1,86 @@ +From 463c3a0cbf18fd1bdd2c9a3c370c484b6cab97b5 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Mon, 21 Jun 2021 23:40:47 +0200 +Subject: [PATCH v2] clk: stm32f4: fix post divisor setup for I2S/SAI PLLs + +Enabling the framebuffer leads to a system hang. Running, as a debug +hack, the store_pan() function in drivers/video/fbdev/core/fbsysfs.c +without taking the console_lock, allows to see the crash backtrace on +the serial line. + +~ # echo 0 0 > /sys/class/graphics/fb0/pan + +[ 9.719414] Unhandled exception: IPSR = 00000005 LR = fffffff1 +[ 9.726937] CPU: 0 PID: 49 Comm: sh Not tainted 5.13.0-rc5 #9 +[ 9.733008] Hardware name: STM32 (Device Tree Support) +[ 9.738296] PC is at clk_gate_is_enabled+0x0/0x28 +[ 9.743426] LR is at stm32f4_pll_div_set_rate+0xf/0x38 +[ 9.748857] pc : [<0011e4be>] lr : [<0011f9e3>] psr: 0100000b +[ 9.755373] sp : 00bc7be0 ip : 00000000 fp : 001f3ac4 +[ 9.760812] r10: 002610d0 r9 : 01efe920 r8 : 00540560 +[ 9.766269] r7 : 02e7ddb0 r6 : 0173eed8 r5 : 00000000 r4 : 004027c0 +[ 9.773081] r3 : 0011e4bf r2 : 02e7ddb0 r1 : 0173eed8 r0 : 1d3267b8 +[ 9.779911] xPSR: 0100000b +[ 9.782719] CPU: 0 PID: 49 Comm: sh Not tainted 5.13.0-rc5 #9 +[ 9.788791] Hardware name: STM32 (Device Tree Support) +[ 9.794120] [<0000afa1>] (unwind_backtrace) from [<0000a33f>] (show_stack+0xb/0xc) +[ 9.802421] [<0000a33f>] (show_stack) from [<0000a8df>] (__invalid_entry+0x4b/0x4c) + +The `pll_num' field in the post_div_data configuration contained a wrong +value which also referenced an uninitialized hardware clock when +clk_register_pll_div() was called. + +Fixes: 517633ef630e ("clk: stm32f4: Add post divisor for I2S & SAI PLLs") +Signed-off-by: Dario Binacchi + +--- + +Changes in v2: +- Change 'u8 pll_num' from 'stm32f4_pll_post_div_data' structure into + 'int pll_idx'. + + drivers/clk/clk-stm32f4.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c +index 18117ce5ff85..5c75e3d906c2 100644 +--- a/drivers/clk/clk-stm32f4.c ++++ b/drivers/clk/clk-stm32f4.c +@@ -526,7 +526,7 @@ struct stm32f4_pll { + + struct stm32f4_pll_post_div_data { + int idx; +- u8 pll_num; ++ int pll_idx; + const char *name; + const char *parent; + u8 flag; +@@ -557,13 +557,13 @@ static const struct clk_div_table post_divr_table[] = { + + #define MAX_POST_DIV 3 + static const struct stm32f4_pll_post_div_data post_div_data[MAX_POST_DIV] = { +- { CLK_I2SQ_PDIV, PLL_I2S, "plli2s-q-div", "plli2s-q", ++ { CLK_I2SQ_PDIV, PLL_VCO_I2S, "plli2s-q-div", "plli2s-q", + CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 0, 5, 0, NULL}, + +- { CLK_SAIQ_PDIV, PLL_SAI, "pllsai-q-div", "pllsai-q", ++ { CLK_SAIQ_PDIV, PLL_VCO_SAI, "pllsai-q-div", "pllsai-q", + CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 8, 5, 0, NULL }, + +- { NO_IDX, PLL_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT, ++ { NO_IDX, PLL_VCO_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT, + STM32F4_RCC_DCKCFGR, 16, 2, 0, post_divr_table }, + }; + +@@ -1774,7 +1774,7 @@ static void __init stm32f4_rcc_init(struct device_node *np) + post_div->width, + post_div->flag_div, + post_div->div_table, +- clks[post_div->pll_num], ++ clks[post_div->pll_idx], + &stm32f4_clk_lock); + + if (post_div->idx != NO_IDX) +-- +2.17.1 + diff --git a/configs/stm32f469_disco_defconfig b/configs/stm32f469_disco_defconfig index e538a664e2..1440aefd95 100644 --- a/configs/stm32f469_disco_defconfig +++ b/configs/stm32f469_disco_defconfig @@ -1,6 +1,7 @@ BR2_arm=y BR2_cortex_m4=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y +BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f469-disco/patches" BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/common/stm32f4xx/stm32-post-build.sh board/stmicroelectronics/stm32f469-disco/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f469-disco/genimage.cfg" From patchwork Sun Jul 4 14:11:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1500426 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2021 header.b=KMrJsRNH; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GHrN61KlHz9sSs for ; Mon, 5 Jul 2021 00:11:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0CE84401AF; Sun, 4 Jul 2021 14:11:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kcgNHOB6F2Am; Sun, 4 Jul 2021 14:11:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 595544010F; Sun, 4 Jul 2021 14:11:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D78C01BF580 for ; Sun, 4 Jul 2021 14:11:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C445883A54 for ; Sun, 4 Jul 2021 14:11:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=libero.it Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vbl9x0XLP4kw for ; Sun, 4 Jul 2021 14:11:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4ECDC8355C for ; Sun, 4 Jul 2021 14:11:23 +0000 (UTC) Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([79.17.119.101]) by smtp-35.iol.local with ESMTPA id 02q2myKHt8HOx02q9mmXmf; Sun, 04 Jul 2021 16:11:21 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1625407881; bh=E9JV7GNnkWKJu7eL1n5SYXiCheO6bkdAz3AEb4J0+nc=; h=From; b=KMrJsRNH0TXRqtQemuS/3pflFDgU6kh2AWUs9YLlYmnMpX2dHICRmS1mIcx+TiATi oU4zWGCtpXzN9IsXRp4b930CzxoI6nopV+kEJCejdGqWtSYscSWd+e8w4ijNXQ4rmv PyG5sY6yYcWc6mOFtrTg91d171jH+aLH9IvMSXEPREfcm3mNyKRVHS34AphRNOZZYo k0DiDL+8B0owEaKbCJXgu7Iu4iphEAiEnXhN0spyFRNUh2JFalBvDx3K53wThDhybM GF2VdNgoqJ72LTtXDSZa8ldAUjfklzQuguaWLC75dQkIJ2rFnEw8BMcMDnvGm5fyM2 g8HxkzjZArPmQ== X-CNFS-Analysis: v=2.4 cv=LfD5VhTi c=1 sm=1 tr=0 ts=60e1c189 cx=a_exe a=do1bHx4A/kh2kuTIUQHSxQ==:117 a=do1bHx4A/kh2kuTIUQHSxQ==:17 a=ebg_UmrbKguA3I-y1BgA:9 To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 16:11:06 +0200 Message-Id: <20210704141106.1746-3-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210704141106.1746-1-dariobin@libero.it> References: <20210704141106.1746-1-dariobin@libero.it> X-CMAE-Envelope: MS4xfEbIz40fxWVW95XVTV12nQbjUz5kK/AZa0qkcW8T+h6NRSGwZymtUUSsKLLsmZmNqlH/mJmTE0wECMTPuz2SRO9fLZaz06dX07Q0ENhyOmcicd9cR2Se qZTtOwBtsELAVHYbDQ9TtuWcGghHZ+e56KAEhbjPzVyIk6ArR2/eEdBcm3Mgxn0x29VaSVkq9Il6N64pq0svp/mtZNCH/s5jJ2RuLzj8B8yipTAssx6ktrkC OrHvy72kbr2LbvdV1J4sFooZjLQ2KTa/EzCGzwOqz6bGFis/0HnB0oekHzc1YlUdwQkaowI5JBD9IIuTR/muXw== Subject: [Buildroot] [PATCH 2/2] configs/stm32f469_disco: add framebuffer test application X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dario Binacchi via buildroot Reply-To: Dario Binacchi Cc: Christophe Priouzeau , Dario Binacchi MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" It's a test suite for Linux framebuffer. You can run, for example, fb-test-rect that displays random rectangles on the screen. But first, you need to enable the framebuffer: ~ # echo 0 0 > /sys/class/graphics/fb0/pan ~ # fb-test-rect Signed-off-by: Dario Binacchi --- configs/stm32f469_disco_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/stm32f469_disco_defconfig b/configs/stm32f469_disco_defconfig index 1440aefd95..b6de6748a0 100644 --- a/configs/stm32f469_disco_defconfig +++ b/configs/stm32f469_disco_defconfig @@ -15,6 +15,7 @@ BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f469-disco" BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config" +BR2_PACKAGE_FB_TEST_APP=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_SIZE="32M" # BR2_TARGET_ROOTFS_TAR is not set