From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 07/10] ns16550: map register base address for debug UART
Date: Mon, 4 Jan 2016 21:07:50 +0800 [thread overview]
Message-ID: <568A6EA6.6070408@wytron.com.tw> (raw)
In-Reply-To: <BLU436-SMTP72755FE6888C48E213482AFFF20@phx.gbl>
Hi Wills,
On 2016?01?04? 19:14, Wills Wang wrote:
> MIPS need to use KSEG1 address for register operation, this patch
> add map_physmem to convert CONFIG_DEBUG_UART_BASE for debug UART.
>
> Signed-off-by: Wills Wang <wills.wang@live.com>
> ---
>
> Changes in v6: None
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
> drivers/serial/ns16550.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 3b24af0..1e2538e 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -270,7 +270,8 @@ int NS16550_tstc(NS16550_t com_port)
>
> static inline void _debug_uart_init(void)
> {
> - struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
> + struct NS16550 *com_port = (struct NS16550 *)map_physmem(
> + CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);
> int baud_divisor;
>
> /*
> @@ -293,7 +294,8 @@ static inline void _debug_uart_init(void)
>
> static inline void _debug_uart_putc(int ch)
> {
> - struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
> + struct NS16550 *com_port = (struct NS16550 *)map_physmem(
> + CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);
>
> while (!(serial_din(&com_port->lsr) & UART_LSR_THRE))
> ;
>
As debug uart may be used in very early stage and SPL, I would suggest
the CONFIG_DEBUG_UART_BASE here is mapped to uncached space already. So
that we can keep the code and stack usage minimal.
My concern is that the uncache mapping in nios2 arch is different
between NOMMU and MMU core, which will be decoded from device tree. So
it won't work for nios2 until DM initialized.
Naked-by: Thomas Chou <thomas@wytron.com.tw>
Best regards,
Thomas
next prev parent reply other threads:[~2016-01-04 13:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1451906101-9801-2-git-send-email-wills.wang@live.com>
2016-01-04 11:14 ` [U-Boot] [PATCH v6 02/10] mips: add base support for QCA/Atheros ath79 SOCs Wills Wang
2016-01-04 11:14 ` [U-Boot] [PATCH v6 03/10] mips: ath79: add support for AR933x SOCs Wills Wang
2016-01-04 11:14 ` [U-Boot] [PATCH v6 04/10] mips: ath79: add support for QCA953x SOCs Wills Wang
2016-01-04 11:14 ` [U-Boot] [PATCH v6 05/10] mips: ath79: add serial driver for ar933x SOC Wills Wang
2016-01-04 12:52 ` Thomas Chou
2016-01-04 11:14 ` [U-Boot] [PATCH v6 06/10] ns16550: add support for mips Wills Wang
2016-01-04 13:12 ` Thomas Chou
2016-01-04 13:25 ` Marek Vasut
2016-01-04 13:56 ` Wills Wang
2016-01-08 16:23 ` Daniel Schwierzeck
2016-01-09 10:46 ` Wills Wang
2016-01-09 14:30 ` Daniel Schwierzeck
2016-01-16 16:15 ` Wills Wang
2016-01-16 16:26 ` Daniel Schwierzeck
2016-01-04 11:14 ` [U-Boot] [PATCH v6 07/10] ns16550: map register base address for debug UART Wills Wang
2016-01-04 13:07 ` Thomas Chou [this message]
2016-01-04 14:10 ` Wills Wang
2016-01-05 21:18 ` Daniel Schwierzeck
2016-01-06 2:50 ` Wills Wang
2016-01-04 11:14 ` [U-Boot] [PATCH v6 08/10] mips: ath79: add spi driver Wills Wang
2016-01-05 2:51 ` Thomas Chou
2016-01-06 12:16 ` Jagan Teki
2016-01-09 17:51 ` Wills Wang
2016-01-04 11:15 ` [U-Boot] [PATCH v6 09/10] mips: ath79: add AP121 reference board Wills Wang
2016-01-04 11:15 ` [U-Boot] [PATCH v6 10/10] mips: ath79: add AP143 " Wills Wang
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=568A6EA6.6070408@wytron.com.tw \
--to=thomas@wytron.com.tw \
--cc=u-boot@lists.denx.de \
/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