Commit Graph

19 Commits

Author SHA1 Message Date
Pedro F. Giffuni
057b4402bf sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2016-04-26 15:03:15 +00:00
Pedro F. Giffuni
74b8d63dcc Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
2016-04-10 23:07:00 +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
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
Andrew Turner
c0e5e17237 Add support for the DesignWare MMC hardware in the HiSilicon hi6220. This
SoC is used in the HiKey board from 96boards.

Currently on the SD card is working on the HiKey, as such devices 0 and 2
will need to be disabled, for example by adding the following to
loader.conf:

hint.hisi_dwmmc.0.disabled=1
hint.hisi_dwmmc.2.disabled=1

Relnotes:	yes (Hikey board booting)
Sponsored by:	ABT Systems Ltd
2015-09-01 16:25:12 +00:00
Andrew Turner
fa6ea9962e Finish allowing the dwmmc driver to be subclassed, move the softc to a new
header, along with the hwtype enum, device attach prototype, and driver_t.

Sponsored by:	ABT Systems Ltd
2015-09-01 15:26:21 +00:00
Andrew Turner
0e308268b0 Remove an variable we only ever write to, and stop assigning 0 to values
in the softc as it's the default value. The latter helps with subclassing
this driver.

Sponsored by:	ABT Systems Ltd
2015-09-01 10:47:42 +00:00
Andrew Turner
755eb18fd7 Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
subclass the dwmmc driver to allow SoC specific attachments.

Sponsored by:	ABT Systems Ltd
2015-08-28 15:27:55 +00:00
Andrew Turner
725b72d5e0 Only check for the bus frequency if it has not already been set, for
example through a driver running as a subclass of this.

Sponsored by:	ABT Systems Ltd
2015-08-28 10:34:37 +00:00
Andrew Turner
2640322a2e There is no need to get the bus tag or handle.
Sponsored by:	ABT Systems Ltd
2015-08-27 16:27:51 +00:00
Andrew Turner
fd59e3a9d8 Limit the speed to the bus frequency.
Sponsored by:	ABT Systems Ltd
2015-08-27 16:24:30 +00:00
Andrew Turner
488d593a0c Allow the fifo-depth and num-slots to be missing. For the former we read
the value from the hardware, for the latter assume a single slot.

Sponsored by:	ABT Systems Ltd
2015-08-27 16:18:22 +00:00
Andrew Turner
26f0e89a6d Allow us to select the transfer count. This allows us to work with hardware
that seems to only work with a single block at a time.

Sponsored by:	ABT Systems Ltd
2015-08-27 13:08:45 +00:00
Andrew Turner
4f768055bd Only access the Samsung registers when targeting Samsung hardware.
Sponsored by:	ABT Systems Ltd
2015-08-26 10:54:14 +00:00
Andrew Turner
d1b2133d03 Attach dwmmc to the ofwbus, som devicetrees place it here.
Sponsored by:	ABT Systems Ltd
2015-08-07 08:57:58 +00:00
Andrew Turner
a336c37514 Stop including machine/fdt.h, it's unneeded, and purposefully
unimplemented on arm64.

Sponsored by:	ABT Systems Ltd
2015-08-07 08:54:50 +00:00
Ganbold Tsagaankhuu
e2763dca83 Enable Synopsys DesignWare Mobile Storage Host Controller
driver on Rockchip boards. It currently supports PIO mode
and dma mode needs external dma controller to be used.

Submitted by:   jmcneill
Approved by:    stas (mentor)
2015-01-20 09:07:28 +00:00
Ruslan Bukin
fdbf76c383 Always wait 'command done' interrupt status bit before proceeding next command.
Sponsored by:	DARPA, AFRL
2014-10-08 08:51:05 +00:00
Ruslan Bukin
41709d23c4 Add driver for Synopsys DesignWare Mobile Storage Host Controller.
Sponsored by:	DARPA, AFRL
2014-10-07 17:39:30 +00:00