0001
0002
0003
0004
0005
0006
0007 #include <linux/debugfs.h>
0008 #include <linux/seq_file.h>
0009
0010 #define BOOTROM_OFFSET 0x10118000
0011 #define BOOTROM_SIZE 0x8000
0012
0013 static void __iomem *membase = (void __iomem *) KSEG1ADDR(BOOTROM_OFFSET);
0014
0015 static int bootrom_show(struct seq_file *s, void *unused)
0016 {
0017 seq_write(s, membase, BOOTROM_SIZE);
0018
0019 return 0;
0020 }
0021
0022 static int bootrom_open(struct inode *inode, struct file *file)
0023 {
0024 return single_open(file, bootrom_show, NULL);
0025 }
0026
0027 static const struct file_operations bootrom_file_ops = {
0028 .open = bootrom_open,
0029 .read = seq_read,
0030 .llseek = seq_lseek,
0031 .release = single_release,
0032 };
0033
0034 static int __init bootrom_setup(void)
0035 {
0036 debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops);
0037 return 0;
0038 }
0039
0040 postcore_initcall(bootrom_setup);