From: Travis B. Sawyer Date: Tue, 14 Sep 2004 20:18:50 -0400 Subject: [U-Boot-Users] Runtime switch from uart0 to uart1? In-Reply-To: <20040819141627.99258C109F@atlas.denx.de> References: <20040819141627.99258C109F@atlas.denx.de> Message-ID: <1095207529.2892.12.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2004-08-19 at 10:16, Wolfgang Denk wrote: > In message <1092921384.24546.9.camel@pavement.sandburst.com> you wrote: > > > > After having read the README and some code, I was wondering if there is > > a way to switch, at runtime (rather than at compile time) from UART0 to > > UART1. > > > > The board is the ocotea, ppc440gx, u-boot 1.1.2, build tools from ELDK3 > > Not out of the box. But doc/README.serial_multi shows what we did on > MPC8xx processors; this can be used as a starting point to extend it > for 4xx as well. > > Best regards, > > Wolfgang Denk Wolfgang: Thanx. I've been tasked out by my higher-ups to do this. I'm planning on adding the code directly to cpu/ppc4xx/serial.c. However, I think this is going to add a little bit of text space even if CONFIG_SERIAL_MULTI is not defined. For example: Currently we have int serial_init(void) {...} My vision: int serial_init_dev(unsigned long dev_base) {...} with: #if !defined(CONFIG_SERIAL_MULTI) int serial_init(void) { return(serial_init_dev(ACTING_UART0_BASE)); } #else int serial0_init(void) { return(serial_init_dev(UART0_BASE)); } int serial1_init(void) { return(serial_init_dev(UART1_BASE)); } #endif There are several functions that will need to have this done, thus adding 1 layer of indirection to the current code to allow for multiple serial channels. Do you think this is OK? I _*KNOW_* the readme says not to add options that will bloat the code when the option is off. Thank you, Travis Sawyer