mmcbrvar.h revision 184452
1163516Simp/*- 2163516Simp * Copyright (c) 2006 Bernd Walter. All rights reserved. 3163516Simp * Copyright (c) 2006 M. Warner Losh. 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 ``AS IS'' AND ANY EXPRESS OR 15163516Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16163516Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17163516Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18163516Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19163516Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20163516Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21163516Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22163516Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23163516Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24163516Simp * 25170002Simp * Portions of this software may have been developed with reference to 26170002Simp * the SD Simplified Specification. The following disclaimer may apply: 27170002Simp * 28170002Simp * The following conditions apply to the release of the simplified 29170002Simp * specification ("Simplified Specification") by the SD Card Association and 30170002Simp * the SD Group. The Simplified Specification is a subset of the complete SD 31170002Simp * Specification which is owned by the SD Card Association and the SD 32170002Simp * Group. This Simplified Specification is provided on a non-confidential 33170002Simp * basis subject to the disclaimers below. Any implementation of the 34170002Simp * Simplified Specification may require a license from the SD Card 35170002Simp * Association, SD Group, SD-3C LLC or other third parties. 36170002Simp * 37170002Simp * Disclaimers: 38170002Simp * 39170002Simp * The information contained in the Simplified Specification is presented only 40170002Simp * as a standard specification for SD Cards and SD Host/Ancillary products and 41170002Simp * is provided "AS-IS" without any representations or warranties of any 42170002Simp * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD 43170002Simp * Card Association for any damages, any infringements of patents or other 44170002Simp * right of the SD Group, SD-3C LLC, the SD Card Association or any third 45170002Simp * parties, which may result from its use. No license is granted by 46170002Simp * implication, estoppel or otherwise under any patent or other rights of the 47170002Simp * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing 48170002Simp * herein shall be construed as an obligation by the SD Group, the SD-3C LLC 49170002Simp * or the SD Card Association to disclose or distribute any technical 50170002Simp * information, know-how or other confidential information to any third party. 51170002Simp * 52163516Simp * "$FreeBSD: head/sys/dev/mmc/mmcbrvar.h 184452 2008-10-29 20:01:26Z mav $" 53163516Simp */ 54163516Simp 55163516Simp#ifndef DEV_MMC_MMCBRVAR_H 56163516Simp#define DEV_MMC_MMCBRVAR_H 57163516Simp 58163516Simp#include <dev/mmc/bridge.h> 59163516Simp#include "mmcbr_if.h" 60163516Simp 61163516Simpenum mmcbr_device_ivars { 62163516Simp MMCBR_IVAR_BUS_MODE, 63163516Simp MMCBR_IVAR_BUS_WIDTH, 64163516Simp MMCBR_IVAR_CHIP_SELECT, 65163516Simp MMCBR_IVAR_CLOCK, 66163516Simp MMCBR_IVAR_F_MIN, 67163516Simp MMCBR_IVAR_F_MAX, 68163516Simp MMCBR_IVAR_HOST_OCR, 69163516Simp MMCBR_IVAR_MODE, 70163516Simp MMCBR_IVAR_OCR, 71163516Simp MMCBR_IVAR_POWER_MODE, 72163516Simp MMCBR_IVAR_VDD, 73183450Simp MMCBR_IVAR_CAPS, 74183704Smav MMCBR_IVAR_TIMING, 75184452Smav MMCBR_IVAR_MAX_DATA, 76163516Simp// MMCBR_IVAR_, 77163516Simp}; 78163516Simp 79163516Simp/* 80163516Simp * Simplified accessors for pci devices 81163516Simp */ 82163516Simp#define MMCBR_ACCESSOR(var, ivar, type) \ 83163516Simp __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) 84163516Simp 85163516SimpMMCBR_ACCESSOR(bus_mode, BUS_MODE, int) 86163516SimpMMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) 87163516SimpMMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) 88163516SimpMMCBR_ACCESSOR(clock, CLOCK, int) 89163516SimpMMCBR_ACCESSOR(f_max, F_MAX, int) 90163516SimpMMCBR_ACCESSOR(f_min, F_MIN, int) 91163516SimpMMCBR_ACCESSOR(host_ocr, HOST_OCR, int) 92163516SimpMMCBR_ACCESSOR(mode, MODE, int) 93163516SimpMMCBR_ACCESSOR(ocr, OCR, int) 94163516SimpMMCBR_ACCESSOR(power_mode, POWER_MODE, int) 95163516SimpMMCBR_ACCESSOR(vdd, VDD, int) 96183450SimpMMCBR_ACCESSOR(caps, CAPS, int) 97183704SmavMMCBR_ACCESSOR(timing, TIMING, int) 98184452SmavMMCBR_ACCESSOR(max_data, MAX_DATA, int) 99163516Simp 100163516Simpstatic int __inline 101163516Simpmmcbr_update_ios(device_t dev) 102163516Simp{ 103163516Simp return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); 104163516Simp} 105163516Simp 106183447Simpstatic int __inline 107183447Simpmmcbr_get_ro(device_t dev) 108183447Simp{ 109183447Simp return (MMCBR_GET_RO(device_get_parent(dev), dev)); 110183447Simp} 111183447Simp 112163516Simp#endif /* DEV_MMC_MMCBRVAR_H */ 113