bootrom.c 600 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. *
  4. * Copyright (C) 2013 John Crispin <[email protected]>
  5. */
  6. #include <linux/debugfs.h>
  7. #include <linux/seq_file.h>
  8. #define BOOTROM_OFFSET 0x10118000
  9. #define BOOTROM_SIZE 0x8000
  10. static void __iomem *membase = (void __iomem *) KSEG1ADDR(BOOTROM_OFFSET);
  11. static int bootrom_show(struct seq_file *s, void *unused)
  12. {
  13. seq_write(s, membase, BOOTROM_SIZE);
  14. return 0;
  15. }
  16. DEFINE_SHOW_ATTRIBUTE(bootrom);
  17. static int __init bootrom_setup(void)
  18. {
  19. debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_fops);
  20. return 0;
  21. }
  22. postcore_initcall(bootrom_setup);