Tiny Core Linux

General TC => General TC Talk => Topic started by: aj on May 23, 2013, 01:52:32 PM

Title: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on May 23, 2013, 01:52:32 PM
Hello,

I have installed TC OS and I want to develop an application for communication through serial port. The only requirement for this application is the serial port baudrate. I need to use the max speed available and I want to know if it is possible use 921600 kbs or there is some limitation?

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Juanito on May 23, 2013, 02:04:35 PM
Does "stty < /dev/ttyXX" give the allowable baud rate?
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 23, 2013, 02:10:39 PM
Does "stty < /dev/ttyXX" give the allowable baud rate?

I dont knew the stty command but I will try it.

Thanks :)
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 27, 2013, 04:11:46 AM
Does "stty < /dev/ttyXX" give the allowable baud rate?

Hi,

I used the stty command and shows the configuration of serial port. My doubt is how to know the max baudrate supported by TC. I need to know if is a software limitation or a hardware limitation.

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Juanito on May 27, 2013, 04:15:46 AM
I guess any software limitation would be that of the linux-3.0.21 kernel.

Hardware-wise, you'd have to check with the manufacturer - what happens when you use stty to set the baud rate?
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 27, 2013, 04:25:31 AM
I guess any software limitation would be that of the linux-3.0.21 kernel.

Hardware-wise, you'd have to check with the manufacturer - what happens when you use stty to set the baud rate?

When I set the baudrate 230400 with stty command i get this message: "cannot perform all requested operations"

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 28, 2013, 07:11:22 AM
Hi aj
I think the baud rates may be hard coded in stty and only go up to 115200. For the speed you are looking to run at
will probably require you to find some documentation on your motherboard. The information you need is what type
of UART is on the board and what speed it is being clocked at to determine if it can even achieve the desired baud
rate. If it can't, you will need to find a serial card that can. Then you should be able to use setserial.tcz to configure it.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 28, 2013, 07:26:14 AM
Hi aj
I think the baud rates may be hard coded in stty and only go up to 115200. For the speed you are looking to run at
will probably require you to find some documentation on your motherboard. The information you need is what type
of UART is on the board and what speed it is being clocked at to determine if it can even achieve the desired baud
rate. If it can't, you will need to find a serial card that can. Then you should be able to use setserial.tcz to configure it.

Hi Rich,

I have installed setserial.tcz and now i can change the baudrate.
My UART type is 16550A and it supports the 921600 baudrate.
Now I'm trying to change the baudrate but I just only can with setserial and I would like make the configuration by software developed in C language.

Thanks   
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 28, 2013, 07:35:00 AM
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 28, 2013, 07:47:12 AM
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c

I will try this and then I post the results.

Thanks Rich :)
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 03:05:05 AM
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c
Hi Rich,

I use setserial to change the baud_base to 921600.
My serial card is a super I/O W83627HF and it supports the 921600 baud rate.
I compile the code you give me and I can configure the serial port but some strange things happen:
   -> baud_base 921600 (with setserial) -> 115200 configured by software -> 9600 real baud rate
   -> baud_base 921600 (with setserial) -> 230400 configured by software -> 38400 real baud rate
   -> and I tried with different values for baud_base and I changed the divisor with setserial but the real max baud rate is 115200.
   
The problem could be the TC serial driver? I'm trying to debug if the problem is the software before contact the super I/O manufacturer.

Thanks
 
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 29, 2013, 08:02:44 AM
Hi aj
OK, one thing at a time. Does setserial correctly set the baud rate to 921600? Show the setserial command you are
issuing.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 08:16:43 AM
Hi aj
OK, one thing at a time. Does setserial correctly set the baud rate to 921600? Show the setserial command you are
issuing.

I set "sudo setserial /dev/ttyS0 cust_spd baud_base 921600 divisor 1". Then I use "setserial -a /dev/ttyS0" and I can see the configuration results.
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 29, 2013, 08:23:22 AM
Hi aj
If you send data out of the port, is it coming out at 921600?
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 08:38:14 AM
Hi aj
If you send data out of the port, is it coming out at 921600?

No. I'm sending data to another pc and the max speed that I can read is 115200.
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 29, 2013, 08:48:07 AM
Hi aj
So you used setserial to program the port for 921600 and it doesn't send at that speed. Are you certain that the W83627HF
has a fast enough clock to support that speed?
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 08:59:59 AM
Hi aj
So you used setserial to program the port for 921600 and it doesn't send at that speed. Are you certain that the W83627HF
has a fast enough clock to support that speed?

Hi Rich,

I read the W83627HF's datasheet and it supports 230k, 460k  and 921k.
So if the problem isn't the TC serial driver I will try to contact the W83627HF manufacturer.

Thanks for support
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 29, 2013, 09:09:19 AM
Hi aj
Yes, I know the chip can support that speed. That doesn't mean the board it's installed on can. From the data sheet:
Quote
UART
∙  Two high-speed 16550 compatible UARTs with 16-byte send/receive FIFOs
∙  MIDI compatible
∙  Fully programmable serial-interface characteristics: 
          --- 5, 6, 7 or 8-bit characters 
          --- Even, odd or no parity bit generation/detection   
          --- 1, 1.5 or 2 stop bits generation
∙  Internal diagnostic capabilities:
          --- Loop-back controls for communications link fault isolation   
          --- Break, parity, overrun, framing error simulation   
∙  Programmable baud generator allows division of 1.8461 MHz and 24 MHz by 1 to (216-1)
∙  Maximum baud rate up to 921k bps for 14.769 MHz and 1.5M bps for 24 MHz
If the chip is not supplied with a fast enough clock (14.769Mhz.) it can not run at 921600.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 09:19:52 AM
Hi aj
Yes, I know the chip can support that speed. That doesn't mean the board it's installed on can. From the data sheet:
Quote
UART
∙  Two high-speed 16550 compatible UARTs with 16-byte send/receive FIFOs
∙  MIDI compatible
∙  Fully programmable serial-interface characteristics: 
          --- 5, 6, 7 or 8-bit characters 
          --- Even, odd or no parity bit generation/detection   
          --- 1, 1.5 or 2 stop bits generation
∙  Internal diagnostic capabilities:
          --- Loop-back controls for communications link fault isolation   
          --- Break, parity, overrun, framing error simulation   
∙  Programmable baud generator allows division of 1.8461 MHz and 24 MHz by 1 to (216-1)
∙  Maximum baud rate up to 921k bps for 14.769 MHz and 1.5M bps for 24 MHz
If the chip is not supplied with a fast enough clock (14.769Mhz.) it can not run at 921600.

Hi Rich,
I don't know the hardware. I will check the clock speed.
Thanks for support
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 29, 2013, 10:04:21 AM
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 29, 2013, 10:24:31 AM
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.

Hi Rich,

I will try this too.

Thanks again :)
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 30, 2013, 02:24:18 AM
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.

Hi Rich,

I followed these steps and doesn't worked.
The  W83627HF's clock speed is 24MHz so it supports 921k.
The problem could be the serial driver? I found this link http://www.muru.com/linux/w83627hf/.

Thanks for the support
Title: Re: TC Max Serial Port Baudrate
Post by: genec on May 30, 2013, 04:50:27 AM
so you tried
Code: [Select]
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4then open some serial program and used the baud rate 38400 and still no luck?
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 30, 2013, 05:05:44 AM
so you tried
Code: [Select]
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4then open some serial program and used the baud rate 38400 and still no luck?

Hi genec

Yes, I tried this and still no luck. But this link shows a driver for my serial card. I need compile this driver? Or the TC serial driver is enough?

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 30, 2013, 06:02:31 AM
Hi aj
Quote
I need compile this driver? Or the TC serial driver is enough?
hwmon-3.0.21-tinycore.tcz  contains the  w83627hf  driver. Install the extension and modprobe the driver if you haven't
already done so.
Quote
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4
That will set the baud rate to 230400 and should be executed with sudo.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 30, 2013, 07:17:54 AM
Hi aj
Quote
I need compile this driver? Or the TC serial driver is enough?
hwmon-3.0.21-tinycore.tcz  contains the  w83627hf  driver. Install the extension and modprobe the driver if you haven't
already done so.
Quote
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4
That will set the baud rate to 230400 and should be executed with sudo.

Hi Rich,

I have installed hwmon-3.0.21-tinycore.tcz and modprobe w83627hf. I set dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4 and the real baud rate is 38400. If I set dev/ttyS0 uart 16550A baud_base 230400 spd_cust divisor 1, the real baud rate is 115200.
I need add another module? Or I need remove the old serial driver?

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 30, 2013, 11:37:14 PM
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 31, 2013, 02:22:09 AM
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.

Hi Rich,

I will try to compile the driver.

Thanks for the support
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 31, 2013, 02:45:46 AM
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.

Hi Rich,

It is possible compile the driver with Tiny Core? Some includes are in "/usr/src" and TC doesn't have this directory.

Thanks
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 31, 2013, 08:22:05 AM
Hi aj
I was able to compile the source. Make sure you have compiletc.tcz and linux-headers-3.0.21-tinycore.tcz installed.
Comment out or remove this line from the source:
Code: [Select]
#include <linux/config.h>Create a file called  Makefile  in the same directory as the source containing:
Code: [Select]
obj-m += w83627hf-fast-serial.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
Execute  make  from the command line and it should build.
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 31, 2013, 08:35:02 AM
Hi aj
I was able to compile the source. Make sure you have compiletc.tcz and linux-headers-3.0.21-tinycore.tcz installed.
Comment out or remove this line from the source:
Code: [Select]
#include <linux/config.h>Create a file called  Makefile  in the same directory as the source containing:
Code: [Select]
obj-m += w83627hf-fast-serial.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
Execute  make  from the command line and it should build.

Hi Rich,

I have installed compiletc.tcz but don't have linux-headers-3.0.21-tinycore.tcz.
I will install linux-headers-3.0.21-tinycore.tcz and compile the module.
I hope this works!!

Thanks very much for the support :)
Title: Re: TC Max Serial Port Baudrate
Post by: aj on May 31, 2013, 08:58:16 AM
Hi aj
I was able to compile the source. Make sure you have compiletc.tcz and linux-headers-3.0.21-tinycore.tcz installed.
Comment out or remove this line from the source:
Code: [Select]
#include <linux/config.h>Create a file called  Makefile  in the same directory as the source containing:
Code: [Select]
obj-m += w83627hf-fast-serial.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
Execute  make  from the command line and it should build.

Hi Rich,

You are The Man!!!!!
Now I can configure the max baud rate and it works at 921k.

Thanks very much for the support :)
Title: Re: TC Max Serial Port Baudrate
Post by: Rich on May 31, 2013, 09:11:34 AM
Hi aj
You are welcome, glad to hear it worked. Please go to your original post, click on  Modify, and add  [SOLVED] to the
subject line.
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 05, 2013, 08:49:12 AM
Hi,

I have compiled the fast serial diver for W83627HF. Now I can set serial port ttyS0 at 921k and it works. When I try do the same for ttyS1 I can't obtain the same results.
I want to know if the driver just configure one serial port?

Thanks
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: Rich on June 05, 2013, 08:56:06 AM
Hi aj
I see some code that seems to indicate it supports both UARTs. After you try to set ttyS1 execute:
Code: [Select]
dmesg | tailand see if the driver logged any messages.
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 05, 2013, 09:03:55 AM
Hi aj
I see some code that seems to indicate it supports both UARTs. After you try to set ttyS1 execute:
Code: [Select]
dmesg | tailand see if the driver logged any messages.

Hi Rich

dmesg | tail :
------------------------------------------------------
UART 0 clock speed: 0x0
UART 0 clock speed: 0x2
Entering bdlab mode to change the UART speed
Baudrate divisor low register: 0x60
Baudrate divisor: 0x6000
Baudrate divisor low register: 0x1
Baudrate divisor: 0x100
Leaving bdlab mode
setserial sets custom speed on ttyS0. This is deprecated.
setserial sets custom speed on ttyS1. This is deprecated.
------------------------------------------------------

Thanks
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: Rich on June 05, 2013, 09:09:46 AM
Hi aj
Can I ask you to try that again with:
Code: [Select]
dmesg | tail -n 20
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 05, 2013, 09:27:19 AM
Hi aj
Can I ask you to try that again with:
Code: [Select]
dmesg | tail -n 20

Hi Rich,

-----------------------------------------------------------------------------------------------------
ACPI: resource (null) [io  0x0480-0x04bf] conflicts with ACPI region GPIO [io 0x480-0x4bf]
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
lpc_sch: probe of 0000:00:1f.0 failed with error -16
ACPI: Deprecated procfs I/F for AC is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
ACPI: AC Adapter [ADP1] (on-line)
input: PC Speaker as /devices/platform/pcspkr/input/input3
Adding 126656k swap on /dev/zram0.  Priority:-1 extents:1 across:126656k SS
squashfs: version 4.0 (2009/01/31) Phillip Lougher
EXT4-fs (sda1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
W83627HF fast serial port driver 0.1 loaded
Uart port address seems to be: 0x2f8
UART 0 clock speed: 0x0
UART 0 clock speed: 0x2
Entering bdlab mode to change the UART speed
Baudrate divisor low register: 0x60
Baudrate divisor: 0x6000
Baudrate divisor low register: 0x1
Baudrate divisor: 0x100
Leaving bdlab mode
setserial sets custom speed on ttyS1. This is deprecated.
-----------------------------------------------------------------------------------------------------

Thanks
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: Rich on June 06, 2013, 05:19:53 AM
Hi aj
As a quick test, open the source file, go to the  w83627_set_serial  routine, and change:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
To:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
w83627_set_uart_clock(WDT_CLOCK_2400000,1);
Recompile the driver and see if ttyS1 can now be programmed to run at the higher speed.
Sorry for the delay. I'm still trying to get a grip on how this driver is supposed to work.
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 06, 2013, 01:53:11 PM
Hi aj
As a quick test, open the source file, go to the  w83627_set_serial  routine, and change:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
To:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
w83627_set_uart_clock(WDT_CLOCK_2400000,1);
Recompile the driver and see if ttyS1 can now be programmed to run at the higher speed.
Sorry for the delay. I'm still trying to get a grip on how this driver is supposed to work.

Hi Rich,

I will try this alteration. You don't have to be sorry because you are helping me a lot :)
I contacted Tony Lindgren (driver's developer) and he suggested this:
-------------------------------------------------------------------------------
This is a bug:
/*
* Reads the UART clock source speed
*/
 static int w83627_get_uart_clock(int uartno)
{
...
return (clock & 0x2); // bug here – must 3 in order to mask 2 bits
}

same thing with set clock
maybe try fixing the above in the patch?
-----------------------------------------------------------------------------

Thanks for the support
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: Rich on June 06, 2013, 02:29:14 PM
Hi aj
I spotted those bugs however the result of get clock is only used to print a kernel message and in set clock it is oring the
number 3 in so those two bits are set anyway. In fact, if you look at set clock you'll see the speed parameter is not even
used to set the speed, it's hard coded:
Code: [Select]
clock |= WDT_CLOCK_1476000;and WDT_CLOCK_1476000 is defined as 3.
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 06, 2013, 03:18:17 PM
Hi aj
I spotted those bugs however the result of get clock is only used to print a kernel message and in set clock it is oring the
number 3 in so those two bits are set anyway. In fact, if you look at set clock you'll see the speed parameter is not even
used to set the speed, it's hard coded:
Code: [Select]
clock |= WDT_CLOCK_1476000;and WDT_CLOCK_1476000 is defined as 3.

Hi Rich,
What you are saying make sense and I will try your suggestion.
Thanks again for the support
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 08, 2013, 10:00:28 AM
Hi aj
As a quick test, open the source file, go to the  w83627_set_serial  routine, and change:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
To:
Code: [Select]
w83627_set_uart_clock(WDT_CLOCK_2400000,0);
clock = w83627_get_uart_clock(WDT_UART0); /* UART 0 clock speed */
printk(KERN_INFO "UART 0 clock speed: 0x%x\n", clock);
w83627_set_uart_clock(WDT_CLOCK_2400000,1);
Recompile the driver and see if ttyS1 can now be programmed to run at the higher speed.
Sorry for the delay. I'm still trying to get a grip on how this driver is supposed to work.

Hi Rich
I made the alteration that you suggested and it resulted. Now I can configure the second serial port.
I am grateful for your support

Thanks again :)
Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: Rich on June 08, 2013, 07:42:31 PM
Hi aj
Good to hear. I figured that would kick up the speed of the second UART. For what it's worth, after loading, all this module
does is program a couple of registers. After that, it just sits in memory occupying space. After modprobing the module
you should be able to unload it again. At this point, both UARTs are running at 8x their normal speed. You could skip
using setserial and use stty to select 155200 and you will have 8 x 115200=921600. All the baud rates stty supports
will be 8x higher.

Title: Re: [SOLVED] TC Max Serial Port Baudrate
Post by: aj on June 09, 2013, 01:00:38 PM
Hi aj
Good to hear. I figured that would kick up the speed of the second UART. For what it's worth, after loading, all this module
does is program a couple of registers. After that, it just sits in memory occupying space. After modprobing the module
you should be able to unload it again. At this point, both UARTs are running at 8x their normal speed. You could skip
using setserial and use stty to select 155200 and you will have 8 x 115200=921600. All the baud rates stty supports
will be 8x higher.

Hi Rich,
I'm loading the module at OS startup.
Then I use setserial to configure the max baud rate but I appreciate your advice.

Thanks again :)