iodevs.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # -*- perl -*-
  2. #
  3. # I/O device configuration
  4. #
  5. # Common constants
  6. our %consts = (
  7. '_PC_RESET' => 0x10,
  8. '_PC_IRQ' => 0x20,
  9. 'SRAM_ADDR' => 0,
  10. 'SRAM_BITS' => 15,
  11. 'SDRAM_ADDR' => 0x40000000,
  12. 'SDRAM_BITS' => 25,
  13. 'SYS_MAGIC_MAX80' => unpack('V', 'MAX8'),
  14. 'TIMER_SHIFT' => 5, # 32 Hz
  15. 'TTY_CHANNELS' => 2,
  16. 'USER_CONTEXT_CSR' => 0x7f0,
  17. 'MEINFO_CSR' => 0x7f1
  18. );
  19. # I/O address definitions
  20. our $xdev_addr_bits = 2;
  21. our $xdev_addr_shift = 28;
  22. our $iodev_addr_bits = 4;
  23. our $iodev_addr_shift = 7;
  24. # Special IRQs (CPU or non-device)
  25. our @sysirqs = ('timer', 'ebreak', 'buserr');
  26. # Define -irq to a string of 'e' (edge) or 'l' (level)
  27. # for a corresponding number of IRQs.
  28. our @iodevs = (
  29. { -name => 'sys' },
  30. { -name => 'abc', -irq => 'l' },
  31. { -name => 'abcmemmap', -xdev => 1 },
  32. { -name => 'sysclock', -irq => 'e' },
  33. { -name => 'tty', -irq => 'l' x $consts{'TTY_CHANNELS'} },
  34. { -name => 'usbdesc', -xdev => 1 },
  35. { -name => 'romcopy', -irq => 'l' },
  36. { -name => 'sdcard', -irq => 'l' },
  37. { -name => 'i2c', -irq => 'l' },
  38. { -name => 'esp', -irq => 'l' },
  39. { -name => 'random', -irq => 'l' },
  40. { -name => 'dirty', -xdev => 1 },
  41. { -name => 'vjtag', -irq => 'e' }
  42. );