public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] resubmit: PPC440: Add flow control for serial port
Date: Mon, 3 Dec 2007 11:45:28 +0100	[thread overview]
Message-ID: <200712031145.29039.sr@denx.de> (raw)
In-Reply-To: <20071203095818.2611E2430C@gemini.denx.de>

On Monday 03 December 2007, Wolfgang Denk wrote:
> In message <200712031048.54727.niklausgiger@gmx.ch> you wrote:
> > Sorry for my mistake in my first submission..
> >
> > This has been tested on our HCU5 PPC440EPx based board, where we
> > have only one serial port.
>
> I object against applying such a patch.
>
> Using hardware flow-control on the only available serial port (= con-
> sole port) is fundamentally broken. It is not acceptable that a board
> does not come up just because no  console  terminal  is  attached  or
> because the console is in the wrong state.

This patch "only" enables the 4xx UART driver for hardware flow control
and doesn't configure it for the HCU5 board. So that should not be a
problem.

But this patch unfortunately has coding style issues:

> +#if defined(CONFIG_CMD_HWFLOW) && defined(CONFIG_440) &&
> !defined(CONFIG_SERIAL_MULTI) +int hwflow_onoff(int flow_on)
> +{
> +???????if (flow_on == 1) {
> +???????????????out8(UART_BASE + UART_MCR, 0x0b);???????/* The OUT2 bit may be written and read
> +??????? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? but it provides no function */
> +???????} 
> +???????else
> +???????{
> +???????????????out8(UART_BASE + UART_MCR, 0x00);???????/* no modem control DTR RTS */
> +???????} 
> +???????return 0;
> +}
> +#endif

Please use something like this:

if defined(CONFIG_CMD_HWFLOW) && defined(CONFIG_440) && \
   !defined(CONFIG_SERIAL_MULTI)
int hwflow_onoff(int flow_on)
{
	if (flow_on == 1) {
		/*
		 * The OUT2 bit may be written and read
		 * but it provides no function
		 */
		out8(UART_BASE + UART_MCR, 0x0b);
	}?else {
		/* No modem control DTR RTS */
		out8(UART_BASE + UART_MCR, 0x00);
	}

	return 0;
}
#endif

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

      reply	other threads:[~2007-12-03 10:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 13:39 [U-Boot-Users] [PATCH] PPC440: Add flow control for serial port Niklaus Giger
2007-11-30 19:57 ` Stefan Roese
2007-12-03  9:48   ` [U-Boot-Users] [PATCH] resubmit: " Niklaus Giger
2007-12-03  9:58     ` Wolfgang Denk
2007-12-03 10:45       ` Stefan Roese [this message]

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=200712031145.29039.sr@denx.de \
    --to=sr@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox