diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-06-29 15:24:02 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-06-29 15:24:02 -0700 |
commit | 6366a25a6b6243b0819056a74653e92ef918c89a (patch) | |
tree | 54ebb4901197609186d2d2749e3e051283feb62e | |
parent | 4d2d307258f927e8129e45195d864534ef19bc63 (diff) | |
download | syslinux-6366a25a6b6243b0819056a74653e92ef918c89a.tar.gz syslinux-6366a25a6b6243b0819056a74653e92ef918c89a.tar.xz syslinux-6366a25a6b6243b0819056a74653e92ef918c89a.zip |
linux.c32: add support for a device tree blob (dtb)
Based on a patch by Thierry Reding, add support for loading a device
tree blob using the generic setup_data framework.
I used the name dtb= instead of fdt= since it looks like dtb= is the
common acronym for the filenames and what is used in the kernel.
Originally-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | com32/modules/linux.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/com32/modules/linux.c b/com32/modules/linux.c index 102e8777..10998753 100644 --- a/com32/modules/linux.c +++ b/com32/modules/linux.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved - * Copyright 2009 Intel Corporation; author: H. Peter Anvin + * Copyright 2009-2012 Intel Corporation; author: H. Peter Anvin * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -113,6 +113,7 @@ int main(int argc, char *argv[]) { const char *kernel_name; struct initramfs *initramfs; + struct setup_data *setup_data; char *cmdline; char *boot_image; void *kernel_data; @@ -222,9 +223,31 @@ int main(int argc, char *argv[]) } } + /* Handle dtb and eventually other setup data */ + setup_data = setup_data_init(); + if (!setup_data) + goto bail; + + if ((arg = find_argument(argp, "dtb="))) { + if (!opt_quiet) { + printf("Loading %s... ", arg); + + if (setup_data_load(setup_data, SETUP_DTB, arg)) { + if (opt_quiet) + printf("Loading %s ", arg); + printf("failed\n"); + goto bail; + } + + if (!opt_quiet) + printf("ok\n"); + } + } + /* This should not return... */ errno = 0; - syslinux_boot_linux(kernel_data, kernel_len, initramfs, NULL, cmdline); + syslinux_boot_linux(kernel_data, kernel_len, initramfs, + setup_data, cmdline); fprintf(stderr, "syslinux_boot_linux() failed: "); bail: |