make early serial console support more generic

This patch makes pre-RAM serial init more generic, particularly for
platforms which do not necessarily need cache-as-RAM in order to use
the serial console and do not have a standard 8250 serial port.

This adds a Kconfig variable to set romstage-* for very early serial
console init. The current method assumes that cache-as-RAM should
enable this, so to maintain compatibility selecting CACHE_AS_RAM will
also select EARLY_SERIAL_CONSOLE.

The UART code structure needs some rework, but the use of ROMCC,
romstage, and then ramstage makes things complex.

uart.h now includes all .h files for all uarts. All 2 of them.
This is actually a simplifying change.

Change-Id: I089e7af633c227baf3c06c685f005e9d0e4b38ce
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/2086
Tested-by: build bot (Jenkins)
This commit is contained in:
David Hendricks
2012-12-31 17:28:43 -08:00
committed by Ronald G. Minnich
parent 10c90d3126
commit 6a503b6a0f
9 changed files with 33 additions and 12 deletions

View File

@ -15,19 +15,29 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* FIXME(dhendrix): This file contains generic prototypes for UART functions.
* The existing headers are too specific to the 8250, so we need a better
* abstraction for use with non-8250 UARTs.
*/
/* madness. Uarts are a mess. If you include this file, it
* includes ALL uart implementations which may be needed.
* No need to include them separately, and include this file FIRST.
* At least one (but at most one) of the files needs to define
* uart_init().
*/
#ifndef UART_H
#define UART_H
#if CONFIG_CONSOLE_SERIAL8250
#include <uart8250.h>
#endif
#if CONFIG_CPU_SAMSUNG_EXYNOS5
#include <cpu/samsung/exynos5250/uart.h>
#endif
#ifndef __ROMCC__
unsigned char uart_rx_byte(void);
void uart_tx_byte(unsigned char data);
void uart_tx_flush(void);
void uart_init(void);
#endif
#endif /* UART_H */