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>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Stefan Roese <sr@denx.de>
Subject: [PATCH 07/39] video: Drop CONFIG_LCD_MENU
Date: Wed, 19 Oct 2022 05:23:24 -0600	[thread overview]
Message-ID: <20221019112356.1042065-8-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/samsung/common/board.c        |   4 -
 board/samsung/common/misc.c         | 339 ----------------------------
 include/configs/s5pc210_universal.h |   3 -
 include/configs/trats.h             |   3 -
 include/configs/trats2.h            |   3 -
 include/samsung/misc.h              |  15 --
 scripts/config_whitelist.txt        |   1 -
 7 files changed, 368 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index ff178b7fe67..04cfc5d6358 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -262,10 +262,6 @@ int misc_init_r(void)
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	set_board_info();
 #endif
-#ifdef CONFIG_LCD_MENU
-	keys_init();
-	check_boot_mode();
-#endif
 #ifdef CONFIG_CMD_BMP
 	if (panel_info.logo_on)
 		draw_logo();
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index b3b1bbcc820..ee6d2d2a0d7 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -114,345 +114,6 @@ void set_board_info(void)
 }
 #endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
 
-#ifdef CONFIG_LCD_MENU
-static int power_key_pressed(u32 reg)
-{
-	struct udevice *dev;
-	int ret;
-	u32 status;
-	u32 mask;
-
-	if (IS_ENABLED(CONFIG_TARGET_TRATS))
-		ret = pmic_get("max8997-pmic", &dev);
-	else if (IS_ENABLED(CONFIG_TARGET_TRATS2))
-		ret = pmic_get("max77686-pmic", &dev);
-	else if (IS_ENABLED(CONFIG_TARGET_S5PC210_UNIVERSAL))
-		ret = pmic_get("max8998-pmic", &dev);
-	else
-		return 0;
-
-	if (ret)
-		return ret;
-
-	if (reg == KEY_PWR_STATUS_REG)
-		mask = KEY_PWR_STATUS_MASK;
-	else
-		mask = KEY_PWR_INTERRUPT_MASK;
-
-	status = pmic_reg_read(dev, reg);
-	if (status < 0)
-		return status;
-
-	return !!(status & mask);
-}
-
-static int key_pressed(int key)
-{
-	int value;
-
-	switch (key) {
-	case KEY_POWER:
-		value = power_key_pressed(KEY_PWR_INTERRUPT_REG);
-		break;
-	case KEY_VOLUMEUP:
-		value = !gpio_get_value(KEY_VOL_UP_GPIO);
-		break;
-	case KEY_VOLUMEDOWN:
-		value = !gpio_get_value(KEY_VOL_DOWN_GPIO);
-		break;
-	default:
-		value = 0;
-		break;
-	}
-
-	return value;
-}
-
-#ifdef CONFIG_LCD
-static int check_keys(void)
-{
-	int keys = 0;
-
-	if (key_pressed(KEY_POWER))
-		keys += KEY_POWER;
-	if (key_pressed(KEY_VOLUMEUP))
-		keys += KEY_VOLUMEUP;
-	if (key_pressed(KEY_VOLUMEDOWN))
-		keys += KEY_VOLUMEDOWN;
-
-	return keys;
-}
-
-/*
- * 0 BOOT_MODE_INFO
- * 1 BOOT_MODE_THOR
- * 2 BOOT_MODE_UMS
- * 3 BOOT_MODE_DFU
- * 4 BOOT_MODE_EXIT
- */
-static char *
-mode_name[BOOT_MODE_EXIT + 1][2] = {
-	{"DEVICE", ""},
-	{"THOR", "thor"},
-	{"UMS", "ums"},
-	{"DFU", "dfu"},
-	{"GPT", "gpt"},
-	{"ENV", "env"},
-	{"EXIT", ""},
-};
-
-static char *
-mode_info[BOOT_MODE_EXIT + 1] = {
-	"info",
-	"downloader",
-	"mass storage",
-	"firmware update",
-	"restore",
-	"default",
-	"and run normal boot"
-};
-
-static char *
-mode_cmd[BOOT_MODE_EXIT + 1] = {
-	"",
-	"thor 0 mmc 0",
-	"ums 0 mmc 0",
-	"dfu 0 mmc 0",
-	"gpt write mmc 0 $partitions",
-	"env default -a; saveenv",
-	"",
-};
-
-static void display_board_info(void)
-{
-#ifdef CONFIG_MMC
-	struct mmc *mmc = find_mmc_device(0);
-#endif
-	vidinfo_t *vid = &panel_info;
-
-	lcd_position_cursor(4, 4);
-
-	lcd_printf("%s\n\t", U_BOOT_VERSION);
-	lcd_puts("\n\t\tBoard Info:\n");
-#ifdef CONFIG_SYS_BOARD
-	lcd_printf("\tBoard name: %s\n", CONFIG_SYS_BOARD);
-#endif
-#ifdef CONFIG_REVISION_TAG
-	lcd_printf("\tBoard rev: %u\n", get_board_rev());
-#endif
-	lcd_printf("\tDRAM banks: %u\n", CONFIG_NR_DRAM_BANKS);
-	lcd_printf("\tDRAM size: %u MB\n", gd->ram_size / SZ_1M);
-
-#ifdef CONFIG_MMC
-	if (mmc) {
-		if (!mmc->capacity)
-			mmc_init(mmc);
-
-		lcd_printf("\teMMC size: %llu MB\n", mmc->capacity / SZ_1M);
-	}
-#endif
-	if (vid)
-		lcd_printf("\tDisplay resolution: %u x % u\n",
-			   vid->vl_col, vid->vl_row);
-
-	lcd_printf("\tDisplay BPP: %u\n", 1 << vid->vl_bpix);
-}
-#endif
-
-static int mode_leave_menu(int mode)
-{
-#ifdef CONFIG_LCD
-	char *exit_option;
-	char *exit_reset = "reset";
-	char *exit_back = "back";
-	struct cmd_tbl *cmd;
-	int cmd_result;
-	int leave;
-
-	lcd_clear();
-
-	switch (mode) {
-	case BOOT_MODE_EXIT:
-		return 1;
-	case BOOT_MODE_INFO:
-		display_board_info();
-		exit_option = exit_back;
-		leave = 0;
-		break;
-	default:
-		cmd = find_cmd(mode_name[mode][1]);
-		if (cmd) {
-			printf("Enter: %s %s\n", mode_name[mode][0],
-			       mode_info[mode]);
-			lcd_printf("\n\n\t%s %s\n", mode_name[mode][0],
-				   mode_info[mode]);
-			lcd_puts("\n\tDo not turn off device before finish!\n");
-
-			cmd_result = run_command(mode_cmd[mode], 0);
-
-			if (cmd_result == CMD_RET_SUCCESS) {
-				printf("Command finished\n");
-				lcd_clear();
-				lcd_printf("\n\n\t%s finished\n",
-					   mode_name[mode][0]);
-
-				exit_option = exit_reset;
-				leave = 1;
-			} else {
-				printf("Command error\n");
-				lcd_clear();
-				lcd_printf("\n\n\t%s command error\n",
-					   mode_name[mode][0]);
-
-				exit_option = exit_back;
-				leave = 0;
-			}
-		} else {
-			lcd_puts("\n\n\tThis mode is not supported.\n");
-			exit_option = exit_back;
-			leave = 0;
-		}
-	}
-
-	lcd_printf("\n\n\tPress POWER KEY to %s\n", exit_option);
-
-	/* Clear PWR button Rising edge interrupt status flag */
-	power_key_pressed(KEY_PWR_INTERRUPT_REG);
-
-	/* Wait for PWR key */
-	while (!key_pressed(KEY_POWER))
-		mdelay(1);
-
-	lcd_clear();
-	return leave;
-#else
-	return 0;
-#endif
-}
-
-#ifdef CONFIG_LCD
-static void display_download_menu(int mode)
-{
-	char *selection[BOOT_MODE_EXIT + 1];
-	int i;
-
-	for (i = 0; i <= BOOT_MODE_EXIT; i++)
-		selection[i] = "[  ]";
-
-	selection[mode] = "[=>]";
-
-	lcd_clear();
-	lcd_printf("\n\n\t\tDownload Mode Menu\n\n");
-
-	for (i = 0; i <= BOOT_MODE_EXIT; i++)
-		lcd_printf("\t%s  %s - %s\n\n", selection[i],
-			   mode_name[i][0], mode_info[i]);
-}
-#endif
-
-static void download_menu(void)
-{
-#ifdef CONFIG_LCD
-	int mode = 0;
-	int last_mode = 0;
-	int run;
-	int key = 0;
-	int timeout = 15; /* sec */
-	int i;
-
-	display_download_menu(mode);
-
-	lcd_puts("\n");
-
-	/* Start count if no key is pressed */
-	while (check_keys())
-		continue;
-
-	while (timeout--) {
-		lcd_printf("\r\tNormal boot will start in: %2.d seconds.",
-			   timeout);
-
-		/* about 1000 ms in for loop */
-		for (i = 0; i < 10; i++) {
-			mdelay(100);
-			key = check_keys();
-			if (key)
-				break;
-		}
-		if (key)
-			break;
-	}
-
-	if (!key) {
-		lcd_clear();
-		return;
-	}
-
-	while (1) {
-		run = 0;
-
-		if (mode != last_mode)
-			display_download_menu(mode);
-
-		last_mode = mode;
-		mdelay(200);
-
-		key = check_keys();
-		switch (key) {
-		case KEY_POWER:
-			run = 1;
-			break;
-		case KEY_VOLUMEUP:
-			if (mode > 0)
-				mode--;
-			break;
-		case KEY_VOLUMEDOWN:
-			if (mode < BOOT_MODE_EXIT)
-				mode++;
-			break;
-		default:
-			break;
-		}
-
-		if (run) {
-			if (mode_leave_menu(mode))
-				run_command("reset", 0);
-
-			display_download_menu(mode);
-		}
-	}
-
-	lcd_clear();
-#endif
-}
-
-void check_boot_mode(void)
-{
-	int pwr_key;
-
-	pwr_key = power_key_pressed(KEY_PWR_STATUS_REG);
-	if (!pwr_key)
-		return;
-
-	/* Clear PWR button Rising edge interrupt status flag */
-	power_key_pressed(KEY_PWR_INTERRUPT_REG);
-
-	if (key_pressed(KEY_VOLUMEUP))
-		download_menu();
-	else if (key_pressed(KEY_VOLUMEDOWN))
-		mode_leave_menu(BOOT_MODE_THOR);
-}
-
-void keys_init(void)
-{
-	/* Set direction to input */
-	gpio_request(KEY_VOL_UP_GPIO, "volume-up");
-	gpio_request(KEY_VOL_DOWN_GPIO, "volume-down");
-	gpio_direction_input(KEY_VOL_UP_GPIO);
-	gpio_direction_input(KEY_VOL_DOWN_GPIO);
-}
-#endif /* CONFIG_LCD_MENU */
-
 #ifdef CONFIG_CMD_BMP
 void draw_logo(void)
 {
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h
index a2b62f5f6de..f94135355ab 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -98,9 +98,6 @@ int universal_spi_read(void);
 /* Common misc for Samsung */
 #define CONFIG_MISC_COMMON
 
-/* Download menu - Samsung common */
-#define CONFIG_LCD_MENU
-
 /* Download menu - definitions for check keys */
 #ifndef __ASSEMBLY__
 
diff --git a/include/configs/trats.h b/include/configs/trats.h
index daa8cc79b2f..9e4cd6794cc 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -128,9 +128,6 @@
 /* Common misc for Samsung */
 #define CONFIG_MISC_COMMON
 
-/* Download menu - Samsung common */
-#define CONFIG_LCD_MENU
-
 /* Download menu - definitions for check keys */
 #ifndef __ASSEMBLY__
 
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 052045a6014..dc28ded9825 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -118,9 +118,6 @@
 /* Common misc for Samsung */
 #define CONFIG_MISC_COMMON
 
-/* Download menu - Samsung common */
-#define CONFIG_LCD_MENU
-
 /* Download menu - definitions for check keys */
 #ifndef __ASSEMBLY__
 
diff --git a/include/samsung/misc.h b/include/samsung/misc.h
index 4ff28a1df0e..89546a1cbcc 100644
--- a/include/samsung/misc.h
+++ b/include/samsung/misc.h
@@ -9,21 +9,6 @@ u32 get_board_rev(void);
 void set_board_info(void);
 #endif
 
-#ifdef CONFIG_LCD_MENU
-enum {
-	BOOT_MODE_INFO,
-	BOOT_MODE_THOR,
-	BOOT_MODE_UMS,
-	BOOT_MODE_DFU,
-	BOOT_MODE_GPT,
-	BOOT_MODE_ENV,
-	BOOT_MODE_EXIT,
-};
-
-void keys_init(void);
-void check_boot_mode(void);
-#endif /* CONFIG_LCD_MENU */
-
 #ifdef CONFIG_CMD_BMP
 void draw_logo(void);
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 1284b76f61b..7dd9cbb7b2e 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -263,7 +263,6 @@ CONFIG_KSNET_SERDES_SGMII2_BASE
 CONFIG_KSNET_SERDES_SGMII_BASE
 CONFIG_L1_INIT_RAM
 CONFIG_L2_CACHE
-CONFIG_LCD_MENU
 CONFIG_LD9040
 CONFIG_LEGACY_BOOTCMD_ENV
 CONFIG_LOADS_ECHO
-- 
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 ` Simon Glass [this message]
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 ` [PATCH 14/39] BuR: Drop old LCD code Simon Glass
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-8-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=agust@denx.de \
    --cc=jh80.chung@samsung.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.