From 82bd9504b12160992309d6508dc5654b3db93c2b Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Thu, 27 Jun 2013 11:04:10 -0400 Subject: extract definitions for EXT_CSD register EXT_CSD_PARTITIONING_SUPPORT Signed-off-by: Chris Ball --- mmc.h | 3 +++ mmc_cmds.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mmc.h b/mmc.h index a007b6b..7c0cb49 100644 --- a/mmc.h +++ b/mmc.h @@ -43,6 +43,7 @@ #define EXT_CSD_SANITIZE_START 165 #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 */ @@ -82,6 +83,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 42bebb9..de12300 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -660,14 +660,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"); -- cgit v1.2.3