[U-Boot] [PATCH 1/5] Remove unused CONFIG_MODEM_SUPPORT option and associated dead code.

David Müller d.mueller at elsoft.ch
Sat Feb 6 07:57:25 CET 2016


Signed-off-by: David Müller <d.mueller at elsoft.ch>
---
 arch/powerpc/cpu/mpc8xx/serial.c  |  22 ---------
 common/Makefile                   |   1 -
 common/board_f.c                  |   3 --
 common/main.c                     |  14 ------
 common/modem.c                    | 100 --------------------------------------
 drivers/serial/serial_s3c24x0.c   |  18 -------
 include/asm-generic/global_data.h |   4 --
 7 files changed, 162 deletions(-)
 delete mode 100644 common/modem.c

diff --git a/arch/powerpc/cpu/mpc8xx/serial.c b/arch/powerpc/cpu/mpc8xx/serial.c
index af65c96..94c785f 100644
--- a/arch/powerpc/cpu/mpc8xx/serial.c
+++ b/arch/powerpc/cpu/mpc8xx/serial.c
@@ -268,11 +268,6 @@ smc_putc(const char c)
 	volatile cpm8xx_t	*cpmp = &(im->im_cpm);
 	volatile serialbuffer_t	*rtx;
 
-#ifdef CONFIG_MODEM_SUPPORT
-	if (gd->be_quiet)
-		return;
-#endif
-
 	if (c == '\n')
 		smc_putc ('\r');
 
@@ -527,11 +522,6 @@ scc_putc(const char c)
 	volatile immap_t	*im = (immap_t *)CONFIG_SYS_IMMR;
 	volatile cpm8xx_t	*cpmp = &(im->im_cpm);
 
-#ifdef CONFIG_MODEM_SUPPORT
-	if (gd->be_quiet)
-		return;
-#endif
-
 	if (c == '\n')
 		scc_putc ('\r');
 
@@ -637,18 +627,6 @@ void mpc8xx_serial_initialize(void)
 #endif
 }
 
-#ifdef CONFIG_MODEM_SUPPORT
-void disable_putc(void)
-{
-	gd->be_quiet = 1;
-}
-
-void enable_putc(void)
-{
-	gd->be_quiet = 0;
-}
-#endif
-
 #if defined(CONFIG_CMD_KGDB)
 
 void
diff --git a/common/Makefile b/common/Makefile
index 5998411..117178a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -82,7 +82,6 @@ obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
-obj-$(CONFIG_MODEM_SUPPORT) += modem.o
 obj-$(CONFIG_UPDATE_TFTP) += update.o
 obj-$(CONFIG_DFU_TFTP) += update.o
 obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
diff --git a/common/board_f.c b/common/board_f.c
index c470b59..a960144 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -162,9 +162,6 @@ static int display_text_info(void)
 		text_base, bss_start, bss_end);
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
-	debug("Modem Support enabled\n");
-#endif
 #ifdef CONFIG_USE_IRQ
 	debug("IRQ Stack: %08lx\n", IRQ_STACK_START);
 	debug("FIQ Stack: %08lx\n", FIQ_STACK_START);
diff --git a/common/main.c b/common/main.c
index 5a03181..1a2ef39 100644
--- a/common/main.c
+++ b/common/main.c
@@ -20,19 +20,6 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 __weak void show_boot_progress(int val) {}
 
-static void modem_init(void)
-{
-#ifdef CONFIG_MODEM_SUPPORT
-	debug("DEBUG: main_loop:   gd->do_mdm_init=%lu\n", gd->do_mdm_init);
-	if (gd->do_mdm_init) {
-		char *str = getenv("mdm_cmd");
-
-		setenv("preboot", str);  /* set or delete definition */
-		mdm_init(); /* wait for modem connection */
-	}
-#endif  /* CONFIG_MODEM_SUPPORT */
-}
-
 static void run_preboot_environment_command(void)
 {
 #ifdef CONFIG_PREBOOT
@@ -66,7 +53,6 @@ void main_loop(void)
 	puts("upgraded by the late 2014 may break or be removed.\n");
 #endif
 
-	modem_init();
 #ifdef CONFIG_VERSION_VARIABLE
 	setenv("ver", version_string);  /* set version variable */
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/common/modem.c b/common/modem.c
deleted file mode 100644
index 96b1064..0000000
--- a/common/modem.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * (C) Copyright 2002-2009
- * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-
-/* 'inline' - We have to do it fast */
-static inline void mdm_readline(char *buf, int bufsiz)
-{
-	char c;
-	char *p;
-	int n;
-
-	n = 0;
-	p = buf;
-	for(;;) {
-		c = serial_getc();
-
-		debug("(%c)", c);
-
-		switch(c) {
-		case '\r':
-			break;
-		case '\n':
-			*p = '\0';
-			return;
-
-		default:
-			if(n++ > bufsiz) {
-				*p = '\0';
-				return; /* sanity check */
-			}
-			*p = c;
-			p++;
-			break;
-		}
-	}
-}
-
-int mdm_init (void)
-{
-	char env_str[16];
-	char *init_str;
-	int i;
-	extern void enable_putc(void);
-	extern int hwflow_onoff(int);
-
-	enable_putc(); /* enable serial_putc() */
-
-#ifdef CONFIG_HWFLOW
-	init_str = getenv("mdm_flow_control");
-	if (init_str && (strcmp(init_str, "rts/cts") == 0))
-		hwflow_onoff (1);
-	else
-		hwflow_onoff(-1);
-#endif
-
-	for (i = 1;;i++) {
-		sprintf(env_str, "mdm_init%d", i);
-		if ((init_str = getenv(env_str)) != NULL) {
-			serial_puts(init_str);
-			serial_puts("\n");
-			for(;;) {
-				mdm_readline(console_buffer, CONFIG_SYS_CBSIZE);
-				debug("ini%d: [%s]", i, console_buffer);
-
-				if ((strcmp(console_buffer, "OK") == 0) ||
-					(strcmp(console_buffer, "ERROR") == 0)) {
-					debug("ini%d: cmd done", i);
-					break;
-				} else /* in case we are originating call ... */
-					if (strncmp(console_buffer, "CONNECT", 7) == 0) {
-						debug("ini%d: connect", i);
-						return 0;
-					}
-			}
-		} else
-			break; /* no init string - stop modem init */
-
-		udelay(100000);
-	}
-
-	udelay(100000);
-
-	/* final stage - wait for connect */
-	for(;i > 1;) { /* if 'i' > 1 - wait for connection
-				  message from modem */
-		mdm_readline(console_buffer, CONFIG_SYS_CBSIZE);
-		debug("ini_f: [%s]", console_buffer);
-		if (strncmp(console_buffer, "CONNECT", 7) == 0) {
-			debug("ini_f: connected");
-			return 0;
-		}
-	}
-
-	return 0;
-}
diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
index 7afc504..4cc94d9 100644
--- a/drivers/serial/serial_s3c24x0.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -164,30 +164,12 @@ int hwflow_onoff(int on)
 }
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
-static int be_quiet = 0;
-void disable_putc(void)
-{
-	be_quiet = 1;
-}
-
-void enable_putc(void)
-{
-	be_quiet = 0;
-}
-#endif
-
-
 /*
  * Output a single byte to the serial port.
  */
 static void _serial_putc(const char c, const int dev_index)
 {
 	struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index);
-#ifdef CONFIG_MODEM_SUPPORT
-	if (be_quiet)
-		return;
-#endif
 
 	while (!(readl(&uart->utrstat) & 0x2))
 		/* wait for room in the tx FIFO */ ;
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index a587d3c..f2810a1 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -48,10 +48,6 @@ typedef struct global_data {
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long precon_buf_idx;	/* Pre-Console buffer index */
 #endif
-#ifdef CONFIG_MODEM_SUPPORT
-	unsigned long do_mdm_init;
-	unsigned long be_quiet;
-#endif
 	unsigned long env_addr;	/* Address  of Environment struct */
 	unsigned long env_valid;	/* Checksum of Environment valid? */
 
-- 
1.8.4



More information about the U-Boot mailing list