diff target-utils/dspdump/dumpops.c @ 544:451d8b545b11

dspdump: fulldump command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 28 Oct 2019 21:00:40 +0000
parents 947c6a443a9c
children
line wrap: on
line diff
--- 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 */
+	}
+}