Commit a7bb4873 authored by Adam Wujek's avatar Adam Wujek

arch: move softpll to wrc_global and change their addresses in memory

wrc_global can be accessed at the place where softpll was (0x90)

This commit changes the address of softpll data. Softpll is no longer available
at 0x90 in the dump of a memory, but it has to be accessed via softpll pointer
in the structure wrc_global.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent fd813231
......@@ -115,8 +115,8 @@ _true_reset:
.int 0x01234567
.short 0x89ab, 0xcdef
/* Pointer to structures, for the dumping tool */
.org SOFTPLL_PADDR
.word softpll
.org WRC_STATIC_PADDR
.word wrc_global
.org FIFO_LOG_PADDR
.word fifo_log
#ifdef CONFIG_WRPC_PPSI
......@@ -141,8 +141,6 @@ version_wrpc:
version_ppsi:
.byte WRS_PPSI_SHMEM_VERSION
.org WRC_STATIC_PADDR
.word wrc_global
/* Pointer to a structure used by testbenches, use only when
* CONFIG_WR_NODE_SIM is set */
......
......@@ -11,14 +11,14 @@
/* offsets for crt0.s */
#define WRPC_MARK 0x80
#define SOFTPLL_PADDR 0x90
#define WRC_STATIC_PADDR 0x90
#define FIFO_LOG_PADDR 0x94
#define PPG_STATIC_PADDR 0x98
#define STATS_PADDR 0x9c
#define UPTIME_SEC_ADDR 0xa0
#define VERSION_WRPC_ADDR 0xa4
#define VERSION_PPSI_ADDR 0xa5
#define WRC_STATIC_PADDR 0xa8
#define HDL_TESTBENCH_PADDR 0xbc
#endif /* __CRT0_H__ */
......@@ -22,8 +22,8 @@ _exception_entry:
.int 0x01234567
.short 0x89ab, 0xcdef
/* Pointer to structures, for the dumping tool */
.org SOFTPLL_PADDR
.word softpll
.org WRC_STATIC_PADDR
.word wrc_global
.org FIFO_LOG_PADDR
.word fifo_log
#ifdef CONFIG_WRPC_PPSI
......@@ -48,8 +48,6 @@ version_wrpc:
version_ppsi:
.byte WRS_PPSI_SHMEM_VERSION
.org WRC_STATIC_PADDR
.word wrc_global
/* Pointer to a structure used by testbenches, use only when
* CONFIG_WR_NODE_SIM is set */
......
......@@ -11,14 +11,14 @@
/* offsets for crt0.s */
#define WRPC_MARK 0x80
#define SOFTPLL_PADDR 0x90
#define WRC_STATIC_PADDR 0x90
#define FIFO_LOG_PADDR 0x94
#define PPG_STATIC_PADDR 0x98
#define STATS_PADDR 0x9c
#define UPTIME_SEC_ADDR 0xa0
#define VERSION_WRPC_ADDR 0xa4
#define VERSION_PPSI_ADDR 0xa5
#define WRC_STATIC_PADDR 0xa8
#define HDL_TESTBENCH_PADDR 0xbc
#endif /* __CRT0_H__ */
......@@ -18,6 +18,7 @@ struct dump_info dump_wrpc_info[] = {
DUMP_FIELD(int, task_list_max),
DUMP_FIELD(pointer, task_list),
DUMP_FIELD(pointer, config),
DUMP_FIELD(pointer, softpll),
#undef DUMP_STRUCT
#define DUMP_STRUCT struct wrc_global_link
......@@ -44,7 +45,7 @@ struct dump_info dump_wrpc_info[] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT struct softpll_state
DUMP_HEADER("softpll"),
DUMP_HEADER("struct_softpll"),
DUMP_FIELD(spll_mode, mode),
DUMP_FIELD(int, seq_state),
DUMP_FIELD(int, dac_timeout),
......
......@@ -11,7 +11,7 @@
/* Please increment WRPC_SHMEM_VERSION if you change any exported data
* structure */
#define WRPC_SHMEM_VERSION 2 /* removed some unused fields */
#define WRPC_SHMEM_VERSION 3 /* add wrc_global in the place where spll was */
#ifndef __ASSEMBLY__
extern const char *build_revision;
......
......@@ -19,6 +19,7 @@ struct wrc_global {
struct wrc_global_link *link_status;
int task_list_max;
struct wrc_task *task_list;
volatile struct softpll_state *softpll;
void * config;
};
......
......@@ -178,5 +178,7 @@ struct spll_fifo_log {
extern int spll_ljd_present;
extern volatile struct softpll_state softpll;
#endif // __SOFTPLL_NG_H
......@@ -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;
unsigned long tmp_off, spll_off;
char *prefix;
printf("wrc_global at 0x%lx\n", wrc_global_off);
......@@ -436,6 +436,14 @@ void dump_mem_wrpc_global(void *mapaddr, unsigned long wrc_global_off)
/* dump task list */
dump_mem_wrpc_task_list(mapaddr, wrc_global_off);
spll_off = wrpc_get_pointer(mapaddr + wrc_global_off, "wrc_global",
"softpll");
if (spll_off) {
prefix = "wrc_global.spll";
printf("%s at 0x%lx\n", prefix, spll_off);
dump_many_fields(mapaddr + spll_off, "struct_softpll", prefix);
}
/* dump config */
tmp_off = wrpc_get_pointer(mapaddr + wrc_global_off, "wrc_global",
"config");
......@@ -447,7 +455,7 @@ void dump_mem_wrpc_global(void *mapaddr, unsigned long wrc_global_off)
}
/* all of these are 0 by default */
unsigned long spll_off, fifo_off, ppg_off, stats_off, wrc_global_off;
unsigned long fifo_off, ppg_off, stats_off, wrc_global_off;
/* Use: wrs_dump_memory <file> <hex-offset> <name> */
int main(int argc, char **argv)
......@@ -457,7 +465,6 @@ int main(int argc, char **argv)
unsigned long offset;
struct stat st;
char *dumpname = "";
char *prefix;
char c;
uint8_t version_wrpc, version_ppsi;
......@@ -524,8 +531,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)) {
spll_off = wrpc_get_l32(mapaddr + SOFTPLL_PADDR);
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);
......@@ -546,14 +551,6 @@ int main(int argc, char **argv)
exit(1);
}
/* Now check the "name" to be dumped */
if (!strcmp(dumpname, "pll"))
spll_off = offset;
if (spll_off) {
prefix = "spll";
printf("%s at 0x%lx\n", prefix, spll_off);
dump_many_fields(mapaddr + spll_off, "softpll", prefix);
}
if (!strcmp(dumpname, "fifo"))
fifo_off = offset;
if (fifo_off) {
......
......@@ -76,6 +76,7 @@ struct wrc_global wrc_global = {
.link_status = &wrc_global_link,
.task_list_max = WRC_MAX_TASKS,
.task_list = tasks,
.softpll = &softpll,
#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