summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-07-14 22:28:27 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-07-15 16:34:37 +0200
commit4d3e4c421e94814884d1ff035a4c4ec80d4b33b2 (patch)
tree714cf2a02ad6ee568928084df4c5cc36530ae96f /src/lib
parent45acb34ffce5ffef1e574305b4e18af6d26df46b (diff)
downloadcoreboot-4d3e4c421e94814884d1ff035a4c4ec80d4b33b2.tar.xz
cbfs: hardcode file alignment
Assume that it's 64 byte. Change-Id: I168facd92f64c2cf99c26c350c60317807a4aed4 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10919 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbfs.c9
-rw-r--r--src/lib/cbfs_boot_props.c2
2 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 3e83765bf3..abc40770af 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -57,7 +57,6 @@ int cbfs_boot_locate(struct region_device *fh, const char *name, uint32_t *type)
return -1;
cbfs.rdev = &rdev;
- cbfs.align = props.align;
return cbfs_locate(fh, &cbfs, name, type);
}
@@ -83,11 +82,9 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
{
size_t offset;
const struct region_device *rd;
- size_t align;
offset = 0;
rd = cbfs->rdev;
- align = cbfs->align;
LOG("Locating '%s'\n", name);
@@ -107,7 +104,7 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
if (memcmp(file.magic, CBFS_FILE_MAGIC, sizeof(file.magic))) {
offset++;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}
@@ -127,14 +124,14 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
if (!name_match) {
DEBUG(" Unmatched '%s' at %zx\n", fname, offset);
offset += file.offset + file.len;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}
if (type != NULL && *type != file.type) {
DEBUG(" Unmatched type %x at %zx\n", file.type, offset);
offset += file.offset + file.len;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}
diff --git a/src/lib/cbfs_boot_props.c b/src/lib/cbfs_boot_props.c
index 21e64d37a5..7a9f7a98e0 100644
--- a/src/lib/cbfs_boot_props.c
+++ b/src/lib/cbfs_boot_props.c
@@ -49,13 +49,11 @@ int __attribute__((weak)) cbfs_boot_region_properties(struct cbfs_props *props)
header.magic = ntohl(header.magic);
header.romsize = ntohl(header.romsize);
- header.align = ntohl(header.align);
header.offset = ntohl(header.offset);
if (header.magic != CBFS_HEADER_MAGIC)
return -1;
- props->align = header.align;
props->offset = header.offset;
props->size = header.romsize;
props->size -= props->offset;