ZuluSCSI_config.h 4.5 KB

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