changeset 544:451d8b545b11

dspdump: fulldump command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 28 Oct 2019 21:00:40 +0000
parents 947c6a443a9c
children 47ee7373010b
files target-utils/dspdump/cmdtab.c target-utils/dspdump/dumpops.c
diffstat 2 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/target-utils/dspdump/cmdtab.c	Mon Oct 28 20:47:40 2019 +0000
+++ b/target-utils/dspdump/cmdtab.c	Mon Oct 28 21:00:40 2019 +0000
@@ -4,6 +4,7 @@
 extern void cmd_abbw();
 extern void cmd_bigdump();
 extern void cmd_dump();
+extern void cmd_fulldump();
 extern void cmd_jump();
 extern void cmd_r8();
 extern void cmd_r16();
@@ -23,6 +24,7 @@
 	{"abbw", cmd_abbw},
 	{"bigdump", cmd_bigdump},
 	{"dump", cmd_dump},
+	{"fulldump", cmd_fulldump},
 	{"jump", cmd_jump},
 	{"poweroff", abb_power_off},
 	{"r8", cmd_r8},
--- a/target-utils/dspdump/dumpops.c	Mon Oct 28 20:47:40 2019 +0000
+++ b/target-utils/dspdump/dumpops.c	Mon Oct 28 21:00:40 2019 +0000
@@ -95,3 +95,37 @@
 		return;		/* error msg already printed */
 	dump_large_section((u16)mode, (u32)addr, (u32)len);
 }
+
+static struct rom_section {
+	char *name;
+	u32 addr;
+	u32 size;
+	int mode;
+} rom_sections[] = {
+	{ "Registers",	0x00000, 0x0060, BL_MODE_DATA_READ },
+	{ "DROM",	0x09000, 0x5000, BL_MODE_DROM_READ },
+	{ "PDROM",	0x0e000, 0x2000, BL_MODE_PROM_READ },
+	{ "PROM0",	0x07000, 0x7000, BL_MODE_PROM_READ },
+	{ "PROM1",	0x18000, 0x8000, BL_MODE_PROM_READ },
+	{ "PROM2",	0x28000, 0x8000, BL_MODE_PROM_READ },
+	{ "PROM3",	0x38000, 0x2000, BL_MODE_PROM_READ },
+	{ 0, 0, 0, -1 }
+};
+
+void
+cmd_fulldump()
+{
+	struct rom_section *tp;
+	int rc;
+
+	rc = boot_dsp_dump_agent();
+	if (rc < 0)
+		return;		/* error msg already printed */
+	for (tp = rom_sections; tp->name; tp++) {
+		printf("DSP dump: %s [%05x-%05x]\n", tp->name, tp->addr,
+			tp->addr + tp->size - 1);
+		rc = dump_large_section(tp->mode, tp->addr, tp->size);
+		if (rc < 0)
+			return;		/* error msg already printed */
+	}
+}