Search by Tags

Tegra SD card interface settings

 
Applicable for


Article updated at 16 Apr 2018
Compare with Revision




Disable SDIO

The SD card interface can be disabled in Registry: Disable the SDCard driver.

Changing Card Detect Pin and Polarity

The SD card detect pin and its polarity can be changed by adding the following values to the registry:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIO]
"SodimmCardDetect" = dword:X   ; X = the SODIMM pin number of the CardDetect GPIO. 0xffffffff means no CardDetect pin ->fix inserted card.
"CardDetectPol" = dword:Y      ; Y = active polarity, 0: GPIO is low if card is available, 
                               ;                      1: pin is high if card is available.

By default the SodimmCardDetect is set to SODIMM Pin 43 for default SDIO and -1 for all the other instances. CardDetectPol is active low (0) by default. You can use any other SODIMM Pin which is not used by any other interface as a card detect pin.

Default SDIO Pin Settings

As you can see in the datasheets of each module from the Tegra family, there are some different pins which can be used for the SDIO interfaces. Bellow you see a selection of possible SDIO instance configurations. Use the default and recommended 2nd interface to be compatible with the Colibri standard pinout.

Each of the following configuration has a default bus width, if you want to force a bus with of 4 or 8 bits, use the following registry key (supported since Image V2.0 beta 1):

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIO]
"BusWidth" = dword:X   ; Number of data lines forced to be used. If not define default setting for each configuration is used.

Colibri T20

InstanceCLKCMDDflt. widthDAT0DAT1DAT2 DAT3DAT4DAT5DAT6DAT7
4 (default)471904192495153 166168170172
33067463552859 90888692
2 (recommended 2nd interface)969841011037997 67598565
12325427373335 ----

Colibri T30

S.No.CLKCMDDflt. widthDAT0DAT1DAT2DAT3 DAT4DAT5DAT6DAT7
2 (default)47*190*4192*49*51*53* ----
1 (recommended 2nd interface)96*98*4101*103*79*97* ----
33067*463552859 ----

(*) These pins are multiplexed. Make sure the second instance on the SODIMM pin remains tristated

Apalis T30

S.No.CLKCMDDflt. widthDAT0DAT1DAT2DAT3 DAT4DAT5DAT6DAT7
1 (default 4 bit SD bus)1841804186188176178 ----
2134571115 175173135159
3 (default 8 bit MMC bus)1541508160162144146 148152156158

SD Card SODIMM Pin Assignment

You can define the pin selection for the SD interfaces two different ways. Either use the Instance number from the table above (recommended) or select all the pins manually.

Select a configuration by instance number

Chose one of the instance numbers from the instance table above. The following example shows how to use a specific SDIO instance:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIO]
"SdioInstance"  = "dword:4"         ; Default is 4, See instance table above for alternative setups.

Define pins manually

We recommend to select the pin setup automatically as described above. Still if you do not want to use one of the SDIO instances predefined you can select the pins manually. We don't recommend selecting pins on your own as changing pins could lead to conflicting setups.

You can choose the SODIMM pin assignment.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIO]
SodimmClk (dword)    
SodimmCmd (dword)      
SodimmDat0 (dword)      
SodimmDat (dword)
SodimmDat2 (dword)      
SodimmDat3 (dword)       
SodimmDat4 (dword)         
SodimmDat5 (dword)       
SodimmDat6 (dword)        
SodimmDat7 (dword)        

Run multiple instances

It is possible to run multiple SDIO instance in parallel. Therefore just add an other key to the registry like this:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIOi]

where as i is an incremented number (0 > i). Copy all the entries like they are in the main instance (Dll, Prefix, IClass, Order) and add the the specific pin configuration to the new key (i.e. SdioInstance) plus SDIO pin detect configuration. Up to four instances are supported.

Clock Speed and Misc Settings

This feature is available in Images V1.1 beta 4 and later.

SD card clock frequency can be limited to a maximum value - this can be useful for debugging purposes. The actual used frequency will be lower than MaximumClockFrequency.

ClockAlwaysOn has to be set to 0x1 if you want to prevent the clock being switched off if there is no communication going on. This is often used for SDIO WLAN adapters and similar devices.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDIO]
"MaximumClockFrequency" = dword:01298be0  ; Maximum SD card clock (Hz). Default 52MHz. 
"ClockAlwaysOn"         = dword:value     ; default value 0x0
"TapDelay"              = dword:value     ; TapDelay defines the time between the clock edge and when the 
                                          ; controller samples the data signals. Default 0x4
"PowerUpDelay"          =  dword:Z        ; Z = Delay in ms between powering up the device and start communication. 
                                          ; Default value 200ms. Supported from image version 1.4 beta 1 on.

Using WriteProtect GPIO

Currently, the SDCard driver does not supports WriteProtect feature.

Testing alternative instances on the Colibri Evaluation Board V2.1

This is an example how to test an alternative SDIO setting. The following example tests the SD Card slot of the Evaluation Board with the SDIO instance 2 of the Colibri T20 and second configuration from table shown in Colibri T30 section above.

The following table shows the cabling. The inside rail in the table is the line of X9 or X10, outside is X12 or X7. of Please also take a look on the picture of the setup. Remove all the jumpers of the used pins.

Cabling Table:

PortInside railOutside rail
CLKUpper 38Lower 16
CMDUpper 39Upper 45
DAT0Lower 39Upper 46
DAT1Lower 40Lower 17
DAT2Lower 34Lower 18
DAT3Lower 38Lower 19

Setup in on the Evaluation Board: