summaryrefslogtreecommitdiff
path: root/cmd/ubi.c
AgeCommit message (Collapse)AuthorFilesLines
2018-11-22cmd: ubi: Make ubi_detach() staticStefan Roese1-4/+1
Its only called from this file, so make it static. While at it, remove some occurances of multiple blank lines as well. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Boris Brezillon <boris.brezillon@bootlin.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-11-13cmd: ubi: Remove useless call to mtdparts_init()Boris Brezillon1-5/+0
Commit c58fb2cdb3e4 ("cmd: ubi: clean the partition handling") introduced a call to mtd_probe_devices() in the ubi_attach() path and this function takes care of parsing mtdparts/mtdids and creating/registering the associated mtd partitions. The mtdparts_init() call in the ubi_detach() path is not only unnecessary but can sometimes print error messages even when things work properly (that's the case with SPI NAND devices that have not been probed with 'mtd list'), which is misleading. Remove this call to mtdparts_init() and drop the dependency on CMD_MTDPARTS. Fixes: c58fb2cdb3e4 ("cmd: ubi: clean the partition handling") Reported-by: Stefan Roese <sr@denx.de> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Stefan Roese <sr@denx.de> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-10-02Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini1-76/+25
This is the PR for SPI-NAND changes along with few spi changes. [trini: Re-sync changes for ls1012afrwy_qspi*_defconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-10-02cmd: ubi: clean the partition handlingMiquel Raynal1-71/+25
UBI should not mess with MTD partitions, now that the partitions are handled in a clean way, clean the ubi command and avoid using this uneeded extra-glue to reference the devices. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
2018-09-28cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()Tien Fong Chee1-2/+1
cmd_ubifs_umount() function would be called directly instead of involving whole command machinery in generic firmware loader, so checking on ubifs_initialized status need to be done in cmd_ubifs_umount() without breaking original functionality design. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de> [trini: Fix conflicting type error in cmd/ubi.c] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-09-20cmd: ubi: delete useless and misleading definitionsMiquel Raynal1-5/+0
These definitions are simply not used and are misleading because similar definitions exist in jffs2/load_kernel.h and are used widely to define MTD device types (which is, by the way, totally redundant with what the MTD core does). Remove these definitions. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
2018-07-26cmd/ubi.c: Fix format warningTom Rini1-1/+1
On 64bit platforms we would otherwise see: ../cmd/ubi.c: In function 'ubi_volume_read': ../cmd/ubi.c:359:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=] Fixes: 68c7025d99db ("cmd: ubi: print load size after establishing volume size") Signed-off-by: Tom Rini <trini@konsulko.com>
2018-07-12cmd: ubi: Add additional message upon UBI attach errorStefan Roese1-0/+1
When trying to attach an UBI MTD partition via "ubi part", it may happen that the MTD partition defined in U-Boot (via mtdparts) is not big enough than the one, where the UBI device has been created on. This may lead to errors, which are not really descriptive to debug and solve this issue, like: ubi0 error: vtbl_check: too large reserved_pebs 1982, good PEBs 1020 ubi0 error: vtbl_check: volume table check failed: record 0, error 9 or: ubi0 error: init_volumes: not enough PEBs, required 1738, available 1020 ubi0 error: ubi_wl_init: no enough physical eraseblocks (-718, need 1) ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 Lets add an additional message upon attach failure, to aid the U-Boot user to solve this problem. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Heiko Schocher <hs@denx.de>
2018-07-12cmd: ubi: print load size after establishing volume sizeStefan Agner1-3/+2
When using static volumes, the file size stored in the volume is determined at runtime. Currently the ubi command prints the file size specified on the console, which leads to a rather confusing series of messages: # ubi read ${fdt_addr_r} testvol Read 0 bytes from volume testvol to 82000000 No size specified -> Using max size (179924992) Make sure to print the actual size read in any case: # ubi read ${fdt_addr_r} testvol No size specified -> Using max size (179924992) Read 179924992 bytes from volume testvol to 82000000 Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-09-12cmd: set filesize variable in ubi readHolger Dengler1-0/+5
After a successful read of a UBI volume, the variable filesize is set to the number of read bytes. To boot linux with a raw initramfs/initrd, you must specify the exact size of the initramfs/initrd image in boot command. If the initramfs/inird is read from UBI volume, $filesize is required to access the number of read bytes. Example: ubi read ${loadaddr} kernelvol ubi read ${fdtaddr} dtbvol ubi read ${initrd_addr} initrdvol bootz ${loadaddr} ${initrd_addr}:${filesize} ${fdt_addr} Signed-off-by: Holger Dengler <dengler@linutronix.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2017-04-18cmd: ubi: remove unnecessary logical constraintxypron.glpk@gmx.de1-1/+1
A size_t variable can never be negative. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2017-01-26cmd: ubi: allow '-' to specify maximum volume sizeLadislav Michl1-3/+5
Currently maximum volume size can be specified only if no other arguments are used. Use '-' placeholder as volume size to allow maximum volume size to be specified together with volume id and type. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-09-27cmd: ubi: add option to specify volume idLadislav Michl1-4/+11
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-09-23treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada1-1/+1
Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have the same content. (both just wrap <asm-generic/errno.h>) Replace all include directives for <asm/errno.h> with <linux/errno.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Fixup include/clk.] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-06-09ubi: add new ubi command "ubi detach"Heiko Schocher1-11/+27
simple detachs ubi from the mtd partition. Signed-off-by: Heiko Schocher <hs@denx.de>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass1-0/+685
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>