2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2013 John Crispin <john@phrozen.org>
9 #include <linux/debugfs.h>
10 #include <linux/seq_file.h>
12 #define BOOTROM_OFFSET 0x10118000
13 #define BOOTROM_SIZE 0x8000
15 static void __iomem
*membase
= (void __iomem
*) KSEG1ADDR(BOOTROM_OFFSET
);
17 static int bootrom_show(struct seq_file
*s
, void *unused
)
19 seq_write(s
, membase
, BOOTROM_SIZE
);
24 static int bootrom_open(struct inode
*inode
, struct file
*file
)
26 return single_open(file
, bootrom_show
, NULL
);
29 static const struct file_operations bootrom_file_ops
= {
33 .release
= single_release
,
36 static int bootrom_setup(void)
38 if (!debugfs_create_file("bootrom", 0444,
39 NULL
, NULL
, &bootrom_file_ops
)) {
40 pr_err("Failed to create bootrom debugfs file\n");
48 postcore_initcall(bootrom_setup
);