All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] serial: mfd: adjust the baud rate setting
  2010-11-19  2:20 [PATCH] serial: mfd: adjust the baud rate setting Feng Tang
@ 2010-11-19  2:05 ` Greg KH
  2010-11-19  2:46   ` Feng Tang
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2010-11-19  2:05 UTC (permalink / raw)
  To: Feng Tang; +Cc: linux-serial, alan

On Fri, Nov 19, 2010 at 10:20:26AM +0800, Feng Tang wrote:
> This change is made according to silicon engineers' feedback and
> the real world test result.

Ok, but what was that feeback and test results?  What needed to be
changed and why?  In other words, describe the change, don't just say
why you did it.

Care to resend please?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] serial: mfd: adjust the baud rate setting
@ 2010-11-19  2:20 Feng Tang
  2010-11-19  2:05 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Feng Tang @ 2010-11-19  2:20 UTC (permalink / raw)
  To: linux-serial, greg, alan; +Cc: Feng Tang

This change is made according to silicon engineers' feedback and
the real world test result.

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/serial/mfd.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c
index 5fc699e..d40010a 100644
--- a/drivers/serial/mfd.c
+++ b/drivers/serial/mfd.c
@@ -900,8 +900,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
 	unsigned char cval, fcr = 0;
 	unsigned long flags;
 	unsigned int baud, quot;
-	u32 mul = 0x3600;
-	u32 ps = 0x10;
+	u32 ps, mul;
 
 	switch (termios->c_cflag & CSIZE) {
 	case CS5:
@@ -943,31 +942,24 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
 	baud = uart_get_baud_rate(port, termios, old, 0, 4000000);
 
 	quot = 1;
+	ps = 0x10;
+	mul = 0x3600;
 	switch (baud) {
 	case 3500000:
 		mul = 0x3345;
 		ps = 0xC;
 		break;
-	case 3000000:
-		mul = 0x2EE0;
-		break;
-	case 2500000:
-		mul = 0x2710;
-		break;
-	case 2000000:
-		mul = 0x1F40;
-		break;
 	case 1843200:
 		mul = 0x2400;
 		break;
+	case 3000000:
+	case 2500000:
+	case 2000000:
 	case 1500000:
-		mul = 0x1770;
-		break;
 	case 1000000:
-		mul = 0xFA0;
-		break;
 	case 500000:
-		mul = 0x7D0;
+		/* mul/ps/quot = 0x9C4/0x10/0x1 will make a 500000 bps */
+		mul = baud / 500000 * 0x9C4;
 		break;
 	default:
 		/* Use uart_get_divisor to get quot for other baud rates */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] serial: mfd: adjust the baud rate setting
  2010-11-19  2:05 ` Greg KH
@ 2010-11-19  2:46   ` Feng Tang
  0 siblings, 0 replies; 6+ messages in thread
From: Feng Tang @ 2010-11-19  2:46 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-serial, alan

On Fri, 19 Nov 2010 10:05:59 +0800
Greg KH <greg@kroah.com> wrote:

> On Fri, Nov 19, 2010 at 10:20:26AM +0800, Feng Tang wrote:
> > This change is made according to silicon engineers' feedback and
> > the real world test result.
> 
> Ok, but what was that feeback and test results?  What needed to be
> changed and why?  In other words, describe the change, don't just say
> why you did it.
> 
> Care to resend please?
> 
> thanks,
> 
> greg k-h

Sure, will do. And thanks for pointing it out.

- Feng

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] serial: mfd: adjust the baud rate setting
  2010-11-19  4:03 ` Greg KH
@ 2010-11-19  5:15   ` Feng Tang
  0 siblings, 0 replies; 6+ messages in thread
From: Feng Tang @ 2010-11-19  5:15 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-serial, alan

On Fri, 19 Nov 2010 12:03:25 +0800
Greg KH <greg@kroah.com> wrote:

> On Fri, Nov 19, 2010 at 11:01:48AM +0800, Feng Tang wrote:
> > Previous baud rate setting code only has been tested with 3.5M/9600/
> > 115200/230400/460800 bps, and recently we got a 3M bps device to
> > test, which needs to modify current MUL register setting, and with
> > this patch 2.5M/2M/1.5M/1M/0.5M should also work as they just use a
> > MUL value scale down from 3M's.
> > 
> > Also got some reference register setting from silicon guys for
> > different baud rates, which tries to keep the pre-scalar register
> > value to 16.
> > 
> > Signed-off-by: Feng Tang <feng.tang@intel.com>
> 
> Wonderful, now that's a change log entry :)
> 
> One final question, this should go into .37, right?  Is it also
> applicable for .36-stable and older?

This patch should be in stable git too, but don't know if it could
be applied to stable tree directly. Thanks,

- Feng 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] serial: mfd: adjust the baud rate setting
  2010-11-19  3:01 Feng Tang
@ 2010-11-19  4:03 ` Greg KH
  2010-11-19  5:15   ` Feng Tang
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2010-11-19  4:03 UTC (permalink / raw)
  To: Feng Tang; +Cc: linux-serial, alan

On Fri, Nov 19, 2010 at 11:01:48AM +0800, Feng Tang wrote:
> Previous baud rate setting code only has been tested with 3.5M/9600/
> 115200/230400/460800 bps, and recently we got a 3M bps device to test,
> which needs to modify current MUL register setting, and with this
> patch 2.5M/2M/1.5M/1M/0.5M should also work as they just use a MUL
> value scale down from 3M's.
> 
> Also got some reference register setting from silicon guys for
> different baud rates, which tries to keep the pre-scalar register value
> to 16.
> 
> Signed-off-by: Feng Tang <feng.tang@intel.com>

Wonderful, now that's a change log entry :)

One final question, this should go into .37, right?  Is it also
applicable for .36-stable and older?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] serial: mfd: adjust the baud rate setting
@ 2010-11-19  3:01 Feng Tang
  2010-11-19  4:03 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Feng Tang @ 2010-11-19  3:01 UTC (permalink / raw)
  To: linux-serial, greg, alan; +Cc: Feng Tang

Previous baud rate setting code only has been tested with 3.5M/9600/
115200/230400/460800 bps, and recently we got a 3M bps device to test,
which needs to modify current MUL register setting, and with this
patch 2.5M/2M/1.5M/1M/0.5M should also work as they just use a MUL
value scale down from 3M's.

Also got some reference register setting from silicon guys for
different baud rates, which tries to keep the pre-scalar register value
to 16.

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/serial/mfd.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c
index 5fc699e..d40010a 100644
--- a/drivers/serial/mfd.c
+++ b/drivers/serial/mfd.c
@@ -900,8 +900,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
 	unsigned char cval, fcr = 0;
 	unsigned long flags;
 	unsigned int baud, quot;
-	u32 mul = 0x3600;
-	u32 ps = 0x10;
+	u32 ps, mul;
 
 	switch (termios->c_cflag & CSIZE) {
 	case CS5:
@@ -943,31 +942,24 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
 	baud = uart_get_baud_rate(port, termios, old, 0, 4000000);
 
 	quot = 1;
+	ps = 0x10;
+	mul = 0x3600;
 	switch (baud) {
 	case 3500000:
 		mul = 0x3345;
 		ps = 0xC;
 		break;
-	case 3000000:
-		mul = 0x2EE0;
-		break;
-	case 2500000:
-		mul = 0x2710;
-		break;
-	case 2000000:
-		mul = 0x1F40;
-		break;
 	case 1843200:
 		mul = 0x2400;
 		break;
+	case 3000000:
+	case 2500000:
+	case 2000000:
 	case 1500000:
-		mul = 0x1770;
-		break;
 	case 1000000:
-		mul = 0xFA0;
-		break;
 	case 500000:
-		mul = 0x7D0;
+		/* mul/ps/quot = 0x9C4/0x10/0x1 will make a 500000 bps */
+		mul = baud / 500000 * 0x9C4;
 		break;
 	default:
 		/* Use uart_get_divisor to get quot for other baud rates */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-19  4:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19  2:20 [PATCH] serial: mfd: adjust the baud rate setting Feng Tang
2010-11-19  2:05 ` Greg KH
2010-11-19  2:46   ` Feng Tang
2010-11-19  3:01 Feng Tang
2010-11-19  4:03 ` Greg KH
2010-11-19  5:15   ` Feng Tang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.