vboot: move vboot files to designated directory

This moves vboot1 and vboot2 files to their designated directory. Common
code stays in vendorcode/google/chromeos.

BUG=none
BRANCH=none
TEST=built cosmos, veyron_pinky, rush_ryu, nyan_blaze, samus, parrot,
lumpy, daisy_spring, and storm.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>

Original-Change-Id: Ia9fb41ba30930b79b222269acfade7ef44b23626
Original-Reviewed-on: https://chromium-review.googlesource.com/222874
Original-Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Original-Tested-by: Daisuke Nojiri <dnojiri@chromium.org>

(cherry picked from commit cbfef9ad40776d890e2149b9db788fe0b387d210)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>

Change-Id: Ia73696accfd93cc14ca83516fa77f87331faef51
Reviewed-on: http://review.coreboot.org/9433
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Daisuke Nojiri
2014-10-10 10:51:06 -07:00
committed by Aaron Durbin
parent b952f6b68b
commit 742fc8d768
28 changed files with 593 additions and 429 deletions

View File

@@ -23,6 +23,8 @@
#include <stddef.h>
#include <stdint.h>
#include <bootmode.h>
#include "vboot_common.h"
#include "vboot2/misc.h"
/*for mainboard use only*/
void setup_chromeos_gpios(void);
@@ -47,54 +49,14 @@ static inline void elog_add_boot_reason(void) { return; }
struct romstage_handoff;
/* TODO(shawnn): Remove these CONFIGs and define default weak functions
* that can be overridden in the platform / MB code. */
#if CONFIG_VBOOT_VERIFY_FIRMWARE || CONFIG_VBOOT2_VERIFY_FIRMWARE
struct vboot_region {
uintptr_t offset_addr;
int32_t size;
};
/*
* The vboot handoff structure keeps track of a maximum number of firmware
* components in the verfieid RW area of flash. This is not a restriction on
* the number of components packed in a firmware block. It's only the maximum
* number of parsed firmware components (address and size) included in the
* handoff structure.
*/
#define MAX_PARSED_FW_COMPONENTS 5
/* The FW areas consist of multiple components. At the beginning of
* each area is the number of total compoments as well as the size and
* offset for each component. One needs to caculate the total size of the
* signed firmware region based off of the embedded metadata. */
struct vboot_component_entry {
uint32_t offset;
uint32_t size;
} __attribute__((packed));
struct vboot_components {
uint32_t num_components;
struct vboot_component_entry entries[0];
} __attribute__((packed));
void vboot_locate_region(const char *name, struct vboot_region *region);
struct vboot_components *vboot_locate_components(struct vboot_region *region);
/*
* This is a dual purpose routine. If dest is non-NULL the region at
* offset_addr will be read into the area pointed to by dest. If dest
* is NULL,the region will be mapped to a memory location. NULL is
* returned on error else the location of the requested region.
*/
void *vboot_get_region(uintptr_t offset_addr, size_t size, void *dest);
/* Returns 0 on success < 0 on error. */
int vboot_get_handoff_info(void **addr, uint32_t *size);
int vboot_enable_developer(void);
int vboot_enable_recovery(void);
int vboot_skip_display_init(void);
#else
void *vboot_get_payload(int *len);
#else /* CONFIG_VBOOT_VERIFY_FIRMWARE || CONFIG_VBOOT2_VERIFY_FIRMWARE */
static inline void vboot_verify_firmware(struct romstage_handoff *h) {}
static inline void *vboot_get_payload(int *len) { return NULL; }
static inline int vboot_get_handoff_info(void **addr, uint32_t *size)
@@ -121,55 +83,4 @@ static inline void chromeos_ram_oops_init(chromeos_acpi_t *chromeos) {}
static inline void chromeos_reserve_ram_oops(struct device *dev, int idx) {}
#endif /* CONFIG_CHROMEOS_RAMOOPS */
void vboot2_verify_firmware(void);
#if CONFIG_VBOOT2_VERIFY_FIRMWARE
void *vboot_load_ramstage(void);
void verstage_main(void);
void *vboot_load_stage(int stage_index,
struct vboot_region *fw_main,
struct vboot_components *fw_info);
void vboot_reboot(void);
/*
* this is placed at the start of the vboot work buffer. selected_region is used
* for the verstage to return the location of the selected slot. buffer is used
* by the vboot2 core. Keep the struct cpu architecture agnostic as it crosses
* stage boundaries.
*/
struct vb2_working_data {
uint32_t selected_region_offset;
uint32_t selected_region_size;
uint64_t buffer_size;
uint64_t buffer;
};
struct vb2_working_data * const vboot_get_working_data(void);
static inline void vb2_get_selected_region(struct vb2_working_data *wd,
struct vboot_region *region)
{
region->offset_addr = wd->selected_region_offset;
region->size = wd->selected_region_size;
}
static inline void vb2_set_selected_region(struct vb2_working_data *wd,
struct vboot_region *region)
{
wd->selected_region_offset = region->offset_addr;
wd->selected_region_size = region->size;
}
static inline int vboot_is_slot_selected(struct vb2_working_data *wd)
{
return wd->selected_region_size > 0;
}
static inline int vboot_is_readonly_path(struct vb2_working_data *wd)
{
return wd->selected_region_size == 0;
}
#endif /* CONFIG_VBOOT2_VERIFY_FIRMWARE */
#endif
#endif /* __CHROMEOS_H__ */