[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] MDM UART support
Hello,
in the macro XILINX_MDMUART_PLATFORM_INITIALISER the "id" field of the
data structure must be set to a different value. For example
.id = (n+6)
Otherwise the id is set to zero and the first uartlite serial line
already occupies this id and the mdm_uart is not integrated. If we do
set the id according to the upper statement, we have to increase the
value of the macro
#define ULITE_NR_UARTS 8
Instead of the original value 4. After these changes the serial JTAG
line works for me. I can start the command
# agetty ttyS6 115200 &
and login as usual on the JTAG serial line. The terminal is a little bit
slow but it works.
Regards,
Hans
John Williams <jwilliams@xxxxxxxxxxxxxx> wrote:
> 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
> 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)
--
Dr. Johann Pfefferl ------------ mailto j.pfefferl at eubus dot net
Eubus GmbH http://www.eubus.net +++++ http://www.hydraxc.com
Gollierstr. 70
D-80339 Muenchen
Phone: +49 (0)89 45 22 578-67 Fax: +49 (0)89 45 22 578-55
Registergericht Muenchen HRB 145 336, Ust-Id Nr. DE 225 783 933
Geschaeftsfuehrer: Volker Ulrich, Peter Sibities
==
-o) A computer program does what you tell it to do,
/\\ not what you want it to do.
_\_v-
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/