Commit 3483d3d4 authored by Ben Avison's avatar Ben Avison Committed by ROOL
Browse files

Support optional factory-fit non-removable memory devices

Some boards feature non-removable memory devices with a no-fit option that
can only detected by seeing whether the device responds or not once we
start trying to talk to it. To support these, defer drive allocation until
the UnitAttached service call. This is already designed to dynamically
add extra drives in case a shared MMC bus is found, so the only difference
is that the initial number of drives is 0, not 1. Note that there is still
a minimum of 1 drive per slot for removable slots, since a removable slot
may be empty at module initialisation time, and there's no way to
electrically distinguish an empty socket from a no-fit socket.

Version 0.11. Tagged as 'SDFS-0_11'
parent 17fb10a8
/* (0.10)
/* (0.11)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.10
#define Module_MajorVersion_CMHG 0.11
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Jun 2020
#define Module_Date_CMHG 18 Jul 2022
#define Module_MajorVersion "0.10"
#define Module_Version 10
#define Module_MajorVersion "0.11"
#define Module_Version 11
#define Module_MinorVersion ""
#define Module_Date "27 Jun 2020"
#define Module_Date "18 Jul 2022"
#define Module_ApplicationDate "27-Jun-20"
#define Module_ApplicationDate "18-Jul-22"
#define Module_ComponentName "SDFS"
#define Module_FullVersion "0.10"
#define Module_HelpVersion "0.10 (27 Jun 2020)"
#define Module_LibraryVersionInfo "0:10"
#define Module_FullVersion "0.11"
#define Module_HelpVersion "0.11 (18 Jul 2022)"
#define Module_LibraryVersionInfo "0:11"
......@@ -55,8 +55,20 @@ void service_SDIOSlotAttached(uint32_t bus, uint32_t slot, bool integrated, bool
if (integrated)
return;
uint32_t min_drive = integrated_mem ? 4 : 0;
uint32_t max_drive = min_drive + (integrated_mem ? NUM_WINNIES : NUM_FLOPPIES) - 1;
/* Some boards feature non-removable memory devices with a no-fit option that
* can only detected by seeing whether the device responds or not once we
* start trying to talk to it. To support these, defer drive allocation until
* the UnitAttached service call. This is already designed to dynamically
* add extra drives in case a shared MMC bus is found, so the only difference
* is that the initial number of drives is 0, not 1. Note that there is still
* a minimum of 1 drive per slot for removable slots, since a removable slot
* may be empty at module initialisation time, and there's no way to
* electrically distinguish an empty socket from a no-fit socket. */
if (integrated_mem)
return;
uint32_t min_drive = 0;
uint32_t max_drive = min_drive + NUM_FLOPPIES - 1;
/* We need at least one drive to represent this new slot */
spinrw_write_lock(&g_drive_lock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment