Tronlong_T113i_C906_FreeRTOS/startup/resource_table.c

56 lines
1.2 KiB
C

#include <stddef.h>
#include <stdint.h>
#define __PACKED __attribute__((packed))
typedef enum {
RSC_CARVEOUT = 0,
RSC_DEVMEM = 1,
RSC_TRACE = 2,
RSC_VDEV = 3,
RSC_LAST = 4,
RSC_VENDOR_START = 128,
RSC_VENDOR_END = 512,
} rsc_type_t;
typedef struct __PACKED {
uint32_t ver;
uint32_t num;
uint32_t reserved[2];
} rsc_head_t;
typedef struct __PACKED {
rsc_type_t type;
uint32_t da;
uint32_t pa;
uint32_t len;
uint32_t flags;
uint32_t reserved;
uint8_t name[32];
} rsc_fw_carveout_t;
typedef struct __PACKED {
rsc_head_t head;
uint32_t offsets[1];
rsc_fw_carveout_t carveout_sdram;
} rsc_table_t;
__attribute__((section(".resource_table"))) const rsc_table_t rsc_tbl = {
.head =
{
.ver = 1,
.num = 1,
.reserved = {0UL, 0UL},
},
.offsets = {offsetof(rsc_table_t, carveout_sdram)},
.carveout_sdram =
{
.type = RSC_CARVEOUT,
.da = 0x4F800000UL,
.pa = 0x4F800000UL,
.len = 0x00800000UL,
.flags = 0x00000000UL,
.name = "SDRAM",
},
};