Skip to contentSkip to conversation

kgdb: unify kgdb on serial

PATCH New Jean-Christophe PLAGNIOL-VILLARD 2 participants 2 messages May 16, 2009 – Jun 5, 2009 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kgdb: unify kgdb on serial

unify kgdb serial implementatin when we kgdb over the main serial interface (serial_{getc,putc,puts})

introduce CONFIG_KGDB_ON_SERIAL for this purpose otherwise use as curently CONFIG_KGDB_SER_INDEX to define the serial port to use

---
 board/Marvell/common/serial.c                      |   26 --------
 board/amirix/ap1000/serial.c                       |   26 --------
 board/esd/cpci750/serial.c                         |   26 --------
 board/evb64260/serial.c                            |   31 ----------
 board/ml2/serial.c                                 |   26 --------
 board/prodrive/p3mx/serial.c                       |   26 --------
 board/xilinx/ml300/serial.c                        |   31 ----------
 common/Makefile                                    |    1 +
 .../p3mx/serial.c => common/kgdb_on_serial.c       |   64 ++-----------------
 cpu/i386/serial.c                                  |   39 +-----------
 cpu/ppc4xx/4xx_uart.c                              |   39 +-----------
 include/configs/CPCI750.h                          |    1 +
 include/configs/DB64360.h                          |    1 +
 include/configs/DB64460.h                          |    1 +
 include/configs/EVB64260.h                         |    1 +
 include/configs/ML2.h                              |    1 +
 include/configs/P3G4.h                             |    1 +
 include/configs/VCMA9.h                            |    2 +-
 include/configs/ZUMA.h                             |    1 +
 include/configs/actux1.h                           |    2 +-
 include/configs/actux2.h                           |    2 +-
 include/configs/actux3.h                           |    2 +-
 include/configs/actux4.h                           |    2 +-
 include/configs/davinci_dvevm.h                    |    2 +-
 include/configs/davinci_schmoogie.h                |    2 +-
 include/configs/davinci_sffsdr.h                   |    2 +-
 include/configs/davinci_sonata.h                   |    2 +-
 include/configs/lpd7a400.h                         |    2 +-
 include/configs/lpd7a404.h                         |    2 +-
 include/configs/mx1ads.h                           |    2 +-
 include/configs/ns9750dev.h                        |    2 +-
 include/configs/omap1510inn.h                      |    2 +-
 include/configs/omap1610h2.h                       |    2 +-
 include/configs/omap1610inn.h                      |    2 +-
 include/configs/omap5912osk.h                      |    2 +-
 include/configs/omap730p2.h                        |    2 +-
 include/configs/p3mx.h                             |    1 +
 include/configs/sbc2410x.h                         |    2 +-
 include/configs/smdk2400.h                         |    2 +-
 include/configs/smdk2410.h                         |    2 +-
 include/configs/smdk6400.h                         |    2 +-
 include/configs/trab.h                             |    2 +-
 include/configs/xaeniax.h                          |    2 +-
 43 files changed, 46 insertions(+), 345 deletions(-)
 copy board/prodrive/p3mx/serial.c => common/kgdb_on_serial.c (57%)
board/Marvell/common/serial.c +0 -26
index 3e7f406..36c40fe 100644
@@ -144,29 +144,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void kgdb_serial_init (void)
-{
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/amirix/ap1000/serial.c +0 -26
index 87003be..ca46a88 100644
@@ -83,29 +83,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void kgdb_serial_init (void)
-{
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/esd/cpci750/serial.c +0 -26
index e1af37e..69e8780 100644
@@ -79,29 +79,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void kgdb_serial_init (void)
-{
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/evb64260/serial.c +0 -31
index 9d71115..dbc4ee8 100644
@@ -152,34 +152,3 @@ serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void
-kgdb_serial_init(void)
-{
-}
-
-void
-putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void
-putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int
-getDebugChar (void)
-{
-	return serial_getc();
-}
-
-void
-kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/ml2/serial.c +0 -26
index d9113ab..d9f8996 100644
@@ -87,29 +87,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void kgdb_serial_init (void)
-{
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/prodrive/p3mx/serial.c +0 -26
index e1af37e..69e8780 100644
@@ -79,29 +79,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void kgdb_serial_init (void)
-{
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif
board/xilinx/ml300/serial.c +0 -31
index 4215513..6add295 100644
@@ -121,34 +121,3 @@ serial_puts(const char *s)
 		serial_putc(*s++);
 	}
 }
-
-#if defined(CONFIG_CMD_KGDB)
-void
-kgdb_serial_init(void)
-{
-}
-
-void
-putDebugChar(int c)
-{
-	serial_putc(c);
-}
-
-void
-putDebugStr(const char *str)
-{
-	serial_puts(str);
-}
-
-int
-getDebugChar(void)
-{
-	return serial_getc();
-}
-
-void
-kgdb_interruptible(int yes)
-{
-	return;
-}
-#endif
common/Makefile +1 -0
index f47e2ed..235d640 100644
@@ -153,6 +153,7 @@ COBJS-$(CONFIG_CMD_DOC) += docecc.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
 COBJS-y += flash.o
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
+COBJS-$(CONFIG_KGDB_ON_SERIAL) += kgdb_on_serial.o
 COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
common/kgdb_on_serial.c renamed from board/prodrive/p3mx/serial.c +7 -57

85 lines not on this page · raw message

cpu/i386/serial.c +3 -36
index 8b5f8fa..a495f85 100644
@@ -394,16 +394,11 @@ int serial_buffered_tstc(void)
 #endif	/* CONFIG_SERIAL_SOFTWARE_FIFO */
 
 
-#if defined(CONFIG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB) && (CONFIG_KGDB_SER_INDEX & 2)
 /*
-  AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
-  number 0 or number 1
-  - if CONFIG_KGDB_SER_INDEX = 1 => serial port number 0 :
-  configuration has been already done
-  - if CONFIG_KGDB_SER_INDEX = 2 => serial port number 1 :
-  configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
+ * use the serial number 1
+ * configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
 */
-#if (CONFIG_KGDB_SER_INDEX & 2)
 void kgdb_serial_init(void)
 {
 	volatile char val;
@@ -472,32 +467,4 @@ void kgdb_interruptible(int yes)
 {
 	return;
 }
-
-#else	/* ! (CONFIG_KGDB_SER_INDEX & 2) */
-
-void kgdb_serial_init(void)
-{
-	serial_printf ("[on serial] ");
-}
-
-void putDebugChar(int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr(const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar(void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible(int yes)
-{
-	return;
-}
-#endif	/* (CONFIG_KGDB_SER_INDEX & 2) */
 #endif
cpu/ppc4xx/4xx_uart.c +3 -36
index c106ac2..692b801 100644
@@ -644,16 +644,11 @@ int serial_buffered_tstc (void)
 
 #endif	/* CONFIG_SERIAL_SOFTWARE_FIFO */
 
-#if defined(CONFIG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB) && (CONFIG_KGDB_SER_INDEX & 2)
 /*
-  AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
-  number 0 or number 1
-  - if CONFIG_KGDB_SER_INDEX = 1 => serial port number 0 :
-  configuration has been already done
-  - if CONFIG_KGDB_SER_INDEX = 2 => serial port number 1 :
-  configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
+ * use serial port number 1 :
+ * configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
 */
-#if (CONFIG_KGDB_SER_INDEX & 2)
 void kgdb_serial_init (void)
 {
 	u8 val;
@@ -722,34 +717,6 @@ void kgdb_interruptible (int yes)
 {
 	return;
 }
-
-#else	/* ! (CONFIG_KGDB_SER_INDEX & 2) */
-
-void kgdb_serial_init (void)
-{
-	serial_printf ("[on serial] ");
-}
-
-void putDebugChar (int c)
-{
-	serial_putc (c);
-}
-
-void putDebugStr (const char *str)
-{
-	serial_puts (str);
-}
-
-int getDebugChar (void)
-{
-	return serial_getc ();
-}
-
-void kgdb_interruptible (int yes)
-{
-	return;
-}
-#endif	/* (CONFIG_KGDB_SER_INDEX & 2) */
 #endif
 
 
include/configs/CPCI750.h +1 -0
index 8494faa..8c9a957 100644
@@ -189,6 +189,7 @@
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/DB64360.h +1 -0
index 160871b..9d6228e 100644
@@ -273,6 +273,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/DB64460.h +1 -0
index 06fd157..899b645 100644
@@ -211,6 +211,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/EVB64260.h +1 -0
index bf41c13..18855eb 100644
@@ -127,6 +127,7 @@
 #define	CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define	CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define	CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define	CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/ML2.h +1 -0
index 5fcc173..fa85d51 100644
@@ -114,6 +114,7 @@
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define	CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define	CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/P3G4.h +1 -0
index 971338a..df6d19c 100644
@@ -154,6 +154,7 @@
 #define	CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define	CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define	CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define	CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/VCMA9.h +1 -1
index 1bab0f1..d286d07 100644
@@ -155,7 +155,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/ZUMA.h +1 -0
index b73aaa8..e9dc3dc 100644
@@ -149,6 +149,7 @@
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size	*/
 #else
 #define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size	*/
include/configs/actux1.h +1 -1
index 91f6ff0..c71bda7 100644
@@ -77,7 +77,7 @@
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE		230400
 /* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX		1
+# define CONFIG_KGDB_ON_SERIAL
 #endif
 
 /* Miscellaneous configurable options */
include/configs/actux2.h +1 -1
index b936938..98a6787 100644
@@ -68,7 +68,7 @@
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE		230400
 /* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX		1
+# define CONFIG_KGDB_ON_SERIAL
 #endif
 
 /* Miscellaneous configurable options */
include/configs/actux3.h +1 -1
index f5ee899..4c37f2d 100644
@@ -66,7 +66,7 @@
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE		230400
 /* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX		1
+# define CONFIG_KGDB_ON_SERIAL
 #endif
 
 /* Miscellaneous configurable options */
include/configs/actux4.h +1 -1
index 8d70a26..13fc084 100644
@@ -65,7 +65,7 @@
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE		230400
 /* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX		1
+# define CONFIG_KGDB_ON_SERIAL
 #endif
 
 /* Miscellaneous configurable options */
include/configs/davinci_dvevm.h +1 -1
index 6c5d065..2309bf2 100644
@@ -235,6 +235,6 @@
 /*=======================*/
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
include/configs/davinci_schmoogie.h +1 -1
index 6612cb3..db795aa 100644
@@ -153,6 +153,6 @@
 /*=======================*/
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
include/configs/davinci_sffsdr.h +1 -1
index 6c1dc11..349d3ba 100644
@@ -146,6 +146,6 @@
 /* KGDB support (if any) */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
include/configs/davinci_sonata.h +1 -1
index 893729c..c602321 100644
@@ -205,6 +205,6 @@
 /*=======================*/
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
include/configs/lpd7a400.h +1 -1
index b1bd74f..b4b858b 100644
@@ -83,7 +83,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/lpd7a404.h +1 -1
index b197674..fb9aebc 100644
@@ -83,7 +83,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/mx1ads.h +1 -1
index 12e567b..005a1ff 100644
@@ -107,7 +107,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 						/* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/ns9750dev.h +1 -1
index 79dcd64..a198cfc 100644
@@ -106,7 +106,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/omap1510inn.h +1 -1
index 8408209..65712e8 100644
@@ -114,7 +114,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/omap1610h2.h +1 -1
index 42e0198..c485eea 100644
@@ -108,7 +108,7 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 
 /*
include/configs/omap1610inn.h +1 -1
index 22c873e..aa28116 100644
@@ -113,7 +113,7 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 
 /*
include/configs/omap5912osk.h +1 -1
index d0ce9dc..be55579 100644
@@ -117,7 +117,7 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use */
 #endif
 
 /*
include/configs/omap730p2.h +1 -1
index 32a9b23..26057eb 100644
@@ -124,7 +124,7 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	   115200    /* Speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	   1	     /* Which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL	     /* Which serial port to use */
 #endif
 
 /*
include/configs/p3mx.h +1 -0
index 5e4d30b..c9392be 100644
@@ -291,6 +291,7 @@
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	        "=> "	/* Monitor Command Prompt	*/
 #if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_ON_SERIAL
 #define CONFIG_SYS_CBSIZE	        1024	/* Console I/O Buffer Size	*/
 #else
 #define CONFIG_SYS_CBSIZE	        256	/* Console I/O Buffer Size	*/
include/configs/sbc2410x.h +1 -1
index d0ee582..31aaa51 100644
@@ -121,7 +121,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/smdk2400.h +1 -1
index 20adfca..5a471fb 100644
@@ -123,7 +123,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/smdk2410.h +1 -1
index 0215e99..8acb7d6 100644
@@ -106,7 +106,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/smdk6400.h +1 -1
index cac58cf..2973941 100644
@@ -120,7 +120,7 @@
 
 #if (CONFIG_COMMANDS & CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use	 */
+#define CONFIG_KGDB_ON_SERIAL	/* which serial port to use	 */
 #endif
 
 /*
include/configs/trab.h +1 -1
index cb5a051..544a503 100644
@@ -298,7 +298,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX	1		/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL		/* which serial port to use */
 #endif
 
 /*
include/configs/xaeniax.h +1 -1
index 1632d29..8999130 100644
@@ -105,7 +105,7 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200			/* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX	1			/* which serial port to use */
+#define CONFIG_KGDB_ON_SERIAL			/* which serial port to use */
 #endif
 
 /*
Signature · 1 line
1.6.1.3
#1 lore raw

PATCH 1/1 kgdb: unify kgdb on serial

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 8 lines · In message <[email protected]> you wrote:

unify kgdb serial implementatin when we kgdb over the main serial interface (serial_{getc,putc,puts})

introduce CONFIG_KGDB_ON_SERIAL for this purpose otherwise use as curently CONFIG_KGDB_SER_INDEX to define the serial port to use

...

The new CONFIG_KGDB_ON_SERIAL variable needs to be documented in the README, and the exact use of CONFIG_KGDB_SER_INDEX in the new context needs to be explained, too.

Quoted 10 lines
cpu/i386/serial.c +1 -1
index 8b5f8fa..a495f85 100644
@@ -394,16 +394,11 @@ int serial_buffered_tstc(void)
 #endif	/* CONFIG_SERIAL_SOFTWARE_FIFO */
 
 
-#if defined(CONFIG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB) && (CONFIG_KGDB_SER_INDEX & 2)

cpu/i386/serial.c int serial_buffered_tstc(void) · line 401

Quoted 10 lines
cpu/i386/serial.c +2 -6
 /*
-  AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
-  number 0 or number 1
-  - if CONFIG_KGDB_SER_INDEX = 1 => serial port number 0 :
-  configuration has been already done
-  - if CONFIG_KGDB_SER_INDEX = 2 => serial port number 1 :
-  configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
+ * use the serial number 1
+ * configure port 1 for serial I/O with rate = CONFIG_KGDB_BAUDRATE
 */

I don;t understand the use of "CONFIG_KGDB_SER_INDEX & 2" here; the old (deleted) comment would be helpful, but I don;t understand if it still applies with your changes.

This needs better documentation / comments.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A fractal is by definition a set for which the Hausdorff Besicovitch
dimension strictly exceeds the topological dimension."
- Mandelbrot, _The Fractal Geometry of Nature_