Message ID | 20090414030812.GC17618@linux-sh.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Dear Paul I'm sorry I took miss on explain > > Current SCIFA use module_clk, > > and above calculation for SH7723 is (mey be) depend on ap325 board. > > module_clk of ap325 is 33MHz and bus_clk is 66MHz, > > mey be (clk*2) mean it. > > But ms7724se module_clk is 33MHz and bus_clk is 83MHz. > > So, ms7724se board's SCIFA can not work on it. This explain was wrong. bus_clk = module_clk * 2 is correct on SH7723/SH7724 I'm sorry again. But SCBRR calculation is wrong. I will send patch. Best regards -- Kuninori Morimoto -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 511c10d..7cd28b2 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h @@ -789,7 +789,14 @@ static inline int sci_rxd_in(struct uart_port *port) defined(CONFIG_CPU_SUBTYPE_SH7721) #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) #elif defined(CONFIG_CPU_SUBTYPE_SH7723) -#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(16*bps)-1) +static inline int scbrr_calc(struct uart_port *port, int bps, int clk) +{ + if (port->type == PORT_SCIF) + return (clk+16*bps)/(32*bps)-1; + else + return ((clk*2)+16*bps)/(16*bps)-1; +} +#define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk) #elif defined(__H8300H__) || defined(__H8300S__) #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1) #else /* Generic SH */