summaryrefslogtreecommitdiff
path: root/api/api_storage.c
Commit message (Collapse)AuthorAgeFilesLines
* Convert CONFIG_SYS_MMC_MAX_DEVICE to KconfigTom Rini2022-11-101-4/+0
| | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_MMC_MAX_DEVICE Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* scsi: Drop CONFIG_SYS_SCSI_MAX_DEVICESimon Glass2022-02-091-1/+2
| | | | | | | | | | | | | | This is defined based on two other CONFIGs for all boards except sandbox and durian. For sandbox the value does not matter. For durian the value seems excessive. Drop the option completely, to simplify configuration and reduce the number of things we need to convert to Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
* common: Drop part.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* api: storage: Add the missing write operation supportCristian Ciocaltea2019-11-071-0/+24
| | | | | | | | | | | | API_dev_write(va_list ap) is currently lacking the write support to storage devices because, historically, those devices did not implement block_write() The solution has been tested by loading and booting a (patched) GRUB instance in a QEMU vexpress-a9 environment. The disk write operations were triggered with GRUB's save_env command. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
* api: storage: Fix enumeration of storage devicesCristian Ciocaltea2018-12-261-0/+5
| | | | | | | | | | | | | | | dev_stor_get() is not able to find the next available device in the current storage group when the previous enumerated device belongs to a different group or class (e.g. network). The root cause is the device group iterator not being reset after an unsuccessful search for the last returned device so that the following search for the next available device will start from beginning. The issue has been identified by loading and booting GRUB in a QEMU vexpress-a9 environment. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@iquestgroup.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>
* Kconfig: Add CONFIG_SATA to enable SATASimon Glass2017-07-111-1/+1
| | | | | | | | | At present CONFIG_CMD_SATA enables the 'sata' command which also brings in SATA support. Some boards may wish to enable SATA without the command. Add a separate CONFIG to permit this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* api: Define a default mmc max deviceEmmanuel Vadot2017-06-231-0/+3
| | | | | | | | Define a default number of 1 for mmc max device if board config didn't specify one. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Kconfig: Add a CONFIG_IDE optionSimon Glass2017-05-221-1/+1
| | | | | | | | | | | At present IDE support is controlled by CONFIG_CMD_IDE. Add a separate CONFIG_IDE option so that IDE support can be enabled without requiring the 'ide' command. Update existing users and move the ide driver into drivers/block since it should not be in common/. Signed-off-by: Simon Glass <sjg@chromium.org>
* Apparent conflict between CONFIG_BLK and CONFIG_APIfuz@fuz.su2017-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Good evening, I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure: $ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all ... CC api/api_storage.o api/api_storage.c: In function 'dev_read_stor': api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read' if ((dd->block_read) == NULL) { ^~ api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read' return dd->block_read(dd, start, len, buf); ^~ api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1 gmake[1]: *** [Makefile:1229: api] Fehler 2 gmake: *** [Makefile:460: __build_one_by_one] Error 2 I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though: Yours, Robert Clausecker
* api: storage: Test all block device in dev_stor_getEmmanuel Vadot2017-01-201-64/+34
| | | | | | | | | | | In a config with one MMC at device id '1' and no MMC at device id '0' (a BeagleBone Black with no sd inserted for example), the current code will first test to access the MMC 0 (sd port), seeing that no device is present it will simply return that no more device are present for this class. This patch fixes this by testing all devices for each class. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
* Cosmetic api: api_storage.c Spelling correctionWalt Feasel2016-12-041-1/+1
| | | | | | Make spelling correction for 'from' Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
* Cosmetic api: api_storage.c Comment styleWalt Feasel2016-12-041-15/+17
| | | | | | Make comment style modifications Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
* Cosmetic api: api_storage.c Line over 80 charWalt Feasel2016-12-041-1/+1
| | | | | | | Make checkpatch style modification for WARNING: line over 80 characters Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
* Cosmetic api: api_storage.c Blank line after {Walt Feasel2016-12-041-3/+0
| | | | | | | | Make checkpatch style modification for CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
* Cosmetic api: api_storage.c Align parenthesisWalt Feasel2016-12-041-1/+1
| | | | | | | Make checkpatch style modification for CHECK: Alignment should match open parenthesis Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
* api: storage: Avoid enumeration for non-configured subsystemEmmanuel Vadot2016-10-241-1/+5
| | | | | | If a subsystem wasn't configured, avoid enumeration. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
* dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSISimon Glass2016-05-171-1/+1
| | | | | | | | This option currently enables both the command and the SCSI functionality. Rename the existing option to CONFIG_SCSI since most of the code relates to the feature. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: blk: Rename get_dev() to blk_get_dev()Simon Glass2016-03-141-5/+7
| | | | | | | | | The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: Drop the block_dev_desc_t typedefSimon Glass2016-03-141-7/+7
| | | | | | | | | 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>
* block: pass block dev not num to read/write/erase()Stephen Warren2016-01-131-14/+1
| | | | | | | | | | | This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* api_storage: Fix non-first storage device enumerationAndreas Färber2015-09-151-0/+5
| | | | | | | | | | | | | | When enabling CONFIG_API and chain-loading GRUB2 on jetson-tk1, only the eMMC would show up as (hd0), but not the SD card, leading to GRUB not finding its configuration and modules, falling back to a rescue shell. This is because enum_ended would get set for !more after returning a cookie for the first MMC device in group 3. Fix this by properly setting the "more" argument also in the case of the first storage device of a group. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-18/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* api: remove un-needed ifdef CONFIG_API already handle by the MakefileJean-Christophe PLAGNIOL-VILLARD2009-05-151-5/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-181-4/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* api: Fix building with CONFIG_APIMatthias Fuchs2008-10-141-0/+4
| | | | | | | | | This patch fixes building with CONFIG_API and CONFIG_USB_STORAGE. USB_MAX_STOR_DEV is defined in include/usb.h, but needed in api/api_storage.c. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
* Fix merge problemsStefan Roese2008-08-061-12/+33
| | | | Signed-off-by: Stefan Roese <sr@denx.de>
* Fix remaining CONFIG_COMMANDSJean-Christophe PLAGNIOL-VILLARD2008-02-141-3/+3
| | | | | | | update comments Fix coding style Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* API for external applications.Rafal Jaworowski2008-01-091-0/+370
This is an API for external (standalone) applications running on top of U-Boot, and is meant to be more extensible and robust than the existing jumptable mechanism. It is similar to UNIX syscall approach. See api/README for more details. Included is the demo application using this new framework (api_examples). Please note this is still an experimental feature, and is turned off by default. Signed-off-by: Rafal Jaworowski <raj@semihalf.com>