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 F0D25C433FE for ; Wed, 19 Oct 2022 11:33:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFC3D84EA3; Wed, 19 Oct 2022 13:33:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="QXFPKBIV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 07C7184F94; Wed, 19 Oct 2022 13:33:13 +0200 (CEST) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F3ABD84FC7 for ; Wed, 19 Oct 2022 13:24:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2c.google.com with SMTP id e15so14163391iof.2 for ; Wed, 19 Oct 2022 04:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zlN2tjxYmq+ADElBtpyjMd2CwyYFg3YBI3C6E+5d1uI=; b=QXFPKBIVD1B/ziQmrL1Jk9KKLmpkPZev3Eno+cMyrZbwD3PbYG7RVu6l+HSrszzD7s F4u5yGI56n2zwOmPCgqZ+s2s0D9dlSKrLHzyvCa3YF12ZtfNKNTEoyfSWoJb3dErKh0O yuOAmvnbIa+g47Snw3DKGOcX4/lCf5VdJtXeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zlN2tjxYmq+ADElBtpyjMd2CwyYFg3YBI3C6E+5d1uI=; b=iRQ3UAYDqLNKvYB91yJ4ShbtpZDVVZ33r4B2p/DDEirPv/EH99MaotFYGpwDD0jLmW xdTnRUf9dZ/xKpXO1SKdeUGkaiWfFAXb964M3PlA8hECpFXVARdkSGo2ZQYfrTw4XO/i sAF14bKrrcC9XEB27bxaqUi/ueMYZ5WaJrqjLfIB0en/O8GZWXKtH5rYFz91sLOp94kt gokW+Qsfcz9a6XBxUEaRPsrN4wTvCFaIe52LyMcRa7hLE3Allqk620BHOE79CyyOLM5/ 39BdxmKDxY3sQ98rfzZB3sLJzYUtuGC4noBN7R8lSvqp8M2NU2ndaxzIBiyFeoj/ubyX qbWQ== X-Gm-Message-State: ACrzQf3gNUlJflkTtzn/4iaU0dZ3y9Rjz8iZ1wp8LRaOvW/jTJ3yM8Kc Vvq7VS/q74o9r9V0kA/nIhl2Pd+drv0MAw== X-Google-Smtp-Source: AMsMyM7/B/gN6h/i85//JaJnyNgU6rPXahkksELGAxpt8+8KuQb9fQrjAJ0y5XDvD0Kfh8gFkAaAMg== X-Received: by 2002:a05:6638:408c:b0:363:dd60:d575 with SMTP id m12-20020a056638408c00b00363dd60d575mr5576446jam.93.1666178690901; Wed, 19 Oct 2022 04:24:50 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id g34-20020a022722000000b003634aa4a55asm2041156jaa.82.2022.10.19.04.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:24:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Simon Glass , Wolfgang Wallner Subject: [PATCH 14/39] BuR: Drop old LCD code Date: Wed, 19 Oct 2022 05:23:31 -0600 Message-Id: <20221019112356.1042065-15-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019112356.1042065-1-sjg@chromium.org> References: <20221019112356.1042065-1-sjg@chromium.org> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean This relies on the old LCD implementation which is to be removed. Drop it. Signed-off-by: Simon Glass --- board/BuR/brxre1/board.c | 9 -- board/BuR/common/br_resetc.c | 6 - board/BuR/common/bur_common.h | 6 - board/BuR/common/common.c | 224 ---------------------------------- 4 files changed, 245 deletions(-) diff --git a/board/BuR/brxre1/board.c b/board/BuR/brxre1/board.c index 544e09f447c..a909104df4a 100644 --- a/board/BuR/brxre1/board.c +++ b/board/BuR/brxre1/board.c @@ -164,21 +164,12 @@ int board_late_init(void) br_resetc_bmode(); /* setup othbootargs for bootvx-command (vxWorks bootline) */ -#ifdef CONFIG_LCD - snprintf(othbootargs, sizeof(othbootargs), - "u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x", - (u32)gd->fb_base - 0x20, - (u32)env_get_ulong("vx_memtop", 16, gd->fb_base - 0x20), - (u32)env_get_ulong("vx_romfsbase", 16, 0), - (u32)env_get_ulong("vx_romfssize", 16, 0)); -#else snprintf(othbootargs, sizeof(othbootargs), "u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x", (u32)gd->relocaddr, (u32)env_get_ulong("vx_memtop", 16, gd->relocaddr), (u32)env_get_ulong("vx_romfsbase", 16, 0), (u32)env_get_ulong("vx_romfssize", 16, 0)); -#endif env_set("othbootargs", othbootargs); /* * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does diff --git a/board/BuR/common/br_resetc.c b/board/BuR/common/br_resetc.c index 5006687fbf0..32f32b65e9d 100644 --- a/board/BuR/common/br_resetc.c +++ b/board/BuR/common/br_resetc.c @@ -23,14 +23,8 @@ #define BMODE_PME 12 #define BMODE_DIAG 15 -#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) -#else #define LCD_SETCURSOR(x, y) #define LCD_PUTS(x) -#endif /* CONFIG_LCD */ static const char *bootmodeascii[16] = { "BOOT", "reserved", "reserved", "reserved", diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h index 79c9af1466b..55d14c2a6b0 100644 --- a/board/BuR/common/bur_common.h +++ b/board/BuR/common/bur_common.h @@ -11,12 +11,6 @@ #ifndef _BUR_COMMON_H_ #define _BUR_COMMON_H_ -#if !CONFIG_IS_ENABLED(DM_VIDEO) -#include <../../../drivers/video/ti/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 78bf7d62288..c6126e251ec 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -22,230 +22,6 @@ DECLARE_GLOBAL_DATA_PTR; /* --------------------------------------------------------------------------*/ -#if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \ - !defined(CONFIG_DM_VIDEO) && !defined(CONFIG_SPL_BUILD) -#include -#include -#include -#include -#include "../../../drivers/video/ti/am335x-fb.h" - -void lcdbacklight(int on) -{ - unsigned int driver = env_get_ulong("ds1_bright_drv", 16, 0UL); - unsigned int bright = env_get_ulong("ds1_bright_def", 10, 50); - unsigned int pwmfrq = env_get_ulong("ds1_pwmfreq", 10, ~0UL); - unsigned int tmp; - struct gptimer *timerhw; - - if (on) - bright = bright != ~0UL ? bright : 50; - else - bright = 0; - - switch (driver) { - case 2: - timerhw = (struct gptimer *)DM_TIMER5_BASE; - break; - default: - timerhw = (struct gptimer *)DM_TIMER6_BASE; - } - - switch (driver) { - case 0: /* PMIC LED-Driver */ - /* brightness level */ - tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, - TPS65217_WLEDCTRL2, bright, 0xFF); - /* current sink */ - tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, - TPS65217_WLEDCTRL1, - bright != 0 ? 0x0A : 0x02, - 0xFF); - break; - case 1: - case 2: /* PWM using timer */ - if (pwmfrq != ~0UL) { - timerhw->tiocp_cfg = TCFG_RESET; - udelay(10); - while (timerhw->tiocp_cfg & TCFG_RESET) - ; - tmp = ~0UL-(V_OSCK/pwmfrq); /* bottom value */ - timerhw->tldr = tmp; - timerhw->tcrr = tmp; - tmp = tmp + ((V_OSCK/pwmfrq)/100) * bright; - timerhw->tmar = tmp; - timerhw->tclr = (TCLR_PT | (2 << TCLR_TRG_SHIFT) | - TCLR_CE | TCLR_AR | TCLR_ST); - } else { - puts("invalid pwmfrq in env/dtb! skip PWM-setup.\n"); - } - break; - default: - puts("no suitable backlightdriver in env/dtb!\n"); - break; - } -} - -int load_lcdtiming(struct am335x_lcdpanel *panel) -{ - struct am335x_lcdpanel pnltmp; - - pnltmp.hactive = env_get_ulong("ds1_hactive", 10, ~0UL); - pnltmp.vactive = env_get_ulong("ds1_vactive", 10, ~0UL); - pnltmp.bpp = env_get_ulong("ds1_bpp", 10, ~0UL); - pnltmp.hfp = env_get_ulong("ds1_hfp", 10, ~0UL); - pnltmp.hbp = env_get_ulong("ds1_hbp", 10, ~0UL); - pnltmp.hsw = env_get_ulong("ds1_hsw", 10, ~0UL); - pnltmp.vfp = env_get_ulong("ds1_vfp", 10, ~0UL); - pnltmp.vbp = env_get_ulong("ds1_vbp", 10, ~0UL); - pnltmp.vsw = env_get_ulong("ds1_vsw", 10, ~0UL); - pnltmp.pxl_clk = env_get_ulong("ds1_pxlclk", 10, ~0UL); - pnltmp.pol = env_get_ulong("ds1_pol", 16, ~0UL); - pnltmp.pup_delay = env_get_ulong("ds1_pupdelay", 10, ~0UL); - pnltmp.pon_delay = env_get_ulong("ds1_tondelay", 10, ~0UL); - panel_info.vl_rot = env_get_ulong("ds1_rotation", 10, 0); - - if ( - ~0UL == (pnltmp.hactive) || - ~0UL == (pnltmp.vactive) || - ~0UL == (pnltmp.bpp) || - ~0UL == (pnltmp.hfp) || - ~0UL == (pnltmp.hbp) || - ~0UL == (pnltmp.hsw) || - ~0UL == (pnltmp.vfp) || - ~0UL == (pnltmp.vbp) || - ~0UL == (pnltmp.vsw) || - ~0UL == (pnltmp.pxl_clk) || - ~0UL == (pnltmp.pol) || - ~0UL == (pnltmp.pup_delay) || - ~0UL == (pnltmp.pon_delay) - ) { - puts("lcd-settings in env/dtb incomplete!\n"); - printf("display-timings:\n" - "================\n" - "hactive: %d\n" - "vactive: %d\n" - "bpp : %d\n" - "hfp : %d\n" - "hbp : %d\n" - "hsw : %d\n" - "vfp : %d\n" - "vbp : %d\n" - "vsw : %d\n" - "pxlclk : %d\n" - "pol : 0x%08x\n" - "pondly : %d\n", - pnltmp.hactive, pnltmp.vactive, pnltmp.bpp, - pnltmp.hfp, pnltmp.hbp, pnltmp.hsw, - pnltmp.vfp, pnltmp.vbp, pnltmp.vsw, - pnltmp.pxl_clk, pnltmp.pol, pnltmp.pon_delay); - - return -1; - } - debug("lcd-settings in env complete, taking over.\n"); - memcpy((void *)panel, - (void *)&pnltmp, - sizeof(struct am335x_lcdpanel)); - - return 0; -} - -static void br_summaryscreen_printenv(char *prefix, - char *name, char *altname, - char *suffix) -{ - char *envval = env_get(name); - if (0 != envval) { - lcd_printf("%s %s %s", prefix, envval, suffix); - } else if (0 != altname) { - envval = env_get(altname); - if (0 != envval) - lcd_printf("%s %s %s", prefix, envval, suffix); - } else { - lcd_printf("\n"); - } -} - -void br_summaryscreen(void) -{ - br_summaryscreen_printenv(" - B&R -", "br_orderno", 0, "-\n"); - br_summaryscreen_printenv(" Serial/Rev :", "br_serial", 0, "\n"); - br_summaryscreen_printenv(" MAC1 :", "br_mac1", "ethaddr", "\n"); - br_summaryscreen_printenv(" MAC2 :", "br_mac2", 0, "\n"); - lcd_puts(" Bootloader : " PLAIN_VERSION "\n"); - lcd_puts("\n"); -} - -void lcdpower(int on) -{ - u32 pin, swval, i; - char buf[16] = { 0 }; - - pin = env_get_ulong("ds1_pwr", 16, ~0UL); - - if (pin == ~0UL) { - puts("no pwrpin in dtb/env, cannot powerup display!\n"); - return; - } - - for (i = 0; i < 3; i++) { - if (pin != 0) { - snprintf(buf, sizeof(buf), "ds1_pwr#%d", i); - if (gpio_request(pin & 0x7F, buf) != 0) { - printf("%s: not able to request gpio %s", - __func__, buf); - continue; - } - swval = pin & 0x80 ? 0 : 1; - if (on) - gpio_direction_output(pin & 0x7F, swval); - else - gpio_direction_output(pin & 0x7F, !swval); - - debug("switched pin %d to %d\n", pin & 0x7F, swval); - } - pin >>= 8; - } -} - -vidinfo_t panel_info = { - .vl_col = 1366, /* - * give full resolution for allocating enough - * memory - */ - .vl_row = 768, - .vl_bpix = 5, - .priv = 0 -}; - -void lcd_ctrl_init(void *lcdbase) -{ - struct am335x_lcdpanel lcd_panel; - - memset(&lcd_panel, 0, sizeof(struct am335x_lcdpanel)); - if (load_lcdtiming(&lcd_panel) != 0) - return; - - lcd_panel.panel_power_ctrl = &lcdpower; - - if (0 != am335xfb_init(&lcd_panel)) - printf("ERROR: failed to initialize video!"); - /* - * modifiy panel info to 'real' resolution, to operate correct with - * lcd-framework. - */ - panel_info.vl_col = lcd_panel.hactive; - panel_info.vl_row = lcd_panel.vactive; - - lcd_set_flush_dcache(1); -} - -void lcd_enable(void) -{ - br_summaryscreen(); - lcdbacklight(1); -} -#endif /* CONFIG_LCD */ int ft_board_setup(void *blob, struct bd_info *bd) { -- 2.38.0.413.g74048e4d9e-goog