From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26084 invoked from network); 13 Nov 2021 19:02:41 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 13 Nov 2021 19:02:41 -0000 Received: from a8-156.smtp-out.amazonses.com ([54.240.8.156]) by 4ess; Sat Nov 13 13:57:47 -0500 2021 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=a4tryept6ew4kp6pdupzhtikhmwphypy; d=mapinternet.com; t=1636829854; h=From:Content-Type:Mime-Version:Subject:Date:References:To:In-Reply-To:Message-Id; bh=ZVVWsUyW52hGS7rkBxNVCwbOSedhPdWY4ZEi79KD9cg=; b=fvP7TTw7QUeQWWHr2qFb0R/s2wag+I6pm66GASDp91ctKq6fyHIFkJwJ82+OcFKI BhmDg+d5AdIPhtbcRcjb/DH4ynxU5VuEnuSvD7RfX4fXIjEL5hsiP5C/wl1Q/NQY+SK tEdRDA1LcMsLfDT3PSdROxsD9AyxnrxfJiqsHBlM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1636829854; h=From:Content-Type:Mime-Version:Subject:Date:References:To:In-Reply-To:Message-Id:Feedback-ID; bh=ZVVWsUyW52hGS7rkBxNVCwbOSedhPdWY4ZEi79KD9cg=; b=j8ztCiYqcJLZOTHmKX8kn1bGdMfNpD8d7DttemEHdZ7Qe7YxwDyQ9PNNCqimK1fF zZUxrLR9yUAa8EDH74Je9Kts0v6lneUnkj5+vOWbTotFA57wOa6Tlmh2UwtWgI9Ac6/ uJ7hURsd1GR9e3K5U3XdgzVlOFaCqnipe4k8boLk= X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=107.107.61.28; envelope-from=; From: Mack Wallace Content-Type: multipart/alternative; boundary="Apple-Mail=_52ADEC5D-5CF9-4EBE-A650-DAE3F389DD13" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Date: Sat, 13 Nov 2021 18:57:34 +0000 References: <0100017d00cc4300-5b748622-ae08-4f14-8093-bdd98beb656d-000000@email.amazonses.com> To: 9front@9front.org In-Reply-To: Message-ID: <0100017d1aa979f5-e4de042b-ff8f-4b90-8fb6-92aec10d9a2a-000000@email.amazonses.com> X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Authenticated-User: mackbw@mapinternet.com Feedback-ID: 1.us-east-1.X+xhoL9JiEQ8K0gzGjV36WZnSewOzOs8YCWuakKsLBY=:AmazonSES X-SES-Outgoing: 2021.11.13-54.240.8.156 List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: optimized markup general-purpose frontend Subject: Re: [9front] pi 400 and cm4 mmc issues Reply-To: 9front@9front.org Precedence: bulk --Apple-Mail=_52ADEC5D-5CF9-4EBE-A650-DAE3F389DD13 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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=3D293966 = 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 = =20 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=3D288772 = =20 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=E2=80=A6 I don=E2=80=99t 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=E2=80=99m 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] ).=20 Hope some of my babble is useful. mackbw > On Nov 9, 2021, at 10:38 AM, Eli Cohen wrote: >=20 > yo. I wrote a patch a while ago at > https://raw.githubusercontent.com/echoline/9emmc/master/9emmc.patch >=20 > this was for the eMMC chips in the CM3+ to work (at all) >=20 > 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... >=20 > be safe out there! >=20 > love, > uppity 9fans >=20 > On Mon, Nov 8, 2021 at 1:54 PM wrote: >>=20 >> nice. >>=20 >> makes sense. >>=20 >> anyone with a cm4 !=3D 1GB (with eMMC)? >>=20 >> we'd definitely need to adjust port/sdmmc.c code to deal with eMMC = cards, >> but it shouldnt be too difficult. >>=20 >> one can find the JDEC standard for eMMC in duckduckgo. >>=20 >> -- >> cinap >=20 --Apple-Mail=_52ADEC5D-5CF9-4EBE-A650-DAE3F389DD13 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
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=3D293966
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.c= pp 

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=3D288772&nbs= p;

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=E2=80=A6 I don=E2=80=99t 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=E2=80=99m 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.p= atch

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 = !=3D 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


= --Apple-Mail=_52ADEC5D-5CF9-4EBE-A650-DAE3F389DD13--