Thanks for the patch. It worked. However some of the characters can gabble up. And there are also some extra spaces inserted. Not sure this is an issue with the new driver or the XMD UART.
----- Original Message ----
From: John Williams <jwilliams@xxxxxxxxxxxxxx>
To: microblaze-uclinux@xxxxxxxxxxxxxx
Sent: Monday, January 21, 2008 7:22:55 PM
Subject: Re: [microblaze-uclinux] MDM UART support
Hi Simon,
Simon Tam wrote:
> Does Petalinux support the UART feature of Microblaze Debug
Module
> (MDM)?
It is in 2.4, but not currently in 2.6.
You can try the attached experimental patch to the 2.6 kernel, please
let me know if it works. It builds but I haven't boot tested yet.
It should enumerate any MDM UART as the last numbered TTYSn device. If
you have no uartlite present, and only an MDM UART, it might even
register as the console - give it a try.
The MDM UART IRQ must be connected for this patch to work.
$ cd petalinux-dist
$ patch -p0 < mdm-uart.patch
Regards,
John
-----Inline Attachment Follows-----
Index: linux-2.6.x/drivers/serial/uartlite.c
===================================================================
--- linux-2.6.x/drivers/serial/uartlite.c (revision 3324)
+++ linux-2.6.x/drivers/serial/uartlite.c (working copy)
@@ -479,6 +479,17 @@
},
};
+/* MDM uart has same register interface as uartlite, but we give it a
different
+ name */
+static struct platform_driver mdmuart_platform_driver = {
+ .probe = ulite_probe,
+ .remove = ulite_remove,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "mdm-uart",
+ },
+};
+
int __init ulite_init(void)
{
int ret;
@@ -491,6 +502,12 @@
if (ret)
uart_unregister_driver(&ulite_uart_driver);
+ ret = platform_driver_register(&mdmuart_platform_driver);
+ if (ret) {
+ platform_driver_unregister(&ulite_platform_driver);
+
uart_unregister_driver(&ulite_uart_driver);
+ }
+
return ret;
}
Index: linux-2.6.x/arch/microblaze/platform/common/xuartlite.c
===================================================================
--- linux-2.6.x/arch/microblaze/platform/common/xuartlite.c
(revision 3324)
+++ linux-2.6.x/arch/microblaze/platform/common/xuartlite.c (working
copy)
@@ -35,6 +35,27 @@
} \
}
+/* platform_device niitialiser for MDM_UART */
+#define XILINX_MDMUART_PLATFORM_INITIALISER(n) \
+{ \
+ .name = "mdm-uart", \
+ .id = (n), \
+ .dev.platform_data = 0, \
+ .num_resources = 2,
\
+ .resource = (struct resource[]) { \
+ { \
+ .start = CONFIG_XILINX_MDM_##n##_BASEADDR,\
+ .end = CONFIG_XILINX_MDM_##n##_HIGHADDR,\
+ .flags = IORESOURCE_MEM \
+ }, \
+
{ \
+ .start = CONFIG_XILINX_MDM_##n##_IRQ, \
+ .end = CONFIG_XILINX_MDM_##n##_IRQ, \
+ .flags = IORESOURCE_IRQ, \
+ } \
+ } \
+}
+
static struct platform_device xilinx_uartlite_device[]= {
#ifdef CONFIG_XILINX_UARTLITE_0_INSTANCE
XILINX_UARTLITE_PLATFORM_INITIALISER(0),
@@ -54,6 +75,10 @@
#ifdef CONFIG_XILINX_UARTLITE_5_INSTANCE
XILINX_UARTLITE_PLATFORM_INITIALISER(5),
#endif
+/* Map MDM UART in last, if present and IRQ connected etc */
+#if defined(CONFIG_XILINX_MDM_0_INSTANCE) &&
defined(CONFIG_XILINX_MDM_0_USE_UART) && defined(CONFIG_XILINX_MDM_0_IRQ)
+XILINX_MDMUART_PLATFORM_INITIALISER(0),
+#endif
};
static int __init xuartlite_platform_init(void)