BlueSCSI_config.h 5.3 KB

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