diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2018-04-05 09:14:51 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-04-30 09:33:49 +0000 |
commit | 9ab9db0bc5a1bf8bb35980068a840691d54aa5dd (patch) | |
tree | f9b0e0f5999a8a7d24760178a3fafebc59bf807c /src/include | |
parent | 666c172d385823eefdfeb99ae3a4c20fd1b711f9 (diff) |
lib/bootmem: Introduce custom bootmem tags
Introduce bootmem custom memory tags and use them instead of reusing
LB_MEM tags.
Use asserts in bootmem_add_range to verify parameters.
Tested with uImage payload on Cavium SoC.
Change-Id: I7be8fa792fc7933ca218ecd43d250d3a9c55caa6
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25633
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/bootmem.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/include/bootmem.h b/src/include/bootmem.h index 6e7d127f62..df2233f202 100644 --- a/src/include/bootmem.h +++ b/src/include/bootmem.h @@ -20,6 +20,22 @@ #include <stdint.h> #include <boot/coreboot_tables.h> +/** + * Bootmem types match to LB_MEM tags. + * Start at 0x10000 to make sure that the caller doesn't provide LB_MEM tags. + */ +enum bootmem_type { + BM_MEM_FIRST = 0x10000, /* First entry in this list */ + BM_MEM_RAM, /* Memory anyone can use */ + BM_MEM_RESERVED, /* Don't use this memory region */ + BM_MEM_ACPI, /* ACPI Tables */ + BM_MEM_NVS, /* ACPI NVS Memory */ + BM_MEM_UNUSABLE, /* Unusable address space */ + BM_MEM_VENDOR_RSVD, /* Vendor Reserved */ + BM_MEM_TABLE, /* Ram configuration tables are kept in */ + BM_MEM_LAST, /* Last entry in this list */ +}; + /* Write memory coreboot table. Current resource map is serialized into * memtable (LB_MEM_* types). bootmem library is unusable until this function * is called first in the write tables path before payload is loaded. */ @@ -30,7 +46,8 @@ void bootmem_write_memory_table(struct lb_memory *mem); void bootmem_arch_add_ranges(void); /* Add a range of a given type to the bootmem address space. */ -void bootmem_add_range(uint64_t start, uint64_t size, uint32_t type); +void bootmem_add_range(uint64_t start, uint64_t size, + const enum bootmem_type tag); /* Print current range map of boot memory. */ void bootmem_dump_ranges(void); |