[PATCH] Xilinx UART Lite 2.6.18 driver

Peter Korsgaard jacmet at sunsite.dk
Fri Oct 13 17:08:34 EST 2006


>>>>> "David" == David Bolcsfoldi <dbolcsfoldi at gmail.com> writes:

Hi,

David> No I did not know that unfortunately, it could have saved me
David> some work.  You are of course right and I'd much prefer to make
David> changes to your driver instead of writing another one.

It unfortunately happens all the time - Googling a bit around before
writing code often pays off ;)

David> I've noticed that in the probe function it tries to get some
David> resources from the platform_device structure but it looks like
David> that this operation will always fail unless I add a 'uartlite'
David> platform device or have I completely misunderstood how platform
David> devices work?

Yes, you need a platform device with the info, E.G. something like:


#include <linux/platform_device.h>

static struct resource myuartlite_resources[] = {
       [0] = {
                 .start  = 0xa1000003,
                 .end    = 0xa1000012,
                 .flags  = IORESOURCE_MEM,
              },
       [1] = {
                 .start  = 2,
                 .end    = 2,
                 .flags  = IORESOURCE_IRQ,
       },
};

static struct platform_device my_uartlite = {
       .name                    = "uartlite",
       .id                      = 0,
       .num_resources           = ARRAY_SIZE(myuartlite_resources),
       .resource                = myuartlite_resources,
       .dev.platform_data       = 0,
};

Which you then add to the platform bus (platform_add_devices).

David> But yes, I will try to add support for the things I need to
David> this driver instead, most importantly early console support and
David> move the #defines for register offsets and such into a separate
David> header file per Grants comment.

Great!

-- 
Bye, Peter Korsgaard



More information about the Linuxppc-embedded mailing list