<div>Hi All,</div>
<div> </div>
<div>I am working with ARM1176 core, and using standard serial driver NS16550. </div>
<div>I found one bug in to this function - </div>
<div> </div>
<div>The driver doesn't work with baudrate 57600, I debuged this issue and find that small modification is required in function "calc_divisor" -</div>
<div>Below is complete function -</div>
<div> </div>
<div>CFG_NS16550_CLK = 10000000</div>
<div>MODE_X_DIV=16</div>
<div>static int calc_divisor (NS16550_t port)<br>{<br> unsigned int baudrate_div;<br>#ifdef CONFIG_OMAP1510<br> /* If can't cleanly clock 115200 set div to 1 */<br> if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
<br> port->osc_12m_sel = OSC_12M_SEL; /* enable 6.5 * divisor */<br> return (1); /* return 1 for base divisor */<br> }<br> port->osc_12m_sel = 0; /* clear if previsouly set */
<br>#endif<br>#ifdef CONFIG_OMAP1610<br> /* If can't cleanly clock 115200 set div to 1 */<br> if ((CFG_NS16550_CLK == 48000000) && (gd->baudrate == 115200)) {<br> return (26); /* return 26 for base divisor */
<br> }<br>#endif</div>
<div>
<p>#ifdef CONFIG_APTIX<br>#define MODE_X_DIV 13<br>#else<br>#define MODE_X_DIV 16<br>#endif<br> baudrate_div = (CFG_NS16550_CLK / gd->baudrate);<br> if ((baudrate_div%MODE_X_DIV)>7)<br> baudrate_div+=8;
<br> baudrate_div/=MODE_X_DIV;</p>
<p> return baudrate_div;</p>
<p>}<br></p>
<p>I have tested with baudrates 9600, 19200, 38400 and 57600. it's working perfectly fine.</p>
<p>Am I on correct path? Please let me know if I am missing something.</p>
<p>Thanks,</p>
<p>Vaibhav</p>
<p> </p></div>