Page MenuHomeFreeBSD

Add MMCCAM support to AllWinner MMC driver
ClosedPublic

Authored by kibab on Jun 18 2018, 9:20 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

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kibab created this revision.Jun 18 2018, 9:20 PM
imp accepted this revision.Jun 18 2018, 9:37 PM

Seems fine to me.

This revision is now accepted and ready to land.Jun 18 2018, 9:37 PM
manu added a comment.Jun 18 2018, 9:40 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 ↗(On Diff #44039)

All of those device_printf should be under if (bootverbose)

kevans added a subscriber: kevans.Jun 19 2018, 4:37 PM

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.

imp added a comment.Jun 19 2018, 7:47 PM

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.

kibab marked an inline comment as done.Jun 19 2018, 9:09 PM
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 test plan for this revision. (Show Details)Jun 19 2018, 9:13 PM
kibab edited the summary of this revision. (Show Details)
manu added inline comments.Jun 20 2018, 7:47 AM
sys/arm/allwinner/aw_mmc.c
543 ↗(On Diff #44039)

Indentation here is wrong

576 ↗(On Diff #44039)

Here too

manu added inline comments.Jun 20 2018, 8:37 AM
sys/arm/allwinner/aw_mmc.c
831 ↗(On Diff #44039)

This will annoy a lot of people (me included)

1065 ↗(On Diff #44039)

This will annoy a lot of people (me included)

manu added a comment.Jun 20 2018, 8:38 AM

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).

kibab added inline comments.Jun 20 2018, 8:40 AM
sys/arm/allwinner/aw_mmc.c
1065 ↗(On Diff #44039)

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.