Drivers for the MNT ZZ9000 graphics and ARM coprocessor card for classic Amigas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

79 lines
2.1 KiB

  1. #ifndef MNTSD_H
  2. #define MNTSD_H
  3. #define uint32 unsigned long
  4. #define uint8 unsigned char
  5. #define uint16 unsigned short
  6. #define SD_HEADS 1
  7. #define SD_CYLS 4096 /* 4096 MB */
  8. #define SD_TRACK_SECTORS 2048 /* 1 MB */
  9. #define SD_CYL_SECTORS 2048 /* TRACK_SECTORS * HEADS */
  10. #define SD_SECTOR_BYTES 512
  11. #define SD_SECTOR_SHIFT 9
  12. #define SD_RETRY 10
  13. #define SDERRF_TIMEOUT (1 << 7)
  14. #define SDERRF_PARAM (1 << 6)
  15. #define SDERRF_ADDRESS (1 << 5)
  16. #define SDERRF_ERASESEQ (1 << 4)
  17. #define SDERRF_CRC (1 << 3)
  18. #define SDERRF_ILLEGAL (1 << 2)
  19. #define SDERRF_ERASERES (1 << 1)
  20. #define SDERRF_IDLE (1 << 0)
  21. #define SD_UNITS 1 /* Only one chip select for now */
  22. #define SDU_STACK_SIZE (4096 / sizeof(ULONG))
  23. #define CMD_NAME(x) if (cmd == x) return #x
  24. #define TD_READ64 24
  25. #define TD_WRITE64 25
  26. #define TD_SEEK64 26
  27. #define TD_FORMAT64 27
  28. struct MNTUSBSRegs {
  29. volatile uint16 tx_hi; // d0
  30. volatile uint16 tx_lo; // d2
  31. volatile uint16 rx_hi; // d4
  32. volatile uint16 rx_lo; // d6
  33. volatile uint16 status; // d8
  34. volatile uint16 bufsel; // da
  35. volatile uint32 capacity; // dc
  36. };
  37. struct SDBase {
  38. struct Device* sd_Device;
  39. struct SDUnit {
  40. struct Unit sdu_Unit;
  41. /*struct Unit {
  42. struct MsgPort unit_MsgPort;
  43. UBYTE unit_flags;
  44. UNITF_ACTIVE = 1
  45. UNITF_INTASK = 2
  46. UBYTE unit_pad;
  47. UWORD unit_OpenCnt;
  48. };*/
  49. BOOL sdu_Enabled;
  50. void* sdu_Registers;
  51. BOOL sdu_Present; /* Is a device detected? */
  52. BOOL sdu_Valid; /* Is the device ready for IO? */
  53. BOOL sdu_ReadOnly; /* Is the device read-only? */
  54. BOOL sdu_Motor; /* TD_MOTOR state */
  55. ULONG sdu_ChangeNum;
  56. } sd_Unit[SD_UNITS];
  57. };
  58. uint16 sdcmd_read_blocks(void* registers, uint8* data, uint32 block, uint32 len);
  59. uint16 sdcmd_write_blocks(void* registers, uint8* data, uint32 block, uint32 len);
  60. uint16 sdcmd_present();
  61. uint16 sdcmd_detect();
  62. uint32 sdcmd_capacity(void* registers);
  63. void sd_reset(void* regs);
  64. #endif