mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heinz-Georg Sawicki <hgsawicki@web.de>
To: linux-kernel@vger.kernel.org
Subject: Bug+Bugfix: Serialdriver 2.6.0-test8(setting custum speed)
Date: Fri, 24 Oct 2003 23:19:57 +0200	[thread overview]
Message-ID: <200310242319.59470.hgsawicki@web.de> (raw)

Hi!

First excuse me for my bad english.
In case of custom speed the routine   uart_get_divisor  in  serial_core.c  
must calcuate the custom baudrate and return it to the caller. It may look
somewhat like this:

unsigned int
uart_get_divisor(struct uart_port *port, unsigned int* pBaud)
{
	unsigned int quot;

	/*
	 * Old custom speed handling.
	 */
	if (*pBaud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
    {
		quot = port->custom_divisor;
        *pBaud = port->uartclk / (16 * quot);
    }
	else
		quot = port->uartclk / (16 * (*pBaud));

	return quot;
}

This is necessary because  serial8250_set_termios  in   8250.c   uses the 
baudrate for setting the fifotriggerlevel

		if (baud < 2400)
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
#ifdef CONFIG_SERIAL_8250_RSA
		else if (up->port.type == PORT_RSA)
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_14;
#endif
		else
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_8;

In my case i setup a customdivisor of 11520 to get a baudrate of 10 baud, to 
receive the dcf77-signal(UART 16550A, PC-Hardware). Instead of one byte per 
second i received 8 bytes at once because of the wrong triggerlevel. By 
setting the triggerlevel always to one 
		:
		else
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;

i checked that this was the cause for the problem.

By the way, the comment

	/*
	 * Old custom speed handling.
	 */
 
says, that this is the old way for setting up a custom speed. Can you please 
tell me the new way for doing this. Thanks.

Have a nice day,

	Heinz-Georg Sawicki


                 reply	other threads:[~2003-10-24 21:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200310242319.59470.hgsawicki@web.de \
    --to=hgsawicki@web.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome