2
0

iodevs.conf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. );
  17. # I/O address definitions
  18. our $xdev_addr_bits = 2;
  19. our $xdev_addr_shift = 28;
  20. our $iodev_addr_bits = 4;
  21. our $iodev_addr_shift = 7;
  22. # Special IRQs (CPU or non-device)
  23. our @sysirqs = ('timer', 'ebreak', 'buserr');
  24. # Define -irq to a string of 'e' (edge) or 'l' (level)
  25. # for a corresponding number of IRQs.
  26. our @iodevs = (
  27. { -name => 'sys' },
  28. { -name => 'abc', -irq => 'l' },
  29. { -name => 'abcmemmap', -xdev => 1 },
  30. { -name => 'sysclock', -irq => 'e' },
  31. { -name => 'tty', -irq => 'l' x $consts{'TTY_CHANNELS'} },
  32. { -name => 'usbdesc', -xdev => 1 },
  33. { -name => 'romcopy', -irq => 'l' },
  34. { -name => 'sdcard', -irq => 'l' },
  35. { -name => 'i2c', -irq => 'l' },
  36. { -name => 'esp', -irq => 'l' },
  37. { -name => 'random', -irq => 'l' },
  38. { -name => 'vjtag', -irq => 'e' }
  39. );