imx_sdhci.c (297127) | imx_sdhci.c (300050) |
---|---|
1/*- 2 * Copyright (c) 2013 Ian Lepore <ian@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2013 Ian Lepore <ian@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/arm/freescale/imx/imx_sdhci.c 297127 2016-03-21 00:52:24Z ian $"); | 28__FBSDID("$FreeBSD: head/sys/arm/freescale/imx/imx_sdhci.c 300050 2016-05-17 12:52:31Z eadler $"); |
29 30/* 31 * SDHCI driver glue for Freescale i.MX SoC family. 32 * 33 * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs). 34 */ 35 36#include <sys/param.h> --- 583 unchanged lines hidden (view full) --- 620 * 621 * We check DAT0 immediately because most of the time, especially on a 622 * read, the card will actually be done by time we get here. If it's 623 * not, then the wait_done routine will schedule a callout to re-check 624 * periodically until it is done. In that case we clear the interrupt 625 * out of the hardware now so that we can present it later when the DAT0 626 * line is released. 627 * | 29 30/* 31 * SDHCI driver glue for Freescale i.MX SoC family. 32 * 33 * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs). 34 */ 35 36#include <sys/param.h> --- 583 unchanged lines hidden (view full) --- 620 * 621 * We check DAT0 immediately because most of the time, especially on a 622 * read, the card will actually be done by time we get here. If it's 623 * not, then the wait_done routine will schedule a callout to re-check 624 * periodically until it is done. In that case we clear the interrupt 625 * out of the hardware now so that we can present it later when the DAT0 626 * line is released. 627 * |
628 * If we need to wait for the the DAT0 line to be released, we set up a | 628 * If we need to wait for the DAT0 line to be released, we set up a |
629 * timeout point 250ms in the future. This number comes from the SD 630 * spec, which allows a command to take that long. In the real world, 631 * cards tend to take 10-20ms for a long-running command such as a write 632 * or erase that spans two pages. 633 */ 634 switch (sc->r1bfix_type) { 635 case R1BFIX_NODATA: 636 intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_RESPONSE; --- 203 unchanged lines hidden --- | 629 * timeout point 250ms in the future. This number comes from the SD 630 * spec, which allows a command to take that long. In the real world, 631 * cards tend to take 10-20ms for a long-running command such as a write 632 * or erase that spans two pages. 633 */ 634 switch (sc->r1bfix_type) { 635 case R1BFIX_NODATA: 636 intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_RESPONSE; --- 203 unchanged lines hidden --- |