* [U-Boot] serial : Device tree support for multiple serial devices.
@ 2012-01-23 21:01 hanumant
2012-01-30 18:35 ` Simon Glass
0 siblings, 1 reply; 4+ messages in thread
From: hanumant @ 2012-01-23 21:01 UTC (permalink / raw)
To: u-boot
Hi
The board that I am working on has multiple serial ports.
I am trying to use device trees to configure board resource of these
ports as well as the serial framework. So the driver doesnot know
apriori the number of uart ports on the board. But querries the device
tree for it.I am facing the following issues.
1) Ports are memory mapped and each port has its own register space.
As such the serial framework apis dont provide for passing a port id at
the time of the call. So how do i access the correct register space for
the corresponding port?. Or should i define for my own set of apis to be
called by clients, allowing me to access specific ports corresponding
address space, and use the serial framework api's only for the default
serial console?
2) the default serial console, also gets configured based on information
obtained from the device tree, at run time. If i keep a global
representation of the default serial console with its base address etc,
it will still have to be reinitialized after relocation. The
default_serial_console() gives me an opportunity to reinitialize the
global structure. Is that the way to go?
Thanks
Hanumant
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] serial : Device tree support for multiple serial devices.
2012-01-23 21:01 [U-Boot] serial : Device tree support for multiple serial devices hanumant
@ 2012-01-30 18:35 ` Simon Glass
2012-01-30 23:18 ` hanumant
0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2012-01-30 18:35 UTC (permalink / raw)
To: u-boot
Hi,
On Mon, Jan 23, 2012 at 1:01 PM, hanumant <hanumant07@gmail.com> wrote:
> Hi
>
> ? ? ? ?The board that I am working on has multiple serial ports.
> I am trying to use device trees to configure board resource of these ports
> as well as the serial framework. So the driver doesnot know apriori the
> number of uart ports on the board. But querries the device tree for it.I am
> facing the following issues.
>
> 1) Ports are memory mapped and each port has its own register space.
> As such the serial framework apis dont provide for passing a port id at the
> time of the call. So how do i access the correct register space for the
> corresponding port?. Or should i define for my own set of apis to be called
> by clients, allowing me to access specific ports corresponding address
> space, and use the serial framework api's only for the default serial
> console?
>
> 2) the default serial console, also gets configured based on information
> obtained from the device tree, at run time. If i keep a global
> representation of the default serial console with its base address etc, it
> will still have to be reinitialized after relocation. The
> default_serial_console() gives me an opportunity to reinitialize the global
> structure. Is that the way to go?
I have done similar things. IMO the right way to go is to refactor the
serial API so that it takes a device pointer as the first parameter. I
haven't done it though.
What I did for now was to implement a new fdt_serial.c file which
defines 4 separate sets of function (each set containing putc, getc,
etc.) with the device pointer built in to those functions. It's really
ugly, and is what eserial does. Those functions look up the device
tree during init and redirect to the real serial driver's functions of
the same name.
I could probably rustle up a patch if it would help.
Regards,
Simon
>
> Thanks
> Hanumant
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] serial : Device tree support for multiple serial devices.
2012-01-30 18:35 ` Simon Glass
@ 2012-01-30 23:18 ` hanumant
2012-02-21 6:41 ` Simon Glass
0 siblings, 1 reply; 4+ messages in thread
From: hanumant @ 2012-01-30 23:18 UTC (permalink / raw)
To: u-boot
On 1/30/2012 10:35 AM, Simon Glass wrote:
> What I did for now was to implement a new fdt_serial.c file which
> defines 4 separate sets of function (each set containing putc, getc,
> etc.) with the device pointer built in to those functions. It's really
> ugly, and is what eserial does. Those functions look up the device
> tree during init and redirect to the real serial driver's functions of
> the same name.
>
> I could probably rustle up a patch if it would help.
Thank you a patch would help a great deal.
Thanks
hanumant
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] serial : Device tree support for multiple serial devices.
2012-01-30 23:18 ` hanumant
@ 2012-02-21 6:41 ` Simon Glass
0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2012-02-21 6:41 UTC (permalink / raw)
To: u-boot
Hi,
On Mon, Jan 30, 2012 at 3:18 PM, hanumant <hanumant07@gmail.com> wrote:
> On 1/30/2012 10:35 AM, Simon Glass wrote:
>>
>> What I did for now was to implement a new fdt_serial.c file which
>> defines 4 separate sets of function (each set containing putc, getc,
>> etc.) with the device pointer built in to those functions. It's really
>> ugly, and is what eserial does. Those functions look up the device
>> tree during init and redirect to the real serial driver's functions of
>> the same name.
>>
>> I could probably rustle up a patch if it would help.
>
>
> Thank you a patch would help a great deal.
Maybe too late to be useful, but I have finally got to this, and sent
a patch to the list.
>
> Thanks
> hanumant
Regards,
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-21 6:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 21:01 [U-Boot] serial : Device tree support for multiple serial devices hanumant
2012-01-30 18:35 ` Simon Glass
2012-01-30 23:18 ` hanumant
2012-02-21 6:41 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox