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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6DBBC48BD1 for ; Fri, 11 Jun 2021 16:17:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 48597613F9 for ; Fri, 11 Jun 2021 16:17:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48597613F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=in.bosch.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5F3E82925; Fri, 11 Jun 2021 18:15:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=in.bosch.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=in.bosch.com header.i=@in.bosch.com header.b="etMVtqXO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25D6A82917; Fri, 11 Jun 2021 18:15:00 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::613]) (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 5691682893 for ; Fri, 11 Jun 2021 18:14:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=in.bosch.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Gireesh.Hiremath@in.bosch.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GU3P9PfFiXTfMi8mErh+Y9tLqLZf6CFMT8190zNMdV2NShWmgBYeWwFfZ9lchBbuA24oN2B/yZe1dDDNlZTowJAAayW1y+1F1lrMcotacFnsbY555pjqD4LDgr6ujQNREnGoxa3BF3Ig0hiKTLcSwPeexIzJp2G+6W6VmHrss2fGQ6Yzm+04w5ZL3FY8wdbDkhTkpXwlm+K+YRwd87HE6H1nDH6FPWKwhuQNit7pywZXMjZRvuoD7dMvLzAKJW/nVmsShdls6puCTOyseh3kM51LO0NsB1DTg/AXvRtm/r8433iGYp23Fux64F5hRpwK1CeffkzuQq6gAHETtK7ybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iA4tEAmfT/B07FPYIIB5Tar2s/VimtE3kFDYmBafgBQ=; b=aQLnWjcv7GRXzDTbx61+8o3kjFXdx+UkBHvUdPHkHPKh6rW9KFnokAZrGo79OKIdLpzaiZuca55CNw+QqnQ2Q5YYY0HxNG3TC49rEbWpPEAUUeRHywyjf7JaPHxXoUufXcKLIdXwwTrsmIf5m4eaOK1P9aS1g0YgWmV02e+cIWXwn35pWd5wRTYClRtM974Jqi44jJ0UgrKiHKPbdG0Jf7iQydVkpgd4CKbGFNZHVz7qi0X5EADJeF9swvetn/WjzGBzyHjPBTR26zF4UCefZu7sSscQguh+imd1RAGw0tqflGS+ze0hRK8Ycl5SfYozNrBTH5MPS6gYusJXzavDpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 139.15.153.201) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=in.bosch.com; dmarc=pass (p=reject sp=none pct=100) action=none header.from=in.bosch.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=in.bosch.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iA4tEAmfT/B07FPYIIB5Tar2s/VimtE3kFDYmBafgBQ=; b=etMVtqXOK5Db/ipZib5pYbO2Ww4SnCLHprVMiwPiyez0a+agNq92qh01gH68jF8fFbdQZyBe1p2s+ufAHRUMNKDZyqWA/fbHtNlOKwZ3Me64lD6iWGE6tcuDDKZv2qDSRTMSQYkpiF8ISuslUj31vX0OBcBKsZTWyezH+zgNZlc= Received: from AM6PR0202CA0062.eurprd02.prod.outlook.com (2603:10a6:20b:3a::39) by VI1PR10MB3487.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:132::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 16:14:54 +0000 Received: from VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:3a:cafe::cf) by AM6PR0202CA0062.outlook.office365.com (2603:10a6:20b:3a::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Fri, 11 Jun 2021 16:14:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 139.15.153.201) smtp.mailfrom=in.bosch.com; lists.denx.de; dkim=none (message not signed) header.d=none; lists.denx.de; dmarc=pass action=none header.from=in.bosch.com; Received-SPF: Pass (protection.outlook.com: domain of in.bosch.com designates 139.15.153.201 as permitted sender) receiver=protection.outlook.com; client-ip=139.15.153.201; helo=eop.bosch-org.com; Received: from eop.bosch-org.com (139.15.153.201) by VE1EUR03FT022.mail.protection.outlook.com (10.152.18.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 16:14:53 +0000 Received: from FE-EXCAS2000.de.bosch.com (10.139.217.199) by eop.bosch-org.com (139.15.153.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2176.14; Fri, 11 Jun 2021 18:14:44 +0200 Received: from SI-HUB2000.de.bosch.com (10.4.103.108) by FE-EXCAS2000.de.bosch.com (10.139.217.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2176.14; Fri, 11 Jun 2021 18:14:44 +0200 Received: from localhost.localdomain (10.141.230.85) by SI-HUB2000.de.bosch.com (10.4.103.108) with Microsoft SMTP Server id 15.1.2176.14; Fri, 11 Jun 2021 18:14:42 +0200 From: To: , , CC: , , Subject: [PATCH v4 15/18] am335x, guardian: Enable panel driver Himax HX8238D Date: Fri, 11 Jun 2021 16:13:47 +0000 Message-ID: <20210611161350.2141-16-Gireesh.Hiremath@in.bosch.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210611161350.2141-1-Gireesh.Hiremath@in.bosch.com> References: <20210611161350.2141-1-Gireesh.Hiremath@in.bosch.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.141.230.85] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77243fc7-018b-4df7-c9b1-08d92cf40c3f X-MS-TrafficTypeDiagnostic: VI1PR10MB3487: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WGOvxQ1Razj2tfmibF8vVEa54Arv+I30ucmmbaRh5jrs/lzu3GeAe+v7zA2ToBXW2YqlotPpK1X9F2ObQc9c1ZKHtc26dDsL8Ax7GWsFIJ9yDVg6XuHCn+LbhgqReQ0SSjo3b1r9Tstm6LbijYK4XO4omSYhQU9WkoEQc1VkRZZIYXyQLuxtDOlGATxsJe3Qu7EMNttwV7R9tLbyop9ujM6vJkcrmKsltt9CfcA0lUx20sghcPOcj8b32P5NxkGd9JGAGN/56KNyrAW+qyq2bdeiWhAjhBvPGa2Yw7kPMUt6LO7zpBt69PIOBh3Hcd3iuK4yWbZyq0XD/WSuSv2sgPikv6X+mEpVMeJpGIJATRMuNFlvmMF0YflHIbN6cEK1z0RVTkhSif2iVmIzB6HRrFsE/1OjAfjXUtBrseLLgFvGnuSkgy79SYdKHYcxCwqRiNY3z/8Iv0hKf2IQwuIH1JKDjYv2Gnf6qA/GoztTFwZsdG5KzqfgqZUNisIh7hgufGR+nvBDgQFrLUQab56IyWq1Y4vzHhRTdyWm5ysuh4+uRipcp543ajz4DXn1kf4RpaNTeLWzDePAp0LgzIcNM+wUzqHhxergO4sCM6mqRXcW2wSN5jjwPB33iPQM0ilMl0USJq7+sF99DAfVuKwaGyxy/ZU4jce3tz108PqHC0iV1ggxYc+QvTvA1dLH0BW8 X-Forefront-Antispam-Report: CIP:139.15.153.201; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:eop.bosch-org.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(186003)(8936002)(26005)(356005)(498600001)(16526019)(81166007)(70206006)(54906003)(82310400003)(8676002)(5660300002)(86362001)(2876002)(36860700001)(336012)(107886003)(83380400001)(2616005)(2906002)(4326008)(1076003)(70586007)(110136005)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: in.bosch.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 16:14:53.7727 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77243fc7-018b-4df7-c9b1-08d92cf40c3f X-MS-Exchange-CrossTenant-Id: 0ae51e19-07c8-4e4b-bb6d-648ee58410f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0ae51e19-07c8-4e4b-bb6d-648ee58410f4; Ip=[139.15.153.201]; Helo=[eop.bosch-org.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB3487 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Gireesh Hiremath - Enable lcd controller - Display splash screen Signed-off-by: Gireesh Hiremath --- arch/arm/dts/am335x-guardian-u-boot.dtsi | 11 +++ arch/arm/dts/am335x-guardian.dts | 8 ++- arch/arm/mach-omap2/am33xx/Kconfig | 2 + board/bosch/guardian/board.c | 87 +++++++++++++++++++++++- board/bosch/guardian/mux.c | 3 +- include/configs/am335x_guardian.h | 11 +++ 6 files changed, 119 insertions(+), 3 deletions(-) diff --git a/arch/arm/dts/am335x-guardian-u-boot.dtsi b/arch/arm/dts/am335x-guardian-u-boot.dtsi index 986f58e664..a1a7913de8 100644 --- a/arch/arm/dts/am335x-guardian-u-boot.dtsi +++ b/arch/arm/dts/am335x-guardian-u-boot.dtsi @@ -42,6 +42,17 @@ u-boot,dm-pre-reloc; }; +&spi0 { + lcd0: display@0 { + compatible = "himax,hx8238d"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_pins>; + reg = <0>; + label = "lcd"; + spi-max-frequency = <100000>; + }; +}; + &uart0 { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/dts/am335x-guardian.dts b/arch/arm/dts/am335x-guardian.dts index 207246b4e0..69bee45848 100644 --- a/arch/arm/dts/am335x-guardian.dts +++ b/arch/arm/dts/am335x-guardian.dts @@ -87,7 +87,7 @@ ac-bias = <255>; ac-bias-intrpt = <0>; dma-burst-sz = <16>; - bpp = <24>; + bpp = <16>; bus-width = <16>; fdd = <0x80>; sync-edge = <0>; @@ -247,6 +247,12 @@ &lcdc { blue-and-red-wiring = "crossed"; status = "okay"; + + port { + lcdc_0: endpoint@0 { + remote-endpoint = <0>; + }; + }; }; &mmc1 { diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig index 11e54cd293..65f43944fe 100644 --- a/arch/arm/mach-omap2/am33xx/Kconfig +++ b/arch/arm/mach-omap2/am33xx/Kconfig @@ -95,6 +95,8 @@ config TARGET_AM335X_GUARDIAN select DM_SERIAL select DM_GPIO select DM_USB + select DM_VIDEO + select DM_PANEL_HX8238D config TARGET_AM335X_SL50 bool "Support am335x_sl50" diff --git a/board/bosch/guardian/board.c b/board/bosch/guardian/board.c index 4388ef70d2..179511a670 100644 --- a/board/bosch/guardian/board.c +++ b/board/bosch/guardian/board.c @@ -26,12 +26,16 @@ #include #include #include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include "board.h" DECLARE_GLOBAL_DATA_PTR; @@ -250,13 +254,94 @@ void lcdbacklight_en(void) brightness != 0 ? 0x0A : 0x02, 0xFF); } +#if IS_ENABLED(CONFIG_AM335X_LCD) +static void splash_screen(void) +{ + struct udevice *video_dev; + struct udevice *console_dev; + struct video_priv *vid_priv; + struct mtd_info *mtd; + size_t len; + int ret; + + struct mtd_device *mtd_dev; + struct part_info *part; + u8 pnum; + + ret = uclass_get_device(UCLASS_VIDEO, 0, &video_dev); + if (ret != 0) { + debug("video device not found\n"); + goto exit; + } + + vid_priv = dev_get_uclass_priv(video_dev); + mtdparts_init(); + + if (find_dev_and_part(SPLASH_SCREEN_NAND_PART, &mtd_dev, &pnum, &part)) { + debug("Could not find nand partition\n"); + goto splash_screen_text; + } + + mtd = get_nand_dev_by_index(mtd_dev->id->num); + if (!mtd) { + debug("MTD partition is not valid\n"); + goto splash_screen_text; + } + + len = SPLASH_SCREEN_BMP_FILE_SIZE; + ret = nand_read_skip_bad(mtd, part->offset, &len, NULL, + SPLASH_SCREEN_BMP_FILE_SIZE, + (u_char *)SPLASH_SCREEN_BMP_LOAD_ADDR); + if (ret != 0) { + debug("Reading NAND partition failed\n"); + goto splash_screen_text; + } + + ret = video_bmp_display(video_dev, SPLASH_SCREEN_BMP_LOAD_ADDR, 0, 0, false); + if (ret != 0) { + debug("No valid bmp image found!!\n"); + goto splash_screen_text; + } else { + goto exit; + } + +splash_screen_text: + vid_priv->colour_fg = CONSOLE_COLOR_RED; + vid_priv->colour_bg = CONSOLE_COLOR_BLACK; + + if (!uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &console_dev)) { + debug("Found console\n"); + vidconsole_position_cursor(console_dev, 17, 7); + vidconsole_put_string(console_dev, SPLASH_SCREEN_TEXT); + } else { + debug("No console device found\n"); + } + +exit: + return; +} +#endif /* CONFIG_AM335X_LCD */ + int board_late_init(void) { + int ret; + struct udevice *cdev; + #ifdef CONFIG_LED_GPIO led_default_state(); #endif set_bootmode_env(); + + ret = uclass_get_device(UCLASS_PANEL, 0, &cdev); + if (ret) { + debug("video panel not found: %d\n", ret); + return ret; + } + lcdbacklight_en(); + if (IS_ENABLED(CONFIG_AM335X_LCD)) + splash_screen(); + return 0; } #endif /* CONFIG_BOARD_LATE_INIT */ diff --git a/board/bosch/guardian/mux.c b/board/bosch/guardian/mux.c index 9c81f29f9f..12c3eb666f 100644 --- a/board/bosch/guardian/mux.c +++ b/board/bosch/guardian/mux.c @@ -28,8 +28,9 @@ static struct module_pin_mux i2c0_pin_mux[] = { static struct module_pin_mux guardian_interfaces_pin_mux[] = { {OFFSET(mcasp0_ahclkx), (MODE(7) | PULLDOWN_EN)}, + {OFFSET(mii1_txen), (MODE(7) | PULLDOWN_EN)}, {OFFSET(mcasp0_aclkx), (MODE(7) | PULLUP_EN)}, - {OFFSET(mii1_txd0), (MODE(7) | PULLUP_EN)}, + {OFFSET(mdio_clk), (MODE(7) | PULLUP_EN)}, {OFFSET(uart1_rxd), (MODE(7) | RXACTIVE | PULLUDDIS)}, {OFFSET(uart1_txd), (MODE(7) | PULLUDDIS)}, {OFFSET(mii1_crs), (MODE(7) | PULLDOWN_EN)}, diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h index 73248292f2..c161b93352 100644 --- a/include/configs/am335x_guardian.h +++ b/include/configs/am335x_guardian.h @@ -82,6 +82,17 @@ #endif /* ! CONFIG_SPL_BUILD */ +#define CONFIG_BMP_16BPP +#define SPLASH_SCREEN_NAND_PART "nand0,10" +#define SPLASH_SCREEN_BMP_FILE_SIZE 0x26000 +#define SPLASH_SCREEN_BMP_LOAD_ADDR 0x82000000 +#define SPLASH_SCREEN_TEXT "U-Boot" + +/* BGR 16Bit Color Definitions */ +#define CONSOLE_COLOR_BLACK 0x0000 +#define CONSOLE_COLOR_WHITE 0xFFFF +#define CONSOLE_COLOR_RED 0x001F + /* NS16550 Configuration */ #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */ #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ -- 2.20.1