|
| 1 | +/* |
| 2 | + * Copyright (c) 2018 Nordic Semiconductor ASA |
| 3 | + * Copyright (c) 2019 STMicroelectronics |
| 4 | + * |
| 5 | + * SPDX-License-Identifier: Apache-2.0 |
| 6 | + */ |
| 7 | + |
| 8 | +#ifndef RESOURCE_TABLE_H__ |
| 9 | +#define RESOURCE_TABLE_H__ |
| 10 | + |
| 11 | +#ifndef OPENAMP_PACKED_BEGIN |
| 12 | +#define OPENAMP_PACKED_BEGIN |
| 13 | +#endif |
| 14 | + |
| 15 | +#ifndef OPENAMP_PACKED_END |
| 16 | +#define OPENAMP_PACKED_END __attribute__((__packed__)) |
| 17 | +#endif |
| 18 | + |
| 19 | +/* beginning of section: copied from OpenAMP */ |
| 20 | +/** |
| 21 | + * struct fw_rsc_trace - trace buffer declaration |
| 22 | + * @da: device address |
| 23 | + * @len: length (in bytes) |
| 24 | + * @reserved: reserved (must be zero) |
| 25 | + * @name: human-readable name of the trace buffer |
| 26 | + * |
| 27 | + * This resource entry provides the host information about a trace buffer |
| 28 | + * into which the remote remote_proc will write log messages. |
| 29 | + * |
| 30 | + * @da specifies the device address of the buffer, @len specifies |
| 31 | + * its size, and @name may contain a human readable name of the trace buffer. |
| 32 | + * |
| 33 | + * After booting the remote remote_proc, the trace buffers are exposed to the |
| 34 | + * user via debugfs entries (called trace0, trace1, etc..). |
| 35 | + */ |
| 36 | +OPENAMP_PACKED_BEGIN |
| 37 | +struct fw_rsc_trace { |
| 38 | + u32_t type; |
| 39 | + u32_t da; |
| 40 | + u32_t len; |
| 41 | + u32_t reserved; |
| 42 | + u8_t name[32]; |
| 43 | +} OPENAMP_PACKED_END; |
| 44 | + |
| 45 | +OPENAMP_PACKED_BEGIN |
| 46 | + |
| 47 | +enum fw_resource_type { |
| 48 | + RSC_CARVEOUT = 0, |
| 49 | + RSC_DEVMEM = 1, |
| 50 | + RSC_TRACE = 2, |
| 51 | + RSC_VDEV = 3, |
| 52 | + RSC_RPROC_MEM = 4, |
| 53 | + RSC_FW_CHKSUM = 5, |
| 54 | + RSC_LAST = 6, |
| 55 | + RSC_VENDOR_START = 128, |
| 56 | + RSC_VENDOR_END = 512, |
| 57 | +}; |
| 58 | + |
| 59 | +/* end of section: copied from OpenAMP */ |
| 60 | + |
| 61 | +struct stm32_resource_table { |
| 62 | + unsigned int ver; |
| 63 | + unsigned int num; |
| 64 | + unsigned int reserved[2]; |
| 65 | + unsigned int offset[1]; |
| 66 | + |
| 67 | + /* rpmsg trace entry */ |
| 68 | + struct fw_rsc_trace cm_trace; |
| 69 | +} OPENAMP_PACKED_END; |
| 70 | + |
| 71 | +void resource_table_init(volatile void **table_ptr, int *length); |
| 72 | + |
| 73 | +#endif |
| 74 | + |
0 commit comments