|
@@ -40,6 +40,11 @@
|
|
|
#include "custom_timings.h"
|
|
#include "custom_timings.h"
|
|
|
#include <ZuluSCSI_settings.h>
|
|
#include <ZuluSCSI_settings.h>
|
|
|
|
|
|
|
|
|
|
+#ifdef SD_USE_RP2350_SDIO
|
|
|
|
|
+#include <sdio_rp2350.h>
|
|
|
|
|
+#else
|
|
|
|
|
+#include <sdio.h>
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#ifndef PIO_FRAMEWORK_ARDUINO_NO_USB
|
|
#ifndef PIO_FRAMEWORK_ARDUINO_NO_USB
|
|
|
# include <SerialUSB.h>
|
|
# include <SerialUSB.h>
|
|
@@ -171,7 +176,9 @@ bool platform_reclock(zuluscsi_speed_grade_t speed_grade)
|
|
|
#endif
|
|
#endif
|
|
|
logmsg("Initial Clock set to ", (int) platform_sys_clock_in_hz(), "Hz");
|
|
logmsg("Initial Clock set to ", (int) platform_sys_clock_in_hz(), "Hz");
|
|
|
logmsg("Reclocking the MCU to ",(int) g_zuluscsi_timings->clk_hz, "Hz");
|
|
logmsg("Reclocking the MCU to ",(int) g_zuluscsi_timings->clk_hz, "Hz");
|
|
|
|
|
+#ifndef SD_USE_RP2350_SDIO
|
|
|
logmsg("Setting the SDIO clock to ", (int)((g_zuluscsi_timings->clk_hz / g_zuluscsi_timings->sdio.clk_div_pio + (5 * MHZ / 10)) / MHZ) , "MHz");
|
|
logmsg("Setting the SDIO clock to ", (int)((g_zuluscsi_timings->clk_hz / g_zuluscsi_timings->sdio.clk_div_pio + (5 * MHZ / 10)) / MHZ) , "MHz");
|
|
|
|
|
+#endif
|
|
|
usb_log_poll();
|
|
usb_log_poll();
|
|
|
reclock();
|
|
reclock();
|
|
|
logmsg("After reclocking, system reports clock set to ", (int) platform_sys_clock_in_hz(), "Hz");
|
|
logmsg("After reclocking, system reports clock set to ", (int) platform_sys_clock_in_hz(), "Hz");
|
|
@@ -1166,3 +1173,20 @@ const uint16_t g_scsi_parity_check_lookup[512] __attribute__((aligned(1024), sec
|
|
|
#undef X
|
|
#undef X
|
|
|
|
|
|
|
|
} /* extern "C" */
|
|
} /* extern "C" */
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#ifdef SD_USE_SDIO
|
|
|
|
|
+// These functions are not used for SDIO mode but are needed to avoid build error.
|
|
|
|
|
+void sdCsInit(SdCsPin_t pin) {}
|
|
|
|
|
+void sdCsWrite(SdCsPin_t pin, bool level) {}
|
|
|
|
|
+
|
|
|
|
|
+// SDIO configuration for main program
|
|
|
|
|
+SdioConfig g_sd_sdio_config(DMA_SDIO);
|
|
|
|
|
+
|
|
|
|
|
+#ifdef SD_USE_RP2350_SDIO
|
|
|
|
|
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
|
|
|
|
|
+{
|
|
|
|
|
+ rp2350_sdio_sdfat_set_callback(func, buffer);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+#endif
|