Update KGDB serial driver for MPSC:

- merge the necessary #define's from the serial driver -- the shared header file
  has been long killed;

- enable KGDB baud rate option for the driver, change driver's option text to
  be in line with the others;

- fix the write_char() method to accept argument of type 'u8';

- fix the interrupt handler to take only 2 arguments, due to 2.6.19-rc1 change;

- add the missing dot in the platform device name.

While at it, also remove from the "normal" serial driver #define's added by
powerpc-lite.patch for no reason...

Signed-off-by: Sergey Shtylyov <[EMAIL PROTECTED]>

---
The patch is against the top of KGDB patchset in the linux_2_6_21_uprev branch,
it will need some changes to be folded into powerpc-lite.patch...

 drivers/serial/mpsc.c      |    5 ---
 drivers/serial/mpsc_kgdb.c |   59 ++++++++++++++++++++++++++++++++++++++++-----
 lib/Kconfig.kgdb           |    7 +++--
 3 files changed, 57 insertions(+), 14 deletions(-)

Index: linux-2.6/drivers/serial/mpsc.c
===================================================================
--- linux-2.6.orig/drivers/serial/mpsc.c
+++ linux-2.6/drivers/serial/mpsc.c
@@ -242,11 +242,6 @@ struct mpsc_port_info *mpsc_device_remov
 #define        MPSC_RCRR                       0x0004
 #define        MPSC_TCRR                       0x0008
 
-/* MPSC Interrupt registers (offset from MV64x60_SDMA_INTR_OFFSET) */
-#define MPSC_INTR_CAUSE                        0x0004
-#define MPSC_INTR_MASK                 0x0084
-#define MPSC_INTR_CAUSE_RCC            (1<<6)
-
 /* Serial DMA Controller Interface Registers */
 #define        SDMA_SDC                        0x0000
 #define        SDMA_SDCM                       0x0008
Index: linux-2.6/drivers/serial/mpsc_kgdb.c
===================================================================
--- linux-2.6.orig/drivers/serial/mpsc_kgdb.c
+++ linux-2.6/drivers/serial/mpsc_kgdb.c
@@ -7,7 +7,7 @@
  *
  * Author: Randy Vinson <[EMAIL PROTECTED]>
  *
- * 2005 (c) MontaVista Software, Inc.
+ * Copyright (C) 2005-2006 MontaVista Software, Inc.
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
  * Free Software Foundation;  either version 2 of the  License, or (at your
@@ -22,7 +22,55 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 
-#include "mpsc.h"
+/* Main MPSC Configuration Register Offsets */
+#define MPSC_MMCRL             0x0000
+#define MPSC_MMCRH             0x0004
+#define MPSC_MPCR              0x0008
+#define MPSC_CHR_1             0x000c
+#define MPSC_CHR_2             0x0010
+#define MPSC_CHR_3             0x0014
+#define MPSC_CHR_4             0x0018
+#define MPSC_CHR_5             0x001c
+#define MPSC_CHR_6             0x0020
+#define MPSC_CHR_7             0x0024
+#define MPSC_CHR_8             0x0028
+#define MPSC_CHR_9             0x002c
+#define MPSC_CHR_10            0x0030
+#define MPSC_CHR_11            0x0034
+
+#define MPSC_MPCR_FRZ          (1 << 9)
+#define MPSC_MPCR_CL_5         0
+#define MPSC_MPCR_CL_6         1
+#define MPSC_MPCR_CL_7         2
+#define MPSC_MPCR_CL_8         3
+#define MPSC_MPCR_SBL_1        0
+#define MPSC_MPCR_SBL_2        1
+
+#define MPSC_CHR_2_TEV         (1<<1)
+#define MPSC_CHR_2_TA          (1<<7)
+#define MPSC_CHR_2_TTCS                (1<<9)
+#define MPSC_CHR_2_REV         (1<<17)
+#define MPSC_CHR_2_RA          (1<<23)
+#define MPSC_CHR_2_CRD         (1<<25)
+#define MPSC_CHR_2_EH          (1<<31)
+#define MPSC_CHR_2_PAR_ODD     0
+#define MPSC_CHR_2_PAR_SPACE   1
+#define MPSC_CHR_2_PAR_EVEN    2
+#define MPSC_CHR_2_PAR_MARK    3
+
+/* MPSC Signal Routing */
+#define MPSC_MRR               0x0000
+#define MPSC_RCRR              0x0004
+#define MPSC_TCRR              0x0008
+
+/* MPSC Interrupt registers (offset from MV64x60_SDMA_INTR_OFFSET) */
+#define MPSC_INTR_CAUSE        0x0004
+#define MPSC_INTR_MASK         0x0084
+#define MPSC_INTR_CAUSE_RCC    (1<<6)
+
+/* Baud Rate Generator Interface Registers */
+#define BRG_BCR                0x0000
+#define BRG_BTR                0x0004
 
 /* Speed of the UART. */
 static int kgdbmpsc_baud = CONFIG_KGDB_BAUDRATE;
@@ -43,7 +91,7 @@ static void __iomem *sdma_base;
 
 static unsigned int mpsc_irq;
 
-static void kgdb_write_debug_char(int c)
+static void kgdb_write_debug_char(u8 c)
 {
        u32 data;
 
@@ -80,8 +128,7 @@ static int kgdb_get_debug_char(void)
  * line we're in charge of.  If this is true, schedule a breakpoint and
  * return.
  */
-static irqreturn_t
-kgdbmpsc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t kgdbmpsc_interrupt(int irq, void *dev_id)
 {
        if (irq != mpsc_irq)
                return IRQ_NONE;
@@ -227,7 +274,7 @@ static void __init kgdbmpsc_local_exit(v
 static void __init kgdbmpsc_update_pdata(struct platform_device *pdev)
 {
 
-       snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s%u", pdev->name, pdev->id);
+       snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%u", pdev->name, pdev->id);
 }
 
 static int __init kgdbmpsc_pdev_init(void)
Index: linux-2.6/lib/Kconfig.kgdb
===================================================================
--- linux-2.6.orig/lib/Kconfig.kgdb
+++ linux-2.6/lib/Kconfig.kgdb
@@ -91,7 +91,7 @@ config KGDBOE_NOMODULE
          See the documentation for syntax.
 
 config KGDB_MPSC
-       bool "KGDB on MV64x60 MPSC"
+       bool "KGDB: On MV64x60 MPSC"
        depends on SERIAL_MPSC
        help
          Uses a Marvell GT64260B or MV64x60 Multi-Purpose Serial
@@ -212,8 +212,9 @@ config KGDB_SIMPLE_SERIAL
 
 config KGDB_BAUDRATE
        int "Debug serial port baud rate"
-       depends on (KGDB_8250 && KGDB_SIMPLE_SERIAL) || KGDB_CPM_UART \
-               || KGDB_TXX9 || KGDB_PXA_SERIAL || KGDB_AMBA_PL011
+       depends on (KGDB_8250 && KGDB_SIMPLE_SERIAL) || \
+               KGDB_MPSC || KGDB_CPM_UART || \
+               KGDB_TXX9 || KGDB_PXA_SERIAL || KGDB_AMBA_PL011
        default "115200"
        help
          gdb and the kernel stub need to agree on the baud rate to be


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to