[coreboot] [PATCH]

Peter Stuge peter at stuge.se
Fri Apr 22 01:43:49 CEST 2011


Stefan Reinauer wrote:
> The UART divider should be calculated based on the base frequency
> and baudrate, not hardcoded in addition to that.
> 
> Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>

With some changes pointed out below it's:

Acked-by: Peter Stuge <peter at stuge.se>


> +++ src/mainboard/iwave/iWRainbowG6/Kconfig	(working copy)
> @@ -37,9 +37,7 @@
>  	int
>  	default 10
>  
> -# WTF, is this 19200?
> -config TTYS0_DIV
> -	int
> -	default 6
> +# This mainboard might have a higher clocked UART or might not be able to run
> +# serial output at 115200 baud

I don't think this board has a special UART, I think the setting was
just chosen by the original developer as a way to make coreboot
configure the desired baudrate. So just drop the setting and let the
regular baudrate mechanism in Kconfig do the job.


> +++ src/console/uart8250_console.c	(working copy)
> @@ -25,7 +25,13 @@
>  {
>  	static const unsigned char div[8] = { 1, 2, 3, 6, 12, 24, 48, 96 };
>  	int b_index = 0;
> -	unsigned int divisor = CONFIG_TTYS0_DIV;
> +	/* TODO the divisor calculation is hard coded to standard UARTs. Some
> +	 * UARTs won't work with these values. This should be a property of the
> +	 * UART used, worst case a Kconfig variable. For now live with hard
> +	 * codes as the only devices that are different are the iWave
> +	 * iRainbowG6 and the OXPCIe952 card (and the latter is memory mapped)

Also change this wording since it's not really certain that
iRainbowG6 actually is different. (Btw it would be nice to make the
mainboard directory name all lowercase, like with every other board.)


> +++ src/lib/uart8250.c	(working copy)
> @@ -88,6 +88,12 @@
>  #if defined(__PRE_RAM__) || defined(__SMM__)
>  void uart_init(void)
>  {
> +	/* TODO the divisor calculation is hard coded to standard UARTs. Some
> +	 * UARTs won't work with these values. This should be a property of the
> +	 * UART used, worst case a Kconfig variable. For now live with hard
> +	 * codes as the only devices that are different are the iWave
> +	 * iRainbowG6 and the OXPCIe952 card (and the latter is memory mapped)

Same with this comment.


//Peter




More information about the coreboot mailing list