* [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT @ 2013-09-23 6:40 Oliver Metz 2013-09-23 6:40 ` [PATCH 2/2] Don't use u8 for fields with more than 1 byte Oliver Metz 2013-09-24 3:26 ` [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Ben Gardiner 0 siblings, 2 replies; 6+ messages in thread From: Oliver Metz @ 2013-09-23 6:40 UTC (permalink / raw) To: linux-mmc; +Cc: ben.l.gardiner Signed-off-by: Oliver Metz <oliver@freetz.org> --- mmc.h | 3 +++ mmc_cmds.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mmc.h b/mmc.h index a345c1d..ac82446 100644 --- a/mmc.h +++ b/mmc.h @@ -52,6 +52,9 @@ #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_MAX_ENH_SIZE_MULT_2 159 +#define EXT_CSD_MAX_ENH_SIZE_MULT_1 158 +#define EXT_CSD_MAX_ENH_SIZE_MULT_0 157 #define EXT_CSD_PARTITIONS_ATTRIBUTE 156 /* R/W */ #define EXT_CSD_PARTITION_SETTING_COMPLETED 155 /* R/W */ #define EXT_CSD_ENH_SIZE_MULT_2 142 diff --git a/mmc_cmds.c b/mmc_cmds.c index 867a88d..f3f6c03 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -1005,8 +1005,10 @@ int do_read_extcsd(int nargs, char **argv) else printf(" Device cannot have enhanced tech.\n"); - reg = (ext_csd[159] << 16) | (ext_csd[158] << 8) | - ext_csd[157]; + reg = (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_2] << 16) | + (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_1] << 8) | + ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_0]; + printf("Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x%06x\n", reg); unsigned int wp_sz = get_hc_wp_grp_size(ext_csd); -- 1.8.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] Don't use u8 for fields with more than 1 byte 2013-09-23 6:40 [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Oliver Metz @ 2013-09-23 6:40 ` Oliver Metz 2013-09-24 3:25 ` Ben Gardiner 2013-09-24 3:26 ` [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Ben Gardiner 1 sibling, 1 reply; 6+ messages in thread From: Oliver Metz @ 2013-09-23 6:40 UTC (permalink / raw) To: linux-mmc; +Cc: ben.l.gardiner Signed-off-by: Oliver Metz <oliver@freetz.org> --- mmc_cmds.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mmc_cmds.c b/mmc_cmds.c index f3f6c03..145faa4 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -700,6 +700,7 @@ int do_read_smart_status(int nargs, char **argv) int do_read_extcsd(int nargs, char **argv) { __u8 ext_csd[512], ext_csd_rev, reg; + __u32 regl; int fd, ret; char *device; const char *str; @@ -1005,15 +1006,15 @@ int do_read_extcsd(int nargs, char **argv) else printf(" Device cannot have enhanced tech.\n"); - reg = (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_2] << 16) | + regl = (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_2] << 16) | (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_1] << 8) | ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_0]; printf("Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x%06x\n", - reg); + regl); unsigned int wp_sz = get_hc_wp_grp_size(ext_csd); unsigned int erase_sz = get_hc_erase_grp_size(ext_csd); - printf(" i.e. %lu KiB\n", 512l * reg * wp_sz * erase_sz); + printf(" i.e. %lu KiB\n", 512l * regl * wp_sz * erase_sz); printf("Partitions attribute [PARTITIONS_ATTRIBUTE]: 0x%02x\n", ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE]); @@ -1036,23 +1037,23 @@ int do_read_extcsd(int nargs, char **argv) printf(" [GP_SIZE_MULT_1]: 0x%06x\n", (ext_csd[145] << 16) | (ext_csd[144] << 8) | ext_csd[143]); - reg = (ext_csd[EXT_CSD_ENH_SIZE_MULT_2] << 16) | + regl = (ext_csd[EXT_CSD_ENH_SIZE_MULT_2] << 16) | (ext_csd[EXT_CSD_ENH_SIZE_MULT_1] << 8) | ext_csd[EXT_CSD_ENH_SIZE_MULT_0]; printf("Enhanced User Data Area Size" - " [ENH_SIZE_MULT]: 0x%06x\n", reg); - printf(" i.e. %lu KiB\n", 512l * reg * + " [ENH_SIZE_MULT]: 0x%06x\n", regl); + printf(" i.e. %lu KiB\n", 512l * regl * get_hc_erase_grp_size(ext_csd) * get_hc_wp_grp_size(ext_csd)); - reg = (ext_csd[EXT_CSD_ENH_START_ADDR_3] << 24) | + regl = (ext_csd[EXT_CSD_ENH_START_ADDR_3] << 24) | (ext_csd[EXT_CSD_ENH_START_ADDR_2] << 16) | (ext_csd[EXT_CSD_ENH_START_ADDR_1] << 8) | ext_csd[EXT_CSD_ENH_START_ADDR_0]; printf("Enhanced User Data Start Address" - " [ENH_START_ADDR]: 0x%06x\n", reg); + " [ENH_START_ADDR]: 0x%06x\n", regl); printf(" i.e. %lu bytes offset\n", (is_blockaddresed(ext_csd) ? - 1l : 512l) * reg); + 1l : 512l) * regl); /* A441]: reserved [135] */ printf("Bad Block Management mode" -- 1.8.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Don't use u8 for fields with more than 1 byte 2013-09-23 6:40 ` [PATCH 2/2] Don't use u8 for fields with more than 1 byte Oliver Metz @ 2013-09-24 3:25 ` Ben Gardiner 2013-09-26 2:26 ` Chris Ball 0 siblings, 1 reply; 6+ messages in thread From: Ben Gardiner @ 2013-09-24 3:25 UTC (permalink / raw) To: Oliver Metz; +Cc: linux-mmc On Mon, Sep 23, 2013 at 2:40 AM, Oliver Metz <oliver@freetz.org> wrote: > Signed-off-by: Oliver Metz <oliver@freetz.org> > --- > mmc_cmds.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) Looks good to me. Reviewed-by: Ben Gardiner <ben.l.gardiner@gmail.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Don't use u8 for fields with more than 1 byte 2013-09-24 3:25 ` Ben Gardiner @ 2013-09-26 2:26 ` Chris Ball 0 siblings, 0 replies; 6+ messages in thread From: Chris Ball @ 2013-09-26 2:26 UTC (permalink / raw) To: Ben Gardiner; +Cc: Oliver Metz, linux-mmc Hi Oliver, On Mon, Sep 23 2013, Ben Gardiner wrote: > On Mon, Sep 23, 2013 at 2:40 AM, Oliver Metz <oliver@freetz.org> wrote: >> Signed-off-by: Oliver Metz <oliver@freetz.org> >> --- >> mmc_cmds.c | 19 ++++++++++--------- >> 1 file changed, 10 insertions(+), 9 deletions(-) > > Looks good to me. > > Reviewed-by: Ben Gardiner <ben.l.gardiner@gmail.com> Thanks, pushed to mmc-utils with Ben's Reviewed-by. - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT 2013-09-23 6:40 [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Oliver Metz 2013-09-23 6:40 ` [PATCH 2/2] Don't use u8 for fields with more than 1 byte Oliver Metz @ 2013-09-24 3:26 ` Ben Gardiner 2013-09-26 2:25 ` Chris Ball 1 sibling, 1 reply; 6+ messages in thread From: Ben Gardiner @ 2013-09-24 3:26 UTC (permalink / raw) To: Oliver Metz; +Cc: linux-mmc On Mon, Sep 23, 2013 at 2:40 AM, Oliver Metz <oliver@freetz.org> wrote: > Signed-off-by: Oliver Metz <oliver@freetz.org> > --- > mmc.h | 3 +++ > mmc_cmds.c | 6 ++++-- > 2 files changed, 7 insertions(+), 2 deletions(-) Looks good to me. Reviewed-by: Ben Gardiner <ben.l.gardiner@gmail.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT 2013-09-24 3:26 ` [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Ben Gardiner @ 2013-09-26 2:25 ` Chris Ball 0 siblings, 0 replies; 6+ messages in thread From: Chris Ball @ 2013-09-26 2:25 UTC (permalink / raw) To: Ben Gardiner; +Cc: Oliver Metz, linux-mmc Hi Oliver, On Mon, Sep 23 2013, Ben Gardiner wrote: > On Mon, Sep 23, 2013 at 2:40 AM, Oliver Metz <oliver@freetz.org> wrote: >> Signed-off-by: Oliver Metz <oliver@freetz.org> >> --- >> mmc.h | 3 +++ >> mmc_cmds.c | 6 ++++-- >> 2 files changed, 7 insertions(+), 2 deletions(-) > > Looks good to me. > > Reviewed-by: Ben Gardiner <ben.l.gardiner@gmail.com> Thanks, pushed to mmc-utils with Ben's Reviewed-by. - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-26 2:26 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-09-23 6:40 [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Oliver Metz 2013-09-23 6:40 ` [PATCH 2/2] Don't use u8 for fields with more than 1 byte Oliver Metz 2013-09-24 3:25 ` Ben Gardiner 2013-09-26 2:26 ` Chris Ball 2013-09-24 3:26 ` [PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT Ben Gardiner 2013-09-26 2:25 ` Chris Ball
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.