[PATCH 2/8] extract definitions for EXT_CSD register EXT_CSD_PARTITIONING_SUPPORT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ben Gardiner <bengardiner@xxxxxxxxxxxxxx>
---
 mmc.h      |    3 +++
 mmc_cmds.c |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/mmc.h b/mmc.h
index c863751..47ef8ea 100644
--- a/mmc.h
+++ b/mmc.h
@@ -40,6 +40,7 @@
 #define EXT_CSD_WR_REL_PARAM		166
 #define EXT_CSD_BKOPS_EN		163	/* R/W */
 #define EXT_CSD_RST_N_FUNCTION		162	/* R/W */
+#define EXT_CSD_PARTITIONING_SUPPORT	160	/* RO */
 #define EXT_CSD_NATIVE_SECTOR_SIZE	63 /* R */
 #define EXT_CSD_USE_NATIVE_SECTOR	62 /* R/W */
 #define EXT_CSD_DATA_SECTOR_SIZE	61 /* R */
@@ -79,6 +80,8 @@
 #define EXT_CSD_PART_CONFIG_ACC_BOOT1	  (0x2)
 #define EXT_CSD_PART_CONFIG_ACC_USER_AREA (0x7)
 #define EXT_CSD_PART_CONFIG_ACC_ACK	  (0x40)
+#define EXT_CSD_PARTITIONING_EN		(1<<0)
+#define EXT_CSD_ENH_ATTRIBUTE_EN	(1<<1)
 
 /* From kernel linux/mmc/core.h */
 #define MMC_RSP_PRESENT	(1 << 0)
diff --git a/mmc_cmds.c b/mmc_cmds.c
index b407f65..8cf6e89 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -670,14 +670,14 @@ int do_read_extcsd(int nargs, char **argv)
 		printf("H/W reset function"
 			" [RST_N_FUNCTION]: 0x%02x\n", ext_csd[162]);
 		printf("HPI management [HPI_MGMT]: 0x%02x\n", ext_csd[161]);
-		reg = ext_csd[160];
+		reg = ext_csd[EXT_CSD_PARTITIONING_SUPPORT];
 		printf("Partitioning Support [PARTITIONING_SUPPORT]: 0x%02x\n",
 			reg);
-		if (reg & 0x1)
+		if (reg & EXT_CSD_PARTITIONING_EN)
 			printf(" Device support partitioning feature\n");
 		else
 			printf(" Device NOT support partitioning feature\n");
-		if (reg & 0x2)
+		if (reg & EXT_CSD_ENH_ATTRIBUTE_EN)
 			printf(" Device can have enhanced tech.\n");
 		else
 			printf(" Device cannot have enhanced tech.\n");
-- 
1.7.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux