summaryrefslogtreecommitdiff
path: root/cmd/mmc.c
Commit message (Collapse)AuthorAgeFilesLines
* common: command: Rework the 'cmd is repeatable' logicBoris Brezillon2019-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | The repeatable property is currently attached to the main command and sub-commands have no way to change the repeatable value (the ->repeatable field in sub-command entries is ignored). Replace the ->repeatable field by an extended ->cmd() hook (called ->cmd_rep()) which takes a new int pointer to store the repeatable cap of the command being executed. With this trick, we can let sub-commands decide whether they are repeatable or not. We also patch mmc and dtimg who are testing the ->repeatable field directly (they now use cmd_is_repeatable() instead), and fix the help entry manually since it doesn't use the U_BOOT_CMD() macro. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: mmc: Invalidate MMC block cache after initMarek Vasut2019-01-151-0/+6
| | | | | | | | | Make sure the block cache is cleared for the MMC device after it was reinitialized to avoid having any stale data in the cache, like e.g. partition tables or such. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* cmd: mmc: Force mmc reinit when no card presentMarek Vasut2019-01-151-0/+3
| | | | | | | | In case the card is removed, force-init the MMC to start the internal machinery which deregisters and invalidate the MMC device. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: Remove hwpartition help text when command is disabledAlex Kiernan2018-06-181-0/+2
| | | | | | | When the `mmc hwpartition` command is disabled, remove the associated help text. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* mmc: Separate "mmc swrite" from fastbootAlex Kiernan2018-05-301-6/+6
| | | | | | | | | | | | | | Introduce CONFIG_IMAGE_SPARSE and CONFIG_CMD_MMC_SWRITE so the "mmc swrite" command is separated from the fastboot code. Move image-sparse from common to lib so it's clear it's library code. Rename CONFIG_FASTBOOT_FLASH_FILLBUF_SIZE to CONFIG_IMAGE_SPARSE_FILLBUF_SIZE and migrate it to Kconfig. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* fastboot: Refactor fastboot_okay/fail to take responseAlex Kiernan2018-05-301-1/+1
| | | | | | | | | Add the response string as a parameter to fastboot_okay/fail, instead of modifying a global, to match the contract expected by the AOSP U-Boot code. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* Convert CONFIG_SUPPORT_EMMC_RPMB to KconfigAlex Kiernan2018-05-231-3/+3
| | | | | | | Convert CONFIG_SUPPORT_EMMC_RPMB to Kconfig. Split the command handling from the underlying support and expose this through CMD_MMC_RPMB. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* mmc: support writing sparse imagesJassi Brar2018-05-081-0/+73
| | | | | | | | | | | | | Provide an alternate path for sparse-images to be written to MMC. For example, via tftp on platforms that don't support fastboot protocol. Or when an image is to written at some offset, rather than the start of a partition. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> [trini: Guard with CONFIG_FASTBOOT_FLASH tests, use LBAF for lbaint_t printing] Signed-off-by: Tom Rini <trini@konsulko.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* mmc: remove hc_wp_grp_size from struct mmc if not neededJean-Jacques Hiblot2018-01-121-0/+2
| | | | | | | hc_wp_grp_size is needed only if hardware partitionning is used. On ARM removing it saves about 30 bytes of code space. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* mmc: compile out erase and write mmc commands if write operations are not ↵Jean-Jacques Hiblot2018-01-121-0/+8
| | | | | | | | | | enabled Also remove erase_grp_size and write_bl_len from struct mmc as they are not used anymore. On ARM, removing them saves about 100 bytes of code space in SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* mmc: make optional the support for eMMC hardware partitioningJean-Jacques Hiblot2018-01-121-0/+4
| | | | | | | Not all boards have an eMMC and not all users have a need for this. Allow to compile it out. By default it is still included. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* mmc: dump card and host capabilities if debug is enabledJean-Jacques Hiblot2018-01-121-0/+4
| | | | | | | | | This is a useful information while debugging the initialization process or performance issues. Also dump this information with the other mmc info if the verbose option is selected Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* cmd: mmc: display the mode name and current bus speed in the mmc infoJean-Jacques Hiblot2018-01-121-1/+2
| | | | | | | | Display the mode name when the user execute 'mmc info'. Also instead of displaying tran_speed, display the actual bus speed. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* blk: Remove various places that do flush cache after readBin Meng2017-09-151-2/+0
| | | | | | | | | | | | | | | | All these places seem to inherit the codes from the MMC driver where a FIXME was put in the comment. However the correct operation after read should be cache invalidate, not flush. The underlying drivers should be responsible for the cache operation. Remove these codes completely. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: York Sun <york.sun@nxp.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: York Sun <york.sun@nxp.com>
* cmd: mmc: add mmc partconf read capabilityAngelo Dureghello2017-08-171-6/+32
| | | | | | | | | | | | | | This patch allows to show the EXT_CSD[179] partition_config register info, just by specifying the dev param: U-Boot> mmc partconf 0 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x0 BOOT_PARTITION_ENABLE: 0x0 PARTITION_ACCESS: 0x0 Signed-off-by: Angelo Dureghello <angelo@sysam.it> Signed-off-by: Anatolij Gustschin <agust@denx.de>
* mmc: use new hwpart API when CONFIG_BLK enabledKever Yang2017-07-191-0/+4
| | | | | | | | | When CONFIG_BLK is enabled, the hwpart id is different with legacy interface, update it to kame driver work with CONFIG_BLK. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* cmd_mmc: fix arg parsing for setdsr subcmdMarkus Niebel2017-04-121-1/+1
| | | | | | | | | | | The handler do_setdsr receives only the dsr parameter, the action is parsed before. Error was introduced when restructuring the mmc command implementation in commit 1fd93c6e7d8a1e4d6261058cefab11b875ded252. Reported-by: Michael Krummsdorf <Michael.Krummsdorf@tq-group.com> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
* mmc: add bkops-enable commandTomas Melin2016-12-011-0/+32
| | | | | | | | | | | | Add new command that provides possibility to enable the background operations handshake functionality (BKOPS_EN, EXT_CSD byte [163]) on eMMC devices. This is an optional feature of eMMCs, the setting is write-once. The command must be explicitly taken into use with CONFIG_CMD_BKOPS_ENABLE. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
* mmc: Drop dead mmc code for non-generic MMCSimon Glass2016-05-261-62/+0
| | | | | | | All boards that use MMC define CONFIG_GENERIC_MMC now, so we can drop this old code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Move the device list into a separate fileSimon Glass2016-05-171-4/+4
| | | | | | | | | At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model, which needs to maintain this itself. Move the list code into a separate 'legacy' file. The core MMC code remains, and will be shared with the driver-model implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Use the new select_hwpart() APISimon Glass2016-05-171-3/+5
| | | | | | Avoid calling directly into the MMC code - use the new API call instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Drop the get_dev() functionSimon Glass2016-05-171-1/+1
| | | | | | This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* mmc: Fix error in RPMB codeMarek Vasut2016-05-051-1/+1
| | | | | | | | | | | | | | Since we do not build any board with CONFIG_SUPPORT_EMMC_RPMB , this piece of code evaded conversion. Fix the following compiler error: cmd/mmc.c: In function 'do_mmcrpmb': cmd/mmc.c:316:32: error: 'struct blk_desc' has no member named 'part_num' original_part = mmc->block_dev.part_num; ^ Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com>
* mmc: use block layer in mmc commandEric Nelson2016-04-011-3/+4
| | | | | | | | Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is used if enabled and to remove build breakage when CONFIG_BLK is enabled. Signed-off-by: Eric Nelson <eric@nelint.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* dm: part: Rename some partition functionsSimon Glass2016-03-141-1/+1
| | | | | | | | Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: Drop the block_dev_desc_t typedefSimon Glass2016-03-141-1/+1
| | | | | | | | | Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* Remove the cmd_ prefix from command filesSimon Glass2016-01-251-0/+882
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>