summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-12-08 14:34:35 -0600
committerAaron Durbin <adurbin@chromium.org>2015-12-10 04:44:09 +0100
commit7e7a4df58075fdff4293d2203b035b970d21aeb8 (patch)
tree5897c05b07adaa7d12f747a49dc3f513d2dc2d9e /src/lib
parent6d720f38e06d14cc8a89635f66dc124dcd5ac150 (diff)
downloadcoreboot-7e7a4df58075fdff4293d2203b035b970d21aeb8.tar.xz
lib: remove assets infrastructure
Now that only CBFS access is supported for finding resources within the boot media the assets infrastructure can be removed. Remove it. BUG=chromium:445938 BRANCH=None TEST=Built and ran on glados. Change-Id: I383fd6579280cf9cfe5a18c2851baf74cad004e9 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/12690 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Makefile.inc4
-rw-r--r--src/lib/assets.c96
-rw-r--r--src/lib/cbfs.c2
-rw-r--r--src/lib/prog_loaders.c6
4 files changed, 4 insertions, 104 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 0aada5373f..724391fb21 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -19,7 +19,6 @@ ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y)
bootblock-y += bootblock.c
endif
-bootblock-y += assets.c
bootblock-y += prog_loaders.c
bootblock-y += prog_ops.c
bootblock-y += cbfs.c
@@ -39,7 +38,6 @@ bootblock-y += memcmp.c
bootblock-y += boot_device.c
bootblock-y += fmap.c
-verstage-y += assets.c
verstage-y += prog_loaders.c
verstage-y += prog_ops.c
verstage-y += delay.c
@@ -62,7 +60,6 @@ endif
verstage-$(CONFIG_GENERIC_UDELAY) += timer.c
verstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
-romstage-y += assets.c
romstage-y += prog_loaders.c
romstage-y += prog_ops.c
romstage-y += memchr.c
@@ -98,7 +95,6 @@ endif
romstage-$(CONFIG_GENERIC_UDELAY) += timer.c
-ramstage-y += assets.c
ramstage-y += prog_loaders.c
ramstage-y += prog_ops.c
ramstage-y += hardwaremain.c
diff --git a/src/lib/assets.c b/src/lib/assets.c
deleted file mode 100644
index e9f3afb0db..0000000000
--- a/src/lib/assets.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2015 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-
-#include <assets.h>
-#include <boot_device.h>
-#include <cbfs.h>
-#include <console/console.h>
-#include <rules.h>
-#include <stdlib.h>
-
-#define DEFAULT_CBFS_PROVIDER_PRESENT \
- (!ENV_VERSTAGE || (ENV_VERSTAGE && !CONFIG_RETURN_FROM_VERSTAGE))
-
-#if DEFAULT_CBFS_PROVIDER_PRESENT
-static int cbfs_boot_asset_locate(struct asset *asset)
-{
- struct cbfsf file;
-
- if (cbfs_boot_locate(&file, asset_name(asset), NULL))
- return -1;
-
- cbfs_file_data(asset_rdev(asset), &file);
-
- return 0;
-}
-
-static const struct asset_provider cbfs_default_provider = {
- .name = "CBFS",
- .locate = cbfs_boot_asset_locate,
-};
-#endif
-
-extern const struct asset_provider vboot_provider;
-
-static const struct asset_provider *providers[] = {
-#if CONFIG_VBOOT_VERIFY_FIRMWARE
- &vboot_provider,
-#endif
-#if DEFAULT_CBFS_PROVIDER_PRESENT
- &cbfs_default_provider,
-#endif
-};
-
-int asset_locate(struct asset *asset)
-{
- int i;
-
- boot_device_init();
-
- for (i = 0; i < ARRAY_SIZE(providers); i++) {
- /* Default provider state is active. */
- int ret = 1;
- const struct asset_provider *ops;
-
- ops = providers[i];
-
- if (ops->is_active != NULL)
- ret = ops->is_active(asset);
-
- if (ret == 0) {
- printk(BIOS_DEBUG, "%s provider inactive.\n",
- ops->name);
- continue;
- } else if (ret < 0) {
- printk(BIOS_DEBUG, "%s provider failure.\n",
- ops->name);
- continue;
- }
-
- printk(BIOS_DEBUG, "%s provider active.\n", ops->name);
-
- if (ops->locate(asset))
- continue;
-
- printk(BIOS_DEBUG, "'%s' located at offset: %zx size: %zx\n",
- asset->name, region_device_offset(&asset->rdev),
- region_device_sz(&asset->rdev));
-
- return 0;
- }
-
- return -1;
-}
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 1d0869c950..d68aa39cc5 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -175,7 +175,7 @@ void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device)
void *cbfs_boot_load_stage_by_name(const char *name)
{
struct cbfsf fh;
- struct prog stage = PROG_INIT(ASSET_UNKNOWN, name);
+ struct prog stage = PROG_INIT(PROG_UNKNOWN, name);
uint32_t type = CBFS_TYPE_STAGE;
if (cbfs_boot_locate(&fh, name, &type))
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index e27eca1f3a..3f5d95ca6c 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -50,7 +50,7 @@ int prog_locate(struct prog *prog)
void run_romstage(void)
{
struct prog romstage =
- PROG_INIT(ASSET_ROMSTAGE, CONFIG_CBFS_PREFIX "/romstage");
+ PROG_INIT(PROG_ROMSTAGE, CONFIG_CBFS_PREFIX "/romstage");
if (prog_locate(&romstage))
goto fail;
@@ -104,7 +104,7 @@ static int load_relocatable_ramstage(struct prog *ramstage)
void run_ramstage(void)
{
struct prog ramstage =
- PROG_INIT(ASSET_RAMSTAGE, CONFIG_CBFS_PREFIX "/ramstage");
+ PROG_INIT(PROG_RAMSTAGE, CONFIG_CBFS_PREFIX "/ramstage");
timestamp_add_now(TS_END_ROMSTAGE);
@@ -137,7 +137,7 @@ fail:
#ifdef __RAMSTAGE__ // gc-sections should take care of this
static struct prog global_payload =
- PROG_INIT(ASSET_PAYLOAD, CONFIG_CBFS_PREFIX "/payload");
+ PROG_INIT(PROG_PAYLOAD, CONFIG_CBFS_PREFIX "/payload");
void __attribute__((weak)) mirror_payload(struct prog *payload)
{