2010-11-05 Robert Millan <rmh@gnu.org>

On Yeeloong, pass machine type information to Linux.
	
	* grub-core/loader/mips/linux.c [GRUB_MACHINE_MIPS_YEELOONG]
	(LOONGSON_MACHTYPE): New macro, set to
	"machtype=lemote-yeeloong-2f-8.9inches".
	[LOONGSON_MACHTYPE] (grub_cmd_linux): Pass LOONGSON_MACHTYPE as
	additional argument to Linux.
This commit is contained in:
Robert Millan 2010-11-05 19:48:55 +01:00
parent 1a3aaff40f
commit b9b3839f6d
2 changed files with 35 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2010-11-05 Robert Millan <rmh@gnu.org>
On Yeeloong, pass machine type information to Linux.
* grub-core/loader/mips/linux.c [GRUB_MACHINE_MIPS_YEELOONG]
(LOONGSON_MACHTYPE): New macro, set to
"machtype=lemote-yeeloong-2f-8.9inches".
[LOONGSON_MACHTYPE] (grub_cmd_linux): Pass LOONGSON_MACHTYPE as
additional argument to Linux.
2010-11-04 Robert Millan <rmh@gnu.org>
* util/deviceiter.c (grub_util_iterate_devices): Increase SCSI

View file

@ -32,6 +32,14 @@
#include <grub/pci.h>
#include <grub/machine/time.h>
#ifdef GRUB_MACHINE_MIPS_YEELOONG
/* This can be detected on runtime from PMON, but:
a) it wouldn't work when GRUB is the firmware
and
b) for now we only support Yeeloong anyway. */
#define LOONGSON_MACHTYPE "machtype=lemote-yeeloong-2f-8.9inches"
#endif
static grub_dl_t my_mod;
static int loaded;
@ -214,6 +222,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
/* For arguments. */
linux_argc = argc;
#ifdef LOONGSON_MACHTYPE
linux_argc++;
#endif
/* Main arguments. */
size = (linux_argc) * sizeof (grub_uint32_t);
/* Initrd address and size. */
@ -226,6 +237,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
/* Normal arguments. */
for (i = 1; i < argc; i++)
size += ALIGN_UP (grub_strlen (argv[i]) + 1, 4);
#ifdef LOONGSON_MACHTYPE
size += ALIGN_UP (sizeof (LOONGSON_MACHTYPE), 4);
#endif
/* rd arguments. */
size += ALIGN_UP (sizeof ("rd_start=0xXXXXXXXXXXXXXXXX"), 4);
@ -263,6 +277,16 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
linux_argv++;
linux_args += ALIGN_UP (sizeof ("a0"), 4);
#ifdef LOONGSON_MACHTYPE
/* In Loongson platform, it is the responsibility of the bootloader/firmware
to supply the OS kernel with machine type information. */
grub_memcpy (linux_args, LOONGSON_MACHTYPE, sizeof (LOONGSON_MACHTYPE));
*linux_argv = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground
+ target_addr;
linux_argv++;
linux_args += ALIGN_UP (sizeof (LOONGSON_MACHTYPE), 4);
#endif
for (i = 1; i < argc; i++)
{
grub_memcpy (linux_args, argv[i], grub_strlen (argv[i]) + 1);