The mpsc_kgdb.c driver can only work with the old PPC kernels -- make it also
work for the PowerPC kernels as well...

---
The patch is against the linux_2_6_24_uprev branch...
Resending with COFNIG_PPC typo fixed.

 arch/powerpc/sysdev/mv64x60_dev.c |    8 ++++++++
 drivers/serial/mpsc_kgdb.c        |   16 +++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -30,6 +30,7 @@
  */
 static int __init mv64x60_mpsc_register_shared_pdev(struct device_node *np)
 {
+       extern void kgdbmpsc_set_shared_dev(struct platform_device *);
        struct platform_device *pdev;
        struct resource r[2];
        struct mpsc_shared_pdata pdata;
@@ -75,6 +76,9 @@ static int __init mv64x60_mpsc_register_
        if (err)
                goto error;
 
+#ifdef CONFIG_KGDB_MPSC
+       kgdbmpsc_set_shared_dev(pdev);
+#endif
        return 0;
 
 error:
@@ -85,6 +89,7 @@ error:
 
 static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id)
 {
+       extern void kgdbmpsc_set_mpsc_dev(struct platform_device *, int);
        struct resource r[5];
        struct mpsc_pdata pdata;
        struct platform_device *pdev;
@@ -195,6 +200,9 @@ static int __init mv64x60_mpsc_device_se
        if (err)
                goto error;
 
+#ifdef CONFIG_KGDB_MPSC
+       kgdbmpsc_set_mpsc_dev(pdev, id);
+#endif
        return 0;
 
 error:
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
@@ -273,6 +273,7 @@ static void __init kgdbmpsc_local_exit(v
                                                    MPSC_BASE_ORDER, mpsc_base);
 }
 
+#ifdef CONFIG_PPC
 static void __init kgdbmpsc_update_pdata(struct platform_device *pdev)
 {
 
@@ -307,11 +308,24 @@ static int __init kgdbmpsc_pdev_init(voi
 }
 
 postcore_initcall(kgdbmpsc_pdev_init);
+#else
+void kgdbmpsc_set_shared_dev(struct platform_device *pdev)
+{
+       memcpy(&shared_dev, pdev, sizeof(struct platform_device));
+}
 
-static int __init kgdbmpsc_init_io(void)
+void kgdbmpsc_set_mpsc_dev(struct platform_device *pdev, int id)
 {
+       if (id == kgdbmpsc_ttyMM)
+               memcpy(&mpsc_dev, pdev, sizeof(struct platform_device));
+}
+#endif /* CONFIG_PPC */
 
+static int __init kgdbmpsc_init_io(void)
+{
+#ifdef CONFIG_PPC
        kgdbmpsc_pdev_init();
+#endif
 
        if (kgdbmpsc_local_init()) {
                kgdbmpsc_local_exit();


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to