public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Andrei Konovalov <akonovalov@ru•mvista.com>
To: linuxppc-embedded@ozlabs•org
Subject: using drivers/serial/8250.c with platform bus (Virtex 2 Pro and 85xx/83xx)
Date: Mon, 04 Apr 2005 14:53:34 +0400	[thread overview]
Message-ID: <42511CAE.3060600@ru.mvista.com> (raw)

Hi,

Inspired by 85xx, 83xx, and 52xx ports, I've tried to make Xilinx ML300 board to initialize
the 16x50 UART as a platfrom device.
This happened to work after quite a lot of code relying on hard #defines was thrown away
(e.g. arch/ppc/boot/common/ns16550.c needs SERIAL_PORT_DFNS).

Another problem was that serial8250_probe(struct device *dev) from 8250.c walks through the
dev->platform_data[] until the flags field is zero. So I've had to replace

   static struct plat_serial8250_port serial_platform_data = {
         .mapbase        = XPAR_UARTNS550_0_BASEADDR + 3,
         .irq            = XPAR_INTC_0_UARTNS550_0_VEC_ID,
         .uartclk        = XPAR_UARTNS550_0_CLOCK_FREQ_HZ,
         .regshift       = 2,
         .iotype         = UPIO_MEM,
         .flags          = UPF_BOOT_AUTOCONF,
   };

   struct platform_device v2pro_platform_devices[] = {
   #ifdef CONFIG_SERIAL_8250
         {
                 .name = "serial8250",
                 .id     = 0,
                 .dev.platform_data = &serial_platform_data,
         }
   #endif /* CONFIG_SERIAL_8250 */
   };

used originally with

   static struct plat_serial8250_port serial_platform_data[] = {
         {
                 .mapbase        = XPAR_UARTNS550_0_BASEADDR + 3,
                 .irq            = XPAR_INTC_0_UARTNS550_0_VEC_ID,
                 .uartclk        = XPAR_UARTNS550_0_CLOCK_FREQ_HZ,
                 .regshift       = 2,
                 .iotype         = UPIO_MEM,
                 .flags          = UPF_BOOT_AUTOCONF,
         },
         {
                 .flags = 0
         }
   };

   struct platform_device v2pro_platform_devices[] = {
   #ifdef CONFIG_SERIAL_8250
         {
                 .name = "serial8250",
                 .id     = 0,
                 .dev.platform_data = serial_platform_data,
         }
   #endif /* CONFIG_SERIAL_8250 */
   };

That { .flags = 0 }
is missing from 85xx / 83xx code, and my guess is that in that case
the data following serial_platform_data[2] array look like something
with .flags = 0 to the 8250.c.
But wouldn't it be safer to add the { .flags = 0 } terminator
to serial_platform_data[] for 85xx/83xx as well?

Thanks,
Andrei

P.S.
All these XPAR_*'s will be removed when the OF device tree come into play.

                 reply	other threads:[~2005-04-04 10:47 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=42511CAE.3060600@ru.mvista.com \
    --to=akonovalov@ru$(echo .)mvista.com \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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