SD/SDIO/MMC Host Driver
- Please visit http://www.fps-tech.net/products.html for detailed information on the FPS-Tech SD/SDIO/MMC Host Driver.
- uClinux driver is available in test-nios2 branch of the sopc git repository
- Example Quartus project and Evaluation IP is available on link above
- If you are interested in using the core, please request a free license for the 1-bit DAT version.
There are two example designs for MMC/SD on NEEK. One with JDhar's IP, and another use Altera SPI. The one from JDhar got higher performance using master dma and SDIO mode. While the Altera SPI is compatible with application chooser using PIO and SPI mode.
Please follow
RootDevice if you want to use MMC/SD as root filesystem.
Please note, there are two formatting method for a SD media (or other flash media),
1. without partition table, use entire capacity. this is the default when you formatting a black media on Windows.
You will need to use "mkdosfs -I /dev/sda" (substitute the device) . but not /dev/sda1.
On nios2, the SD device is /dev/mmcblk0.
2. with partition table, this may have better compatibility across Linux and digital camera.
You will need to use "fdisk /dev/sda" to create FAT16 partition, type 06.
Then "mkdosfs /dev/sda1"
On nios2, the SD device is /dev/mmcblk0p1.
1.
neek_ocm_sdio.zipselect the driver for nios_mmc, and select the filesystem you want to support, eg, vfat and ext3.
The sdio_host component should be named as "sdio", otherwise you have to modify linux-2.6/arch/nios2/kernel/setup.c .
Device Drivers -->
[*] MMC/SD card support --->
[*] MMC block device driver
[*] Use bounce buffer for simple hosts
[ ] SDIO UART/GPS class support
[ ] MMC host test driver
*** MMC/SD Host Controller Drivers ***
[*] NIOS SD/SDIO/MMC Host
File systems --->
[*] Ext3 journalling file system support
DOS/FAT/NT Filesystems --->
[*] VFAT (Windows-95) fs support
(437) Default codepage for FAT
(iso8859-1) Default iocharset for FAT
-*- Native language support --->
[*] Codepage 437 (United States, Canada)
[*] NLS ISO 8859-1 (Latin 1; Western European Languages)
NIOS_MMC: FPS-Tech SD/SDIO/MMC Host Core, version 1.0
NIOS_MMC: F_MAX: 15000000 Hz, F_MIN: 915 Hz
NIOS_MMC: Host built with 1-bit DAT driver
NIOS_MMC: Using block-prefetching
mmc0: new SD card at address 0002
blk_queue_max_sectors: set to minimum 8
blk_queue_max_phys_segments: set to minimum 1
blk_queue_max_hw_segments: set to minimum 1
blk_queue_max_segment_size: set to minimum 4096
mmcblk0: mmc0:0002 TWTTI 124672KiB
mmcblk0: p1 p2
mount -t vfat /dev/mmcblk0p1 /mnt # for partition 1
or
mount -t vfat /dev/mmcblk0 /mnt # for no partition table on card
2.
neek_ocm_spi.zipselect the driver for mmc_spi, and select the filesystem you want to support as above.
The Altera spi component should be named as "mmc_spi", otherwise you have to modify linux-2.6/arch/nios2/kernel/config.c .Device Drivers -->
[*] SPI support --->
[*] Altera SPI Controller
[*] MMC/SD card support --->
[*] MMC block device driver
[*] Use bounce buffer for simple hosts
[ ] SDIO UART/GPS class support
[ ] MMC host test driver
*** MMC/SD Host Controller Drivers ***
[*] MMC/SD over SPI
mmc_spi spi2.0: ASSUMING SPI bus stays unshared!
mmc_spi spi2.0: ASSUMING 3.2-3.4 V slot power
mmc_spi spi2.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Freeing unused kernel memory: 676k freed (0x1f6000 - 0x29e000)
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 TWTTI 124672KiB
mmcblk0: p1 p2
mmc spi connection on DE2
.MISO_to_the_mmc_spi (SD_DAT),
.MOSI_from_the_mmc_spi (SD_CMD),
.SCLK_from_the_mmc_spi (SD_CLK),
.SS_n_from_the_mmc_spi (SD_DAT3),