summaryrefslogtreecommitdiff
path: root/cmd/part.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-14cmd: part: Extract common code to separate functionSam Protsenko1-38/+23
Refactor the code for "part start" and "part size" commands to avoid code duplication. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-03-14cmd: part: Allow passing partition name to start and sizeSam Protsenko1-11/+25
Allow passing the partition name to "part start" and "part size" commands, so we can avoid magic numbers in the environment. Consider one real use-case: in include/environment/ti/boot.h we have commands like these: setenv boot_part 9 part start mmc ${mmcdev} ${boot_part} boot_start part size mmc ${mmcdev} ${boot_part} boot_size mmc read ${loadaddr} ${boot_start} ${boot_size} Now suppose that we have changed the partition table and boot_part now is 10. We will need to fix commands above. And anyone who relies on these boot commands, will need to change them accordingly, too (this was an actual case in our lab while testing Linux boot on Android environment). By providing the option to pass partition name instead, we fix mentioned issue, by eliminating the necessity to use magic numbers. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2017-08-16env: Rename setenv() to env_set()Simon Glass1-4/+4
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-28cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPTPatrick Delaunay1-4/+0
We convert CONFIG_PARTITION_UUIDS to Kconfig first. But in order to cleanly update all of the config files we must also update CMD_PART and CMD_GPT to also be in Kconfig in order to avoid complex logic elsewhere to update all of the config files. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-03-15dm: part: Rename some partition functionsSimon Glass1-4/+4
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>
2016-03-15dm: blk: Rename get_device_and_partition()Simon Glass1-1/+1
Rename this function to blk_get_device_part_str(). This is a better name because it makes it clear that the function returns a block device and parses a string. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-15dm: blk: Rename get_device() to blk_get_device_by_str()Simon Glass1-3/+3
The current name is too generic. The function returns a block device based on a provided string. Rename it to aid searching and make its purpose clearer. Also add a few comments. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-15dm: Drop the block_dev_desc_t typedefSimon Glass1-4/+4
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>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass1-0/+216
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>