From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Mon, 3 Dec 2007 11:45:28 +0100 Subject: [U-Boot-Users] [PATCH] resubmit: PPC440: Add flow control for serial port In-Reply-To: <20071203095818.2611E2430C@gemini.denx.de> References: <20071203095818.2611E2430C@gemini.denx.de> Message-ID: <200712031145.29039.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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 =====================================================================