iodevs.conf 1.1 KB

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