All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Anatolij Gustschin <agust@denx.de>,
	Simon Glass <sjg@chromium.org>,
	Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Subject: [PATCH 14/39] BuR: Drop old LCD code
Date: Wed, 19 Oct 2022 05:23:31 -0600	[thread overview]
Message-ID: <20221019112356.1042065-15-sjg@chromium.org> (raw)
In-Reply-To: <20221019112356.1042065-1-sjg@chromium.org>

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 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 <lcd.h>
-#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 <asm/arch/hardware.h>
-#include <asm/arch/cpu.h>
-#include <asm/gpio.h>
-#include <power/tps65217.h>
-#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


  parent reply	other threads:[~2022-10-19 11:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 11:23 [PATCH 00/39] lcd: Drop old LCD support Simon Glass
2022-10-19 11:23 ` [PATCH 01/39] video: Split SPLASH_SCREEN_ALIGN from bmp command Simon Glass
2022-10-19 11:23 ` [PATCH 02/39] Convert CONFIG_HIDE_LOGO_VERSION to Kconfig Simon Glass
2022-10-19 11:23 ` [PATCH 03/39] video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE Simon Glass
2022-10-19 11:23 ` [PATCH 04/39] Convert CONFIG_VIDEO_LOGO_MAX_SIZE to Kconfig Simon Glass
2022-10-19 11:23 ` [PATCH 05/39] video: lcd: Drop console rotation Simon Glass
2022-10-19 11:23 ` [PATCH 06/39] video: Drop CONFIG_LCD_ALIGNMENT Simon Glass
2022-10-19 11:23 ` [PATCH 07/39] video: Drop CONFIG_LCD_MENU Simon Glass
2022-10-19 11:23 ` [PATCH 08/39] video: Drop CONFIG_LCD_INFO_BELOW_LOGO Simon Glass
2022-10-19 11:23 ` [PATCH 09/39] video: Drop CONFIG_LCD_INFO Simon Glass
2022-10-19 11:23 ` [PATCH 10/39] video: Move bmp_display() prototype to video.h Simon Glass
2022-10-19 11:23 ` [PATCH 11/39] api: Drop LCD implementation Simon Glass
2022-10-19 11:23 ` [PATCH 13/39] video: Drop VCXK video controller Simon Glass
2022-10-19 11:23 ` Simon Glass [this message]
2022-10-19 11:23 ` [PATCH 16/39] video: atmel: Drop pre-DM parts of video driver Simon Glass
2022-10-19 11:23 ` [PATCH 17/39] video: Drop ld9040 driver Simon Glass
2022-10-19 11:23 ` [PATCH 19/39] treewide: Stop enabling CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 20/39] video: Drop atmel LCD code Simon Glass
2022-10-19 11:23 ` [PATCH 21/39] video: samsung: Drop old " Simon Glass
2022-10-19 11:23 ` [PATCH 23/39] compulab: " Simon Glass
2022-10-19 11:23 ` [PATCH 24/39] tegra: " Simon Glass
2022-10-19 11:23 ` [PATCH 25/39] BuR: ronetix: siemens: " Simon Glass
2022-10-19 11:23 ` [PATCH 26/39] video: cmd: " Simon Glass
2022-10-19 11:23 ` [PATCH 27/39] efi: " Simon Glass
2022-10-19 11:23 ` [PATCH 28/39] video: Drop remaining references to CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 29/39] fdt: Drop support for LCD fixup in simplefb Simon Glass
2022-10-19 11:23 ` [PATCH 30/39] video: Drop LCD_BPP Simon Glass
2022-10-19 11:23 ` [PATCH 31/39] video: Drop CONFIG_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 32/39] " Simon Glass
2022-10-19 11:23 ` [PATCH 33/39] video: Drop CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 34/39] video: Drop use of the lcd header file Simon Glass
2022-10-19 11:23 ` [PATCH 35/39] video: Drop common LCD implementation Simon Glass
2022-10-19 11:23 ` [PATCH 36/39] video: Drop SPLASHIMAGE_CALLBACK Simon Glass
2022-10-19 11:23 ` [PATCH 37/39] video: Make all video options depend on DM_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 38/39] pci: Drop test for DM_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 39/39] video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO Simon Glass
2022-10-19 17:06 ` [PATCH 00/39] lcd: Drop old LCD support Tim Harvey
2022-10-19 17:52   ` Simon Glass
2022-10-25 21:48     ` Tim Harvey
2022-10-31 13:47 ` Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019112356.1042065-15-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=agust@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=wolfgang.wallner@br-automation.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.