Page MenuHomeFreeBSD

Add MMCCAM support to AllWinner MMC driver
ClosedPublic

Authored by kibab on Jun 18 2018, 9:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 18, 5:55 AM
Unknown Object (File)
Feb 26 2024, 11:12 AM
Unknown Object (File)
Dec 10 2023, 11:47 PM
Unknown Object (File)
Dec 9 2023, 1:43 AM
Unknown Object (File)
Nov 18 2023, 9:52 AM
Unknown Object (File)
Nov 16 2023, 7:50 PM
Unknown Object (File)
Nov 10 2023, 6:09 PM
Unknown Object (File)
Nov 6 2023, 9:57 PM

Details

Summary

Using MMCCAM on AllWinner boards is now possible, reaching highest
possible data transfer speed of ~ 10 MB/sec.

For now, MMCCAM doesn't scan cards on boot. This means that scanning has to be done manually.
This also means that it's not possible to mount root from MMC/SD card since there is no block device at the boot time.

NFS root works, though.

Test Plan

For now, MMCCAM doesn't scan cards on boot. This means that scanning has to be done manually

For SD card slot

camcontrol rescan 0:0:0

For SDIO WiFi

camcontrol rescan 1:0:0

For internal eMMC

camcontrol rescan 2:0:0

The result should be like this (NanoPi M1+):

root@fbsd-arm-host:~ # camcontrol devlist
<SDHC SD16G 3.0 SN 7CA5C349 MFG 03/2016 >  at scbus0 target 0 lun 0 (sdda0,pass1)
<SDIO card>                        at scbus1 target 0 lun 0 (pass0)
<MMCHC 8WPD3R 0.0 SN 53CFF01B MFG 10/200>  at scbus2 target 0 lun 0 (sdda1,pass2)

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17422
Build 17254: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jun 18 2018, 9:37 PM

This looks okay for me except one comment.
But due to the fact that I/We had a lot of problems with different revision of the hardware IP let me test on different SoC before commiting.
Also I won't set this review as accepted as I don't know anything about CAM.

sys/arm/allwinner/aw_mmc.c
342

All of those device_printf should be under if (bootverbose)

Please do mention in the commit message that MMCCAM is not usable on Allwinner boards using root-on-MMC to curtail that set of complaints if people actually try it.

Please do mention in the commit message that MMCCAM is not usable on Allwinner boards using root-on-MMC to curtail that set of complaints if people actually try it.

why not? What breaks?

In D15891#336632, @imp wrote:

Please do mention in the commit message that MMCCAM is not usable on Allwinner boards using root-on-MMC to curtail that set of complaints if people actually try it.

why not? What breaks?

08:13 < kibab> And one more thing (c): on AllWinner, MMC devices are not enumerated at boot yet.
08:13 < kevans91> Ah, ok, that explains that, then
08:13 < kibab> That means: you cannot have root on SD/MMC yet.
08:13 < kibab> This is on my list.

So you get dropped into a mountroot prompt.

In D15891#336175, @manu wrote:

This looks okay for me except one comment.
But due to the fact that I/We had a lot of problems with different revision of the hardware IP let me test on different SoC before commiting.
Also I won't set this review as accepted as I don't know anything about CAM.

OK, I'll wait for you to perform the testing using different h/w.

Please follow the updated Test Plan in the change description.

kibab edited the summary of this revision. (Show Details)
sys/arm/allwinner/aw_mmc.c
543

Indentation here is wrong

576

Here too

sys/arm/allwinner/aw_mmc.c
831

This will annoy a lot of people (me included)

1065

This will annoy a lot of people (me included)

It seems to work fine on pine64-lts.
So when my comments are resolved I think you could commit this (with the patch I sent you for arm64).

sys/arm/allwinner/aw_mmc.c
1065

I'll move this behind #ifdef DEBUG in addition to bootverbose then.

This revision was automatically updated to reflect the committed changes.
kibab marked 2 inline comments as done.