1163516Simp#- 2163516Simp# Copyright (c) 2006 M. Warner Losh 3163516Simp# All rights reserved. 4163516Simp# 5163516Simp# Redistribution and use in source and binary forms, with or without 6163516Simp# modification, are permitted provided that the following conditions 7163516Simp# are met: 8163516Simp# 1. Redistributions of source code must retain the above copyright 9163516Simp# notice, this list of conditions and the following disclaimer. 10163516Simp# 2. Redistributions in binary form must reproduce the above copyright 11163516Simp# notice, this list of conditions and the following disclaimer in the 12163516Simp# documentation and/or other materials provided with the distribution. 13163516Simp# 14163516Simp# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15163516Simp# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16163516Simp# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17163516Simp# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18163516Simp# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19163516Simp# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20163516Simp# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21163516Simp# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22163516Simp# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23163516Simp# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24163516Simp# SUCH DAMAGE. 25163516Simp# 26170002Simp# Portions of this software may have been developed with reference to 27170002Simp# the SD Simplified Specification. The following disclaimer may apply: 28170002Simp# 29170002Simp# The following conditions apply to the release of the simplified 30170002Simp# specification ("Simplified Specification") by the SD Card Association and 31170002Simp# the SD Group. The Simplified Specification is a subset of the complete SD 32170002Simp# Specification which is owned by the SD Card Association and the SD 33170002Simp# Group. This Simplified Specification is provided on a non-confidential 34170002Simp# basis subject to the disclaimers below. Any implementation of the 35170002Simp# Simplified Specification may require a license from the SD Card 36170002Simp# Association, SD Group, SD-3C LLC or other third parties. 37170002Simp# 38170002Simp# Disclaimers: 39170002Simp# 40170002Simp# The information contained in the Simplified Specification is presented only 41170002Simp# as a standard specification for SD Cards and SD Host/Ancillary products and 42170002Simp# is provided "AS-IS" without any representations or warranties of any 43170002Simp# kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD 44170002Simp# Card Association for any damages, any infringements of patents or other 45170002Simp# right of the SD Group, SD-3C LLC, the SD Card Association or any third 46170002Simp# parties, which may result from its use. No license is granted by 47170002Simp# implication, estoppel or otherwise under any patent or other rights of the 48170002Simp# SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing 49170002Simp# herein shall be construed as an obligation by the SD Group, the SD-3C LLC 50170002Simp# or the SD Card Association to disclose or distribute any technical 51170002Simp# information, know-how or other confidential information to any third party. 52170002Simp# 53163516Simp# $FreeBSD$ 54163516Simp# 55163516Simp 56163516Simp#include <sys/types.h> 57163516Simp#include <dev/mmc/bridge.h> 58163516Simp#include <dev/mmc/mmcreg.h> 59163516Simp 60163516Simp# 61163516Simp# This is the interface that a mmc bridge chip gives to the mmc bus 62163516Simp# that attaches to the mmc bridge. 63163516Simp# 64163516Simp 65163516SimpINTERFACE mmcbr; 66163516Simp 67163516Simp# 68163516Simp# Called by the mmcbus to setup the IO pins correctly, the voltage to use 69163516Simp# for the card, the type of selects, power modes and bus width. 70163516Simp# 71163516SimpMETHOD int update_ios { 72163516Simp device_t brdev; 73163516Simp device_t reqdev; 74163516Simp}; 75163516Simp 76163516Simp# 77163516Simp# Called by the mmcbus or its children to schedule a mmc request. These 78163516Simp# requests are queued. Time passes. The bridge then gets notification 79163516Simp# of the status of request, who then notifies the requesting device via 80163516Simp# the xfer_done mmcbus method. 81163516Simp# 82163516SimpMETHOD int request { 83163516Simp device_t brdev; 84163516Simp device_t reqdev; 85163516Simp struct mmc_request *req; 86163516Simp}; 87163516Simp 88163516Simp# 89163516Simp# Called by mmcbus to get the read only status bits. 90163516Simp# 91163516SimpMETHOD int get_ro { 92163516Simp device_t brdev; 93163516Simp device_t reqdev; 94163516Simp}; 95163516Simp 96163516Simp# 97163516Simp# Claim the current bridge, blocking the current thread until the host 98163516Simp# is no longer busy. 99163516Simp# 100163516SimpMETHOD int acquire_host { 101163516Simp device_t brdev; 102163516Simp device_t reqdev; 103163516Simp} 104163516Simp 105163516Simp# 106163516Simp# Release the current bridge. 107163516Simp# 108163516SimpMETHOD int release_host { 109163516Simp device_t brdev; 110163516Simp device_t reqdev; 111163516Simp} 112