All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro
Date: Wed, 01 Dec 2010 08:44:57 +0100	[thread overview]
Message-ID: <20101201074457.8E715134FEF@gemini.denx.de> (raw)
In-Reply-To: <1291114965-17100-5-git-send-email-prafulla@marvell.com>

Dear Prafulla Wadaskar,

In message <1291114965-17100-5-git-send-email-prafulla@marvell.com> you wrote:
> On some processors this ier register configuration is different
> for ex. Marvell Armada100
> 
> This patch introduce CONFIG_SYS_NS16550_IER macro support to
> unconditionally initialize this register.

Sorry, but I don't like an implementation detail:

>  void NS16550_init (NS16550_t com_port, int baud_divisor)
>  {
> -	serial_out(0x00, &com_port->ier);
> +	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
>  #if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
>  	serial_out(0x7, &com_port->mdr1);	/* mode select reset TL16C750*/
>  #endif
> @@ -52,7 +52,7 @@ void NS16550_init (NS16550_t com_port, int baud_divisor)
>  #ifndef CONFIG_NS16550_MIN_FUNCTIONS
>  void NS16550_reinit (NS16550_t com_port, int baud_divisor)
>  {
> -	serial_out(0x00, &com_port->ier);
> +	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
>  	serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr);
>  	serial_out(0, &com_port->dll);
>  	serial_out(0, &com_port->dlm);
> diff --git a/include/ns16550.h b/include/ns16550.h
> index 9ea81e9..e9cb449 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -33,6 +33,10 @@
>  	unsigned char postpad_##x[-CONFIG_SYS_NS16550_REG_SIZE - 1];
>  #endif
>  
> +#ifndef CONFIG_SYS_NS16550_IER
> +#define CONFIG_SYS_NS16550_IER	0x00
> +#endif /* CONFIG_SYS_NS16550_IER */

As this macro is only used in drivers/serial/ns16550.c, it makes no
sense to me to move this to ns16550.h - this makes the code just
harder to read.  Please move this #ifndef... to
drivers/serial/ns16550.c

Also, please add a description of the new CONFIG_ variable to the
README file.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A fail-safe circuit will destroy others.                 -- Klipstein

  parent reply	other threads:[~2010-12-01  7:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 11:02 [U-Boot] [PATCH v2 0/7] Add Marvell New Soc Support ARMADA100 Prafulla Wadaskar
2010-11-30 11:02 ` [U-Boot] [PATCH v2 1/7] arm: Add Support for Marvell ARMADA 100 Familiy SoCs Prafulla Wadaskar
2010-11-30  7:18   ` Heiko Schocher
2010-11-30 13:26     ` Prafulla Wadaskar
2010-11-30 11:02   ` [U-Boot] [PATCH v2 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs Prafulla Wadaskar
2010-11-30 11:02     ` [U-Boot] [PATCH v2 3/7] add Multi Function Pin configuration support for ARMADA100 Prafulla Wadaskar
2010-11-30 11:02       ` [U-Boot] [PATCH v2 4/7] Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro Prafulla Wadaskar
2010-11-30 11:02         ` [U-Boot] [PATCH v2 5/7] Serial: Add UART support for Marvell ARMADA 100 SoCs Prafulla Wadaskar
2010-11-30 11:02           ` [U-Boot] [PATCH v2 6/7] mv-common.h: Add support for ARMADA100 Platforms Prafulla Wadaskar
2010-11-30 11:02             ` [U-Boot] [PATCH v2 7/7] Armada100: Add Board Support for Marvell Aspenite-DB Prafulla Wadaskar
2010-11-30  9:38               ` Lei Wen
2010-11-30  9:50                 ` Prafulla Wadaskar
2010-12-01  7:44         ` Wolfgang Denk [this message]
2010-12-01  7:52           ` [U-Boot] [PATCH v2 4/7] Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro Prafulla Wadaskar

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=20101201074457.8E715134FEF@gemini.denx.de \
    --to=wd@denx.de \
    --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 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.