So I applied the patch to bcm/emmc.c and port/sdmmc.c, changed the config in emmc to use emmc for sdmmc rather than sdhc. - just in case it was that stupid simple as I am stupid. Apparently not.

After some searching I came upon the following:

A thread that starts to discuss 'Differences between SD card and eMMC access (CM4)?' https://forums.raspberrypi.com/viewtopic.php?t=293966
but is not very conclusive. However, it does have a reverence to a bare metal driver that the originator of the thread wrote in C++ https://github.com/rsta2/circle/blob/master/addon/SDCard/emmc.cpp 

Another individual was looking to be able to use both the eMMC and an SD card in this thread: https://forums.raspberrypi.com/viewtopic.php?t=288772 

If I understand correctly, the same EMMC2 controller is used for either the eMMC or the microSD card. One could reroute the older SDHOST which is still on the silicon to run the microSD, but then other things would be precluded… I don’t think any of that is a concern.

In emmc.cpp, there are logs of pre-compiler directive conditionals. But from what I think I understand (which I could be completely wrong), there are not many differences between using the EMMC and an SD card. (I’m assuming the USE_SDHOST directive refers to using the older SD controller). Looks like there are some minor command changes and chunks of code that are bypassed (like checking on properties of an SD card). I had started to try to compare what is in emmc.cpp with sdhc.c. Some of the defines and structures line up nicely, but I was having issues lining up the commands (i.e. CEMMCDevice::sd_commands[] and cmdinfo[64] ). 

Hope some of my babble is useful.

mackbw


On Nov 9, 2021, at 10:38 AM, Eli Cohen <echoline@gmail.com> wrote:

yo. I wrote a patch a while ago at
https://raw.githubusercontent.com/echoline/9emmc/master/9emmc.patch

this was for the eMMC chips in the CM3+ to work (at all)

it does need more changes still... other machine architectures... it
does not take buswidth (happy halloween!!!) into account, I wrote a
lot of it just from looking at the linux kernel, etc...

be safe out there!

love,
uppity 9fans

On Mon, Nov 8, 2021 at 1:54 PM <cinap_lenrek@felloff.net> wrote:

nice.

makes sense.

anyone with a cm4 != 1GB (with eMMC)?

we'd definitely need to adjust port/sdmmc.c code to deal with eMMC cards,
but it shouldnt be too difficult.

one can find the JDEC standard for eMMC in duckduckgo.

--
cinap