Giter Site home page Giter Site logo

core_mmc's Introduction

MMC (and derivative standards) Host Controller

Github: https://github.com/ultraembedded/core_mmc

Work-in-progress - basically functional but not yet complete / robust.

Features
  • 1-bit / 4-bit data modes.
  • Large sector buffer (for multiple sector reads or writes).
  • AXI-4 DMA.
Current Bugs
  • DMA: Does not support card write mode (functions as read from card only).
  • Robustness: Not currently checking CRC7 / CRC16 on incoming responses.
  • Writes: Multi-sector write support is not correct.
  • AXI: Dubious combinatorial paths on AWVALID and WVALID.
Testing

Exercised on the following FPGA boards;

  • Digilent Arty A7 (Xilinx Artix 7)
  • LambaConcept ECPIX-5 (Lattice ECP5)
Register Map
Offset Name Description
0x00 MMC_CONTROL [RW] Transfer Control Register
0x04 MMC_CLOCK [RW] Clock Configuration Register
0x08 MMC_STATUS [R] Transfer Status Register
0x0c MMC_CMD0 [RW] Command (first 32-bits)
0x10 MMC_CMD1 [RW] Command (subsequent 16-bits)
0x14 MMC_RESP0 [R] Response Register
0x18 MMC_RESP1 [R] Response Register
0x1c MMC_RESP2 [R] Response Register
0x20 MMC_RESP3 [R] Response Register
0x24 MMC_RESP4 [R] Response Register
0x28 MMC_TX [W] Data Transmit Register
0x2c MMC_RX [R] Data Receive Register
0x30 MMC_DMA [RW] DMA Target
Register: MMC_CONTROL
Bits Name Description
31 START Start transfer.
30 ABORT Abort transfer.
29 FIFO_RST FIFO reset.
15:8 BLOCK_CNT Number of blocks (0=1, 1=2, ...)
5 WRITE Data write operation
4 DMA_EN DMA port enable
3 WIDE_MODE 4-bit data mode.
2 DATA_EXP Wait for data
1 RESP136_EXP Wait for response (R2).
0 RESP48_EXP Wait for response (~R2).
Register: MMC_CLOCK
Bits Name Description
7:0 DIV Clock divider
Register: MMC_STATUS
Bits Name Description
8 CMD_IN Command input line state
7:4 DAT_IN Data input line state
3 FIFO_EMPTY FIFO empty.
2 FIFO_FULL FIFO full.
1 CRC_ERR CRC error
0 BUSY Transfer active
Register: MMC_CMD0
Bits Name Description
31:0 VALUE Command data.
Register: MMC_CMD1
Bits Name Description
15:0 VALUE Command data.
Register: MMC_RESP0
Bits Name Description
31:0 VALUE Response data.
Register: MMC_RESP1
Bits Name Description
31:0 VALUE Response data.
Register: MMC_RESP2
Bits Name Description
31:0 VALUE Response data.
Register: MMC_RESP3
Bits Name Description
31:0 VALUE Response data.
Register: MMC_RESP4
Bits Name Description
31:0 VALUE Response data.
Register: MMC_TX
Bits Name Description
31:0 DATA Data
Register: MMC_RX
Bits Name Description
31:0 DATA Data
Register: MMC_DMA
Bits Name Description
31:0 ADDR Start address

core_mmc's People

Contributors

ultraembedded avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.