180872e21SWolfram Sang /* 280872e21SWolfram Sang * Freescale eSDHC controller driver generics for OF and pltfm. 380872e21SWolfram Sang * 480872e21SWolfram Sang * Copyright (c) 2007 Freescale Semiconductor, Inc. 580872e21SWolfram Sang * Copyright (c) 2009 MontaVista Software, Inc. 680872e21SWolfram Sang * Copyright (c) 2010 Pengutronix e.K. 780872e21SWolfram Sang * Author: Wolfram Sang <w.sang@pengutronix.de> 880872e21SWolfram Sang * 980872e21SWolfram Sang * This program is free software; you can redistribute it and/or modify 1080872e21SWolfram Sang * it under the terms of the GNU General Public License as published by 1180872e21SWolfram Sang * the Free Software Foundation; either version 2 of the License. 1280872e21SWolfram Sang */ 1380872e21SWolfram Sang 1480872e21SWolfram Sang #ifndef _DRIVERS_MMC_SDHCI_ESDHC_H 1580872e21SWolfram Sang #define _DRIVERS_MMC_SDHCI_ESDHC_H 1680872e21SWolfram Sang 1780872e21SWolfram Sang /* 1880872e21SWolfram Sang * Ops and quirks for the Freescale eSDHC controller. 1980872e21SWolfram Sang */ 2080872e21SWolfram Sang 2180872e21SWolfram Sang #define ESDHC_DEFAULT_QUIRKS (SDHCI_QUIRK_FORCE_BLK_SZ_2048 | \ 22cbb45093SBenoît Thébaudeau SDHCI_QUIRK_32BIT_DMA_ADDR | \ 2380872e21SWolfram Sang SDHCI_QUIRK_NO_BUSY_IRQ | \ 2480872e21SWolfram Sang SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | \ 2567b589a2SYangbo Lu SDHCI_QUIRK_PIO_NEEDS_DELAY | \ 2667b589a2SYangbo Lu SDHCI_QUIRK_NO_HISPD_BIT) 2780872e21SWolfram Sang 28a6b44888Syangbo lu /* pltfm-specific */ 29a6b44888Syangbo lu #define ESDHC_HOST_CONTROL_LE 0x20 30f4932cfdSyangbo lu 31a6b44888Syangbo lu /* 32a6b44888Syangbo lu * eSDHC register definition 33a6b44888Syangbo lu */ 34a6b44888Syangbo lu 35e87d2db2Syangbo lu /* Present State Register */ 36e87d2db2Syangbo lu #define ESDHC_PRSSTAT 0x24 37e87d2db2Syangbo lu #define ESDHC_CLOCK_STABLE 0x00000008 38e87d2db2Syangbo lu 39a6b44888Syangbo lu /* Protocol Control Register */ 40a6b44888Syangbo lu #define ESDHC_PROCTL 0x28 41ea35645aSyangbo lu #define ESDHC_VOLT_SEL 0x00000400 42a6b44888Syangbo lu #define ESDHC_CTRL_4BITBUS (0x1 << 1) 43a6b44888Syangbo lu #define ESDHC_CTRL_8BITBUS (0x2 << 1) 44a6b44888Syangbo lu #define ESDHC_CTRL_BUSWIDTH_MASK (0x3 << 1) 45a6b44888Syangbo lu #define ESDHC_HOST_CONTROL_RES 0x01 46a6b44888Syangbo lu 47a6b44888Syangbo lu /* System Control Register */ 4880872e21SWolfram Sang #define ESDHC_SYSTEM_CONTROL 0x2c 4980872e21SWolfram Sang #define ESDHC_CLOCK_MASK 0x0000fff0 5080872e21SWolfram Sang #define ESDHC_PREDIV_SHIFT 8 5180872e21SWolfram Sang #define ESDHC_DIVIDER_SHIFT 4 52e87d2db2Syangbo lu #define ESDHC_CLOCK_SDCLKEN 0x00000008 5380872e21SWolfram Sang #define ESDHC_CLOCK_PEREN 0x00000004 5480872e21SWolfram Sang #define ESDHC_CLOCK_HCKEN 0x00000002 5580872e21SWolfram Sang #define ESDHC_CLOCK_IPGEN 0x00000001 5680872e21SWolfram Sang 57*2f3110ccSyangbo lu /* Host Controller Capabilities Register 2 */ 58*2f3110ccSyangbo lu #define ESDHC_CAPABILITIES_1 0x114 59*2f3110ccSyangbo lu 60ba49cbd0Syangbo lu /* Tuning Block Control Register */ 61ba49cbd0Syangbo lu #define ESDHC_TBCTL 0x120 62ba49cbd0Syangbo lu #define ESDHC_TB_EN 0x00000004 63ba49cbd0Syangbo lu 64a6b44888Syangbo lu /* Control Register for DMA transfer */ 6580872e21SWolfram Sang #define ESDHC_DMA_SYSCTL 0x40c 6619c3a0efSyangbo lu #define ESDHC_PERIPHERAL_CLK_SEL 0x00080000 67ba49cbd0Syangbo lu #define ESDHC_FLUSH_ASYNC_FIFO 0x00040000 6880872e21SWolfram Sang #define ESDHC_DMA_SNOOP 0x00000040 6980872e21SWolfram Sang 7080872e21SWolfram Sang #endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */ 71