Commit 5561d700 authored by Adam Wujek's avatar Adam Wujek

arch: move fifo_log to wrc_global

fifo_log is no longer at constant and known address. The address of fifo_log
has to be read from wrc_global.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent a7bb4873
......@@ -117,8 +117,7 @@ _true_reset:
/* Pointer to structures, for the dumping tool */
.org WRC_STATIC_PADDR
.word wrc_global
.org FIFO_LOG_PADDR
.word fifo_log
#ifdef CONFIG_WRPC_PPSI
.org PPG_STATIC_PADDR
.word ppg_static
......
......@@ -12,7 +12,7 @@
/* offsets for crt0.s */
#define WRPC_MARK 0x80
#define WRC_STATIC_PADDR 0x90
#define FIFO_LOG_PADDR 0x94
#define PPG_STATIC_PADDR 0x98
#define STATS_PADDR 0x9c
#define UPTIME_SEC_ADDR 0xa0
......
......@@ -24,8 +24,6 @@ _exception_entry:
/* Pointer to structures, for the dumping tool */
.org WRC_STATIC_PADDR
.word wrc_global
.org FIFO_LOG_PADDR
.word fifo_log
#ifdef CONFIG_WRPC_PPSI
.org PPG_STATIC_PADDR
.word ppg_static
......
......@@ -12,7 +12,7 @@
/* offsets for crt0.s */
#define WRPC_MARK 0x80
#define WRC_STATIC_PADDR 0x90
#define FIFO_LOG_PADDR 0x94
#define PPG_STATIC_PADDR 0x98
#define STATS_PADDR 0x9c
#define UPTIME_SEC_ADDR 0xa0
......
......@@ -19,6 +19,7 @@ struct dump_info dump_wrpc_info[] = {
DUMP_FIELD(pointer, task_list),
DUMP_FIELD(pointer, config),
DUMP_FIELD(pointer, softpll),
DUMP_FIELD(pointer, pll_fifo),
#undef DUMP_STRUCT
#define DUMP_STRUCT struct wrc_global_link
......@@ -83,7 +84,7 @@ struct dump_info dump_wrpc_info[] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT struct spll_fifo_log
DUMP_HEADER("pll_fifo"),
DUMP_HEADER_SIZE("struct_pll_fifo", sizeof(struct spll_fifo_log)),
DUMP_FIELD(uint32_t, trr),
DUMP_FIELD(uint32_t, tstamp),
DUMP_FIELD(uint32_t, duration),
......
......@@ -20,6 +20,7 @@ struct wrc_global {
int task_list_max;
struct wrc_task *task_list;
volatile struct softpll_state *softpll;
struct spll_fifo_log *pll_fifo;
void * config;
};
......
......@@ -418,7 +418,7 @@ void dump_mem_wrpc_task_list(void *mapaddr, unsigned long wrc_global_off)
void dump_mem_wrpc_global(void *mapaddr, unsigned long wrc_global_off)
{
unsigned long tmp_off, spll_off;
unsigned long tmp_off, spll_off, fifo_off;
char *prefix;
printf("wrc_global at 0x%lx\n", wrc_global_off);
......@@ -444,6 +444,20 @@ void dump_mem_wrpc_global(void *mapaddr, unsigned long wrc_global_off)
dump_many_fields(mapaddr + spll_off, "struct_softpll", prefix);
}
fifo_off = wrpc_get_pointer(mapaddr + wrc_global_off, "wrc_global",
"pll_fifo");
if (fifo_off) {
int i;
int pll_log_struct_size;
printf("fifo log at 0x%lx\n", fifo_off);
pll_log_struct_size = wrpc_get_struct_size("struct_pll_fifo");
for (i = 0; i < FIFO_LOG_LEN; i++)
dump_many_fields(mapaddr + fifo_off
+ i * pll_log_struct_size,
"struct_pll_fifo", "wrc_global.spll_fifo");
}
/* dump config */
tmp_off = wrpc_get_pointer(mapaddr + wrc_global_off, "wrc_global",
"config");
......@@ -531,7 +545,6 @@ int main(int argc, char **argv)
/* If we have a new binary file, pick the pointers
* Magic numbers are taken from crt0.S or disassembly of wrc.bin */
if (!strncmp(mapaddr + WRPC_MARK, "WRPC----", 8)) {
fifo_off = wrpc_get_l32(mapaddr + FIFO_LOG_PADDR);
ppg_off = wrpc_get_l32(mapaddr + PPG_STATIC_PADDR);
stats_off = wrpc_get_l32(mapaddr + STATS_PADDR);
wrc_global_off = wrpc_get_l32(mapaddr + WRC_STATIC_PADDR);
......@@ -551,18 +564,6 @@ int main(int argc, char **argv)
exit(1);
}
if (!strcmp(dumpname, "fifo"))
fifo_off = offset;
if (fifo_off) {
int i;
printf("fifo log at 0x%lx\n", fifo_off);
for (i = 0; i < FIFO_LOG_LEN; i++)
dump_many_fields(mapaddr + fifo_off
+ i * sizeof(struct spll_fifo_log),
"pll_fifo", "fifo");
}
if (!strcmp(dumpname, "ppg"))
ppg_off = offset;
if (ppg_off) {
......
......@@ -64,6 +64,7 @@ struct wr_endpoint_device wrc_endpoint_dev;
int wrc_wr_diags(void); // fixme: move the header
extern char _binary__config_bin_start[];
extern struct spll_fifo_log fifo_log[];
struct wrc_global_link wrc_global_link = {
.version = WRC_G_LINK_VERSION,
......@@ -77,6 +78,7 @@ struct wrc_global wrc_global = {
.task_list_max = WRC_MAX_TASKS,
.task_list = tasks,
.softpll = &softpll,
.pll_fifo = fifo_log,
#ifdef CONFIG_CMD_CONFIG
.config = _binary__config_bin_start,
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment