default y
help
Support CBFS files compressed using the lzma decompression
- algorighm.
+ algorithm.
+ config CBFS_LOCATION
+ depends on COREBOOT_FLASH
+ hex "CBFS memory end location"
+ default 0
+ help
+ Memory address of where the CBFS data ends. This should
+ be zero for normal builds. It may be a non-zero value if
+ the CBFS filesystem is at a non-standard location (eg,
+ 0xffe00000 if CBFS ends 2Meg below the end of flash).
+
config FLASH_FLOPPY
depends on COREBOOT_FLASH
bool "Floppy images in CBFS"
****************************************************************/
#define CBFS_HEADER_MAGIC 0x4F524243
-#define CBFS_HEADPTR_ADDR 0xFFFFFFFc
#define CBFS_VERSION1 0x31313131
struct cbfs_header {
if (!CONFIG_COREBOOT_FLASH)
return;
- struct cbfs_header *hdr = *(void **)CBFS_HEADPTR_ADDR;
+ struct cbfs_header *hdr = *(void **)(CONFIG_CBFS_LOCATION - 4);
if (hdr->magic != cpu_to_be32(CBFS_HEADER_MAGIC)) {
dprintf(1, "Unable to find CBFS (ptr=%p; got %x not %x)\n"
, hdr, hdr->magic, cpu_to_be32(CBFS_HEADER_MAGIC));
}
dprintf(1, "Found CBFS header at %p\n", hdr);
- struct cbfs_file *fhdr = (void *)(0 - be32_to_cpu(hdr->romsize)
- + be32_to_cpu(hdr->offset));
+ u32 romsize = be32_to_cpu(hdr->romsize);
+ u32 romstart = CONFIG_CBFS_LOCATION - romsize;
+ struct cbfs_file *fhdr = (void*)romstart + be32_to_cpu(hdr->offset);
for (;;) {
- if (fhdr < (struct cbfs_file *)(0xFFFFFFFF - be32_to_cpu(hdr->romsize)))
+ if ((u32)fhdr - romstart > romsize)
break;
u64 magic = fhdr->magic;
if (magic != CBFS_FILE_MAGIC)