diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-11-08 12:10:28 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-11-08 12:10:28 +0000 |
commit | 54d4f0401e945025bf51b38429bd1fc725704ef2 (patch) | |
tree | ec24023f07788c4ac5f0b374b8e9f897b837d9e5 /sys/dev/sdmmc | |
parent | cddf72893dcfe862a1ba01572e27076c98105076 (diff) |
Always claim to support sector mode for eMMC. Allows BeagleBone Black
boards with Micron eMMC to work. The Micron eMMC seems to adhere to the
spec which states:
"If there is no indication by a host to a memory that the host is
capable of handling sector type of addressing the higher than 2GB of
density of memory will change its state to Inactive (similarly to a sit-
uation in which there is no common voltage range to work with)"
From Ian Sutton with feedback from uwe@
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_mem.c | 4 | ||||
-rw-r--r-- | sys/dev/sdmmc/sdmmcreg.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c index 459444e6f5f..da2d4c042a0 100644 --- a/sys/dev/sdmmc/sdmmc_mem.c +++ b/sys/dev/sdmmc/sdmmc_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_mem.c,v 1.21 2015/04/22 04:02:06 jsg Exp $ */ +/* $OpenBSD: sdmmc_mem.c,v 1.22 2015/11/08 12:10:27 jsg Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -525,6 +525,8 @@ sdmmc_mem_send_op_cond(struct sdmmc_softc *sc, u_int32_t ocr, cmd.c_opcode = SD_APP_OP_COND; error = sdmmc_app_command(sc, &cmd); } else { + cmd.c_arg &= ~MMC_OCR_ACCESS_MODE_MASK; + cmd.c_arg |= MMC_OCR_SECTOR_MODE; cmd.c_opcode = MMC_SEND_OP_COND; error = sdmmc_mmc_command(sc, &cmd); } diff --git a/sys/dev/sdmmc/sdmmcreg.h b/sys/dev/sdmmc/sdmmcreg.h index 7807f3b76ea..fd5080bf6c1 100644 --- a/sys/dev/sdmmc/sdmmcreg.h +++ b/sys/dev/sdmmc/sdmmcreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmcreg.h,v 1.6 2014/09/23 12:08:13 rapha Exp $ */ +/* $OpenBSD: sdmmcreg.h,v 1.7 2015/11/08 12:10:27 jsg Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -48,6 +48,9 @@ /* OCR bits */ #define MMC_OCR_MEM_READY (1<<31) /* memory power-up status bit */ +#define MMC_OCR_ACCESS_MODE_MASK 0x60000000 /* bits 30:29 */ +#define MMC_OCR_SECTOR_MODE (1<<30) +#define MMC_OCR_BYTE_MODE (1<<29) #define MMC_OCR_3_5V_3_6V (1<<23) #define MMC_OCR_3_4V_3_5V (1<<22) #define MMC_OCR_3_3V_3_4V (1<<21) |