<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/common/cmd_mmc.c, branch v2015.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>mmc: Fix handling of bus widths and DDR card capabilities</title>
<updated>2014-12-12T19:08:06+00:00</updated>
<author>
<name>Andrew Gabbasov</name>
<email>andrew_gabbasov@mentor.com</email>
</author>
<published>2014-12-01T12:59:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=786e8f818c25265d12d5d06e257fe2b1ba516134'/>
<id>786e8f818c25265d12d5d06e257fe2b1ba516134</id>
<content type='text'>
If the MMC_MODE_DDR_52MHz flag is set in card capabilities bitmask,
it is never cleared, even if switching to DDR mode fails, and if
the controller driver uses this flag to check the DDR mode, it can
take incorrect actions.

Also, DDR related checks in mmc_startup() incorrectly handle the case
when the host controller does not support some bus widths (e.g. can't
support 8 bits), since the host_caps is checked for DDR bit, but not
bus width bits.

This fix clearly separates using of card_caps bitmask, having there
the flags for the capabilities, that the card can support, and actual
operation mode, described outside of card_caps (i.e. bus_width and
ddr_mode fields in mmc structure). Separate host controller drivers
may need to be updated to use the actual flags. Respectively,
the capabilities checks in mmc_startup are made more correct and clear.

Also, some clean up is made with errors handling and code syntax layout.

Signed-off-by: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the MMC_MODE_DDR_52MHz flag is set in card capabilities bitmask,
it is never cleared, even if switching to DDR mode fails, and if
the controller driver uses this flag to check the DDR mode, it can
take incorrect actions.

Also, DDR related checks in mmc_startup() incorrectly handle the case
when the host controller does not support some bus widths (e.g. can't
support 8 bits), since the host_caps is checked for DDR bit, but not
bus width bits.

This fix clearly separates using of card_caps bitmask, having there
the flags for the capabilities, that the card can support, and actual
operation mode, described outside of card_caps (i.e. bus_width and
ddr_mode fields in mmc structure). Separate host controller drivers
may need to be updated to use the actual flags. Respectively,
the capabilities checks in mmc_startup are made more correct and clear.

Also, some clean up is made with errors handling and code syntax layout.

Signed-off-by: Andrew Gabbasov &lt;andrew_gabbasov@mentor.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: fix bootpart-resize maxarg to 4</title>
<updated>2014-10-03T14:26:50+00:00</updated>
<author>
<name>Wally Yeh</name>
<email>wally.yeh@atrustcorp.com</email>
</author>
<published>2014-09-25T15:00:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa7b88519e9158cee2b0900d26c049f09f49f8c5'/>
<id>fa7b88519e9158cee2b0900d26c049f09f49f8c5</id>
<content type='text'>
sub-command 'bootpart-resize' check for argc == 4,
it will retrun CMD_RET_FAILURE when argc value not matched.

but bootpart-resize's maxarg is 3, which means you never execute
this sub-command successfully.

fix it by change bootpart-resize maxarg to 4.

Signed-off-by: wally.yeh &lt;wally.yeh@atrustcorp.com&gt;
Cc: Wolfgang Denk &lt;wd@denx.de&gt;
Cc: Pierre Aubert &lt;p.aubert@staubli.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sub-command 'bootpart-resize' check for argc == 4,
it will retrun CMD_RET_FAILURE when argc value not matched.

but bootpart-resize's maxarg is 3, which means you never execute
this sub-command successfully.

fix it by change bootpart-resize maxarg to 4.

Signed-off-by: wally.yeh &lt;wally.yeh@atrustcorp.com&gt;
Cc: Wolfgang Denk &lt;wd@denx.de&gt;
Cc: Pierre Aubert &lt;p.aubert@staubli.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: make mmc dev always re-probe the HW</title>
<updated>2014-06-12T12:21:12+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-05-23T19:24:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a5710920b7b0016c6d83897d251b44922f5ca832'/>
<id>a5710920b7b0016c6d83897d251b44922f5ca832</id>
<content type='text'>
Currently, U-Boot behaves as follows:

- Begin with no SD card inserted in "mmc 1"
- Execute: mmc dev 1
- This fails, since there is no card
- User plugs in an SD card
- Execute: mmc dev 1
- This still fails, since the HW isn't reprobed.

With this change, U-Boot behaves as follows:

- Begin with no SD card inserted in "mmc 1"
- Execute: mmc dev 1
- This fails, since there is no card
- User plugs in an SD card
- Execute: mmc dev 1
- The newly present SD card is detected

I know that "mmc rescan" will force the HW to be reprobed, but I feel it
makes more sense if "mmc dev" always reprobes the HW after selecting the
current MMC device. This allows scripts to just execute "mmc dev", and
not have to also execute "mmc rescan" to check for media presense.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, U-Boot behaves as follows:

- Begin with no SD card inserted in "mmc 1"
- Execute: mmc dev 1
- This fails, since there is no card
- User plugs in an SD card
- Execute: mmc dev 1
- This still fails, since the HW isn't reprobed.

With this change, U-Boot behaves as follows:

- Begin with no SD card inserted in "mmc 1"
- Execute: mmc dev 1
- This fails, since there is no card
- User plugs in an SD card
- Execute: mmc dev 1
- The newly present SD card is detected

I know that "mmc rescan" will force the HW to be reprobed, but I feel it
makes more sense if "mmc dev" always reprobes the HW after selecting the
current MMC device. This allows scripts to just execute "mmc dev", and
not have to also execute "mmc rescan" to check for media presense.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: Use init_mmc_device() from do_mmc_rescan()</title>
<updated>2014-06-12T12:21:12+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-05-23T19:24:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=941944e445193a07dea77787680666db049a14dc'/>
<id>941944e445193a07dea77787680666db049a14dc</id>
<content type='text'>
The body of init_mmc_device() is now identical to that of do_mmc_rescan()
except for the error codes returned. Modify do_mmc_rescan() to simply
call init_mmc_device() and convert the error codes, to avoid code
duplication.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The body of init_mmc_device() is now identical to that of do_mmc_rescan()
except for the error codes returned. Modify do_mmc_rescan() to simply
call init_mmc_device() and convert the error codes, to avoid code
duplication.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: add force_init parameter to init_mmc_device()</title>
<updated>2014-06-12T12:21:12+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-05-23T19:24:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1ae24a5041b6fab7cc986bda7fec92b3d643ac96'/>
<id>1ae24a5041b6fab7cc986bda7fec92b3d643ac96</id>
<content type='text'>
This allows callers to inject mmc-&gt;has_init = 0 between finding the
MMC device, and calling mmc_init(), which forces mmc_init() to rescan
the HW. Future changes will use this feature.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows callers to inject mmc-&gt;has_init = 0 between finding the
MMC device, and calling mmc_init(), which forces mmc_init() to rescan
the HW. Future changes will use this feature.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: default to HW partition 0 if not specified</title>
<updated>2014-06-12T12:21:12+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-05-23T18:48:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=60dc58f735f173458ebed217cc7fe0c24816f383'/>
<id>60dc58f735f173458ebed217cc7fe0c24816f383</id>
<content type='text'>
Currently, "mmc dev 0" does not change the selected HW partition. I
think it makes more sense if "mmc dev 0" is an alias for "mmc dev 0 0",
i.e. that HW partition 0 (main data area) is always selected by default
if the user didn't request a specific partition. Otherwise, the following
happens, which feels wrong:

Select HW partition 1 (boot0):
mmc dev 0 1

Doesn't change the HW partition, so it's still 1 (boot0):
mmc dev 0

With this patch, the second command above re-selects the main data area.

Note that some MMC devices (i.e. SD cards) don't support HW partitions.
However, this patch still works, since mmc_start_init() sets the current
partition number to 0, and mmc_select_hwpart() succeeds if the requested
partition is already selected.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, "mmc dev 0" does not change the selected HW partition. I
think it makes more sense if "mmc dev 0" is an alias for "mmc dev 0 0",
i.e. that HW partition 0 (main data area) is always selected by default
if the user didn't request a specific partition. Otherwise, the following
happens, which feels wrong:

Select HW partition 1 (boot0):
mmc dev 0 1

Doesn't change the HW partition, so it's still 1 (boot0):
mmc dev 0

With this patch, the second command above re-selects the main data area.

Note that some MMC devices (i.e. SD cards) don't support HW partitions.
However, this patch still works, since mmc_start_init() sets the current
partition number to 0, and mmc_select_hwpart() succeeds if the requested
partition is already selected.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_mmc: use new mmc_select_hwpart() function</title>
<updated>2014-05-23T09:23:28+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-05-07T18:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=df348d8245922adbb03a3a979429c5e70342973c'/>
<id>df348d8245922adbb03a3a979429c5e70342973c</id>
<content type='text'>
The implementation of mmc_select_hwpart() was cribbed from do_mmcops().
Update do_mmcops() to call mmc_select_hwpart() to avoid duplication.

&lt;panto&gt; Manual patch update due to patch order.

Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implementation of mmc_select_hwpart() was cribbed from do_mmcops().
Update do_mmcops() to call mmc_select_hwpart() to avoid duplication.

&lt;panto&gt; Manual patch update due to patch order.

Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' command</title>
<updated>2014-05-23T08:53:17+00:00</updated>
<author>
<name>Pierre Aubert</name>
<email>p.aubert@staubli.com</email>
</author>
<published>2014-04-24T08:30:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1fd93c6e7d8a1e4d6261058cefab11b875ded252'/>
<id>1fd93c6e7d8a1e4d6261058cefab11b875ded252</id>
<content type='text'>
This sub-command adds support for the RPMB partition of an eMMC:
* mmc rpmb key &lt;address of the authentication key&gt;
  Programs the authentication key in the eMMC This key can not
  be overwritten.
* mmc rpmb read &lt;address&gt; &lt;block&gt; &lt;#count&gt; [address of key]
  Reads &lt;#count&gt; blocks of 256 bytes in the RPMB partition
  beginning at block number &lt;block&gt;. If the optionnal
  address of the authentication key is provided, the
  Message Authentication Code (MAC) is verified on each
  block.
* mmc rpmb write &lt;address&gt; &lt;block&gt; &lt;#count&gt; &lt;address of key&gt;
  Writes &lt;#count&gt; blocks of 256 bytes in the RPMB partition
  beginning at block number &lt;block&gt;. The datas are signed
  with the key provided.
* mmc rpmb counter
  Returns the 'Write counter' of the RPMB partition.

The sub-command is conditional on compilation flag CONFIG_SUPPORT_EMMC_RPMB

Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
Signed-off-by: Pierre Aubert &lt;p.aubert@staubli.com&gt;
CC: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This sub-command adds support for the RPMB partition of an eMMC:
* mmc rpmb key &lt;address of the authentication key&gt;
  Programs the authentication key in the eMMC This key can not
  be overwritten.
* mmc rpmb read &lt;address&gt; &lt;block&gt; &lt;#count&gt; [address of key]
  Reads &lt;#count&gt; blocks of 256 bytes in the RPMB partition
  beginning at block number &lt;block&gt;. If the optionnal
  address of the authentication key is provided, the
  Message Authentication Code (MAC) is verified on each
  block.
* mmc rpmb write &lt;address&gt; &lt;block&gt; &lt;#count&gt; &lt;address of key&gt;
  Writes &lt;#count&gt; blocks of 256 bytes in the RPMB partition
  beginning at block number &lt;block&gt;. The datas are signed
  with the key provided.
* mmc rpmb counter
  Returns the 'Write counter' of the RPMB partition.

The sub-command is conditional on compilation flag CONFIG_SUPPORT_EMMC_RPMB

Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
Signed-off-by: Pierre Aubert &lt;p.aubert@staubli.com&gt;
CC: Wolfgang Denk &lt;wd@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: Add 'mmc rst-function' sub-command</title>
<updated>2014-04-02T10:02:58+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@ti.com</email>
</author>
<published>2014-02-07T19:15:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=33ace362fdf80e2e2ea4cdf2829a5179c52de3f4'/>
<id>33ace362fdf80e2e2ea4cdf2829a5179c52de3f4</id>
<content type='text'>
Some eMMC chips may need the RST_n_FUNCTION bit set to a non-zero value
in order for warm reset of the system to work.  Details on this being
required will be part of the eMMC datasheet.  Also add using this
command to the dra7xx README.

* Whitespace fix by panto

Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some eMMC chips may need the RST_n_FUNCTION bit set to a non-zero value
in order for warm reset of the system to work.  Details on this being
required will be part of the eMMC datasheet.  Also add using this
command to the dra7xx README.

* Whitespace fix by panto

Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
Acked-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: Split mmc struct, rework mmc initialization (v2)</title>
<updated>2014-03-24T10:58:56+00:00</updated>
<author>
<name>Pantelis Antoniou</name>
<email>panto@antoniou-consulting.com</email>
</author>
<published>2014-03-11T17:34:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=93bfd6167713a5cc1a78bcf60fa63f990fd3f4b3'/>
<id>93bfd6167713a5cc1a78bcf60fa63f990fd3f4b3</id>
<content type='text'>
The way that struct mmc was implemented was a bit of a mess;
configuration and internal state all jumbled up in a single structure.

On top of that the way initialization is done with mmc_register leads
to a lot of duplicated code in drivers.

Typically the initialization got something like this in every driver.

	struct mmc *mmc = malloc(sizeof(struct mmc));
	memset(mmc, 0, sizeof(struct mmc);
	/* fill in fields of mmc struct */
	/* store private data pointer */
	mmc_register(mmc);

By using the new mmc_create call one just passes an mmc config struct
and an optional private data pointer like this:

	struct mmc = mmc_create(&amp;cfg, priv);

All in tree drivers have been updated to the new form, and expect
mmc_register to go away before long.

Changes since v1:

* Use calloc instead of manually calling memset.
* Mark mmc_register as deprecated.

Signed-off-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The way that struct mmc was implemented was a bit of a mess;
configuration and internal state all jumbled up in a single structure.

On top of that the way initialization is done with mmc_register leads
to a lot of duplicated code in drivers.

Typically the initialization got something like this in every driver.

	struct mmc *mmc = malloc(sizeof(struct mmc));
	memset(mmc, 0, sizeof(struct mmc);
	/* fill in fields of mmc struct */
	/* store private data pointer */
	mmc_register(mmc);

By using the new mmc_create call one just passes an mmc config struct
and an optional private data pointer like this:

	struct mmc = mmc_create(&amp;cfg, priv);

All in tree drivers have been updated to the new form, and expect
mmc_register to go away before long.

Changes since v1:

* Use calloc instead of manually calling memset.
* Mark mmc_register as deprecated.

Signed-off-by: Pantelis Antoniou &lt;panto@antoniou-consulting.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
