Allow IEEE1275 ports on path even if it wasn't detected automatically.

Needed on OpenBIOS due to incomplete device tree.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-04-14 17:01:31 +02:00
parent ac4fea7998
commit aa1af9bbda
4 changed files with 76 additions and 26 deletions

View file

@ -31,6 +31,9 @@
#ifdef GRUB_MACHINE_MIPS_LOONGSON
#include <grub/machine/kernel.h>
#endif
#ifdef GRUB_MACHINE_IEEE1275
#include <grub/ieee1275/console.h>
#endif
GRUB_MOD_LICENSE ("GPLv3+");
@ -149,6 +152,19 @@ grub_serial_find (const char *name)
}
#endif
#ifdef GRUB_MACHINE_IEEE1275
if (!port && grub_memcmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) == 0)
{
name = grub_ofserial_add_port (&name[sizeof ("ieee1275/") - 1]);
if (!name)
return NULL;
FOR_SERIAL_PORTS (port)
if (grub_strcmp (port->name, name) == 0)
break;
}
#endif
return port;
}