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…
[GSoC Phase-1] Porting FIO to RTEMS
Hi all, This post covers most of my learnings during phase of GSoC with RTEMS. My main goal of phase 1 was to port an IO benchmark to RTEMS. Towards this, various benchmarks were compared and fio was finalized for the import. FIO is a pretty much widely accepted and highly configurable IO benchmarking tool, which supports a number of large number of different OS and now RTEMS is among one of them. Following were the major considerations i learned while porting a 3rd party user-space tool to RTEMS(I’ll try to generalize as much as possible, but there will be…
Comparing IO benchmarks: FIO, IOZONE and BONNIE++
IO benchmarks refer to the computerized test for measuring various properties of an IO device under multiple conditions. Various features include Read/Write speed, IOPS, seek time, etc and various conditions refer to random/sequential reads/writes, block size used by the filesystem, buffer cache size, etc. There are multiple IO benchmarks available online, but the top 3 opensource IO benchmarks, in my view, include FIO, IOZONE, and BONNIE++. There are several pros and cons for each of them, which we will be discussing in this blog post. Fio (Documentation, Repository) FIO is an I/O tool meant to be used both for benchmark and…
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…
GSoC Project Introduction : Importing SDIO stack and Benchmarking
Hi all, This post is basically an introduction of my GSoC 2018 project under RTEMS. It marks the beginning of a series of blog posts that will be put on ( under the tag ‘GSoC’ ) for documenting my work throughout the time span. Before moving on, I would like to thank RTEMS project and Google for giving me this opportunity of working on a highly fruitful Open source project, whose proposal can be found here ,under the mentorship of Christian Mauderer and punit vara. It would be great working with you both :). Some important links: Wiki page: https://devel.rtems.org/wiki/GSoC/2018/Porting_SDIO_and_Benchmarking Project…
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…
Setting up FreeBSD environment on virtualbox
Hi all, In this post we will review the procedure of setting up the FreeBSD environment on VirtualBox along with setting up Internet on the guest OS(this was pretty tricky!).BTW, my host OS is Ubuntu 14.04 So, I am assuming you have already installed VirtualBox as per your host OS and has downloaded the FreeBSD amd64 iso image(If not you can do it from here and extract it appropriately to get a .iso file. Installing FreeBSD on VirtualBox Installing FreeBSD on virtual box is pretty straight forward, just insert use the downloaded iso to boot up the VM with default…
Effect of file-system on sd card’s performance
I had a task to compare different protocols( and their different implementations) like SD, SPI, SDIO(in FreeBSD’s MMCCAM implementation) by accessing SD Card. Now, for unbiased comparison, I must eliminate file system type in sd card from the equation. In this blog post, I’ll discuss/share my findings of the file-systems used for the card(SD and MMC) and how they affect its performance. So, let’s start with a very quick introduction to some basic concepts: Introduction MMC- Multimedia Card is a memory card unveiled in 1997 by SanDisk and Siemens based on NAND flash memory. eMMC is a regular MMC in…
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; +…
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…