diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-07-22 20:39:45 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:10 -0700 |
commit | cf2414a7b3d7bd2e7ee363fd6e356a3e4d9339a7 (patch) | |
tree | 0c1df789498b09c8bb85371b33aad3f79b6d259e /include/chromeos | |
parent | 4ddaee01e37ed491ce7c45586ab96e5bbb905ab4 (diff) |
CHROMIUM: reunify boot_kernel
During the code migration to the redesigned vboot_reference API, the
boot_kernel (formerly named load_kernel_helper) was divided and its
private functions were taken out to keep U-Boot compilable
$ git log --oneline -3 -- lib/chromeos/load_kernel_helper.c
6cdb577 CHROMIUM: remove codes based on deprecated API of vboot_reference
29c5f74 CHROMIUM: Separate cmdline update part from load_kernel_helper library.
f853479 CHROMIUM: Separate the pre-boot FDT update part from load_kernel_helper library.
The commit 29c5f74 and f853479 took out the private functions for
updating kernel command line and embedding crossystem data into a device
tree. The functions are the guts of boot_kernel and serve no purpose
other than helping boot kernel.
In fact, if you diff load_kernel_helper and boot_kernel, you will find
they are virtually identical, except that functions based on deprecated
APIs of vboot_reference are removed in boot_kernel.
As the code migration has been completed, it is time for the private
functions to reunite with the boot_kernel.
BUG=chromium-os:16542
TEST=boot on Aebl
Change-Id: I6512d7a5197c41df7a2e9cc5d90c40be87b468b0
Reviewed-on: http://gerrit.chromium.org/gerrit/4573
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'include/chromeos')
-rw-r--r-- | include/chromeos/boot_kernel.h | 27 | ||||
-rw-r--r-- | include/chromeos/cmdline_updater.h | 36 | ||||
-rw-r--r-- | include/chromeos/preboot_fdt_update.h | 29 |
3 files changed, 27 insertions, 65 deletions
diff --git a/include/chromeos/boot_kernel.h b/include/chromeos/boot_kernel.h new file mode 100644 index 00000000000..ac1187a44d5 --- /dev/null +++ b/include/chromeos/boot_kernel.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + */ + +#ifndef CHROMEOS_BOOT_KERNEL_H +#define CHROMEOS_BOOT_KERNEL_H + +#include <chromeos/crossystem_data.h> +#include <vboot_api.h> + +/** + * This boots kernel specified in [kparmas]. + * + * @param kparams kparams returned from VbSelectAndLoadKernel() + * @param cdata crossystem data pointer + * @return LOAD_KERNEL_INVALID if it fails to boot; otherwise it never returns + * to its caller + */ +int boot_kernel(VbSelectAndLoadKernelParams *kparams, crossystem_data_t *cdata); + +#endif /* CHROMEOS_BOOT_KERNEL_H */ diff --git a/include/chromeos/cmdline_updater.h b/include/chromeos/cmdline_updater.h deleted file mode 100644 index 1208de83a20..00000000000 --- a/include/chromeos/cmdline_updater.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - */ - -#ifndef CHROMEOS_CMDLINE_UPDATER_H_ -#define CHROMEOS_CMDLINE_UPDATER_H_ - -#include <linux/types.h> - -/** - * This replaces: - * %D -> device number - * %P -> partition number - * %U -> GUID - * in kernel command line. - * - * For example: - * ("root=/dev/sd%D%P", 2, 3) -> "root=/dev/sdc3" - * ("root=/dev/mmcblk%Dp%P", 0, 5) -> "root=/dev/mmcblk0p5". - * - * @param src - input string - * @param devnum - device number of the storage device we will mount - * @param partnum - partition number of the root file system we will mount - * @param guid - guid of the kernel partition - * @param dst - output string; a copy of [src] with special characters replaced - */ -void update_cmdline(char *src, int devnum, int partnum, uint8_t *guid, - char *dst); - -#endif /* CHROMEOS_CMDLINE_UPDATER_H_ */ diff --git a/include/chromeos/preboot_fdt_update.h b/include/chromeos/preboot_fdt_update.h deleted file mode 100644 index 44510945d33..00000000000 --- a/include/chromeos/preboot_fdt_update.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - */ - -/* - * This library does the last chance FDT update before booting to kernel. - * Currently we modify the FDT by embedding crossystem data. So before - * calling bootm(), set_crossystem_data() should be called. - */ - -#ifndef CHROMEOS_PREBOOT_FDT_UPDATE_H_ -#define CHROMEOS_PREBOOT_FDT_UPDATE_H_ - -#include <chromeos/crossystem_data.h> -#include <linux/types.h> - -/* Set the crossystem data pointer. It must be done before booting to kernel */ -void set_crossystem_data(crossystem_data_t *cdata); - -/* Update FDT. This function is called just before booting to kernel. */ -int fit_update_fdt_before_boot(char *fdt, ulong *new_size); - -#endif /* CHROMEOS_PREBOOT_FDT_UPDATE_H_ */ |