mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Alonso <CALONSO@teldat.es>
To: linux-kernel@vger.kernel.org
Subject: [PATCH]: KGDB patch for PPC boards with console in SMC2
Date: Thu, 2 Aug 2001 11:48:40 +0200	[thread overview]
Message-ID: <41FAD0CB3B6BD3118BE600C04F43DB20C0AF24@CORREO> (raw)

Hello. 
I was testing KGDB yesterday on a Power PC embedded board, and found that it
did not work on boards with the console attached to SMC2 (instead of SMC1,
which is the usual thing) in kernel version 2.4.7. I enclose a copy of the
patch that worked for me between the 
=========BEGIN PATCH====== and =======END PATCH==== lines.

The problems seems to be that the KGDB source code in the kernel assumes
that console port is always SMC1, and sometimes it is not. This is the patch
of file arch/ppc/m8xx_io/uart.c that fixed the problem for me (just changed
a few lines with my_console_write(0, <xxxxx>) to
my_console_write(CONFIG_SERIAL_CONSOLE_PORT, <xxxxx>). After applying this
patch, i was able to connect and debug  the Linux Kernel 2.4.7 and 2.4.8pre8
without trouble.

DISCLAIMER: I know I should not be using KGDB. I know I should look at the
code, use the force, ask Santa Tecla for help (spanish Saint for Computer
Sciencists), but, hey!, you got me, I sometimes use KGDB and, IMHO is a nice
tools for people learning about the Linux kernel (like me).


================================BEGIN
PATCH=======================================
--- linux-2.4.7.orig/arch/ppc/8xx_io/uart.c	Mon Jul  2 23:34:57 2001
+++ linux/arch/ppc/8xx_io/uart.c	Thu Aug  2 11:06:50 2001
@@ -2303,7 +2303,7 @@
 int
 xmon_8xx_write(const char *s, unsigned count)
 {
-	my_console_write(0, s, count);
+	my_console_write(CONFIG_SERIAL_CONSOLE_PORT, s, count);
 	return(count);
 }
 #endif
@@ -2312,7 +2312,7 @@
 void
 putDebugChar(char ch)
 {
-	my_console_write(0, &ch, 1);
+	my_console_write(CONFIG_SERIAL_CONSOLE_PORT, &ch, 1);
 }
 #endif
 
@@ -2398,13 +2398,13 @@
 int
 xmon_8xx_read_poll(void)
 {
-	return(my_console_wait_key(0, 1, NULL));
+	return(my_console_wait_key(CONFIG_SERIAL_CONSOLE_PORT, 1, NULL));
 }
 
 int
 xmon_8xx_read_char(void)
 {
-	return(my_console_wait_key(0, 0, NULL));
+	return(my_console_wait_key(CONFIG_SERIAL_CONSOLE_PORT, 0, NULL));
 }
 #endif
 
@@ -2416,7 +2416,7 @@
 getDebugChar(void)
 {
 	if (kgdb_chars <= 0) {
-		kgdb_chars = my_console_wait_key(0, 0, kgdb_buf);
+		kgdb_chars = my_console_wait_key(CONFIG_SERIAL_CONSOLE_PORT,
0, kgdb_buf);
 		kgdp = kgdb_buf;
 	}
 	kgdb_chars--;
@@ -2444,7 +2444,7 @@
 	 * we do here is give it a different buffer and make it a FIFO.
 	 */
 
-	ser = rs_table;
+	ser = rs_table + CONFIG_SERIAL_CONSOLE_PORT;
 
 	/* Right now, assume we are using SMCs.
 	*/
================================END
PATCH=======================================

If you have any comments/suggestions/whatever, please e-mail them to me at 
calonso@teldat.es

Regards,
Cristian Alonso Aldama
Development Group Manager
R&D Department
e-mail: calonso@teldat.es 
http://www.teldat.es


                 reply	other threads:[~2001-08-02  9:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41FAD0CB3B6BD3118BE600C04F43DB20C0AF24@CORREO \
    --to=calonso@teldat.es \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®