CAM, GSoC, mmccam, RTEMS, SDIO

RTEMS SDIO driver: Current progress

Hi, this post mainly concerns with the current progress of SDIO driver’s implementation on RTEMS. In a nutshell, driver is able to detect, initialize the type of card. However, the part concerned with registering the partitions of the card as RTEMS disks is still buggy. So, I’ll discuss some of the bugs which were previously resolved and the ones that are still left. Starting with a very short introduction of how MMCCAM driver is being interfaced with SDHCI driver: Part 1: Interfacing Complete interfacing task is done mainly via these two files: nexus_devices.h #ifdef RTEMS_BSD_MODULE_MMCCAM SYSINIT_MODULE_REFERENCE(cam); SYSINIT_MODULE_REFERENCE(mmcprobe); SYSINIT_MODULE_REFERENCE(sdda); #endif /*…

Continue Reading

CAM, FreeBSD, GSoC, mmccam, RTEMS, SDIO

Backporting MMCCAM/SDIO framework to FreeBSD head 642b174dadd

My phase 2, GSoC objectives includes Backporting the current(rev: d6756a3ac8 ) MMCCAM framework to FreeBSD head 642b174dadd and then importing it to RTEMS. This post mainly concerns with intricacies and workarounds during the backporting process. Backporting is a process that enables old kernels run a latest driver. MMCCAM framework is one such enhancement in the past few months that enables FreeBSD to talk to devices behind the SDIO bus. It’s a major architectural change, that enables further driver development for devices on SDIO bus. So, first step during backporting is to finalize the revisions from which driver will be imported(d6756a3ac8…

Continue Reading

Benchmark, CAM, File system, FreeBSD, GSoC, mmccam, SDIO

microSD Card benchmarking on BeagleBone Black

Hi all, I have been recently involved in benchmarking two different device drivers of FreeBSD ,namely SDHCI and the SDIO driver to compare their relative performance under different circumstances. Here, I will summarize my results, possible conclusions and the benchmarking procedure. Before moving towards benchmarking, i’d prefer going through this article. It really good and provides a great overview of how data is transferred to disk, different APIs available. This will surely help you selecting options for the benchmark. Benchmarking procedure I initially experimented with different benchmarks like iorate, iozone, fio, bonnie++ etc but the one i really liked was…

Continue Reading

ARM, CAM, FreeBSD, mmccam, SDIO, Software

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…

Continue Reading

CAM, FreeBSD, mmccam, SDIO, Software

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

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: https://uditagarwal.in/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; +…

Continue Reading

CAM, FreeBSD, Hardware, mmccam, SDIO, Software

Detailed SDIO protocol Implementation

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 an SDIO compatible host, in its early stage it is in low power mode and consumes very little current. The host identifies the SDIO card, it’s power requirement, it’s I/O capabilities, etc. If the host finds that the power requirement is manageable and there is a driver for the I/O functionality card…

Continue Reading