linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: expose PB1176 ROM in debugfs
@ 2010-07-07 12:05 Linus Walleij
  2010-07-18 19:47 ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2010-07-07 12:05 UTC (permalink / raw)
  To: linux-arm-kernel

This exposes the PB1176 ROM as a simple 16KiB file in debugfs so
that it can be copied out and disassembled with some
objcopy+objdump massage for example. I used this to find out how
the ROM handled the CharLCD.

Signed-off-by: Linus Walleij <triad@df.lth.se>
---
 arch/arm/mach-realview/include/mach/board-pb1176.h |    1 +
 arch/arm/mach-realview/realview_pb1176.c           |   31 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-realview/include/mach/board-pb1176.h b/arch/arm/mach-realview/include/mach/board-pb1176.h
index 2f5ccb2..9f627d4 100644
--- a/arch/arm/mach-realview/include/mach/board-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/board-pb1176.h
@@ -69,6 +69,7 @@
 
 #define REALVIEW_DC1176_GIC_CPU_BASE		0x10120000 /* GIC CPU interface, on devchip */
 #define REALVIEW_DC1176_GIC_DIST_BASE		0x10121000 /* GIC distributor, on devchip */
+#define REALVIEW_DC1176_ROM_BASE		0x10200000 /* 16KiB NRAM preudo-ROM, on devchip */
 #define REALVIEW_PB1176_GIC_CPU_BASE		0x10040000 /* GIC CPU interface, on FPGA */
 #define REALVIEW_PB1176_GIC_DIST_BASE		0x10041000 /* GIC distributor, on FPGA */
 #define REALVIEW_PB1176_L220_BASE		0x10110000 /* L220 registers */
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 099a1f1..cfdfd75 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -26,6 +26,7 @@
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -323,6 +324,36 @@ static void realview_pb1176_fixup(struct machine_desc *mdesc,
 	meminfo->nr_banks = 1;
 }
 
+#ifdef CONFIG_DEBUG_FS
+/*
+ * This exposes the PB1176 DevChip ROM as a simple file in debugfs
+ * The reference manual states that this is actually a pseudo-ROM
+ * programmed in NVRAM.
+ */
+static struct debugfs_blob_wrapper devchip_rom_blob;
+
+static int __init pb1176_export_rom(void)
+{
+	void __iomem *virtbase;
+	struct dentry *d;
+
+	virtbase = ioremap(REALVIEW_DC1176_ROM_BASE, SZ_16K);
+	if (!virtbase)
+		return -EIO;
+	devchip_rom_blob.data = virtbase;
+	devchip_rom_blob.size = SZ_16K;
+	d = debugfs_create_blob("pb1176-DevChip-ROM",
+				S_IFREG | S_IRUSR,
+				NULL, &devchip_rom_blob);
+	if (!d)
+		return -EIO;
+
+	return 0;
+}
+
+device_initcall(pb1176_export_rom);
+#endif
+
 static void __init realview_pb1176_init(void)
 {
 	int i;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-04  2:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07 12:05 [PATCH] ARM: expose PB1176 ROM in debugfs Linus Walleij
2010-07-18 19:47 ` Russell King - ARM Linux
2010-07-18 20:39   ` Linus Walleij
2010-09-03 21:38     ` Linus Walleij
2010-09-04  2:13       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).