ZuluSCSI_config.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.06.13"
  27. #define FW_VER_SUFFIX "release"
  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. // Prefix for command file to create new image (case-insensitive)
  34. #define CREATEFILE "create"
  35. // Log buffer size in bytes, must be a power of 2
  36. #ifndef LOGBUFSIZE
  37. #define LOGBUFSIZE 16384
  38. #endif
  39. #define LOG_SAVE_INTERVAL_MS 1000
  40. // Watchdog timeout
  41. // Watchdog will first issue a bus reset and if that does not help, crashdump.
  42. #define WATCHDOG_BUS_RESET_TIMEOUT 15000
  43. #define WATCHDOG_CRASH_TIMEOUT 30000
  44. // HDD image file format
  45. #define HDIMG_ID_POS 2 // Position to embed ID number
  46. #define HDIMG_LUN_POS 3 // Position to embed LUN numbers
  47. #define HDIMG_BLK_POS 5 // Position to embed block size numbers
  48. #define MAX_FILE_PATH 64 // Maximum file name length
  49. // Image definition options
  50. #define IMAGE_INDEX_MAX 9 // Maximum number of 'IMG0' style statements parsed
  51. // SCSI config
  52. #define NUM_SCSIID 8 // Maximum number of supported SCSI-IDs (The minimum is 0)
  53. #define NUM_SCSILUN 1 // Maximum number of LUNs supported (Currently has to be 1)
  54. #define READ_PARITY_CHECK 0 // Perform read parity check (unverified)
  55. // SCSI raw fallback configuration when no image files are detected
  56. // Presents the whole SD card as an SCSI drive
  57. #define RAW_FALLBACK_ENABLE 1
  58. #define RAW_FALLBACK_SCSI_ID 1
  59. #define RAW_FALLBACK_BLOCKSIZE 512
  60. // Default SCSI drive information (can be overridden in INI file)
  61. // Selected based on device type (fixed, removable, optical, floppy, mag-optical, tape)
  62. // Each entry has {vendor, product, version, serial}
  63. // If serial number is left empty, SD card serial number is used.
  64. #define DRIVEINFO_FIXED {"ZULUSCSI", "HARDDRIVE", PLATFORM_REVISION, ""}
  65. #define DRIVEINFO_REMOVABLE {"ZULUSCSI", "REMOVABLE", PLATFORM_REVISION, ""}
  66. #define DRIVEINFO_OPTICAL {"ZULUSCSI", "CDROM", PLATFORM_REVISION, ""}
  67. #define DRIVEINFO_FLOPPY {"ZULUSCSI", "FLOPPY", PLATFORM_REVISION, ""}
  68. #define DRIVEINFO_MAGOPT {"ZULUSCSI", "MO_DRIVE", PLATFORM_REVISION, ""}
  69. #define DRIVEINFO_TAPE {"ZULUSCSI", "TAPE", PLATFORM_REVISION, ""}
  70. // Default SCSI drive information when Apple quirks are enabled
  71. #define APPLE_DRIVEINFO_FIXED {"CDC", "ZuluSCSI HDD", PLATFORM_REVISION, "1.0"}
  72. #define APPLE_DRIVEINFO_REMOVABLE {"IOMEGA", "BETA230", PLATFORM_REVISION, "2.02"}
  73. #define APPLE_DRIVEINFO_OPTICAL {"MATSHITA", "CD-ROM CR-8004A", PLATFORM_REVISION, "2.0a"}
  74. #define APPLE_DRIVEINFO_FLOPPY {"TEAC", "FD235HS", PLATFORM_REVISION, "1.44"}
  75. #define APPLE_DRIVEINFO_MAGOPT {"MOST", "RMD-5200", PLATFORM_REVISION, "1.0"}
  76. #define APPLE_DRIVEINFO_TAPE {"ZULUSCSI", "APPLE_TAPE", PLATFORM_REVISION, ""}
  77. // Default delay for SCSI phases.
  78. // Can be adjusted in ini file
  79. #define DEFAULT_SCSI_DELAY_US 10
  80. #define DEFAULT_REQ_TYPE_SETUP_NS 500
  81. // Use prefetch buffer in read requests
  82. #ifndef PREFETCH_BUFFER_SIZE
  83. #define PREFETCH_BUFFER_SIZE 8192
  84. #endif