From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A000C433EF for ; Sun, 6 Mar 2022 15:09:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5823F8128D; Sun, 6 Mar 2022 16:09:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="fdwtAbpk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22C928031F; Sun, 6 Mar 2022 16:09:54 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 7FF028128D for ; Sun, 6 Mar 2022 16:09:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4E7AB80E95; Sun, 6 Mar 2022 15:09:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CCAFC340EC; Sun, 6 Mar 2022 15:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646579388; bh=pZ960vCFCnRQdI2yyO5Idwo0GTLLytpimfAfWj3rO00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdwtAbpkEY+eLOps7pRsMHlObww4flejXD8c5Ek2uUXQ3IvXud6oyHmPIyzBQt4EQ 7TuWYSqtfywKYfGBpZTvzRSh33twGOfaaQxZ8ukHw7/4ZsEqjsX9UlyY6P1F3q+5wr JU4xiRt6Iqw6NAnGiCIxUwmyXmw8wVOkzLfW4UQJV8YSg5MBXCFBilzsDA8lPpi4kU /f3WIlIrLUHuNIrrGr1JTrZjF0Te5ESJjZf5zAXSLlovaRkSbkK756qm8KuTNLRDiH cnk4L8nKpgd7TrGWEosdy5KZe4LQeWQCzxHYUmZiPz9Pqy9gG8HSFoazMhYF2L0Gck keCYjTSqWQb4w== Received: by pali.im (Postfix) id 86AD1830; Sun, 6 Mar 2022 16:09:45 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Anatolij Gustschin , Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH] Nokia RX-51: Convert to CONFIG_DM_VIDEO Date: Sun, 6 Mar 2022 16:08:43 +0100 Message-Id: <20220306150843.22804-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220216204219.18539-1-pali@kernel.org> References: <20220216204219.18539-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean Mechanically convert video_hw_init() function to UCLASS_VIDEO probe callback and replace CONFIG_CFB_CONSOLE by CONFIG_DM_VIDEO. As framebuffer base address is setup by the bootloader which loads U-Boot, set it into plat->base. And do not allocate framebuffer in video_post_bind function when base address is already specified. This change was tested in qemu n900 machine and is working fine. What does not work is CONFIG_VIDEO_LOGO, seems to be buggy. Signed-off-by: Pali Rohár --- board/nokia/rx51/rx51.c | 40 +++++++++++++++++++++--------------- configs/nokia_rx51_defconfig | 7 +++++-- drivers/video/video-uclass.c | 3 +++ include/configs/nokia_rx51.h | 11 ++-------- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index a52691509da4..621cff095619 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,8 +62,6 @@ struct emu_hal_params_rx51 { DECLARE_GLOBAL_DATA_PTR; -GraphicDevice gdev; - const omap3_sysinfo sysinfo = { DDR_STACKED, "Nokia RX-51", @@ -342,22 +340,28 @@ void setup_board_tags(struct tag **in_params) *in_params = params; } -/* - * Routine: video_hw_init - * Description: Set up the GraphicDevice depending on sys_boot. - */ -void *video_hw_init(void) +static int rx51_video_probe(struct udevice *dev) { - /* fill in Graphic Device */ - gdev.frameAdrs = 0x8f9c0000; - gdev.winSizeX = 800; - gdev.winSizeY = 480; - gdev.gdfBytesPP = 2; - gdev.gdfIndex = GDF_16BIT_565RGB; - memset((void *)gdev.frameAdrs, 0, 0xbb800); - return (void *) &gdev; + struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev); + struct video_priv *uc_priv = dev_get_uclass_priv(dev); + + uc_plat->base = 0x8f9c0000; + uc_plat->size = 800 * 480 * sizeof(u16); + uc_priv->xsize = 800; + uc_priv->ysize = 480; + uc_priv->bpix = VIDEO_BPP16; + + video_set_flush_dcache(dev, true); + + return 0; } +U_BOOT_DRIVER(rx51_video) = { + .name = "rx51_video", + .id = UCLASS_VIDEO, + .probe = rx51_video_probe, +}; + /* * Routine: twl4030_regulator_set_mode * Description: Set twl4030 regulator mode over i2c powerbus. @@ -777,6 +781,10 @@ U_BOOT_DRVINFOS(rx51_watchdog) = { { "rx51_watchdog" }, }; +U_BOOT_DRVINFOS(rx51_video) = { + { "rx51_video" }, +}; + U_BOOT_DRVINFOS(rx51_kp) = { { "rx51_kp" }, }; diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 47b7bc3b4f03..1d64981afc46 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -77,8 +77,11 @@ CONFIG_SPI=y CONFIG_USB=y CONFIG_USB_MUSB_UDC=y CONFIG_USB_OMAP3=y -CONFIG_CFB_CONSOLE=y -CONFIG_CFB_CONSOLE_ANSI=y +CONFIG_DM_VIDEO=y +CONFIG_VIDEO_LOGO=y +# CONFIG_VIDEO_BPP8 is not set +# CONFIG_VIDEO_BPP32 is not set +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_SPLASH_SCREEN=y CONFIG_WATCHDOG_TIMEOUT_MSECS=31000 CONFIG_WDT=y diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 7d499bcec51d..c2f7d97e93e3 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -78,6 +78,9 @@ static ulong alloc_fb(struct udevice *dev, ulong *addrp) if (!plat->size) return 0; + if (plat->base) + return 0; + align = plat->align ? plat->align : 1 << 20; base = *addrp - plat->size; base &= ~(align - 1); diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 9be64c3d3f87..e837b12b568f 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -70,19 +70,12 @@ #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP -/* - * Framebuffer - */ -/* Video console */ -#define VIDEO_FB_16BPP_PIXEL_SWAP -#define VIDEO_FB_16BPP_WORD_SWAP - /* Environment information */ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "stdin=usbtty,serial,keyboard\0" \ - "stdout=usbtty,serial,vga\0" \ - "stderr=usbtty,serial,vga\0" \ + "stdout=usbtty,serial,vidconsole\0" \ + "stderr=usbtty,serial,vidconsole\0" \ "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \ "switchmmc=mmc dev ${mmcnum}\0" \ "kernaddr=0x82008000\0" \ -- 2.20.1