autoconsole

Mike Kravetz kravetz at us.ibm.com
Fri Jan 16 03:58:49 EST 2004


On Thu, Jan 15, 2004 at 12:18:08PM +1100, Anton Blanchard wrote:
>
> Agreed, how does this look? I could only compile test it, I dont have a
> machine to run on at the moment.
>
<snip>
> +
> +	if (strcmp(name, "serial") == 0) {
> +		int i;
> +		u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
> +		if (i > 8) {
> +			int offset;
> +			switch (reg[1]) {
> +				case 0x3f8:
> +					offset = 0;
> +					break;
> +				case 0x2f8:
> +					offset = 1;
> +					break;
> +				case 0x898:
> +					offset = 2;
> +					break;
> +				case 0x890:
> +					offset = 3;
> +					break;
> +				default:
> +					/* We dont recognise the serial port */
> +					return -ENODEV;
> +			}
> +
> +			return add_preferred_console("ttyS", offset, NULL);
> +		}

My only concern would be the lack of a 'speed' setting for the serial
port/console.  Is there any way to determine the 'speed' of the serial
port?  I don't know this code/architecture well enough, but am looking.
Note that the SLES code (or at least that ported by Olaf) had the speed
hard coded to 9600.  My 'guess' is that the speed of the serial ports
is configurable, but again I don't know this arch well enough to say.

I'll try out this code on my box with a 9600 speed serial console and
let you know what happens.

--
Mike

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list