Source
x
static void bcm2835_prepare_data(struct bcm2835_host *host, struct mmc_cmd *cmd,
// SPDX-License-Identifier: GPL-2.0
/*
* bcm2835 sdhost driver.
*
* The 2835 has two SD controllers: The Arasan sdhci controller
* (supported by the iproc driver) and a custom sdhost controller
* (supported by this driver).
*
* The sdhci controller supports both sdcard and sdio. The sdhost
* controller supports the sdcard only, but has better performance.
* Also note that the rpi3 has sdio wifi, so driving the sdcard with
* the sdhost controller allows to use the sdhci controller for wifi
* support.
*
* The configuration is done by devicetree via pin muxing. Both
* SD controller are available on the same pins (2 pin groups = pin 22
* to 27 + pin 48 to 53). So it's possible to use both SD controllers
* at the same time with different pin groups.
*
* This code was ported to U-Boot by
* Alexander Graf <agraf@suse.de>
* and is based on drivers/mmc/host/bcm2835.c in Linux which is written by
* Phil Elwell <phil@raspberrypi.org>
* Copyright (C) 2015-2016 Raspberry Pi (Trading) Ltd.
* which is based on
* mmc-bcm2835.c by Gellert Weisz
* which is, in turn, based on
* sdhci-bcm2708.c by Broadcom
* sdhci-bcm2835.c by Stephen Warren and Oleksandr Tymoshenko
* sdhci.c and sdhci-pci.c by Pierre Ossman
*/
/* Command to SD card - 16 R/W */
/* Argument to SD card - 32 R/W */
/* Start value for timeout counter - 32 R/W */
/* Start value for clock divider - 11 R/W */
/* SD card response (31:0) - 32 R */
/* SD card response (63:32) - 32 R */
/* SD card response (95:64) - 32 R */
/* SD card response (127:96) - 32 R */
/* SD host status - 11 R/W */
/* SD card power control - 1 R/W */
/* Emergency Debug Mode - 13 R/W */
/* Host configuration - 2 R/W */
/* Host byte count (debug) - 32 R/W */
/* Data to/from SD card - 32 R/W */
/* Host block count (SDIO/SDHC) - 9 R/W */