Posts

Showing posts with the label SDIO

Building FreeBSD's SDIO driver for BeagleBone Black

Hi all, This post mainly concern with building FreeBSD's SDIO driver for BeagleBone Black by cross compiling it on AMD platform. I had few unresolved issues with the master branch of current FreeBSD tree. So, for this i used another unofficial branch: https://github.com/kibab/freebsd/tree/mmcam-new . It does have the required KERNCONF file with stable SDIO driver. A lot of steps below are similar to the one given on: https://forums.freebsd.org/threads/cross-compiling-beaglebone-on-amd64.64718/#post-384835   with slight but inevitable changes. Procedure:  Before proceeding you need to first install git. sudo pkg update -f sudo pkg install git  Setup project directory by mkdir /BBB  Clone the repository to /BBB/src by git clone -b mmcam-new https://github.com/kibab/freebsd.git /BBB/src Setup environment variables as setenv BASEDIR /BBB setenv MAKEOBJDIRPREFIX $BASEDIR/obj setenv TARGET arm setenv TARGET_ARCH armv6 Note that sometime it shows an error ...

Implementing a MMC/SD/SDIO stack using CAM framework(Part 2)

Image
Hi, In the next part lets look at other files which makes up the SDIO stack within mmccam framework. Please have  a look at previous part for more info: http://81.4.107.225/wordpress/index.php/2018/03/19/implementing-a-mmc-sd-sdio-stack-using-cam-framework/ mmc_sdio.c +void sdio_fill_mmcio_rw_direct(union ccb *ccb, uint8_t f, uint8_t wr, uint32_t adr, uint8_t *data) { + struct ccb_mmcio *mmcio; + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("sdio_fill_mmcio(f=%d, wr=%d, adr=%02x, data=%02x)\n", f, wr, adr, (data == NULL ? 0 : *data))); + mmcio = &ccb->mmcio; + + mmcio->cmd.opcode = SD_IO_RW_DIRECT; + mmcio->cmd.arg = SD_IO_RW_FUNC(f) | SD_IO_RW_ADR(adr); + if (wr) + mmcio->cmd.arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(*data); + mmcio->cmd.flags = MMC_RSP_R5 | MMC_CMD_AC; + mmcio->cmd.data->len = 0; +} sdio_fill_mmcio_rw_direct is basically a wrapper for CMD_52 that's needed ...

Detailed SDIO protocol Implementation

Image
Reference: Wikipedia, https://www.sdcard.org/developers/overview/sdio/sdio_spec/Simplified_SDIO_Card_Spec.pdf  SDIO cards are intended to provide high speed data Input/Output on our regular sd card slot. SDIO cards are compatible with any sd card slot and will not cause any physical damage to the host if it's not compatible with SDIO. When SDIO is plugged in a SDIO compatible host, in its early stage it is in low power mode and consumes very little current. Host identifies the SDIO card ,it's power requirement, it's I/O capabilities etc. If host finds that power requirement is manageable and there is driver for the I/O functionality card is offering it allows the SDIO card to power up completely and start it's I/O functions.  SDIO card allows up to 7 different I/O functions along with 1 memory function. It's available in market in 2 form factors: miniSDIO and full size SDIO. For example http://www.spectec.com.tw/sdw-822..html is a miniSDIO wifi card by spectec. Typ...

Understanding SD, SDIO and MMC Interface

Image
    In this blog post i will present the gist of the paper http://www.kaltech.co.il/pdf/Eureka_sd_wp1.pdf ,  It's crucial for anyone willing to understand how removable devices like sd card work, different protocols/functionalities they support. Secure Digital (SD) memory card today, is one of the most popular non-volatile removable data storage media for consumer applications. It's not intended to remove hard-disk. Hard-disk can still deliver much better speed and memory capacity. SD card is used in applications demanding optimum memory capacity, smaller size, and low end product cost.  The combination of small foot print, lower cost and optimal performance contributed in SD-card's success. What is MultiMedia Card (MMC)? MMC and Sd-card share many common features and have the same physical and electrical specifications. The differences between the two standards are mainly on the software level commands. The similarities allow many hosts to accept both MMC and SD cards on ...