From patchwork Sat Feb 22 13:05: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: 1242499 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=txzOlFbd; 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 48PpW56Qthz9sPK for ; Sun, 23 Feb 2020 00:06:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C68981C69; Sat, 22 Feb 2020 14:06:38 +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="txzOlFbd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4CB6181C6A; Sat, 22 Feb 2020 14:06:20 +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-17.italiaonline.it [213.209.10.17]) (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 DCA2081C65 for ; Sat, 22 Feb 2020 14:06: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=dariobin@libero.it Received: from localhost.localdomain ([5.90.75.199]) by smtp-17.iol.local with ESMTPA id 5UTkjGP1IReJd5UU3jisew; Sat, 22 Feb 2020 14:06:15 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1582376775; bh=UrbCDQDh3z/EnlduhaIuibGcP841zOaFSfcSMgXgiw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=txzOlFbdmUj1h98L3nQRXJ4oDRTfjSyuxriGys1CX+OpcWzipLcFfGPi/x3eqSjB2 Nz1Ryc/C280RL9JNroekuGCnHVaLuVFXysOVM7g6Qaq0aQ/Fv7VZkLohJSpl9Esn38 i2WTVcs4vWNYM3fwqxH9DOsXhIivzgAeiX4zSSmGbgMaCdHT67PmSioKNoxLyKhfU6 csUxyaW6WX/96yi5oURgCRwcE9MR4ctlndHcz9+AOCL7z8cyzRslO7TA2QhJvQZp58 DaMO641luSDuH6VJDUtIH2aGzkCaxNothD9VTPvJ34CxAJ/F0xZKxytw9vwSlEw10m hodfRJ/BbR6mg== X-CNFS-Analysis: v=2.3 cv=Qd8YQfTv c=1 sm=1 tr=0 a=Pj3pnR/5H+xJpJwmNtHN6w==:117 a=Pj3pnR/5H+xJpJwmNtHN6w==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=qtklZQDVU-DMzzmDMO8A:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v3 02/13] video: omap: add missing bitfield masks Date: Sat, 22 Feb 2020 14:05:38 +0100 Message-Id: <20200222130549.25565-3-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200222130549.25565-1-dariobin@libero.it> References: <20200222130549.25565-1-dariobin@libero.it> X-CMAE-Envelope: MS4wfHfqfzs8idUvNiW27Nvw+nfqZ6XLXSUZ8OQuRSGFNaFAp0NfNbgvMO4TbBKaP722EXSCMUat+NETR4ojxGuqBXr9PHP/0HZeecuAJIMPJSndV6DjNf/y w6+gZogl99IsEOVQUGYiaPYPZRuIAozJdU7sCfNLQFYaiN2/A3VKtdagnD/u+YBjyHiVCXu8G19FIr7zgI+CQL0ZHfgBrX+DdjbYMeiZBPwuNhq3917eehHh cll0sMTz1s/51yRmrz3+Cw== 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.2 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 --- Changes in v3: None Changes in v2: - Use GENMASK macro 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)