Skip to contentSkip to conversation

U-Boot-Users Digest, Vol 13, Issue 69

U-Boot-Users Vaibhav Hiremath 1 participant 1 message Jun 21, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): mailman.37651.1182382721.29999.u-boot-users@lists.sourceforge.net

#1 lore raw

Hi All,

I am working with ARM1176 core, and using standard serial driver NS16550. I found one bug in to this function -

The driver doesn't work with baudrate 57600, I debuged this issue and find that small modification is required in function "calc_divisor" - Below is complete function -

CFG_NS16550_CLK = 10000000
MODE_X_DIV=16
static int calc_divisor (NS16550_t port)

{
        unsigned int baudrate_div;
#ifdef CONFIG_OMAP1510
        /* If can't cleanly clock 115200 set div to 1 */
        if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
                port->osc_12m_sel = OSC_12M_SEL;        /* enable 6.5 *
divisor */
                return (1);                             /* return 1 for base
divisor */
        }
        port->osc_12m_sel = 0;                  /* clear if previsouly set
*/
#endif
#ifdef CONFIG_OMAP1610
        /* If can't cleanly clock 115200 set div to 1 */
        if ((CFG_NS16550_CLK == 48000000) && (gd->baudrate == 115200)) {
                return (26);            /* return 26 for base divisor */
        }

#endif

#ifdef CONFIG_APTIX
#define MODE_X_DIV 13
#else
#define MODE_X_DIV 16

#endif
        baudrate_div = (CFG_NS16550_CLK / gd->baudrate);
        if ((baudrate_div%MODE_X_DIV)>7)
                baudrate_div+=8;
        baudrate_div/=MODE_X_DIV;

        return baudrate_div;

}

I have tested with baudrates 9600, 19200, 38400 and 57600. it's working perfectly fine.

Am I on correct path? Please let me know if I am missing something.

Thanks,

Vaibhav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070621/ad00b6b7/attachment.htm