summaryrefslogtreecommitdiffstats
path: root/include/mci.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2019-09-09 22:34:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-12 10:30:12 +0200
commitf3db31188849c0f7f603789d125eb60e5f139061 (patch)
tree3e42d45db363213b0b81c1a5c15f058b76078800 /include/mci.h
parent4159407136abb44ca26fac22ab5397236fccc410 (diff)
downloadbarebox-f3db31188849c0f7f603789d125eb60e5f139061.tar.gz
barebox-f3db31188849c0f7f603789d125eb60e5f139061.tar.xz
mci: implement command to switch a mmc device to enhanced mode
The command structure allows adding more subcommands and is designed to match the Linux program mmc from the mmc-utils. So later more commands can easily be added if need be. Compared to mmc-utils' mmc enh_area set <-y|-n|-c> <start KiB> <length KiB> <device> the command that is implemented here ( mmc enh_area [-c] <device> ) is easier to use (because you don't have to check the maximal allowed size by reading some registers and calculate the available size from them (which then must be calculated back to register values by the mmc command)) but less flexible as it doesn't allow all the crazy possibilities specified in the eMMC standard (yet?) but just creates an enhanced area with maximal size. In the future something like mmc enh_area -s 30k <device> could be used to not use the maximal but an explicit size. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mci.h')
-rw-r--r--include/mci.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/mci.h b/include/mci.h
index a46239d8ff..a45d744761 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -306,6 +306,13 @@
#define EXT_CSD_CARD_TYPE_SDR_1_2V (1<<5) /* Card can run at 200MHz */
/* SDR mode @1.2V I/O */
+/* register PARTITIONS_ATTRIBUTE [156] */
+#define EXT_CSD_ENH_USR_MASK (1 << 0)
+
+/* register PARTITIONING_SUPPORT [160] */
+#define EXT_CSD_ENH_ATTRIBUTE_EN_MASK (1 << 0)
+
+/* register BUS_WIDTH [183], field Bus Mode Selection [4:0] */
#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */