23#ifndef REMOTEPROC_LOADER_H_
24#define REMOTEPROC_LOADER_H_
27#include <metal/list.h>
31#if defined __cplusplus
36#define SUPPORT_SEEK 1UL
39#define RPROC_LOAD_ANYADDR ((metal_phys_addr_t)-1)
43#define RPROC_LOADER_NOT_READY 0x0L
45#define RPROC_LOADER_READY_TO_LOAD 0x10000L
47#define RPROC_LOADER_POST_DATA_LOAD 0x20000L
49#define RPROC_LOADER_LOAD_COMPLETE 0x40000L
51#define RPROC_LOADER_MASK 0x00FF0000L
53#define RPROC_LOADER_PRIVATE_MASK 0x0000FFFFL
55#define RPROC_LOADER_RESERVED_MASK 0x0F000000L
60 int (*
open)(
void *store,
const char *path,
const void **img_data);
66 int (*
load)(
void *store,
size_t offset,
size_t size,
69 struct metal_io_region *io,
char is_blocking);
78 int (*
load_header)(
const void *img_data,
size_t offset,
size_t len,
79 void **img_info,
int last_state,
80 size_t *noffset,
size_t *nlen);
84 const void *img_data,
size_t offset,
size_t len,
85 void **img_info,
int last_load_state,
86 metal_phys_addr_t *da,
87 size_t *noffset,
size_t *nlen,
88 unsigned char *padding,
size_t *nmemsize);
95 size_t *offset,
size_t *size);
107#if defined __cplusplus
User-defined image store operations.
Definition remoteproc_loader.h:58
void(* close)(void *store)
User-defined callback to close the "firmware" to clean up after loading.
Definition remoteproc_loader.h:63
unsigned int features
Loader supported features.
Definition remoteproc_loader.h:72
int(* load)(void *store, size_t offset, size_t size, const void **data, metal_phys_addr_t pa, struct metal_io_region *io, char is_blocking)
User-defined callback to load the firmware contents to target memory or local memory.
Definition remoteproc_loader.h:66
int(* open)(void *store, const char *path, const void **img_data)
User-defined callback to open the "firmware" to prepare loading.
Definition remoteproc_loader.h:60
Loader operations.
Definition remoteproc_loader.h:76
int(* locate_rsc_table)(void *img_info, metal_phys_addr_t *da, size_t *offset, size_t *size)
Define how to get the resource table target address, offset to the ELF image file and size of the res...
Definition remoteproc_loader.h:94
int(* load_data)(struct remoteproc *rproc, const void *img_data, size_t offset, size_t len, void **img_info, int last_load_state, metal_phys_addr_t *da, size_t *noffset, size_t *nlen, unsigned char *padding, size_t *nmemsize)
Define how to load the target data.
Definition remoteproc_loader.h:83
metal_phys_addr_t(* get_entry)(void *img_info)
Get entry address.
Definition remoteproc_loader.h:101
void(* release)(void *img_info)
Define how to release the loader.
Definition remoteproc_loader.h:98
int(* get_load_state)(void *img_info)
Get load state from the image information.
Definition remoteproc_loader.h:104
int(* load_header)(const void *img_data, size_t offset, size_t len, void **img_info, int last_state, size_t *noffset, size_t *nlen)
Define how to get the executable headers.
Definition remoteproc_loader.h:78
A remote processor instance.
Definition remoteproc.h:396