From: Russell King <rmk@arm.linux.org.uk>
To: Jon Anders Haugum <jonah@omegav.ntnu.no>
Cc: linux-serial@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] serial8250: set divisor register correctly for AMD Alchemy SoC uart. Re-posted.
Date: Mon, 27 Mar 2006 13:54:23 +0100 [thread overview]
Message-ID: <20060327125423.GA24311@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060327131437.P55909@invalid.ed.ntnu.no>
On Mon, Mar 27, 2006 at 01:27:34PM +0200, Jon Anders Haugum wrote:
> Alchemy SoC uart have got a non-standard divisor register that needs some
> special handling.
>
> This patch adds divisor read/write functions with test and special
> handling for Alchemy internal uart.
>
> @@ -533,22 +565,20 @@ static int size_fifo(struct uart_8250_po
> */
> static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
> {
> - unsigned char old_dll, old_dlm, old_lcr;
> + unsigned char old_lcr;
> unsigned int id;
> + unsigned short old_dl;
>
> old_lcr = serial_inp(p, UART_LCR);
> serial_outp(p, UART_LCR, UART_LCR_DLAB);
>
> - old_dll = serial_inp(p, UART_DLL);
> - old_dlm = serial_inp(p, UART_DLM);
> + old_dl = serial_dl_read(p);
>
> - serial_outp(p, UART_DLL, 0);
> - serial_outp(p, UART_DLM, 0);
> + serial_dl_write(p, 0);
>
> - id = serial_inp(p, UART_DLL) | serial_inp(p, UART_DLM) << 8;
> + id = serial_dl_read(p);
>
> - serial_outp(p, UART_DLL, old_dll);
> - serial_outp(p, UART_DLM, old_dlm);
> + serial_dl_write(p, old_dl);
> serial_outp(p, UART_LCR, old_lcr);
>
> return id;
I'm not sure whether this is a good idea - this is used to detect
an 16C850 UART, so probably should be kept as is.
In other words, we should use serial_dl_read() / serial_dl_write()
when we're actually wanting to read or set the actual divisor, but
not for the autoconfiguration stuff.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-03-27 12:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-27 11:27 [PATCH] serial8250: set divisor register correctly for AMD Alchemy SoC uart. Re-posted Jon Anders Haugum
2006-03-27 12:54 ` Russell King [this message]
2006-03-29 13:39 ` Jon Anders Haugum
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=20060327125423.GA24311@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=jonah@omegav.ntnu.no \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@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