ZuluSCSI_config.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. * ZuluSCSI™ - Copyright (c) 2022 Rabbit Hole Computing™
  3. *
  4. * ZuluSCSI™ firmware is licensed under the GPL version 3 or any later version. 
  5. *
  6. * https://www.gnu.org/licenses/gpl-3.0.html
  7. * ----
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version. 
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. * GNU General Public License for more details. 
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  20. **/
  21. // Compile-time configuration parameters.
  22. // Other settings can be set by ini file at runtime.
  23. #pragma once
  24. #include <ZuluSCSI_platform.h>
  25. // Use variables for version number
  26. #define FW_VER_NUM "23.03.24"
  27. #define FW_VER_SUFFIX "devel"
  28. #define ZULU_FW_VERSION FW_VER_NUM "-" FW_VER_SUFFIX
  29. // Configuration and log file paths
  30. #define CONFIGFILE "zuluscsi.ini"
  31. #define LOGFILE "zululog.txt"
  32. #define CRASHFILE "zuluerr.txt"
  33. // Log buffer size in bytes, must be a power of 2
  34. #ifndef LOGBUFSIZE
  35. #define LOGBUFSIZE 16384
  36. #endif
  37. #define LOG_SAVE_INTERVAL_MS 1000
  38. // Watchdog timeout
  39. // Watchdog will first issue a bus reset and if that does not help, crashdump.
  40. #define WATCHDOG_BUS_RESET_TIMEOUT 15000
  41. #define WATCHDOG_CRASH_TIMEOUT 30000
  42. // HDD image file format
  43. #define HDIMG_ID_POS 2 // Position to embed ID number
  44. #define HDIMG_LUN_POS 3 // Position to embed LUN numbers
  45. #define HDIMG_BLK_POS 5 // Position to embed block size numbers
  46. #define MAX_FILE_PATH 64 // Maximum file name length
  47. // SCSI config
  48. #define NUM_SCSIID 8 // Maximum number of supported SCSI-IDs (The minimum is 0)
  49. #define NUM_SCSILUN 1 // Maximum number of LUNs supported (Currently has to be 1)
  50. #define READ_PARITY_CHECK 0 // Perform read parity check (unverified)
  51. // SCSI raw fallback configuration when no image files are detected
  52. // Presents the whole SD card as an SCSI drive
  53. #define RAW_FALLBACK_ENABLE 1
  54. #define RAW_FALLBACK_SCSI_ID 1
  55. #define RAW_FALLBACK_BLOCKSIZE 512
  56. // Default SCSI drive information (can be overridden in INI file)
  57. // Selected based on device type (fixed, removable, optical, floppy, mag-optical, tape)
  58. // Each entry has {vendor, product, version, serial}
  59. // If serial number is left empty, SD card serial number is used.
  60. #define DRIVEINFO_FIXED {"ZULUSCSI", "HARDDRIVE", PLATFORM_REVISION, ""}
  61. #define DRIVEINFO_REMOVABLE {"ZULUSCSI", "REMOVABLE", PLATFORM_REVISION, ""}
  62. #define DRIVEINFO_OPTICAL {"ZULUSCSI", "CDROM", PLATFORM_REVISION, ""}
  63. #define DRIVEINFO_FLOPPY {"ZULUSCSI", "FLOPPY", PLATFORM_REVISION, ""}
  64. #define DRIVEINFO_MAGOPT {"ZULUSCSI", "MO_DRIVE", PLATFORM_REVISION, ""}
  65. #define DRIVEINFO_TAPE {"ZULUSCSI", "TAPE", PLATFORM_REVISION, ""}
  66. // Default SCSI drive information when Apple quirks are enabled
  67. #define APPLE_DRIVEINFO_FIXED {"CDC", "ZuluSCSI HDD", PLATFORM_REVISION, "1.0"}
  68. #define APPLE_DRIVEINFO_REMOVABLE {"IOMEGA", "BETA230", PLATFORM_REVISION, "2.02"}
  69. #define APPLE_DRIVEINFO_OPTICAL {"MATSHITA", "CD-ROM CR-8004A", PLATFORM_REVISION, "2.0a"}
  70. #define APPLE_DRIVEINFO_FLOPPY {"TEAC", "FD235HS", PLATFORM_REVISION, "1.44"}
  71. #define APPLE_DRIVEINFO_MAGOPT {"MOST", "RMD-5200", PLATFORM_REVISION, "1.0"}
  72. #define APPLE_DRIVEINFO_TAPE {"ZULUSCSI", "APPLE_TAPE", PLATFORM_REVISION, ""}
  73. // Default delay for SCSI phases.
  74. // Can be adjusted in ini file
  75. #define DEFAULT_SCSI_DELAY_US 10
  76. #define DEFAULT_REQ_TYPE_SETUP_NS 500
  77. // Use prefetch buffer in read requests
  78. #ifndef PREFETCH_BUFFER_SIZE
  79. #define PREFETCH_BUFFER_SIZE 8192
  80. #endif