From patchwork Sun Feb 16 15:09:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238763 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=bfU8PXKK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Xh6ycGz9s29 for ; Mon, 17 Feb 2020 02:10:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 137C181259; Sun, 16 Feb 2020 16:10:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="bfU8PXKK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3BAA81225; Sun, 16 Feb 2020 16:10:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 023AA8079C for ; Sun, 16 Feb 2020 16:10:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYdjm1uT; Sun, 16 Feb 2020 16:10:07 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865807; bh=Jy9GUDR3ORKCI0eCqpfU/0WXYtN2B3JmJcOy4YNAuV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bfU8PXKKXkwfgAWMmuWje4vAZKe9llzeWqp5SCuT+7dOhVCVZCSmEsHqa7xwBfq7x 6S4rFph7dN/KBBAsEaB42Vag5Vs9Lke6jpiiQcH/On9gSQBjHAe5tt3D4cnkLq2lYD n6yLlwF9FP54Z3k5/cUupVgRrQU6GI+N9BNt7KGfC16NrvWCodz4OUG5UtitrEGPP7 G+G2q1BIQtjzVyAGDMnRDCrnb2GBmgibF/yYbfzjNlj/63LsS10W4j6UDJAkzmpfNx voExDNMFj3kSJJvtOEGjTjta3h0H4LmxHFh8Qr3LDvM48XAh6LiWP+p8Q9dl4AGiOY jQIzBlJ5DEOdg== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=4UaF-5EpBQO_pNlhY1EA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 01/13] video: omap: use BIT() and GENMASK() macros Date: Sun, 16 Feb 2020 16:09:30 +0100 Message-Id: <20200216150942.3220-2-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKQEM9dVI4sF57iqxFTdEqypashE5VWHng/c3g0jcuoUSfHPVrDQ+FTQAwnG1U7AkzBG+Nyxstp/e4xVYg/sC9Sbu5/Fi4DxDRiWDEr5Y2XB3PgPlbAs bjtV2H9dcah8NRX79MqSoIeuzKCQxZEAzRVdNL1IiGRwU5cn9RbqXpwpeB1gJ4JyBxdrLHe8TXP9jy3h6xzQ0KrWIjD4cP7tA4e/isCZcsTvLF9pOg4ob5A4 3X7VLmjheoBVIu1BgblKVcLT0hjIOXU+0Ub5caYAtM8= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Use the standard BIT() and GENMASK() macros for bitfield definitions. Signed-off-by: Dario Binacchi --- Changes in v2: - Use GENMASK macro too drivers/video/am335x-fb.c | 36 ++++++++++++++++++------------------ drivers/video/am335x-fb.h | 12 ++++++------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 51c1af587f..7065d57148 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -27,11 +27,11 @@ /* LCD Control Register */ #define LCD_CLK_DIVISOR(x) ((x) << 8) -#define LCD_RASTER_MODE 0x01 +#define LCD_RASTER_MODE BIT(0) /* LCD Clock Enable Register */ -#define LCD_CORECLKEN (0x01 << 0) -#define LCD_LIDDCLKEN (0x01 << 1) -#define LCD_DMACLKEN (0x01 << 2) +#define LCD_CORECLKEN BIT(0) +#define LCD_LIDDCLKEN BIT(1) +#define LCD_DMACLKEN BIT(2) /* LCD DMA Control Register */ #define LCD_DMA_BURST_SIZE(x) ((x) << 4) #define LCD_DMA_BURST_1 0x0 @@ -40,28 +40,28 @@ #define LCD_DMA_BURST_8 0x3 #define LCD_DMA_BURST_16 0x4 /* LCD Timing_0 Register */ -#define LCD_HBPLSB(x) ((((x)-1) & 0xFF) << 24) -#define LCD_HFPLSB(x) ((((x)-1) & 0xFF) << 16) -#define LCD_HSWLSB(x) ((((x)-1) & 0x3F) << 10) -#define LCD_HORLSB(x) (((((x) >> 4)-1) & 0x3F) << 4) +#define LCD_HBPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 24) +#define LCD_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) +#define LCD_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) +#define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) #define LCD_HORMSB(x) (((((x) >> 4)-1) & 0x40) >> 4) /* LCD Timing_1 Register */ #define LCD_VBP(x) ((x) << 24) #define LCD_VFP(x) ((x) << 16) #define LCD_VSW(x) (((x)-1) << 10) -#define LCD_VERLSB(x) (((x)-1) & 0x3FF) +#define LCD_VERLSB(x) (((x) - 1) & GENMASK(9, 0)) /* LCD Timing_2 Register */ -#define LCD_HSWMSB(x) ((((x)-1) & 0x3C0) << 21) -#define LCD_VERMSB(x) ((((x)-1) & 0x400) << 16) -#define LCD_HBPMSB(x) ((((x)-1) & 0x300) >> 4) -#define LCD_HFPMSB(x) ((((x)-1) & 0x300) >> 8) -#define LCD_INVMASK(x) ((x) & 0x3F00000) +#define LCD_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) +#define LCD_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) +#define LCD_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) +#define LCD_HFPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 8) +#define LCD_INVMASK(x) ((x) & GENMASK(25, 20)) /* LCD Raster Ctrl Register */ -#define LCD_TFT_24BPP_MODE (1 << 25) -#define LCD_TFT_24BPP_UNPACK (1 << 26) +#define LCD_TFT_24BPP_MODE BIT(25) +#define LCD_TFT_24BPP_UNPACK BIT(26) #define LCD_PALMODE_RAWDATA (0x02 << 20) -#define LCD_TFT_MODE (0x01 << 7) -#define LCD_RASTER_ENABLE (0x01 << 0) +#define LCD_TFT_MODE BIT(7) +#define LCD_RASTER_ENABLE BIT(0) /* Macro definitions */ diff --git a/drivers/video/am335x-fb.h b/drivers/video/am335x-fb.h index f5883c02dd..ad9b015e09 100644 --- a/drivers/video/am335x-fb.h +++ b/drivers/video/am335x-fb.h @@ -7,7 +7,7 @@ #ifndef AM335X_FB_H #define AM335X_FB_H -#define HSVS_CONTROL (0x01 << 25) /* +#define HSVS_CONTROL BIT(25) /* * 0 = lcd_lp and lcd_fp are driven on * opposite edges of pixel clock than * the lcd_pixel_o @@ -17,7 +17,7 @@ * Matrix displays the edge timing is * fixed */ -#define HSVS_RISEFALL (0x01 << 24) /* +#define HSVS_RISEFALL BIT(24) /* * 0 = lcd_lp and lcd_fp are driven on * the rising edge of pixel clock (bit * 25 must be set to 1) @@ -25,19 +25,19 @@ * the falling edge of pixel clock (bit * 25 must be set to 1) */ -#define DE_INVERT (0x01 << 23) /* +#define DE_INVERT BIT(23) /* * 0 = DE is low-active * 1 = DE is high-active */ -#define PXCLK_INVERT (0x01 << 22) /* +#define PXCLK_INVERT BIT(22) /* * 0 = pix-clk is high-active * 1 = pic-clk is low-active */ -#define HSYNC_INVERT (0x01 << 21) /* +#define HSYNC_INVERT BIT(21) /* * 0 = HSYNC is active high * 1 = HSYNC is avtive low */ -#define VSYNC_INVERT (0x01 << 20) /* +#define VSYNC_INVERT BIT(20) /* * 0 = VSYNC is active high * 1 = VSYNC is active low */ From patchwork Sun Feb 16 15:09:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238764 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=QTBehS4F; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Xw104rz9s29 for ; Mon, 17 Feb 2020 02:10:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59EF68079C; Sun, 16 Feb 2020 16:10:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="QTBehS4F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BA7781280; Sun, 16 Feb 2020 16:10:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 515BE8079C for ; Sun, 16 Feb 2020 16:10:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYijm1vn; Sun, 16 Feb 2020 16:10:12 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865812; bh=JCxdO37otNF3BMILLVQ5WNtt6i+fkpSbiFP+WzDK2QM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QTBehS4FvhjWf86ZuQURx9OguClwBxldDK2I6Vlraz9hSBABGpE2NGdqW5V8uIrDu 1zaFZNd7dBEy+5v1YY0DLRqpEBnxbFLa+kfMFjOLSvAt8f0v66nNXDIPbrHJjJ1nDY oufum6R792Fcn/GFjSZuNyVRsxG1pNT8KnNvZvfRg26mtZaWNqNp+aDHou4Bu8TMFJ /XKL3dKzQISW6cYppFVJMMeUlj7/Vv4Sr5JBvQ2+AO1GkVNeO6px+JvOjhmdh9Tgea rH4PYyBXrQRdS+PqKbJZPnkrmxrJNRETwnPuQRNaRTnt3jipyk/ZeYka7UbE2i65nE qSWINruWNqLrg== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=ng6qe6RrQ1DxvtDK4KcA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 02/13] video: omap: add missing bitfield masks Date: Sun, 16 Feb 2020 16:09:31 +0100 Message-Id: <20200216150942.3220-3-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfOlk+GIFDlqxQWZwlpwZ9ru/i64DcVs1w3RhMXxnYkj9P+UljB79ORgq5OOcWwfWjtCOoH4tY3SHfGQnaWn4G6Eq7BwAtul1w2j5ax6LS2Btc2grT73O og0jRCcr/vHbHXpitLHRhN92ukMbQyzMGcezuX3AhiU7rT0mO+s2nphqNmtFnj8wR6b1ioSuKZQoRL7WRNkICba9qGO9vIRtLWexBbiyFHoHOnZ+SjgrpOTm WvmBTMMWRhzD2u18voKkOSr76Eqr6ftFnifeduYAjjk= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Add, if missing, the bitfield masks in the setting macros of the LCD controller registers. Signed-off-by: Dario Binacchi - Use GENMASK macro --- Changes in v2: None drivers/video/am335x-fb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 7065d57148..4fd3b7f65a 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -26,14 +26,14 @@ #define LCDC_FMAX 200000000 /* LCD Control Register */ -#define LCD_CLK_DIVISOR(x) ((x) << 8) +#define LCD_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) #define LCD_RASTER_MODE BIT(0) /* LCD Clock Enable Register */ #define LCD_CORECLKEN BIT(0) #define LCD_LIDDCLKEN BIT(1) #define LCD_DMACLKEN BIT(2) /* LCD DMA Control Register */ -#define LCD_DMA_BURST_SIZE(x) ((x) << 4) +#define LCD_DMA_BURST_SIZE(x) (((x) & GENMASK(2, 0)) << 4) #define LCD_DMA_BURST_1 0x0 #define LCD_DMA_BURST_2 0x1 #define LCD_DMA_BURST_4 0x2 @@ -46,9 +46,9 @@ #define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) #define LCD_HORMSB(x) (((((x) >> 4)-1) & 0x40) >> 4) /* LCD Timing_1 Register */ -#define LCD_VBP(x) ((x) << 24) -#define LCD_VFP(x) ((x) << 16) -#define LCD_VSW(x) (((x)-1) << 10) +#define LCD_VBP(x) (((x) & GENMASK(7, 0)) << 24) +#define LCD_VFP(x) (((x) & GENMASK(7, 0)) << 16) +#define LCD_VSW(x) ((((x) - 1) & GENMASK(5, 0)) << 10) #define LCD_VERLSB(x) (((x) - 1) & GENMASK(9, 0)) /* LCD Timing_2 Register */ #define LCD_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) From patchwork Sun Feb 16 15:09:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238765 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=pC4i4HM0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Y63wBrz9s29 for ; Mon, 17 Feb 2020 02:10:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EA6F8128A; Sun, 16 Feb 2020 16:10:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="pC4i4HM0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DA39F8128A; Sun, 16 Feb 2020 16:10:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B0FF68079C for ; Sun, 16 Feb 2020 16:10:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYmjm1wz; Sun, 16 Feb 2020 16:10:16 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865816; bh=nzBE5zy2vvp1TU9qbtuTjm2w3/gr8ruok1QgKoIl7ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pC4i4HM0yA1NLJ1oZItKqqFhhl7WaOrPRhPM27xkk++3lE5tmYwZf2+oggYdzaJ0I CpGd7K1iSpPypxORyGRIoGMOct2TwhvJ1Hb6MQTnZYt5H9iA8IbuFi6mGDU/35Ca2T w+qqnJ2gnS5dIuxZMlqvKY6kw94D+pF2azwfZTQlH7U85SBfeiHx7N1FKVo5/7f5yy JWqR662DybH67ijgj17WoHMr/0QmbQUShOBa8GiK6mF/QBGG4qmHSKwk/mpA5tJCj8 DzCqNVL0YSiWC0IZH+vhp4P0u+BiZJQg79MyOL6UwaBrYF0vjSiYYEqWgDAiEGKb0y qg59ZbomEG8wQ== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=HUuSXZuFOOStSZgm8vgA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 03/13] video: omap: fix coding style on use of spaces Date: Sun, 16 Feb 2020 16:09:32 +0100 Message-Id: <20200216150942.3220-4-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfPIwVoJJXdZ2JLIyYhTFdy5Ik2Rh7LcMYrxwqmBwyfsjEh9j93x2V4LRoVBX/I4POZccN0kiaNl3e4HaYRow8RO4VQGhVBY5AONTdXu1K/KBpuDctAt+ i+i0wtjsshdYvDWlQl7kNB6LTf7oqSCcSwSuedhhj0wQny91SZSzAn1FE/q5Bttnlag0+y5bre6UPvBnk9Z0EvvHblco05irC6e6e6xf5QzLwU5rDK+ShAor V2GASKdxlamEp4tFD9SIeM1FDeidKUg05VUUVBHSCms= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Use one space around (on each side of) the binary '-' operator. Signed-off-by: Dario Binacchi --- Changes in v2: None drivers/video/am335x-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 4fd3b7f65a..92e37bd1e0 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -44,7 +44,7 @@ #define LCD_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) #define LCD_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) #define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) -#define LCD_HORMSB(x) (((((x) >> 4)-1) & 0x40) >> 4) +#define LCD_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) /* LCD Timing_1 Register */ #define LCD_VBP(x) (((x) & GENMASK(7, 0)) << 24) #define LCD_VFP(x) (((x) & GENMASK(7, 0)) << 16) From patchwork Sun Feb 16 15:09:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238766 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=CC2tPGyQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9YK6PKwz9s29 for ; Mon, 17 Feb 2020 02:11:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 103908129C; Sun, 16 Feb 2020 16:10:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="CC2tPGyQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F8EC81280; Sun, 16 Feb 2020 16:10:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9AC738120A for ; Sun, 16 Feb 2020 16:10:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYqjm1yK; Sun, 16 Feb 2020 16:10:20 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865820; bh=2Eb9Tt1GVqveayfeCT7wQv93TQCqloFzeorP1Iy2z/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CC2tPGyQ3urNOTjrLZGXACJVgUVSIoVh4GpLdseHH46gdvFOr86EEmmbbYYky8vHy pwQbEXGL+IXatpHqAdSj283bAYdzE6JDGgKryaFiCdyeW3bsikgPfXe3uh3txlJoDM DRjdqkQ0HoCDkq3gGsd8EzLGJ5h8WrcgwUDy2U3WuDjjh3idEzBdgQfLAW6Hf2w0U8 nrXSB3qYq2L7kmyFHCXU/zxzuAUgceZqwlhtJ7VgPWwb8+iEQ6HThnFNoBVhnz+Wz4 E8THszAZCSwfqGudULRApy/ZGJ9B1o4qzgDpQDnvMKcsLkksHpgh+4m1/Ao+jS3Zhb mCJKp+EeSCmwg== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=jFuFhNKA0NpGBVxCCTYA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 04/13] video: omap: fix bitfields order Date: Sun, 16 Feb 2020 16:09:33 +0100 Message-Id: <20200216150942.3220-5-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfJbRnCmCvx+Kp24FyeswHnMT7UNLytuFRyZBR9CPYW6GA3F/M3xeQTk5yYCwIAWB/6zQmKCWrIYQWtb91y3nkBwcmYrge9kCF5EFeYur4mvx9JiV7nCC ZTizO1c2n0IipUmFAocn6AoA9kVX8kfEODGGMaBbHmImY5tlGdryhHM+xLfMi8YT6A64Jnp2Uj+j05eQNAhiLTDOXUsquCPMuEF5NeWiyas7nLO84PaEzBqk mqROiJw0UYVTFNCrSXgZ/BL37SRyaZ3t3G78eeE2DV4= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Arrange the bitfields of each register in the ascending order. Signed-off-by: Dario Binacchi --- Changes in v2: None drivers/video/am335x-fb.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 92e37bd1e0..648ce508cc 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -26,8 +26,8 @@ #define LCDC_FMAX 200000000 /* LCD Control Register */ -#define LCD_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) #define LCD_RASTER_MODE BIT(0) +#define LCD_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) /* LCD Clock Enable Register */ #define LCD_CORECLKEN BIT(0) #define LCD_LIDDCLKEN BIT(1) @@ -40,29 +40,28 @@ #define LCD_DMA_BURST_8 0x3 #define LCD_DMA_BURST_16 0x4 /* LCD Timing_0 Register */ -#define LCD_HBPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 24) -#define LCD_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) -#define LCD_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) -#define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) #define LCD_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) +#define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) +#define LCD_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) +#define LCD_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) +#define LCD_HBPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 24) /* LCD Timing_1 Register */ -#define LCD_VBP(x) (((x) & GENMASK(7, 0)) << 24) -#define LCD_VFP(x) (((x) & GENMASK(7, 0)) << 16) -#define LCD_VSW(x) ((((x) - 1) & GENMASK(5, 0)) << 10) #define LCD_VERLSB(x) (((x) - 1) & GENMASK(9, 0)) +#define LCD_VSW(x) ((((x) - 1) & GENMASK(5, 0)) << 10) +#define LCD_VFP(x) (((x) & GENMASK(7, 0)) << 16) +#define LCD_VBP(x) (((x) & GENMASK(7, 0)) << 24) /* LCD Timing_2 Register */ -#define LCD_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) -#define LCD_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) -#define LCD_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) #define LCD_HFPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 8) +#define LCD_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) #define LCD_INVMASK(x) ((x) & GENMASK(25, 20)) +#define LCD_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) +#define LCD_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) /* LCD Raster Ctrl Register */ +#define LCD_RASTER_ENABLE BIT(0) +#define LCD_TFT_MODE BIT(7) +#define LCD_PALMODE_RAWDATA (0x02 << 20) #define LCD_TFT_24BPP_MODE BIT(25) #define LCD_TFT_24BPP_UNPACK BIT(26) -#define LCD_PALMODE_RAWDATA (0x02 << 20) -#define LCD_TFT_MODE BIT(7) -#define LCD_RASTER_ENABLE BIT(0) - /* Macro definitions */ #define FBSIZE(x) ((x->hactive * x->vactive * x->bpp) >> 3) From patchwork Sun Feb 16 15:09:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238767 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=h0Z7rYhc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 48L9YY4tMhz9s29 for ; Mon, 17 Feb 2020 02:11:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE33A81293; Sun, 16 Feb 2020 16:10:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="h0Z7rYhc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 044BC81294; Sun, 16 Feb 2020 16:10:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 262BA81282 for ; Sun, 16 Feb 2020 16:10:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYujm1zH; Sun, 16 Feb 2020 16:10:24 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865824; bh=+KxkIMhMtfVrSR0a+sUKPIQaU+eOLjh2xt9Opc3YNMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h0Z7rYhch+DZMQnUDzSetiXePkNxXbLsdkkm/LD/3ZiBuxgyzdKbUshm171abMqds whmedCxvOZvIxCN4sE4uhAEUnO5av2PyTTJAlA7pVLFPcerlfYzSgxW6TMU7DK3/BO vTazDfxSKWSS3gy4W5N0QYM1ZdoDg+3hsA069Y8Y/BIDbzvbUrzFM1JgHrijxsjxIc UpeXn9XajvsjQ6gxLrpOPrvhC7L96iKKjelSGhZGmDmTeXrx+XaBCJ2BJlrYuXJ5vk cW46gY8hvxlZTBr0g7H3Hb5EyJwVtOYnZpv7sQETT9+YfnwWrdXk7EVWeZknWYbC17 +yKRx+bYqSftQ== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=tWXvalQZkjacmm0-tHgA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 05/13] video: omap: rename LCD controller registers Date: Sun, 16 Feb 2020 16:09:34 +0100 Message-Id: <20200216150942.3220-6-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfE9nHTfAt+e95wPsp2HMEgNbgDodJ9jbRpCRuyUekyyHJyKVlHHcxhSlK0oP5ZzhDMenpfJ75XdQHbhDDfYO124IH44LF41LlBilgZcZIVO82IdzoZxn Au3LesOE3UKrVWWMbS3V63NA4YoMex5oVdPRKSEiSnRyG7dwo1pvHQFeMkbN2idqkbc5PK7KQ3Y0XSc8zMgt7/3jVYa8VmzWrjjQAqqCWq+ULwdkqAXEYCGU 5/I0rL3cVXz1IaMjh8GBuuI3xeQElBpd/T8L2Fk+0Fw= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Add more clarity by prefixing the name of the register to the bitfields. Signed-off-by: Dario Binacchi --- Changes in v2: None drivers/video/am335x-fb.c | 107 +++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 648ce508cc..9f488f656e 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -26,42 +26,42 @@ #define LCDC_FMAX 200000000 /* LCD Control Register */ -#define LCD_RASTER_MODE BIT(0) -#define LCD_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) +#define LCDC_CTRL_RASTER_MODE BIT(0) +#define LCDC_CTRL_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) /* LCD Clock Enable Register */ -#define LCD_CORECLKEN BIT(0) -#define LCD_LIDDCLKEN BIT(1) -#define LCD_DMACLKEN BIT(2) +#define LCDC_CLKC_ENABLE_CORECLKEN BIT(0) +#define LCDC_CLKC_ENABLE_LIDDCLKEN BIT(1) +#define LCDC_CLKC_ENABLE_DMACLKEN BIT(2) /* LCD DMA Control Register */ -#define LCD_DMA_BURST_SIZE(x) (((x) & GENMASK(2, 0)) << 4) -#define LCD_DMA_BURST_1 0x0 -#define LCD_DMA_BURST_2 0x1 -#define LCD_DMA_BURST_4 0x2 -#define LCD_DMA_BURST_8 0x3 -#define LCD_DMA_BURST_16 0x4 +#define LCDC_DMA_CTRL_BURST_SIZE(x) (((x) & GENMASK(2, 0)) << 4) +#define LCDC_DMA_CTRL_BURST_1 0x0 +#define LCDC_DMA_CTRL_BURST_2 0x1 +#define LCDC_DMA_CTRL_BURST_4 0x2 +#define LCDC_DMA_CTRL_BURST_8 0x3 +#define LCDC_DMA_CTRL_BURST_16 0x4 /* LCD Timing_0 Register */ -#define LCD_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) -#define LCD_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) -#define LCD_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) -#define LCD_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) -#define LCD_HBPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 24) +#define LCDC_RASTER_TIMING_0_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) +#define LCDC_RASTER_TIMING_0_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) +#define LCDC_RASTER_TIMING_0_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) +#define LCDC_RASTER_TIMING_0_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) +#define LCDC_RASTER_TIMING_0_HBPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 24) /* LCD Timing_1 Register */ -#define LCD_VERLSB(x) (((x) - 1) & GENMASK(9, 0)) -#define LCD_VSW(x) ((((x) - 1) & GENMASK(5, 0)) << 10) -#define LCD_VFP(x) (((x) & GENMASK(7, 0)) << 16) -#define LCD_VBP(x) (((x) & GENMASK(7, 0)) << 24) +#define LCDC_RASTER_TIMING_1_VERLSB(x) (((x) - 1) & GENMASK(9, 0)) +#define LCDC_RASTER_TIMING_1_VSW(x) ((((x) - 1) & GENMASK(5, 0)) << 10) +#define LCDC_RASTER_TIMING_1_VFP(x) (((x) & GENMASK(7, 0)) << 16) +#define LCDC_RASTER_TIMING_1_VBP(x) (((x) & GENMASK(7, 0)) << 24) /* LCD Timing_2 Register */ -#define LCD_HFPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 8) -#define LCD_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) -#define LCD_INVMASK(x) ((x) & GENMASK(25, 20)) -#define LCD_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) -#define LCD_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) +#define LCDC_RASTER_TIMING_2_HFPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 8) +#define LCDC_RASTER_TIMING_2_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) +#define LCDC_RASTER_TIMING_2_INVMASK(x) ((x) & GENMASK(25, 20)) +#define LCDC_RASTER_TIMING_2_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) +#define LCDC_RASTER_TIMING_2_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) /* LCD Raster Ctrl Register */ -#define LCD_RASTER_ENABLE BIT(0) -#define LCD_TFT_MODE BIT(7) -#define LCD_PALMODE_RAWDATA (0x02 << 20) -#define LCD_TFT_24BPP_MODE BIT(25) -#define LCD_TFT_24BPP_UNPACK BIT(26) +#define LCDC_RASTER_CTRL_ENABLE BIT(0) +#define LCDC_RASTER_CTRL_TFT_MODE BIT(7) +#define LCDC_RASTER_CTRL_PALMODE_RAWDATA (0x02 << 20) +#define LCDC_RASTER_CTRL_TFT_24BPP_MODE BIT(25) +#define LCDC_RASTER_CTRL_TFT_24BPP_UNPACK BIT(26) /* Macro definitions */ #define FBSIZE(x) ((x->hactive * x->vactive * x->bpp) >> 3) @@ -131,10 +131,10 @@ int am335xfb_init(struct am335x_lcdpanel *panel) case 16: break; case 32: - raster_ctrl |= LCD_TFT_24BPP_UNPACK; + raster_ctrl |= LCDC_RASTER_CTRL_TFT_24BPP_UNPACK; /* fallthrough */ case 24: - raster_ctrl |= LCD_TFT_24BPP_MODE; + raster_ctrl |= LCDC_RASTER_CTRL_TFT_24BPP_MODE; break; default: pr_err("am335x-fb: invalid bpp value: %d\n", panel->bpp); @@ -198,34 +198,35 @@ int am335xfb_init(struct am335x_lcdpanel *panel) debug("am335x-fb: wait for stable power ...\n"); mdelay(panel->pup_delay); - lcdhw->clkc_enable = LCD_CORECLKEN | LCD_LIDDCLKEN | LCD_DMACLKEN; + lcdhw->clkc_enable = LCDC_CLKC_ENABLE_CORECLKEN | + LCDC_CLKC_ENABLE_LIDDCLKEN | LCDC_CLKC_ENABLE_DMACLKEN; lcdhw->raster_ctrl = 0; - lcdhw->ctrl = LCD_CLK_DIVISOR(best_d) | LCD_RASTER_MODE; + lcdhw->ctrl = LCDC_CTRL_CLK_DIVISOR(best_d) | LCDC_CTRL_RASTER_MODE; lcdhw->lcddma_fb0_base = gd->fb_base; lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel); lcdhw->lcddma_fb1_base = gd->fb_base; lcdhw->lcddma_fb1_ceiling = gd->fb_base + FBSIZE(panel); - lcdhw->lcddma_ctrl = LCD_DMA_BURST_SIZE(LCD_DMA_BURST_16); - - lcdhw->raster_timing0 = LCD_HORLSB(panel->hactive) | - LCD_HORMSB(panel->hactive) | - LCD_HFPLSB(panel->hfp) | - LCD_HBPLSB(panel->hbp) | - LCD_HSWLSB(panel->hsw); - lcdhw->raster_timing1 = LCD_VBP(panel->vbp) | - LCD_VFP(panel->vfp) | - LCD_VSW(panel->vsw) | - LCD_VERLSB(panel->vactive); - lcdhw->raster_timing2 = LCD_HSWMSB(panel->hsw) | - LCD_VERMSB(panel->vactive) | - LCD_INVMASK(panel->pol) | - LCD_HBPMSB(panel->hbp) | - LCD_HFPMSB(panel->hfp) | + lcdhw->lcddma_ctrl = LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_16); + + lcdhw->raster_timing0 = LCDC_RASTER_TIMING_0_HORLSB(panel->hactive) | + LCDC_RASTER_TIMING_0_HORMSB(panel->hactive) | + LCDC_RASTER_TIMING_0_HFPLSB(panel->hfp) | + LCDC_RASTER_TIMING_0_HBPLSB(panel->hbp) | + LCDC_RASTER_TIMING_0_HSWLSB(panel->hsw); + lcdhw->raster_timing1 = LCDC_RASTER_TIMING_1_VBP(panel->vbp) | + LCDC_RASTER_TIMING_1_VFP(panel->vfp) | + LCDC_RASTER_TIMING_1_VSW(panel->vsw) | + LCDC_RASTER_TIMING_1_VERLSB(panel->vactive); + lcdhw->raster_timing2 = LCDC_RASTER_TIMING_2_HSWMSB(panel->hsw) | + LCDC_RASTER_TIMING_2_VERMSB(panel->vactive) | + LCDC_RASTER_TIMING_2_INVMASK(panel->pol) | + LCDC_RASTER_TIMING_2_HBPMSB(panel->hbp) | + LCDC_RASTER_TIMING_2_HFPMSB(panel->hfp) | 0x0000FF00; /* clk cycles for ac-bias */ lcdhw->raster_ctrl = raster_ctrl | - LCD_PALMODE_RAWDATA | - LCD_TFT_MODE | - LCD_RASTER_ENABLE; + LCDC_RASTER_CTRL_PALMODE_RAWDATA | + LCDC_RASTER_CTRL_TFT_MODE | + LCDC_RASTER_CTRL_ENABLE; debug("am335x-fb: waiting picture to be stable.\n."); mdelay(panel->pon_delay); From patchwork Sun Feb 16 15:09:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238768 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=fN1m1YDg; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Yl2WJ1z9s29 for ; Mon, 17 Feb 2020 02:11:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FD7481299; Sun, 16 Feb 2020 16:10:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="fN1m1YDg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E9E181297; Sun, 16 Feb 2020 16:10:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 68ED88129C for ; Sun, 16 Feb 2020 16:10:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LYyjm203; Sun, 16 Feb 2020 16:10:28 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865828; bh=YlkBS5duRpp1jvqz/43IPX2GW+T1lPcCTsYV4MGY7RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fN1m1YDgjcMb/AGY+uCMAL4qJrDE44ckjjcOWGZ7bZPiggFJ2v/2MkaYdrIEspaSf j9K4tPT+hYxEuZBTsPtlzmVEJm5owW0a+97pswQFwaZkAOQXwnJ/Hp4XppzR4qZMVK 8taQNa5iakD6OlvP55f4x6Cn1Eg+ARbj9SUGiCiEpQYVwD/HMUBGcjSdaHXcT0cF+G sDEayf6gB6nxFu/ME41+nKLQFHFZ9yVorVtxFGOdXqhpwHPlJ4piMe/i/MDc83GQZ0 NCeuRxyRe2W2zSsCVw6hmvZwfkAclf5bgobY6CJX/NqWZn+QhJpKSwi0SaaEzl+PXV uw8mENFUCCSsA== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=sozttTNsAAAA:8 a=n7yrQbU8RceXqjBozi8A:9 a=aeg5Gbbo78KNqacMgKqU:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Lokesh Vutla , Anatolij Gustschin Subject: [PATCH v2 06/13] video: omap: fix debug message Date: Sun, 16 Feb 2020 16:09:35 +0100 Message-Id: <20200216150942.3220-7-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfJjeyN5xqkChiWkDR/cqGk0xMpa2AhvB0f/lYuKUj5zSQJnvfcF3ODm1G2RidGHBNyvCvsjYcaTX15w5f3ppcDKIt0aniyoEToErHAg1mIg4xCuNtoAH gsrzRfX5RFUObyfu/CRPn9sluV6a7oyc5Azo1G2qOoJsRg4PzenErqkhPRx+2TNgqhuPJdh0368LmIstr8dGBlg+TM+RM/m0T8hM7xMG6bEF4tjaufk4U4HR hwLt9+2CM8wB7rYV3uOjwu8ur/M939/9UKtnTwWY0Xs= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean "DISP" -> "DIV" Signed-off-by: Dario Binacchi Reviewed-by: Lokesh Vutla --- Changes in v2: None drivers/video/am335x-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 9f488f656e..bbe965af84 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -179,7 +179,7 @@ int am335xfb_init(struct am335x_lcdpanel *panel) } } } - debug("%s: PLL: best error %d Hz (M %d, N %d, DISP %d)\n", + debug("%s: PLL: best error %d Hz (M %d, N %d, DIV %d)\n", __func__, err_r, dpll_disp.m, dpll_disp.n, best_d); do_setup_dpll(&dpll_disp_regs, &dpll_disp); From patchwork Sun Feb 16 15:09:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238769 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=Y5zJ3OEI; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Yx6Nlmz9s29 for ; Mon, 17 Feb 2020 02:11:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA04681259; Sun, 16 Feb 2020 16:10:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="Y5zJ3OEI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD98B81299; Sun, 16 Feb 2020 16:10:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 745D08129E for ; Sun, 16 Feb 2020 16:10:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZ2jm20z; Sun, 16 Feb 2020 16:10:32 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865832; bh=UV7A0ytDymw/xduA1gQ7lZdk0kqpgpFzaczyD1Jdq1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y5zJ3OEI9HsEVwyVbejb97eNQNYJ9mj2BMzIIKQB/85X24xNzGO0xgOLBTEthWSUa Ux14DVfql3S4edgsItfFKp0U8m0ex0AXwUREoNyDTnIZR9pDrc9YwV98MXbEloUfeE gokgk2kMyilJygQF92C8CV4yJ1pO59KSlUDDqxj67EkKPPqKZ5npjp1WfseM8ILijG VoB2n+gYTIMXqAPy5laN94/qSqBvx+sCg8UcPf+wO9S8g40458f9YfAflBzo10ao7e GwCfT4Lc8XtSeBHj3YSddPREq2jenllkIw83hm1pJSICOjhUjRydY2Y/OfZqaSvdXG f1ORQiqsvsLxA== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=sozttTNsAAAA:8 a=Hlasj0uWh6_VJ9nccHgA:9 a=aeg5Gbbo78KNqacMgKqU:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Lokesh Vutla , Anatolij Gustschin Subject: [PATCH v2 07/13] video: omap: add loop exit conditions to the dpll setup Date: Sun, 16 Feb 2020 16:09:36 +0100 Message-Id: <20200216150942.3220-8-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfNevwf9/FMyjWMmVWqzrTk75CwQ3TrlKSCHk3G4op6/Wkp989o0+h17C/YT9JKalwQz2mYmBd2iIdNlRTfIFLbaPwqves4XJZH0CrD0EEoZo/u9CA/mx ZflP+gm8LuuO+XkbJtY2vTxrx3TES7P2FnbGeElUPQ5rWrFLI5Ng6YKt7in1MLvHZs79he5LGQZycGQjqes7nL69OcpzpQje02J+z2JwWalB26wNu5pg5Q5A 2S9lbSrqa5UdoUAn3hZ6We6vKaoKIRhZ/a8+uZ3RAFo= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean In case of null error, round rate is equal to target rate, so it is useless to continue to search the DPLL setup parameters to get the desidered pixel clock rate. Signed-off-by: Dario Binacchi Reviewed-by: Lokesh Vutla --- Changes in v2: None drivers/video/am335x-fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index bbe965af84..684223f275 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -160,7 +160,7 @@ int am335xfb_init(struct am335x_lcdpanel *panel) err = panel->pxl_clk; err_r = err; - for (d = 2; d < 255; d++) { + for (d = 2; err_r && d < 255; d++) { for (m = 2; m < 2047; m++) { if ((V_OSCK * m) < (panel->pxl_clk * d)) continue; @@ -176,6 +176,8 @@ int am335xfb_init(struct am335x_lcdpanel *panel) dpll_disp.m = m; dpll_disp.n = n; best_d = d; + if (err_r == 0) + break; } } } From patchwork Sun Feb 16 15:09:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238770 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=Khy1ulo5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Z96Jhtz9s29 for ; Mon, 17 Feb 2020 02:11:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7325F812B2; Sun, 16 Feb 2020 16:10:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="Khy1ulo5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33E43812A6; Sun, 16 Feb 2020 16:10:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1AC1081297 for ; Sun, 16 Feb 2020 16:10:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZ5jm21r; Sun, 16 Feb 2020 16:10:36 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865836; bh=kNydKl7oDSmfTq7JdbN47txTVGs8UY5miu7ybq+/JaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Khy1ulo5xTy7nKKanf3eRRxpfRriQQrYfkOM4II68ckPUtJ5wH1ZnGyBJlSPx+RZ0 aKztLkpTSODaMdFktgFmrnXlUIzlktOuiUKQCXiL39v8VXp1R//MUy7+HShKSKlix1 LmrOEJW5ew5HYTVwHzJx6Mu0ndIgApqctup44lZketh+AYKqaiM8qXIjXaX9an9ltR OcMsYFqv4j+/GI4tElq55kZqdXGKMFjHtDllDSYZtFdqw5qMYl2MzJ4eVd6U7VAiV8 y/AF25Nx9DBgOvmXKNXOt5sxMixCbYvyP/OVAY+77YGokrn6/nfy4SvK1Z0Pbu/IwX u7ivHC289KIGA== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=rV7QS9GITF_uIU1qImoA:9 a=YaTjfOmZp4nS-Srn:21 a=uFjvIoBRE7AL8MQw:21 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 08/13] video: omap: create two routines to set the pixel clock rate Date: Sun, 16 Feb 2020 16:09:37 +0100 Message-Id: <20200216150942.3220-9-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfBZvTHltUysgV+HJbK/iTmjrENLvne4nzw2wqwFokhjDTgLu25pwzrQIGaerGzxptjjfc3EomdSo1pNZFbJP4Y9UNFNoW776ePUDP5hzaeMqi7nnuA7v bPioopVoMkHDzODSo6sJQyADvn1s0y9tVSZU9GPdCZDS7UjNCGZj6W6wHceu14Z0xICK0BsAboZ5L2lW5YTOF2DyedUwusBU2/YK6RbOYfeuQwDIFkMRnVwQ zWvAd+FGFBRgtD/DA1p6R7rvrNYax/im5rM8YiR6zVI= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Created in preparation to support driver-model, they can also be called from legacy code. In this way, code duplication is avoided. Signed-off-by: Dario Binacchi - Use GENMASK macro for clock divisor mask --- Changes in v2: None drivers/video/am335x-fb.c | 130 ++++++++++++++++++++++++++++---------- 1 file changed, 97 insertions(+), 33 deletions(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 684223f275..c426ff8aec 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "am335x-fb.h" @@ -26,6 +27,7 @@ #define LCDC_FMAX 200000000 /* LCD Control Register */ +#define LCDC_CTRL_CLK_DIVISOR_MASK GENMASK(15, 8) #define LCDC_CTRL_RASTER_MODE BIT(0) #define LCDC_CTRL_CLK_DIVISOR(x) (((x) & GENMASK(7, 0)) << 8) /* LCD Clock Enable Register */ @@ -98,10 +100,95 @@ struct am335x_lcdhw { unsigned int clkc_reset; /* 0x70 */ }; +struct dpll_data { + unsigned long rounded_rate; + u16 rounded_m; + u8 rounded_n; + u8 rounded_div; +}; + static struct am335x_lcdhw *lcdhw = (void *)LCD_CNTL_BASE; DECLARE_GLOBAL_DATA_PTR; +/** + * am335x_dpll_round_rate() - Round a target rate for an OMAP DPLL + * + * @dpll_data: struct dpll_data pointer for the DPLL + * @rate: New DPLL clock rate + * @return rounded rate and the computed m, n and div values in the dpll_data + * structure, or -ve error code. + */ +static ulong am335x_dpll_round_rate(struct dpll_data *dd, ulong rate) +{ + unsigned int m, n, d; + unsigned long rounded_rate; + int err, err_r; + + dd->rounded_rate = -EFAULT; + err = rate; + err_r = err; + + for (d = 2; err && d < 255; d++) { + for (m = 2; m < 2047; m++) { + if ((V_OSCK * m) < (rate * d)) + continue; + + n = (V_OSCK * m) / (rate * d); + if (n > 127) + break; + + if (((V_OSCK * m) / n) > LCDC_FMAX) + break; + + rounded_rate = (V_OSCK * m) / n / d; + err = abs(rounded_rate - rate); + if (err < err_r) { + err_r = err; + dd->rounded_rate = rounded_rate; + dd->rounded_m = m; + dd->rounded_n = n; + dd->rounded_div = d; + if (err == 0) + break; + } + } + } + + debug("DPLL display: best error %d Hz (M %d, N %d, DIV %d)\n", + err_r, dd->rounded_m, dd->rounded_n, dd->rounded_div); + + return dd->rounded_rate; +} + +/** + * am335x_fb_set_pixel_clk_rate() - Set pixel clock rate. + * + * @am335x_lcdhw: Base address of the LCD controller registers. + * @rate: New clock rate in Hz. + * @return new rate, or -ve error code. + */ +static ulong am335x_fb_set_pixel_clk_rate(struct am335x_lcdhw *regs, ulong rate) +{ + struct dpll_params dpll_disp = { 1, 0, 1, -1, -1, -1, -1 }; + struct dpll_data dd; + ulong round_rate; + u32 reg; + + round_rate = am335x_dpll_round_rate(&dd, rate); + if (IS_ERR_VALUE(round_rate)) + return round_rate; + + dpll_disp.m = dd.rounded_m; + dpll_disp.n = dd.rounded_n; + do_setup_dpll(&dpll_disp_regs, &dpll_disp); + + reg = readl(®s->ctrl) & ~LCDC_CTRL_CLK_DIVISOR_MASK; + reg |= LCDC_CTRL_CLK_DIVISOR(dd.rounded_div); + writel(reg, ®s->ctrl); + return round_rate; +} + int lcd_get_size(int *line_length) { *line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8; @@ -111,11 +198,9 @@ int lcd_get_size(int *line_length) int am335xfb_init(struct am335x_lcdpanel *panel) { u32 raster_ctrl = 0; - struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL; - struct dpll_params dpll_disp = { 1, 0, 1, -1, -1, -1, -1 }; - unsigned int m, n, d, best_d = 2; - int err = 0, err_r = 0; + ulong rate; + u32 reg; if (gd->fb_base == 0) { printf("ERROR: no valid fb_base stored in GLOBAL_DATA_PTR!\n"); @@ -156,34 +241,9 @@ int am335xfb_init(struct am335x_lcdpanel *panel) debug("using frambuffer at 0x%08x with size %d.\n", (unsigned int)gd->fb_base, FBSIZE(panel)); - /* setup display pll for requested clock frequency */ - err = panel->pxl_clk; - err_r = err; - - for (d = 2; err_r && d < 255; d++) { - for (m = 2; m < 2047; m++) { - if ((V_OSCK * m) < (panel->pxl_clk * d)) - continue; - n = (V_OSCK * m) / (panel->pxl_clk * d); - if (n > 127) - break; - if (((V_OSCK * m) / n) > LCDC_FMAX) - break; - - err = abs((V_OSCK * m) / n / d - panel->pxl_clk); - if (err < err_r) { - err_r = err; - dpll_disp.m = m; - dpll_disp.n = n; - best_d = d; - if (err_r == 0) - break; - } - } - } - debug("%s: PLL: best error %d Hz (M %d, N %d, DIV %d)\n", - __func__, err_r, dpll_disp.m, dpll_disp.n, best_d); - do_setup_dpll(&dpll_disp_regs, &dpll_disp); + rate = am335x_fb_set_pixel_clk_rate(lcdhw, panel->pxl_clk); + if (IS_ERR_VALUE(rate)) + return rate; /* clock source for LCDC from dispPLL M2 */ writel(0x0, &cmdpll->clklcdcpixelclk); @@ -203,7 +263,11 @@ int am335xfb_init(struct am335x_lcdpanel *panel) lcdhw->clkc_enable = LCDC_CLKC_ENABLE_CORECLKEN | LCDC_CLKC_ENABLE_LIDDCLKEN | LCDC_CLKC_ENABLE_DMACLKEN; lcdhw->raster_ctrl = 0; - lcdhw->ctrl = LCDC_CTRL_CLK_DIVISOR(best_d) | LCDC_CTRL_RASTER_MODE; + + reg = lcdhw->ctrl & LCDC_CTRL_CLK_DIVISOR_MASK; + reg |= LCDC_CTRL_RASTER_MODE; + lcdhw->ctrl = reg; + lcdhw->lcddma_fb0_base = gd->fb_base; lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel); lcdhw->lcddma_fb1_base = gd->fb_base; From patchwork Sun Feb 16 15:09:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238771 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=XIn79U7C; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9ZP1gmKz9s29 for ; Mon, 17 Feb 2020 02:11:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00DC381297; Sun, 16 Feb 2020 16:10:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="XIn79U7C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D279F8129E; Sun, 16 Feb 2020 16:10:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C7D008129E for ; Sun, 16 Feb 2020 16:10:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZAjm231; Sun, 16 Feb 2020 16:10:40 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865840; bh=OMpxuVk7EOgQYQDnQ9NqNgJZMCgCBbgLeXSpBp7WTAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XIn79U7CV3EbcQfHMK8m/S4ZaEjR3B2pBUfKN4gcKpTztT8gcZsENH8mXT6pxuRch aFI5/z73/DH3wapvbo5YTiI16bVNH5J8EwIdA/P3lGyN0pdMrFVldUeA2x2iBwA2W0 ANu4+5y3nPMToRGeMIZNCxig++HJvB+D/QIjNqQat8zWuRWUvCOE8EDFqPCvoP03c6 0ICjfrUe5a3IglNap1BHqVE/pfIBezMhruTfElszfdJ/nagyhkZbe00rQ0kma8XpoK YYzGdOMQ1DXnn+CXNzCQoXFcMTPDaU02hnF83TIWGxfV4rXIhoNj2WBxfEAbrckJme xiOOM9E0seVBw== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=3iA4PtbMAAAA:8 a=Pu4fZREkpHY8gRAzH7gA:9 a=7qkcgxQUqAfmeve9:21 a=aiG8TakS9Hso25ZN:21 a=5R5j_Wwxudb6U4qMCugr:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 09/13] video: omap: add support for DM/DTS Date: Sun, 16 Feb 2020 16:09:38 +0100 Message-Id: <20200216150942.3220-10-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfH/i6V1EAgblZYyxq2PT8+x9tIsR2LoqK77SKVAgDVLzlihMtGkTs66D8LH2tK1mDC/EuK7xcriOlDRJrHb8nBJ3jV4U9ps/g5KybP937OHA3ac+rY47 Sk5F4MP+O5rFgiP5l9D1iqA8w0879PyGkMV+EuC3WWY5TOD0f9s/SX4//JvcaUMU8gpoUpI7rZL1GHAl/l7RgSilL33FyEIH0b46eL2ukvPrUuYgx/ieC//e uA6UhJH5zp5lTFbUJ3LOA9EufwLZ7GYVM1c0QmUFmjY= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Update the driver to support the device tree and the driver model. Timings and panel parameters are now loaded from the device tree. The DM code replaces the am335x_lcdpanel structure with tilcdc_panel_info taken from the linux kernel, as well the management of additional parameters not covered in the legacy code. In addition, the am335x_lcdpanel structure contains parameters and operations that were probably a requirement of the board for which this driver was developed and which, however, were not developed in the linux kernel. All this led to rewrite th DM controller initialization code, except for the pixel clock setting that is executed in a function created in a previous patch with code taken from the legacy am335xfb_init. The patch has been tested on a custom board with u-boot 2018.11-rc2 and the following device-tree configuration: panel { compatible = "ti,tilcdc,panel"; pinctrl-names = "default"; pinctrl-0 = <&lcd_enable_pins>; enable-gpios = <&gpio0 31 0>; backlight = <&backlight>; status = "okay"; u-boot,dm-pre-reloc; panel-info { ac-bias = <255>; ac-bias-intrpt = <0>; dma-burst-sz = <16>; bpp = <16>; fdd = <0x80>; sync-edge = <0>; sync-ctrl = <1>; raster-order = <0>; fifo-th = <0>; }; display-timings { native-mode = <&timing0>; timing0: 800x480 { hactive = <800>; vactive = <480>; hback-porch = <46>; hfront-porch = <210>; hsync-len = <20>; vback-porch = <23>; vfront-porch = <22>; vsync-len = <10>; clock-frequency = <33000000>; hsync-active = <0>; vsync-active = <0>; }; }; }; Signed-off-by: Dario Binacchi Tested-by: Dario Binacchi - Move clock enabling sequence to arch/arm/mach-omap2/ - Create a Kconfig symbol for CONFIG_AM335X_LCD --- Changes in v2: None arch/arm/mach-omap2/am33xx/clock_am33xx.c | 4 + drivers/video/Kconfig | 6 + drivers/video/am335x-fb.c | 337 +++++++++++++++++++++- drivers/video/am335x-fb.h | 4 + 4 files changed, 341 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx/clock_am33xx.c b/arch/arm/mach-omap2/am33xx/clock_am33xx.c index f2cd496607..2427933c8b 100644 --- a/arch/arm/mach-omap2/am33xx/clock_am33xx.c +++ b/arch/arm/mach-omap2/am33xx/clock_am33xx.c @@ -226,6 +226,10 @@ void enable_basic_clocks(void) &cmper->usb0clkctrl, &cmper->emiffwclkctrl, &cmper->emifclkctrl, +#if CONFIG_IS_ENABLED(AM335X_LCD) + &cmper->lcdclkctrl, + &cmper->lcdcclkstctrl, +#endif 0 }; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4c93369702..7c5012a67f 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -473,6 +473,12 @@ config ATMEL_HLCD help HLCDC supports video output to an attached LCD panel. +config AM335X_LCD + bool "Enable AM335x video support" + depends on DM_VIDEO + help + Supports video output to an attached LCD panel. + config LOGICORE_DP_TX bool "Enable Logicore DP TX driver" depends on DISPLAY diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index c426ff8aec..30543a945b 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2013-2018 Hannes Schmelzer * B&R Industrial Automation GmbH - http://www.br-automation.com + * Copyright (C) 2020 Dario Binacchi * * minimal framebuffer driver for TI's AM335x SoC to be compatible with * Wolfgang Denk's LCD-Framework (CONFIG_LCD, common/lcd.c) @@ -11,19 +12,18 @@ * - starts output DMA from gd->fb_base buffer */ #include +#include #include #include #include #include #include +#include #include #include +#include #include "am335x-fb.h" -#if !defined(LCD_CNTL_BASE) -#error "hw-base address of LCD-Controller (LCD_CNTL_BASE) not defined!" -#endif - #define LCDC_FMAX 200000000 /* LCD Control Register */ @@ -41,6 +41,7 @@ #define LCDC_DMA_CTRL_BURST_4 0x2 #define LCDC_DMA_CTRL_BURST_8 0x3 #define LCDC_DMA_CTRL_BURST_16 0x4 +#define LCDC_DMA_CTRL_FIFO_TH(x) (((x) & GENMASK(2, 0)) << 8) /* LCD Timing_0 Register */ #define LCDC_RASTER_TIMING_0_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) #define LCDC_RASTER_TIMING_0_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) @@ -55,19 +56,26 @@ /* LCD Timing_2 Register */ #define LCDC_RASTER_TIMING_2_HFPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 8) #define LCDC_RASTER_TIMING_2_HBPMSB(x) ((((x) - 1) & GENMASK(9, 8)) >> 4) -#define LCDC_RASTER_TIMING_2_INVMASK(x) ((x) & GENMASK(25, 20)) +#define LCDC_RASTER_TIMING_2_ACB(x) (((x) & GENMASK(7, 0)) << 8) +#define LCDC_RASTER_TIMING_2_ACBI(x) (((x) & GENMASK(3, 0)) << 16) +#define LCDC_RASTER_TIMING_2_VSYNC_INVERT BIT(20) +#define LCDC_RASTER_TIMING_2_HSYNC_INVERT BIT(21) +#define LCDC_RASTER_TIMING_2_PXCLK_INVERT BIT(22) +#define LCDC_RASTER_TIMING_2_DE_INVERT BIT(23) +#define LCDC_RASTER_TIMING_2_HSVS_RISEFALL BIT(24) +#define LCDC_RASTER_TIMING_2_HSVS_CONTROL BIT(25) #define LCDC_RASTER_TIMING_2_VERMSB(x) ((((x) - 1) & BIT(10)) << 16) #define LCDC_RASTER_TIMING_2_HSWMSB(x) ((((x) - 1) & GENMASK(9, 6)) << 21) /* LCD Raster Ctrl Register */ #define LCDC_RASTER_CTRL_ENABLE BIT(0) #define LCDC_RASTER_CTRL_TFT_MODE BIT(7) +#define LCDC_RASTER_CTRL_DATA_ORDER BIT(8) +#define LCDC_RASTER_CTRL_REQDLY(x) (((x) & GENMASK(7, 0)) << 12) #define LCDC_RASTER_CTRL_PALMODE_RAWDATA (0x02 << 20) +#define LCDC_RASTER_CTRL_TFT_ALT_ENABLE BIT(23) #define LCDC_RASTER_CTRL_TFT_24BPP_MODE BIT(25) #define LCDC_RASTER_CTRL_TFT_24BPP_UNPACK BIT(26) -/* Macro definitions */ -#define FBSIZE(x) ((x->hactive * x->vactive * x->bpp) >> 3) - struct am335x_lcdhw { unsigned int pid; /* 0x00 */ unsigned int ctrl; /* 0x04 */ @@ -107,8 +115,6 @@ struct dpll_data { u8 rounded_div; }; -static struct am335x_lcdhw *lcdhw = (void *)LCD_CNTL_BASE; - DECLARE_GLOBAL_DATA_PTR; /** @@ -189,6 +195,19 @@ static ulong am335x_fb_set_pixel_clk_rate(struct am335x_lcdhw *regs, ulong rate) return round_rate; } +#if !CONFIG_IS_ENABLED(DM_VIDEO) + +#if !defined(LCD_CNTL_BASE) +#error "hw-base address of LCD-Controller (LCD_CNTL_BASE) not defined!" +#endif + +/* Macro definitions */ +#define FBSIZE(x) (((x)->hactive * (x)->vactive * (x)->bpp) >> 3) + +#define LCDC_RASTER_TIMING_2_INVMASK(x) ((x) & GENMASK(25, 20)) + +static struct am335x_lcdhw *lcdhw = (void *)LCD_CNTL_BASE; + int lcd_get_size(int *line_length) { *line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8; @@ -299,3 +318,301 @@ int am335xfb_init(struct am335x_lcdpanel *panel) return 0; } + +#else /* CONFIG_DM_VIDEO */ + +#define FBSIZE(t, p) (((t)->hactive.typ * (t)->vactive.typ * (p)->bpp) >> 3) + +enum { + LCD_MAX_WIDTH = 2048, + LCD_MAX_HEIGHT = 2048, + LCD_MAX_LOG2_BPP = VIDEO_BPP32, +}; + +/** + * tilcdc_panel_info: Panel parameters + * + * @ac_bias: AC Bias Pin Frequency + * @ac_bias_intrpt: AC Bias Pin Transitions per Interrupt + * @dma_burst_sz: DMA burst size + * @bpp: Bits per pixel + * @fdd: FIFO DMA Request Delay + * @tft_alt_mode: TFT Alternative Signal Mapping (Only for active) + * @invert_pxl_clk: Invert pixel clock + * @sync_edge: Horizontal and Vertical Sync Edge: 0=rising 1=falling + * @sync_ctrl: Horizontal and Vertical Sync: Control: 0=ignore + * @raster_order: Raster Data Order Select: 1=Most-to-least 0=Least-to-most + * @fifo_th: DMA FIFO threshold + */ +struct tilcdc_panel_info { + u32 ac_bias; + u32 ac_bias_intrpt; + u32 dma_burst_sz; + u32 bpp; + u32 fdd; + bool tft_alt_mode; + bool invert_pxl_clk; + u32 sync_edge; + u32 sync_ctrl; + u32 raster_order; + u32 fifo_th; +}; + +struct am335x_fb_priv { + struct am335x_lcdhw *regs; + struct tilcdc_panel_info panel; + struct display_timing timing; +}; + +static int am335x_fb_remove(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + + uc_plat->base -= 0x20; + uc_plat->size += 0x20; + return 0; +} + +static int am335x_fb_probe(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + struct video_priv *uc_priv = dev_get_uclass_priv(dev); + struct am335x_fb_priv *priv = dev_get_priv(dev); + struct am335x_lcdhw *regs = priv->regs; + struct tilcdc_panel_info *panel = &priv->panel; + struct display_timing *timing = &priv->timing; + struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL; + u32 reg; + + /* Before relocation we don't need to do anything */ + if (!(gd->flags & GD_FLG_RELOC)) + return 0; + + am335x_fb_set_pixel_clk_rate(regs, timing->pixelclock.typ); + + /* clock source for LCDC from dispPLL M2 */ + writel(0, &cmdpll->clklcdcpixelclk); + + /* palette default entry */ + memset((void *)uc_plat->base, 0, 0x20); + *(unsigned int *)uc_plat->base = 0x4000; + /* point fb behind palette */ + uc_plat->base += 0x20; + uc_plat->size -= 0x20; + + writel(LCDC_CLKC_ENABLE_CORECLKEN | LCDC_CLKC_ENABLE_LIDDCLKEN | + LCDC_CLKC_ENABLE_DMACLKEN, ®s->clkc_enable); + writel(0, ®s->raster_ctrl); + + reg = readl(®s->ctrl) & LCDC_CTRL_CLK_DIVISOR_MASK; + reg |= LCDC_CTRL_RASTER_MODE; + writel(reg, ®s->ctrl); + + writel(uc_plat->base, ®s->lcddma_fb0_base); + writel(uc_plat->base + FBSIZE(timing, panel), + ®s->lcddma_fb0_ceiling); + writel(uc_plat->base, ®s->lcddma_fb1_base); + writel(uc_plat->base + FBSIZE(timing, panel), + ®s->lcddma_fb1_ceiling); + + reg = LCDC_DMA_CTRL_FIFO_TH(panel->fifo_th); + switch (panel->dma_burst_sz) { + case 1: + reg |= LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_1); + break; + case 2: + reg |= LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_2); + break; + case 4: + reg |= LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_4); + break; + case 8: + reg |= LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_8); + break; + case 16: + reg |= LCDC_DMA_CTRL_BURST_SIZE(LCDC_DMA_CTRL_BURST_16); + break; + } + + writel(reg, ®s->lcddma_ctrl); + + writel(LCDC_RASTER_TIMING_0_HORLSB(timing->hactive.typ) | + LCDC_RASTER_TIMING_0_HORMSB(timing->hactive.typ) | + LCDC_RASTER_TIMING_0_HFPLSB(timing->hfront_porch.typ) | + LCDC_RASTER_TIMING_0_HBPLSB(timing->hback_porch.typ) | + LCDC_RASTER_TIMING_0_HSWLSB(timing->hsync_len.typ), + ®s->raster_timing0); + + writel(LCDC_RASTER_TIMING_1_VBP(timing->vback_porch.typ) | + LCDC_RASTER_TIMING_1_VFP(timing->vfront_porch.typ) | + LCDC_RASTER_TIMING_1_VSW(timing->vsync_len.typ) | + LCDC_RASTER_TIMING_1_VERLSB(timing->vactive.typ), + ®s->raster_timing1); + + reg = LCDC_RASTER_TIMING_2_ACB(panel->ac_bias) | + LCDC_RASTER_TIMING_2_ACBI(panel->ac_bias_intrpt) | + LCDC_RASTER_TIMING_2_HSWMSB(timing->hsync_len.typ) | + LCDC_RASTER_TIMING_2_VERMSB(timing->vactive.typ) | + LCDC_RASTER_TIMING_2_HBPMSB(timing->hback_porch.typ) | + LCDC_RASTER_TIMING_2_HFPMSB(timing->hfront_porch.typ); + + if (timing->flags & DISPLAY_FLAGS_VSYNC_LOW) + reg |= LCDC_RASTER_TIMING_2_VSYNC_INVERT; + + if (timing->flags & DISPLAY_FLAGS_HSYNC_LOW) + reg |= LCDC_RASTER_TIMING_2_HSYNC_INVERT; + + if (panel->invert_pxl_clk) + reg |= LCDC_RASTER_TIMING_2_PXCLK_INVERT; + + if (panel->sync_edge) + reg |= LCDC_RASTER_TIMING_2_HSVS_RISEFALL; + + if (panel->sync_ctrl) + reg |= LCDC_RASTER_TIMING_2_HSVS_CONTROL; + + writel(reg, ®s->raster_timing2); + + reg = LCDC_RASTER_CTRL_PALMODE_RAWDATA | LCDC_RASTER_CTRL_TFT_MODE | + LCDC_RASTER_CTRL_ENABLE | LCDC_RASTER_CTRL_REQDLY(panel->fdd); + + if (panel->tft_alt_mode) + reg |= LCDC_RASTER_CTRL_TFT_ALT_ENABLE; + + if (panel->bpp == 24) + reg |= LCDC_RASTER_CTRL_TFT_24BPP_MODE; + else if (panel->bpp == 32) + reg |= LCDC_RASTER_CTRL_TFT_24BPP_MODE | + LCDC_RASTER_CTRL_TFT_24BPP_UNPACK; + + if (panel->raster_order) + reg |= LCDC_RASTER_CTRL_DATA_ORDER; + + writel(reg, ®s->raster_ctrl); + + uc_priv->xsize = timing->hactive.typ; + uc_priv->ysize = timing->vactive.typ; + uc_priv->bpix = log_2_n_round_up(panel->bpp); + return 0; +} + +static int am335x_fb_ofdata_to_platdata(struct udevice *dev) +{ + struct am335x_fb_priv *priv = dev_get_priv(dev); + struct tilcdc_panel_info *panel = &priv->panel; + struct display_timing *timing = &priv->timing; + ofnode node; + int err; + + node = ofnode_by_compatible(ofnode_null(), "ti,am33xx-tilcdc"); + if (!ofnode_valid(node)) { + dev_err(dev, "missing 'ti,am33xx-tilcdc' node\n"); + return -ENXIO; + } + + priv->regs = (struct am335x_lcdhw *)ofnode_get_addr(node); + dev_dbg(dev, "LCD: base address=0x%x\n", (unsigned int)priv->regs); + + err = ofnode_decode_display_timing(dev_ofnode(dev), 0, timing); + if (err) { + dev_err(dev, "failed to get display timing\n"); + return err; + } + + if (timing->pixelclock.typ > (LCDC_FMAX / 2)) { + dev_err(dev, "invalid display clock-frequency: %d Hz\n", + timing->pixelclock.typ); + return -EINVAL; + } + + if (timing->hactive.typ > LCD_MAX_WIDTH) + timing->hactive.typ = LCD_MAX_WIDTH; + + if (timing->vactive.typ > LCD_MAX_HEIGHT) + timing->vactive.typ = LCD_MAX_HEIGHT; + + node = ofnode_find_subnode(dev_ofnode(dev), "panel-info"); + if (!ofnode_valid(node)) { + dev_err(dev, "missing 'panel-info' node\n"); + return -ENXIO; + } + + err |= ofnode_read_u32(node, "ac-bias", &panel->ac_bias); + err |= ofnode_read_u32(node, "ac-bias-intrpt", &panel->ac_bias_intrpt); + err |= ofnode_read_u32(node, "dma-burst-sz", &panel->dma_burst_sz); + err |= ofnode_read_u32(node, "bpp", &panel->bpp); + err |= ofnode_read_u32(node, "fdd", &panel->fdd); + err |= ofnode_read_u32(node, "sync-edge", &panel->sync_edge); + err |= ofnode_read_u32(node, "sync-ctrl", &panel->sync_ctrl); + err |= ofnode_read_u32(node, "raster-order", &panel->raster_order); + err |= ofnode_read_u32(node, "fifo-th", &panel->fifo_th); + if (err) { + dev_err(dev, "failed to get panel info\n"); + return err; + } + + switch (panel->bpp) { + case 16: + case 24: + case 32: + break; + default: + dev_err(dev, "invalid seting, bpp: %d\n", panel->bpp); + return -EINVAL; + } + + switch (panel->dma_burst_sz) { + case 1: + case 2: + case 4: + case 8: + case 16: + break; + default: + dev_err(dev, "invalid setting, dma-burst-sz: %d\n", + panel->dma_burst_sz); + return -EINVAL; + } + + /* optional */ + panel->tft_alt_mode = ofnode_read_bool(node, "tft-alt-mode"); + panel->invert_pxl_clk = ofnode_read_bool(node, "invert-pxl-clk"); + + dev_dbg(dev, "LCD: %dx%d, bpp=%d, clk=%d Hz\n", timing->hactive.typ, + timing->vactive.typ, panel->bpp, timing->pixelclock.typ); + dev_dbg(dev, " hbp=%d, hfp=%d, hsw=%d\n", timing->hback_porch.typ, + timing->hfront_porch.typ, timing->hsync_len.typ); + dev_dbg(dev, " vbp=%d, vfp=%d, vsw=%d\n", timing->vback_porch.typ, + timing->vfront_porch.typ, timing->vsync_len.typ); + + return 0; +} + +static int am335x_fb_bind(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + + uc_plat->size = ((LCD_MAX_WIDTH * LCD_MAX_HEIGHT * + (1 << LCD_MAX_LOG2_BPP)) >> 3) + 0x20; + + dev_dbg(dev, "frame buffer size 0x%x\n", uc_plat->size); + return 0; +} + +static const struct udevice_id am335x_fb_ids[] = { + { .compatible = "ti,tilcdc,panel" }, + { } +}; + +U_BOOT_DRIVER(am335x_fb) = { + .name = "am335x_fb", + .id = UCLASS_VIDEO, + .of_match = am335x_fb_ids, + .bind = am335x_fb_bind, + .ofdata_to_platdata = am335x_fb_ofdata_to_platdata, + .probe = am335x_fb_probe, + .remove = am335x_fb_remove, + .priv_auto_alloc_size = sizeof(struct am335x_fb_priv), +}; + +#endif /* CONFIG_DM_VIDEO */ diff --git a/drivers/video/am335x-fb.h b/drivers/video/am335x-fb.h index ad9b015e09..c9f92bc389 100644 --- a/drivers/video/am335x-fb.h +++ b/drivers/video/am335x-fb.h @@ -7,6 +7,8 @@ #ifndef AM335X_FB_H #define AM335X_FB_H +#if !CONFIG_IS_ENABLED(DM_VIDEO) + #define HSVS_CONTROL BIT(25) /* * 0 = lcd_lp and lcd_fp are driven on * opposite edges of pixel clock than @@ -68,4 +70,6 @@ struct am335x_lcdpanel { int am335xfb_init(struct am335x_lcdpanel *panel); +#endif /* CONFIG_DM_VIDEO */ + #endif /* AM335X_FB_H */ From patchwork Sun Feb 16 15:09:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238772 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=libero.it 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=s2014 header.b=oSgrm15m; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Zc5Jfmz9s29 for ; Mon, 17 Feb 2020 02:12:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4087E812AB; Sun, 16 Feb 2020 16:10:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="oSgrm15m"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 111ED81297; Sun, 16 Feb 2020 16:10:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A38481297 for ; Sun, 16 Feb 2020 16:10:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZEjm246; Sun, 16 Feb 2020 16:10:45 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865845; bh=mV1kK7yfVSJ7+CRkJzte2YMLHVLx3mEepkr2/EhZVpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oSgrm15mSZ/UuHlV34tytoZ5NpU6vk5dZ9GJNTFbqo7rV0uWKdoMeTvQpf9ktN3cY Jbv1Ouwx0IOYD5M9Z/WI2iwSs5SD/sHwU2fLCMdCCfVj6mBXTgkp+8wF0fhmmSO6h8 ZC0YUnPWDde8pFZYuG/RF6xwWGShKpCOwCY3e6EbMoPaFC1L3p1xdxUNCHwUAA1cIF hFmf6Nn6pzBXI9srJodD2Nf6UMrpDXKukrk3hqQ28OY+UDlh/InSrrnvjEJ+WyNxy/ rm+B5Xgs5pXG2eUt7zQSRdhyDDhfsUogDh4KxSokOSntDGA84BVXpEZS4GvJcyIrb4 avBUujm/tmo4w== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=TwFtR1TAINEIWl22nz8A:9 a=Pvd1JgDF0mXJYcZs9yW8:22 a=p-dnK0njbqwfn1k4-x12:22 a=jjky5lfK57Ii_Ajn6BuG:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Adam Ford , Bartosz Golaszewski , Felix Brack , Grygorii Strashko , Hannes Schmelzer , Jagan Teki , Lokesh Vutla , Martyn Welch , Moses Christopher , Neil Armstrong , Simon Goldschmidt , Sjoerd Simons , Stefan Roese , Tom Rini Subject: [PATCH v2 10/13] arm: dts: am335x: add 'u-boot, dm-pre-reloc' to panel Date: Sun, 16 Feb 2020 16:09:39 +0100 Message-Id: <20200216150942.3220-11-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfLxV9smTK0zal7K44unvbvg5uvvlZLc6PrRFPIFPER9xaicBCQpTxjpHq019wCtqH1bqG2krsY9TMNtZ6NqUurX5obg1LG71+WzwpudLHLR/+oTx5n9C y/QxFn/5fvQRi06rMo6+vxMCxx1bgUw259ZoMS9fc0ndIFajMIy0mWIF7z/RgT4fnTu/hrIq4g3jnTctOr0rO9GMlUhqhFronX+17dmNVU+LJthLrnf02P1Q Yq/rQXz8TA7I2TCUWJuJQ3jTj+yS/0rLlEK0Tf6Ymv+SpXyOCV8eAJNqyBWnGLBkquchBRP7csWNhxWxJ9koia+ezY0wf8IHyTSUgbF7e0eUoCOpDeonpzYR 9wB/cgjchbi9USzwg1TdBxN0E7e0N1zAyMVxNL1juSSn1kXC/4GT+lhznGQW1s1LMjfmeOojzFvHuoY/N9ajpdcPfXbvaUjlkODOjHDA1GvrzTjy6KTLyn8g 0Ir70Rfk7NrVd8hbN/l61B8G82kSjr/LEnl3+yPBDdBPRH2RIamuT50yVxGGagy45NBB66X1i5aZLbf5K9qsZzHNg1LY7A31x5tGlyqeBxMyQAXYqfAddg2i ShL1HyVqz/WLaMAehQQqWOtIpt5Gdbzj+VZGG3NRf1UZda2wu2U/p1qzjZPtz5bJkperbPpHBn7xOoeEJVsIPt5mQjCq87djpoeLuwuEIsm4zoemjqiYVIbK kstkrQHstSE= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Add the "u-boot,dm-pre-reloc" property to the "ti,tilcdc,panel" compatible node. In this way the video-uclass module can allocate the amount of memory needed to be assigned to the frame buffer. In the case of the boards that support Linux, the addition of the property in the *-u-boot.dtsi file still required changing its dts file adding a label to the panel node in order to be referenced. Signed-off-by: Dario Binacchi - Change subject line in: arm: dts: am335x: - Move 'u-boot,dm-pre-reloc' property in *-u-boot.dtsi files for boards tha support Linux - Ran building tests with CONFIG_AM335X_LCD enabled and disabled for following configurations: - brxre1_defconfig --> success - am335x_guardian_defconfig --> success - am335x_evm_defconfig --> success - da850evm_defconfig --> failure with CONFIG_AM335X_LCD enabled Enabling CONFIG_AM335X_LCD causes building errors even without applying the patch. The driver has never been enabled on the da850 and must be adapted for this platform. Reviewed-by: Tom Rini --- Changes in v2: None arch/arm/dts/am335x-brppt1-mmc.dts | 2 ++ arch/arm/dts/am335x-brppt1-nand.dts | 2 ++ arch/arm/dts/am335x-brppt1-spi.dts | 2 ++ arch/arm/dts/am335x-brsmarc1.dts | 1 + arch/arm/dts/am335x-brxre1.dts | 2 ++ arch/arm/dts/am335x-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/am335x-evm.dts | 2 +- arch/arm/dts/am335x-evmsk-u-boot.dtsi | 10 ++++++++++ arch/arm/dts/am335x-evmsk.dts | 2 +- arch/arm/dts/am335x-guardian-u-boot.dtsi | 4 ++++ arch/arm/dts/am335x-guardian.dts | 2 +- arch/arm/dts/am335x-pdu001-u-boot.dtsi | 4 ++++ arch/arm/dts/am335x-pdu001.dts | 2 +- arch/arm/dts/am335x-pxm50-u-boot.dtsi | 10 ++++++++++ arch/arm/dts/am335x-pxm50.dts | 2 +- arch/arm/dts/am335x-rut-u-boot.dtsi | 10 ++++++++++ arch/arm/dts/am335x-rut.dts | 2 +- arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/da850-evm.dts | 2 +- 19 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 arch/arm/dts/am335x-evmsk-u-boot.dtsi create mode 100644 arch/arm/dts/am335x-pxm50-u-boot.dtsi create mode 100644 arch/arm/dts/am335x-rut-u-boot.dtsi diff --git a/arch/arm/dts/am335x-brppt1-mmc.dts b/arch/arm/dts/am335x-brppt1-mmc.dts index 9be34d9da0..6f919711f0 100644 --- a/arch/arm/dts/am335x-brppt1-mmc.dts +++ b/arch/arm/dts/am335x-brppt1-mmc.dts @@ -53,6 +53,8 @@ bkl-pwm = <&pwmbacklight>; bkl-tps = <&tps_bl>; + u-boot,dm-pre-reloc; + panel-info { ac-bias = <255>; ac-bias-intrpt = <0>; diff --git a/arch/arm/dts/am335x-brppt1-nand.dts b/arch/arm/dts/am335x-brppt1-nand.dts index 11bd5c551c..9d4340f591 100644 --- a/arch/arm/dts/am335x-brppt1-nand.dts +++ b/arch/arm/dts/am335x-brppt1-nand.dts @@ -53,6 +53,8 @@ bkl-pwm = <&pwmbacklight>; bkl-tps = <&tps_bl>; + u-boot,dm-pre-reloc; + panel-info { ac-bias = <255>; ac-bias-intrpt = <0>; diff --git a/arch/arm/dts/am335x-brppt1-spi.dts b/arch/arm/dts/am335x-brppt1-spi.dts index 01ab74be5e..c078af8fba 100644 --- a/arch/arm/dts/am335x-brppt1-spi.dts +++ b/arch/arm/dts/am335x-brppt1-spi.dts @@ -54,6 +54,8 @@ bkl-pwm = <&pwmbacklight>; bkl-tps = <&tps_bl>; + u-boot,dm-pre-reloc; + panel-info { ac-bias = <255>; ac-bias-intrpt = <0>; diff --git a/arch/arm/dts/am335x-brsmarc1.dts b/arch/arm/dts/am335x-brsmarc1.dts index a63fc2da22..7e9516e8f8 100644 --- a/arch/arm/dts/am335x-brsmarc1.dts +++ b/arch/arm/dts/am335x-brsmarc1.dts @@ -59,6 +59,7 @@ /*backlight = <&tps_bl>; */ compatible = "ti,tilcdc,panel"; status = "okay"; + u-boot,dm-pre-reloc; panel-info { ac-bias = <255>; diff --git a/arch/arm/dts/am335x-brxre1.dts b/arch/arm/dts/am335x-brxre1.dts index 33d8ab78d8..6091a12fb7 100644 --- a/arch/arm/dts/am335x-brxre1.dts +++ b/arch/arm/dts/am335x-brxre1.dts @@ -79,6 +79,8 @@ backlight = <&tps_bl>; + u-boot,dm-pre-reloc; + panel-info { ac-bias = <255>; ac-bias-intrpt = <0>; diff --git a/arch/arm/dts/am335x-evm-u-boot.dtsi b/arch/arm/dts/am335x-evm-u-boot.dtsi index b6b97ed16d..fc0250bd24 100644 --- a/arch/arm/dts/am335x-evm-u-boot.dtsi +++ b/arch/arm/dts/am335x-evm-u-boot.dtsi @@ -8,6 +8,10 @@ status = "disabled"; }; +&panel { + u-boot,dm-pre-reloc; +}; + &usb0 { dr_mode = "peripheral"; }; diff --git a/arch/arm/dts/am335x-evm.dts b/arch/arm/dts/am335x-evm.dts index 0bda4d4429..4aa8c78003 100644 --- a/arch/arm/dts/am335x-evm.dts +++ b/arch/arm/dts/am335x-evm.dts @@ -104,7 +104,7 @@ default-brightness-level = <8>; }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; status = "okay"; pinctrl-names = "default"; diff --git a/arch/arm/dts/am335x-evmsk-u-boot.dtsi b/arch/arm/dts/am335x-evmsk-u-boot.dtsi new file mode 100644 index 0000000000..1105ec471f --- /dev/null +++ b/arch/arm/dts/am335x-evmsk-u-boot.dtsi @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * am335x-evmsk U-Boot Additions + * + * Copyright (C) 2020 Dario Binacchi + */ + +&panel { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/am335x-evmsk.dts b/arch/arm/dts/am335x-evmsk.dts index 5762967cf7..1fff1095c9 100644 --- a/arch/arm/dts/am335x-evmsk.dts +++ b/arch/arm/dts/am335x-evmsk.dts @@ -166,7 +166,7 @@ }; }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&lcd_pins_default>; diff --git a/arch/arm/dts/am335x-guardian-u-boot.dtsi b/arch/arm/dts/am335x-guardian-u-boot.dtsi index 156b9b0e83..77d6e90598 100644 --- a/arch/arm/dts/am335x-guardian-u-boot.dtsi +++ b/arch/arm/dts/am335x-guardian-u-boot.dtsi @@ -22,6 +22,10 @@ u-boot,dm-pre-reloc; }; +&panel { + u-boot,dm-pre-reloc; +}; + &rtc { clocks = <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "int-clk"; diff --git a/arch/arm/dts/am335x-guardian.dts b/arch/arm/dts/am335x-guardian.dts index 5ed2133e78..bd3c890a37 100644 --- a/arch/arm/dts/am335x-guardian.dts +++ b/arch/arm/dts/am335x-guardian.dts @@ -62,7 +62,7 @@ }; }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>; diff --git a/arch/arm/dts/am335x-pdu001-u-boot.dtsi b/arch/arm/dts/am335x-pdu001-u-boot.dtsi index 84a07bdef4..301959a361 100644 --- a/arch/arm/dts/am335x-pdu001-u-boot.dtsi +++ b/arch/arm/dts/am335x-pdu001-u-boot.dtsi @@ -44,3 +44,7 @@ &mmc2_pins { u-boot,dm-pre-reloc; }; + +&panel { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/am335x-pdu001.dts b/arch/arm/dts/am335x-pdu001.dts index ae43d61f4e..c7f512852e 100644 --- a/arch/arm/dts/am335x-pdu001.dts +++ b/arch/arm/dts/am335x-pdu001.dts @@ -49,7 +49,7 @@ regulator-boot-on; }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; status = "okay"; pinctrl-names = "default"; diff --git a/arch/arm/dts/am335x-pxm50-u-boot.dtsi b/arch/arm/dts/am335x-pxm50-u-boot.dtsi new file mode 100644 index 0000000000..f69fd384ac --- /dev/null +++ b/arch/arm/dts/am335x-pxm50-u-boot.dtsi @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * am335x-pxm50 U-Boot Additions + * + * Copyright (C) 2020 Dario Binacchi + */ + +&panel { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/am335x-pxm50.dts b/arch/arm/dts/am335x-pxm50.dts index f4e66d29d5..dcd3f6732f 100644 --- a/arch/arm/dts/am335x-pxm50.dts +++ b/arch/arm/dts/am335x-pxm50.dts @@ -16,7 +16,7 @@ model = "PXM2/PXM50"; compatible = "ti,am335x-evm", "ti,am33xx"; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; backlight = <&backlight0>; pinctrl-names = "default"; diff --git a/arch/arm/dts/am335x-rut-u-boot.dtsi b/arch/arm/dts/am335x-rut-u-boot.dtsi new file mode 100644 index 0000000000..b351eba6ee --- /dev/null +++ b/arch/arm/dts/am335x-rut-u-boot.dtsi @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * am335x-rut U-Boot Additions + * + * Copyright (C) 2020 Dario Binacchi + */ + +&panel { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/am335x-rut.dts b/arch/arm/dts/am335x-rut.dts index 145247344f..0278bb4dcd 100644 --- a/arch/arm/dts/am335x-rut.dts +++ b/arch/arm/dts/am335x-rut.dts @@ -86,7 +86,7 @@ reg = <0x80000000 0x10000000>; /* 256 MB */ }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; pinctrl-names = "default"; pinctrl-0 = <&lcd_pins_s0>; diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi b/arch/arm/dts/da850-evm-u-boot.dtsi index aa42d30c72..a3c9ab19b9 100644 --- a/arch/arm/dts/da850-evm-u-boot.dtsi +++ b/arch/arm/dts/da850-evm-u-boot.dtsi @@ -28,6 +28,10 @@ u-boot,dm-spl; }; +&panel { + u-boot,dm-pre-reloc; +}; + &serial2 { u-boot,dm-spl; }; diff --git a/arch/arm/dts/da850-evm.dts b/arch/arm/dts/da850-evm.dts index f04bc3e153..b1b1158411 100644 --- a/arch/arm/dts/da850-evm.dts +++ b/arch/arm/dts/da850-evm.dts @@ -42,7 +42,7 @@ default-brightness-level = <7>; }; - panel { + panel: panel { compatible = "ti,tilcdc,panel"; pinctrl-names = "default"; pinctrl-0 = <&lcd_pins>; From patchwork Sun Feb 16 15:09:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238773 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=cQkTQ+yK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9Zq5RVWz9s29 for ; Mon, 17 Feb 2020 02:12:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E5C5812B9; Sun, 16 Feb 2020 16:11:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="cQkTQ+yK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6DB6381297; Sun, 16 Feb 2020 16:10:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8522812AA for ; Sun, 16 Feb 2020 16:10:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZKjm25p; Sun, 16 Feb 2020 16:10:50 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865850; bh=o8/AjNJBrp+Ox4xe5fuzbnRbIbfbS2IQe+ZyKrBAx3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cQkTQ+yK2w6S4Lnhbrs8L5CNFqE5rBjbZVooGfUw/T8AimA7nEyxUxjXv7+Sn6DnC Eqtsr88dJbf6+14iSrW1ZxJEGD+mJ3viJDqYHeubEGm/YPxAsJxvW7U4F8N+Gzlkho dURS5ABsha8v2I30nVWcqp1cMGCrXTnDW6mS4flixeL+xzo120u2qo8O7m723zExmt 4Dr7mjRrFEiwzvYvmDJkOhdTrDAbEIbkjYSZvEmtFYOzJLQ106IUVvkkJiAsjnRIay fFDJ6gL4N7NNpSeVAdEybcEdUpJ2755ueSHsdX8eENs/CvM8u5zyuj+ONtdBzGFfVj AKM/n8Xpb32xQ== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=cm27Pg_UAAAA:8 a=sozttTNsAAAA:8 a=ClIjyz9EBEid75TcmjgA:9 a=oEweslz66f4wYtX8:21 a=SuhC9BGWC96LqlvT:21 a=xmb-EsYY8bH0VWELuYED:22 a=aeg5Gbbo78KNqacMgKqU:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Simon Glass , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 11/13] fdt: video: omap: add framebuffer and panel bindings Date: Sun, 16 Feb 2020 16:09:40 +0100 Message-Id: <20200216150942.3220-12-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfAA8h63FrMNQqPbH04ahGpOsN4K7jnUJjHVkdNzSPctUJVviLGs0tPY4qETu/JsYH3ugoGTFNJfEFA6usrqzM8GMtipj/4ODV/bTpMKgcscCJlAyoJE/ QmOZD1xyR+HqG3u1bLIf2LDF450JCGzwWafraO+8y763XOBmDURCDz/0N9hqwp6gjWyhCKrEMjJwKdLdOobxZMyVwqOFLXZkVuK+3L7rtE7gU9MGVMJ0PY28 P+MyCrfUbnbgvBc3nn0JofbiyWSaWwXPiTzadBguVDQVITCCIkKrahvXQMKk+Y4A X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Add device-tree binding documentation for ti framebuffer and generic panel output driver. Signed-off-by: Dario Binacchi Reviewed-by: Simon Glass --- Changes in v2: None .../video/tilcdc/panel.txt | 66 +++++++++++++++ .../video/tilcdc/tilcdc.txt | 82 +++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 doc/device-tree-bindings/video/tilcdc/panel.txt create mode 100644 doc/device-tree-bindings/video/tilcdc/tilcdc.txt diff --git a/doc/device-tree-bindings/video/tilcdc/panel.txt b/doc/device-tree-bindings/video/tilcdc/panel.txt new file mode 100644 index 0000000000..808216310e --- /dev/null +++ b/doc/device-tree-bindings/video/tilcdc/panel.txt @@ -0,0 +1,66 @@ +Device-Tree bindings for tilcdc DRM generic panel output driver + +Required properties: + - compatible: value should be "ti,tilcdc,panel". + - panel-info: configuration info to configure LCDC correctly for the panel + - ac-bias: AC Bias Pin Frequency + - ac-bias-intrpt: AC Bias Pin Transitions per Interrupt + - dma-burst-sz: DMA burst size + - bpp: Bits per pixel + - fdd: FIFO DMA Request Delay + - sync-edge: Horizontal and Vertical Sync Edge: 0=rising 1=falling + - sync-ctrl: Horizontal and Vertical Sync: Control: 0=ignore + - raster-order: Raster Data Order Select: 1=Most-to-least 0=Least-to-most + - fifo-th: DMA FIFO threshold + - display-timings: typical videomode of lcd panel. Multiple video modes + can be listed if the panel supports multiple timings, but the 'native-mode' + should be the preferred/default resolution. Refer to + Documentation/devicetree/bindings/display/panel/display-timing.txt for display + timing binding details. + +Optional properties: +- backlight: phandle of the backlight device attached to the panel +- enable-gpios: GPIO pin to enable or disable the panel + +Recommended properties: + - pinctrl-names, pinctrl-0: the pincontrol settings to configure + muxing properly for pins that connect to TFP410 device + +Example: + + /* Settings for CDTech_S035Q01 / LCD3 cape: */ + lcd3 { + compatible = "ti,tilcdc,panel"; + pinctrl-names = "default"; + pinctrl-0 = <&bone_lcd3_cape_lcd_pins>; + backlight = <&backlight>; + enable-gpios = <&gpio3 19 0>; + + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <16>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + display-timings { + native-mode = <&timing0>; + timing0: 320x240 { + hactive = <320>; + vactive = <240>; + hback-porch = <21>; + hfront-porch = <58>; + hsync-len = <47>; + vback-porch = <11>; + vfront-porch = <23>; + vsync-len = <2>; + clock-frequency = <8000000>; + hsync-active = <0>; + vsync-active = <0>; + }; + }; + }; diff --git a/doc/device-tree-bindings/video/tilcdc/tilcdc.txt b/doc/device-tree-bindings/video/tilcdc/tilcdc.txt new file mode 100644 index 0000000000..7bf1bb4448 --- /dev/null +++ b/doc/device-tree-bindings/video/tilcdc/tilcdc.txt @@ -0,0 +1,82 @@ +Device-Tree bindings for tilcdc DRM driver + +Required properties: + - compatible: value should be one of the following: + - "ti,am33xx-tilcdc" for AM335x based boards + - "ti,da850-tilcdc" for DA850/AM18x/OMAP-L138 based boards + - interrupts: the interrupt number + - reg: base address and size of the LCDC device + +Recommended properties: + - ti,hwmods: Name of the hwmod associated to the LCDC + +Optional properties: + - max-bandwidth: The maximum pixels per second that the memory + interface / lcd controller combination can sustain + - max-width: The maximum horizontal pixel width supported by + the lcd controller. + - max-pixelclock: The maximum pixel clock that can be supported + by the lcd controller in KHz. + - blue-and-red-wiring: Recognized values "straight" or "crossed". + This property deals with the LCDC revision 2 (found on AM335x) + color errata [1]. + - "straight" indicates normal wiring that supports RGB565, + BGR888, and XBGR8888 color formats. + - "crossed" indicates wiring that has blue and red wires + crossed. This setup supports BGR565, RGB888 and XRGB8888 + formats. + - If the property is not present or its value is not recognized + the legacy mode is assumed. This configuration supports RGB565, + RGB888 and XRGB8888 formats. However, depending on wiring, the red + and blue colors are swapped in either 16 or 24-bit color modes. + +Optional nodes: + + - port/ports: to describe a connection to an external encoder. The + binding follows Documentation/devicetree/bindings/graph.txt and + supports a single port with a single endpoint. + + - See also Documentation/devicetree/bindings/display/tilcdc/panel.txt and + Documentation/devicetree/bindings/display/tilcdc/tfp410.txt for connecting + tfp410 DVI encoder or lcd panel to lcdc + +[1] There is an errata about AM335x color wiring. For 16-bit color mode + the wires work as they should (LCD_DATA[0:4] is for Blue[3:7]), + but for 24 bit color modes the wiring of blue and red components is + crossed and LCD_DATA[0:4] is for Red[3:7] and LCD_DATA[11:15] is + for Blue[3-7]. For more details see section 3.1.1 in AM335x + Silicon Errata: + http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=sprz360 + +Example: + + fb: fb@4830e000 { + compatible = "ti,am33xx-tilcdc", "ti,da850-tilcdc"; + reg = <0x4830e000 0x1000>; + interrupt-parent = <&intc>; + interrupts = <36>; + ti,hwmods = "lcdc"; + + blue-and-red-wiring = "crossed"; + + port { + lcdc_0: endpoint@0 { + remote-endpoint = <&hdmi_0>; + }; + }; + }; + + tda19988: tda19988 { + compatible = "nxp,tda998x"; + reg = <0x70>; + + pinctrl-names = "default", "off"; + pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; + + port { + hdmi_0: endpoint@0 { + remote-endpoint = <&lcdc_0>; + }; + }; + }; From patchwork Sun Feb 16 15:09:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238774 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=IgNOU46H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9b15BBgz9s29 for ; Mon, 17 Feb 2020 02:12:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5FD4C80E9D; Sun, 16 Feb 2020 16:11:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="IgNOU46H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A68D812B8; Sun, 16 Feb 2020 16:11:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0A13A8129E for ; Sun, 16 Feb 2020 16:10:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZRjm27I; Sun, 16 Feb 2020 16:10:57 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865857; bh=AJySetHdQS/T40ULTg1izSmLYzy0KcbBwXAFGgq4U6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IgNOU46HvvMxUQo6ZyoHC0bQ6NxYVu7d2gRw49iyq6rGCFsQiQH27WvdKf9rJR2oT IXmFf8PYbEEBUY79FOjy1PlEoSeqekVTlS+bnj51O3nJmFSYcfV6xcPuoQyOd7bbba SG6sS+0EJYMEr23VWDPgPoXw2MNkPcCplYjWE13UFsxkclPEw0ignLT68ZtL6/ZEHu NzeVW+EZxxpxPmg4I08Ze1gbb7PItNsBGDQh9MQvfyPI6CRL8wlrXr8TWh5UjIxQUJ 3dIo4rqvfYdTSQast2zlSmBk6f7xgG+Ay1mGcuO96uYpholmW2t7k/iun+dfWGqNzL 4xDQSJ8WQ4CmQ== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=WcGd53mObNz4m6zIKtAA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v2 12/13] video: omap: fix pixel-per-line bitfield setting Date: Sun, 16 Feb 2020 16:09:41 +0100 Message-Id: <20200216150942.3220-13-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfCS12anNW2bLQ1PoMQKDms1Nl6J8sSAU/qWq2v01JMFGD2e8CYPgc/Uh02D/NJeJlCzMfDJYyGn8VkzQsWa2N5dOzplUhu34gPsIhLslI6+XDEqKgNiK 6lB0BHpOV9JADKJYEuHByrcobr2xNUgs2UVucUUVzLgs1k083oXpTjvdLzSukje8WMY0YbotCnrILxNgPulKk2jSpEgEG1BCJogvrp8NguG/ivl3aKDMJB4l P9CLanCVf034yjz3VGgdpIxlLOV7xTSozEU+XdaKuzU= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Fix the macro to set the pplmsb field (bit 3) of the RASTER_TIMING_0 register. It is used in order to support up to 2048 pixels per line. Signed-off-by: Dario Binacchi --- Changes in v2: None drivers/video/am335x-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index 30543a945b..eb5add2a20 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -43,7 +43,7 @@ #define LCDC_DMA_CTRL_BURST_16 0x4 #define LCDC_DMA_CTRL_FIFO_TH(x) (((x) & GENMASK(2, 0)) << 8) /* LCD Timing_0 Register */ -#define LCDC_RASTER_TIMING_0_HORMSB(x) (((((x) >> 4) - 1) & 0x40) >> 4) +#define LCDC_RASTER_TIMING_0_HORMSB(x) ((((x) - 1) & BIT(10)) >> 7) #define LCDC_RASTER_TIMING_0_HORLSB(x) (((((x) >> 4) - 1) & GENMASK(5, 0)) << 4) #define LCDC_RASTER_TIMING_0_HSWLSB(x) ((((x) - 1) & GENMASK(5, 0)) << 10) #define LCDC_RASTER_TIMING_0_HFPLSB(x) ((((x) - 1) & GENMASK(7, 0)) << 16) From patchwork Sun Feb 16 15:09:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1238775 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=PMLPgIgJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48L9bC54mHz9s29 for ; Mon, 17 Feb 2020 02:12:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59AAD812B5; Sun, 16 Feb 2020 16:11:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="PMLPgIgJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FBAF812B3; Sun, 16 Feb 2020 16:11:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35-i2.italiaonline.it [213.209.12.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EFDA3812B7 for ; Sun, 16 Feb 2020 16:11:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([80.116.32.220]) by smtp-35.iol.local with ESMTPA id 3LYRjOBjiMAUp3LZVjm28K; Sun, 16 Feb 2020 16:11:01 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1581865861; bh=7u6Au7Rc6DyxpP1ktyagwJ05T7tUk16NlIxIMlMv7f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PMLPgIgJVF0kwkVdKKfJSclkHjU3f54yhofi90mKC7RGHWjBwj9ft2KOLy8gJPcnL UBhOSC+8mIh6CDV9C5159b990cwVmcehQ9vEUhHtsGcCrCpRlok858fcvDeJmHB59m Z6f4d5UEqmDdRMO8fnYpEG+p31FYh9yGb6JR9Ueq5YTdBj+cJILOktdFmiJzfQFeP/ zXQVrclFOVRSjaltpzJ7GQoDiqr+qd7dqrfHuzBDgzOxqgm+jfsxkT4zwRuRzwaQEM hIWMoHuYsbxNBTHG0Umw64XVbcRHdYw4ky10H4JoILfN5Fov51YwuNHhkiX5IgH031 ZJK8yC8bG35Ww== X-CNFS-Analysis: v=2.3 cv=B/fHL9lM c=1 sm=1 tr=0 a=gDoL7ROJeSFQT6fuE5q7ug==:117 a=gDoL7ROJeSFQT6fuE5q7ug==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=j15D7WwTIEwJOkT7eRkA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Hannes Schmelzer , Joe Hershberger , Simon Glass Subject: [PATCH v2 13/13] board: brxre1: fix building errors Date: Sun, 16 Feb 2020 16:09:42 +0100 Message-Id: <20200216150942.3220-14-dariobin@libero.it> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216150942.3220-1-dariobin@libero.it> References: <20200216150942.3220-1-dariobin@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfEvWexmQGPx/01ZxJ9mt/tR1TYlji5waC6tnd+neMYXgTg+oeepLfWUE4/wB+R/hxMIoI+6WqQprixnNtgpDAe1WCv2CUP5He06xnhFfICfTlTTmZ6nK HRnkoJ6sXE3AlR9m4kyedq6Tix2tfwVEXxBZpg+Je0ODw0hgSbEJ1wJCdsSg7ZP+2YEbAfhn5/yKGTJjkR7HUky/jcxAX4sJSNrwpt6Tq1AmlzPuL8Sn5X84 VHx35vom2o66AxxXFC2Vg8kJcq63yFf7/s9G6J55YLQwZmiiHzG1mDtC8p2rujoscq1hYIPabfcfvqHr/3Aojw== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Fix building errors if CONFIG_DM_VIDEO is enabled. This is the only u-boot board that enables CONFIG_AM335X_LCD and from which I started to develop the version of the frame buffer driver that supports the driver model. Signed-off-by: Dario Binacchi --- Changes in v2: None board/BuR/common/br_resetc.c | 2 +- board/BuR/common/bur_common.h | 3 +++ board/BuR/common/common.c | 2 +- include/configs/brxre1.h | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/board/BuR/common/br_resetc.c b/board/BuR/common/br_resetc.c index c0e7fb65b2..70ad8322ef 100644 --- a/board/BuR/common/br_resetc.c +++ b/board/BuR/common/br_resetc.c @@ -22,7 +22,7 @@ #define BMODE_PME 12 #define BMODE_DIAG 15 -#ifdef CONFIG_LCD +#if CONFIG_IS_ENABLED(LCD) && !CONFIG_IS_ENABLED(DM_VIDEO) #include #define LCD_SETCURSOR(x, y) lcd_position_cursor(x, y) #define LCD_PUTS(x) lcd_puts(x) diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h index 2591bf4bb3..618cebc1a5 100644 --- a/board/BuR/common/bur_common.h +++ b/board/BuR/common/bur_common.h @@ -11,9 +11,12 @@ #ifndef _BUR_COMMON_H_ #define _BUR_COMMON_H_ +#if !CONFIG_IS_ENABLED(DM_VIDEO) #include <../../../drivers/video/am335x-fb.h> int load_lcdtiming(struct am335x_lcdpanel *panel); +#endif + void br_summaryscreen(void); void pmicsetup(u32 mpupll, unsigned int bus); void enable_uart0_pin_mux(void); diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 148fc9075e..de8d455c27 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR; /* --------------------------------------------------------------------------*/ #if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \ - !defined(CONFIG_SPL_BUILD) + !defined(CONFIG_DM_VIDEO) && !defined(CONFIG_SPL_BUILD) #include #include #include diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index ea15912c90..006663373b 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -14,7 +14,9 @@ #include #include /* ------------------------------------------------------------------------- */ +#if !defined(CONFIG_AM335X_LCD) #define CONFIG_AM335X_LCD +#endif #define LCD_BPP LCD_COLOR32 /* memory */