summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-01-11 16:07:02 -0800
committerJulius Werner <jwerner@chromium.org>2021-03-17 00:13:53 +0000
commit965846fcd0657bead026056e9bdc3625a534552e (patch)
tree1ffd1fe6f6b252087121fa4934d1d9c2d6c112ae /src/include
parent1de8708fe50339162b4a59039e0ac45e6f3ffdd0 (diff)
cbfs: Remove prog_locate() for payloads (SELF and FIT)
This patch removes the prog_locate() call for all instances of loading payload formats (SELF and FIT), as the previous patch did for stages. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I582b37f36fe6f9f26975490a823e85b130ba49a2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49336 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootmem.h2
-rw-r--r--src/include/fit_payload.h10
-rw-r--r--src/include/program_loading.h11
3 files changed, 11 insertions, 12 deletions
diff --git a/src/include/bootmem.h b/src/include/bootmem.h
index 0625bbb3bc..6ccdd884aa 100644
--- a/src/include/bootmem.h
+++ b/src/include/bootmem.h
@@ -17,6 +17,8 @@
* Start at 0x10000 to make sure that the caller doesn't provide LB_MEM tags.
*/
enum bootmem_type {
+ BM_MEM_INVALID = 0, /* Invalid type (used in optional arguments). */
+
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 */
diff --git a/src/include/fit_payload.h b/src/include/fit_payload.h
deleted file mode 100644
index 4ebe3ce78e..0000000000
--- a/src/include/fit_payload.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-
-#ifndef __FIT_PAYLOAD_H_
-#define __FIT_PAYLOAD_H_
-
-#include <program_loading.h>
-
-void fit_payload(struct prog *payload);
-
-#endif /* __FIT_PAYLOAD_H_ */
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 7ceecc40f2..f936c618ad 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -3,6 +3,7 @@
#define PROGRAM_LOADING_H
#include <bootmem.h>
+#include <commonlib/bsd/cbfs_serialized.h>
#include <commonlib/region.h>
#include <stdint.h>
#include <stddef.h>
@@ -45,7 +46,7 @@ struct prog {
* payload. For architectures that use a bounce buffer
* then it would represent the bounce buffer. */
enum prog_type type;
- uint32_t cbfs_type;
+ enum cbfs_type cbfs_type;
const char *name;
struct region_device rdev;
/* Entry to program with optional argument. It's up to the architecture
@@ -70,7 +71,7 @@ static inline enum prog_type prog_type(const struct prog *prog)
return prog->type;
}
-static inline uint32_t prog_cbfs_type(const struct prog *prog)
+static inline enum cbfs_type prog_cbfs_type(const struct prog *prog)
{
return prog->cbfs_type;
}
@@ -197,5 +198,11 @@ void payload_run(void);
*/
bool selfload_check(struct prog *payload, enum bootmem_type dest_type);
bool selfload(struct prog *payload);
+/* Like selfload_check() but with the payload data already mapped to memory. */
+bool selfload_mapped(struct prog *payload, void *mapping,
+ enum bootmem_type dest_type);
+
+/* Load a FIT payload. The payload data must already be mapped to memory. */
+void fit_payload(struct prog *payload, void *data);
#endif /* PROGRAM_LOADING_H */