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…

Continue Reading

FreeBSD, Software

Setting up FreeBSD environment on virtualbox

Hi all, In this post we will review the procedure of setting up 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…

Continue Reading

File system, Hardware, NAND/NOR

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 about how file-system on a card(SD and MMC) affect its performance. So, let’s start with a very quick introduction to some basic concepts: Introduction MMC- Multimedia Card is a memory…

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: http://uditagarwal.in/index.php/2018/03/19/implementing-a-mmc-sd-sdio-stack-using-cam-framework/ mmc_sdio.c

sdio_fill_mmcio_rw_direct is basically a wrapper for CMD_52 that’s needed to read/write directly into mmc register R5. Remember that register R5 in mmc, is used for RCA(Relative card address) management. It’s right time now to talk about different command types of SD/MMC/SDIO: broadcast commands (bc), no…

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 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…

Continue Reading

CAM, FreeBSD, mmccam

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

In this blog post we will have a detailed look at all the files added/changed while implementing the MMC/SD/SDIO stack via CAM framework. We will basically discuss the commit  https://github.com/freebsd/freebsd/commit/a87c7a85be3e3727b6b08b19741b4282f942400d which aims at adding MMC/SD/SDIO stack to FreeBSD’s already existing CAM framework. So, lets start one by one with each file: mmc.h

This file presents the basic structure of the SD-Card/MMC peripheral. This structure is further used in CAM_EDT i.e CAM Existing Device Table which stores…

Continue Reading

CAM, FreeBSD

Understanding FreeBSD’s CAM Framework

This blog post presents a gist of Free BSD’s doc on CAM(here) and chapter 14 of the book FreeBSD device driver- A guide for intrepid. It gives an introduction to the CAM(Common access method), it’s applications, it’s working and it’s organization in FreeBSD. It is written to get myself a really good understanding of mmccam stack which is nothing but SDHC/SDIO protocols wired within the CAM framework. COMMON ACCESS METHOD CAM is a method for separating HBA…

Continue Reading

Hardware

Understanding SD, SDIO and MMC Interface

    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…

Continue Reading

RTEMS, RTOS, Software

Coding conventions : RTEMS

From my experience till now, If you desire to contribute to open source, it’s necessary to adapt!! Your old sluggish, inconsistence coding practices wont do any good, neither to you nor to the community. ^^ That was my story!! After a month of working with professionals , I realized that my 5 years of coding was trash! It’s not about logic, it’s about ethics. To be a good coder, you don’t only need to work on your…

Continue Reading

Hardware, RTEMS, RTOS, Software

Building and testing RTEMS-libbsd for BeagleBone Black BSP

———————————————————————— Building and testing libbsd for BeagleBone Black BSP ———————————————————————— == Installation overview == === Initial setup === – Jump into your workspace and make a directory named sandbox This folder will contain all our project files – cd sandbox/ – export sandbox=$PWD – git clone git://git.rtems.org/rtems-source-builder.git – git clone git://git.rtems.org/rtems.git – git clone git://git.rtems.org/rtems-libbsd.git === Building desired toolset for ARM === – cd rtems-source-builder/rtems/ – ../source-builder/sb-check – ../source-builder/sb-set-builder –prefix=$sandbox/5 5/rtems-arm – cd $sandbox – export PATH=$PWD/5/bin:$PATH…

Continue Reading