1*2c295eddSjcs /* $OpenBSD: rtsxvar.h,v 1.5 2017/09/06 13:07:38 jcs Exp $ */ 2f615cd67Sstsp 3f615cd67Sstsp /* 4f615cd67Sstsp * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> 5f615cd67Sstsp * Copyright (c) 2012 Stefan Sperling <stsp@openbsd.org> 6f615cd67Sstsp * 7f615cd67Sstsp * Permission to use, copy, modify, and distribute this software for any 8f615cd67Sstsp * purpose with or without fee is hereby granted, provided that the above 9f615cd67Sstsp * copyright notice and this permission notice appear in all copies. 10f615cd67Sstsp * 11f615cd67Sstsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12f615cd67Sstsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13f615cd67Sstsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14f615cd67Sstsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15f615cd67Sstsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16f615cd67Sstsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17f615cd67Sstsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18f615cd67Sstsp */ 19f615cd67Sstsp 20f615cd67Sstsp #ifndef _RTSXVAR_H_ 21f615cd67Sstsp #define _RTSXVAR_H_ 22f615cd67Sstsp 23f615cd67Sstsp #include <machine/bus.h> 24f615cd67Sstsp 25f615cd67Sstsp /* Number of registers to save for suspend/resume in terms of their ranges. */ 26f615cd67Sstsp #define RTSX_NREG ((0XFDAE - 0XFDA0) + (0xFD69 - 0xFD32) + (0xFE34 - 0xFE20)) 27f615cd67Sstsp 28f615cd67Sstsp struct rtsx_softc { 29f615cd67Sstsp struct device sc_dev; 30f615cd67Sstsp struct device *sdmmc; /* generic SD/MMC device */ 31f615cd67Sstsp bus_space_tag_t iot; /* host register set tag */ 32f615cd67Sstsp bus_space_handle_t ioh; /* host register set handle */ 33f615cd67Sstsp bus_dma_tag_t dmat; /* DMA tag from attachment driver */ 34f615cd67Sstsp bus_dmamap_t dmap_cmd; /* DMA map for command transfer */ 35f615cd67Sstsp bus_dmamap_t dmap_data; /* DMA map for data transfer */ 36f615cd67Sstsp int flags; 37f615cd67Sstsp u_int32_t intr_status; /* soft interrupt status */ 38f615cd67Sstsp u_int8_t regs[RTSX_NREG];/* host controller state */ 39f615cd67Sstsp u_int32_t regs4[6]; /* host controller state */ 40f615cd67Sstsp }; 41f615cd67Sstsp 42f615cd67Sstsp /* Host controller functions called by the attachment driver. */ 43f615cd67Sstsp int rtsx_attach(struct rtsx_softc *, bus_space_tag_t, 440cd9a838Sstsp bus_space_handle_t, bus_size_t, bus_dma_tag_t, int); 45f615cd67Sstsp int rtsx_activate(struct device *, int); 46f615cd67Sstsp int rtsx_intr(void *); 47f615cd67Sstsp 48f615cd67Sstsp /* flag values */ 49f615cd67Sstsp #define RTSX_F_CARD_PRESENT 0x01 50f615cd67Sstsp #define RTSX_F_SDIO_SUPPORT 0x02 510cd9a838Sstsp #define RTSX_F_5209 0x04 52ae1f177aSstsp #define RTSX_F_5229 0x08 53ae1f177aSstsp #define RTSX_F_5229_TYPE_C 0x10 54*2c295eddSjcs #define RTSX_F_525A 0x20 55f615cd67Sstsp 56f615cd67Sstsp #endif 57