
Hi!
I have some problems with understanding the serial initialization. Maybe someone can help me out here...
In my case I want to use a second serial console on a DM365 davinci dvevm which is provided on an external chip through EMIF. The use case would be then to switch from the internal SoC serial (ns16550) to the second external console and back during runtime.
So here is my question:
While board initialization, serial_init() gets called, which calls the driver specific (hardware, etc...) init stuff. The default is that the default serial (in my case the SoC ns16550 ) will be initialized. So my extra serial port stays uninitialized because it's not default.
When i switch stdout/stdin/stderr to the second serial port during runtime, serial_assign() gets called, but without calling serial_init () of the second serial port first.
This confuses me, or am I misunderstanding the architecture / how serial interfaces work in uboot?
Thanks for your help, Valentin

On Thu, Mar 18, 2010 at 12:33 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote: ...
While board initialization, serial_init() gets called, which calls the driver specific (hardware, etc...) init stuff. The default is that the default serial (in my case the SoC ns16550 ) will be initialized. So my extra serial port stays uninitialized because it's not default.
Did you add the CONFIG_SYS_NS16550_COM2 in your board configuration file?

well, i don't want to use the second com port of the ns16550. Im using an external serial chip over EMIF. so -> no, i don't, wouldn't make any sense to me...
thx for the help
On 18.03.2010, at 12:31, Michael Zaidman wrote:
On Thu, Mar 18, 2010 at 12:33 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote: ...
While board initialization, serial_init() gets called, which calls the driver specific (hardware, etc...) init stuff. The default is that the default serial (in my case the SoC ns16550 ) will be initialized. So my extra serial port stays uninitialized because it's not default.
Did you add the CONFIG_SYS_NS16550_COM2 in your board configuration file?

On Thu, Mar 18, 2010 at 2:21 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote:
well, i don't want to use the second com port of the ns16550. Im using an external serial chip over EMIF.
I am not familiar with Davinci architecture and probably my case is completely different from yours but on our board we have dual uart on mpc8349 chip + external quad uart ns16554 chip connected via local bus. The current u-boot code supports up to 4 ns16550 devices, i.e. from COM1 to COM4. So I extended the serial_ports array to 6 entries and in this way got ability to communicate via COM5 and COM6.
Michael.

I see...I think we have a very similar setup, and I see how you init your ports. Although I'm not sure if this is suitable for me, since editing the ns16550-files to support/init an external COM-chip is not a really clean/nice implementation.
I'm not sure if there is any way to implement this in a nice way. But I will let you know if we find something ;)
thx for your help! Valentin
On 18.03.2010, at 15:37, Michael Zaidman wrote:
On Thu, Mar 18, 2010 at 2:21 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote:
well, i don't want to use the second com port of the ns16550. Im using an external serial chip over EMIF.
I am not familiar with Davinci architecture and probably my case is completely different from yours but on our board we have dual uart on mpc8349 chip + external quad uart ns16554 chip connected via local bus. The current u-boot code supports up to 4 ns16550 devices, i.e. from COM1 to COM4. So I extended the serial_ports array to 6 entries and in this way got ability to communicate via COM5 and COM6.
Michael.

On Thu, Mar 18, 2010 at 4:58 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote:
I see...I think we have a very similar setup, and I see how you init your ports. Although I'm not sure if this is suitable for me, since editing the ns16550-files to support/init an external COM-chip is not a really clean/nice implementation.
I'm not sure if there is any way to implement this in a nice way. But I will let you know if we find something ;)
I implemented it first in board specific code. It added small code overhead due to necessity to duplicate the serial_ports array and add uart_init for ports higher then 4. Afterwards, I implemented the same in common code. Extending the original serial_ports array makes the code more generic. I also added serial loopback tests availible via CLI and POST. I am going to post this patch on u-boot-list promptly.
Michael.

On Thu, Mar 18, 2010 at 5:23 PM, Michael Zaidman michael.zaidman@gmail.com wrote:
On Thu, Mar 18, 2010 at 4:58 PM, Valentin Ecker valentin.ecker.dev@gmail.com wrote:
I see...I think we have a very similar setup, and I see how you init your ports. Although I'm not sure if this is suitable for me, since editing the ns16550-files to support/init an external COM-chip is not a really clean/nice implementation.
I'm not sure if there is any way to implement this in a nice way. But I will let you know if we find something ;)
I implemented it first in board specific code. It added small code overhead due to necessity to duplicate the serial_ports array and add uart_init for ports higher then 4. Afterwards, I implemented the same in common code. Extending the original serial_ports array makes the code more generic. I also added serial loopback tests availible via CLI and POST. I am going to post this patch on u-boot-list promptly.
Michael.
Link to the patches: http://lists.denx.de/pipermail/u-boot/2010-March/068796.html http://lists.denx.de/pipermail/u-boot/2010-March/068797.html
Any comments/suggestions/objections?
Regards, Michael
participants (2)
-
Michael Zaidman
-
Valentin Ecker