Raw write to eMMC

709 views
Skip to first unread message

Prabhu Chawandi

unread,
Jun 9, 2016, 9:59:29 AM6/9/16
to inside...@googlegroups.com
Hi,

  I have requirement, where I need to write data  to eMMC in raw format from withing kernel space. 

I am not getting how can I achieve that, let me know your thoughts. 

Ex: if I have 8GB of eMMC, first 1GB - i have to reserve for it and it should not be used for creating partitions, on this 1GB I have to read/write raw data. 

Many Thanks,
Prabhu Chawandi

--
Cheers
p.

Anil Kumar Pugalia

unread,
Jun 9, 2016, 10:56:32 PM6/9/16
to inside...@googlegroups.com
Create a 1GB partition and then use dd or your app to raw read/write into it, using the partition's device file.

Regards
Anil
Passion: http://sysplay.in (Playing with Systems)
--
You received this message because you are subscribed to the Google Groups "SysPlay's Inside Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Prabhu Chawandi

unread,
Jun 9, 2016, 11:01:36 PM6/9/16
to inside...@googlegroups.com

Anil,

   I have to do it from other driver. And user should not be seeing this partition. Use case is software download.

Many thanks,
Prabhu Chawandi

Anil Kumar Pugalia

unread,
Jun 10, 2016, 12:07:15 AM6/10/16
to inside...@googlegroups.com
By default, it would be visible as the whole device would be mapped to a device file.

Regarding doing it from other driver, that you can do a direct access over the MMC layer.

What do you mean by software download?


Regards
Anil
Passion: http://sysplay.in (Playing with Systems)

Prabhu Chawandi

unread,
Jun 10, 2016, 12:28:46 AM6/10/16
to inside...@googlegroups.com
Hello Anil,

I got, I should be making one partition and that should not be formatted with any filesystem, then I can do a raw read/ write. I was going through mmc subsystem code <drivers/mmc>, I think I should look at drivers/mmc/core/core.c - please correct me if I am looking in wrong place.

I am not getting clue on how to get handle of the partition from being in other driver. In case of MTD partitions like mtd0 mtd1, while accessing it from other driver I used to pass partition number 0 or 1 ... to the API get_mtd_device() to get the device structure, in case of this mmc partitions what API to use, I am not able to see it in core.c 
Could please help me with it ?

Software download is - downloading new software version released for the system, software has to be downloaded and crc verified before accepting the new software, its OTA I mean.

Many Thanks,
Prabhu Chawandi

Cheers
p.

Anil Kumar Pugalia

unread,
Jun 10, 2016, 1:34:13 AM6/10/16
to inside...@googlegroups.com
Seems like there is none equivalent to get_mtd_device(). Instead, I guess, you might have to access it through the block layer.


Regards
Anil
Passion: http://sysplay.in (Playing with Systems)

Prabhu Chawandi

unread,
Jun 10, 2016, 2:10:22 AM6/10/16
to inside...@googlegroups.com
Thanks Anil ... I will check. 
Reply all
Reply to author
Forward
0 new messages