Commit Graph

8 Commits

Author SHA1 Message Date
Jared McNeill
6a05f063ed Convert Allwinner port to extres clk/hwreset/regulator APIs.
Reviewed by:		andrew, gonzo, Emmanuel Vadot <manu@bidouilliste.com>
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D5752
2016-04-06 23:11:03 +00:00
Ian Lepore
dec4873723 Fix fallout from r292180 (Dec 2015)... ensure that every driver which has
a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc.  This
is because the kernel linker only searches for symbols in dependent modules,
so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc
was not compiled into the kernel (even if you hand-loaded mmc first).

(Thanks to jilles@ for providing the vital clue about the kernel linker.)
2016-03-21 00:52:24 +00:00
Jared McNeill
ce6507d3d9 Fix PIO mode on A31 and later SoCs.
Newer Allwinner MMC implementations use a different FIFO register offset
(0x200 instead of 0x100). Since the FDT uses the same compat string for
both cases, base the decision on which FIFO offset to use on the Allwinner
SoC family.

Reviewed by:		Emmanuel Vadot <manu@bidouilliste.com>
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D5468
2016-02-27 22:26:05 +00:00
Andrew Turner
461a7671c7 Add the start of support for the Allwinner A31 clocks. It only adds
support for the i2c, mmc, and gmac clocks. Further clocks can be added as
needed.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by:	jmcneill
Differential Revision:	https://reviews.freebsd.org/D5339
2016-02-26 13:53:09 +00:00
Andrew Turner
907fe11655 Update of the Allwinner drivers to:
* Use the Linux compat string
 * Use EARLY_DRIVER_MODULE to attach at the right time
 * Add a generic A10 kernel config file
 * A20 now use generic_timer
 * Add two new dts files for Olimex boards
 * Update our custom DTS file for A10 and A20 to use the same compatible
   property names as the vendor ones.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D4792
2016-02-10 09:19:29 +00:00
Ian Lepore
3f62727443 Move the DRIVER_MODULE() statements that declare mmc(4) to be a child of
the various bridge drivers out of dev/mmc.c and into the bridge drivers.

Requested by:	   jhb (almost two years ago; better late than never)
2015-12-14 01:09:25 +00:00
Luiz Otavio O Souza
5ee00411e4 Add DMA support for Allwinner MMC controller.
DMA handles all data transfers up to 128K or 16 segments and fallback to
pio mode when DMA requirements are not met.

The read performance has improved greatly while the write performance also
showed some improvement but seems limited by the card type and quality.

Submitted by:	Pratik Singhal <pratiksinghal@freebsd.org>
Sponsored by:	Google Summer of Code 2015
Tested on:	A10 (cubieboard) and A20 (cubieboard 2 and banana pi)
2015-07-01 23:27:01 +00:00
Luiz Otavio O Souza
6a11fa4e31 Add the MMC/SD driver for Allwinner SoCs.
This is based on the patch sent by Alexander Fedorov with the following
fixes/improvements:

 - Better error handling;
 - Clock is derived from PLL6 (obtained from netbsd);
 - No more unnecessary busy loops on interrupt handler;
 - style(9) fixes and code cleanup.

I also want to thanks Martin Galvan who has sent an alternative
implementation with some interesting fixes.

Tested on CubieBoard2, Banana-Pi (thanks to netgate!) and Cubieboard1
(Pratik Singhal).

This is intended to pave the way for the upcoming GSoC work (and make
easier the build of images for the supported boards).

PR:		196081
Submitted by:	Alexander Fedorov <alexander.fedorov@rtlservice.com>
2015-05-21 17:39:42 +00:00