summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-08fs: btrfs: Imeplement btrfs_list_subvols() using new infrastructureQu Wenruo1-5/+73
Reimplement btrfs_list_subvols() to use new code. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Introduce function to resolve the path of one subvolumeQu Wenruo1-0/+81
This patch introduces a new function, list_one_subvol(), which will resolve the path to FS_TREE of one subvolume. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Introduce function to resolve path in one subvolumeQu Wenruo2-1/+68
This patch introduces a new function, get_path_in_subvolume(), which resolves inode number into path inside a subvolume. This function will be later used for btrfs subvolume list functionality. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Implement btrfs_file_read()Qu Wenruo3-20/+176
This version of btrfs_file_read() has the following new features: - Tries all mirrors - More handling on unaligned size - Better compressed extent handling The old implementation doesn't handle compressed extent with offset properly: we need to read out the whole compressed extent, then decompress the whole extent, and only then copy the requested part. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Introduce lookup_data_extent() for later useQu Wenruo1-0/+101
This implements lookup_data_extent() function for the incoming new implementation of btrfs_file_read(). Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Introduce btrfs_read_extent_inline() and btrfs_read_extent_reg()Qu Wenruo4-0/+205
These two functions are used to do sector aligned read, which will be later used to implement btrfs_file_read(). Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Rename btrfs_file_read() and its callees to avoid name conflictsQu Wenruo4-9/+9
Rename btrfs_file_read() and its callees to avoid name conflicts with the incoming new code. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Use btrfs_lookup_path() to implement btrfs_exists() and btrfs_size()Qu Wenruo1-17/+48
After this the only remaining function that still utilizes __btrfs_lookup_path() is btrfs_read(). Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Use btrfs_iter_dir() to replace btrfs_readdir()Qu Wenruo4-91/+144
Use extent buffer based infrastructure to re-implement btrfs_readdir(). Along this rework, some small corner cases fixed: - Subvolume tree mtime Mtime of a subvolume tree is recorded in its root item, since there is no INODE_ITEM for it. This needs extra search from tree root. - Output the unknown type If the DIR_ITEM is corrupted, at least don't try to access the memory out of boundary. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Implement btrfs_lookup_path()Qu Wenruo3-0/+360
This is the extent buffer based path lookup routine. To implement this, btrfs_lookup_dir_item() is crossported from btrfs-progs, and implements btrfs_lookup_path() from scratch. Unlike the existing __btrfs_lookup_path(), since btrfs_read_fs_root() will check whether a root is a orphan at read time, there is no need to check root backref, this makes the code a little easier to read. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: inode: Allow next_length() to return value > BTRFS_NAME_LENQu Wenruo1-2/+6
All existing next_length() caller handles return value > BTRFS_NAME_LEN, so there is no need to do BTRFS_NAME_LEN check in next_length(). But still, we want to exit early if we're beyond BTRFS_NAME_LEN, so this patch makes next_length() exit as soon as we're beyond BTRFS_NAME_LEN. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Use btrfs_readlink() to implement __btrfs_readlink()Qu Wenruo2-37/+65
The existing __btrfs_readlink() can be easily re-implemented using the extent buffer based btrfs_readlink(). This is the first step to re-implement U-Boot's btrfs code. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Rename path resolve related functions to avoid name conflictsQu Wenruo7-33/+43
Since the old code is using __btrfs_path/__btrfs_root which is different from the regular extent buffer based one, we add "__" prefix for the old implementation to avoid name conflicts for the incoming crossport. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progsQu Wenruo8-20/+579
open_ctree_fs_info() is the main entry point to open btrfs. This version is a simplfied version of __open_ctree_fd() of btrfs-progs, the main differences are: - Parameters on how to specify a block device Instead of @fd and @path, U-Boot uses blk_desc and disk_partition_t. - Remove open_ctree flags There won't be multiple open ctree modes in U-Boot. Otherwise functions structures are all kept the same. With open_ctree_fs_info() implemented, also introduce the global current_fs_info pointer to show the current opened btrfs. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport btrfs_read_sys_array() and btrfs_read_chunk_tree()Qu Wenruo5-3/+306
These two functions play a big role in btrfs bootstrap. The following function is removed: - Seed device support Although in theory we can still support multiple devices, we don't have a facility in U-Boot to do device scan without opening them. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport btrfs_search_slot() from btrfs-progsQu Wenruo2-7/+591
This patch copies the core function, btrfs_search_slot(), from btrfs-progs. This version has the following functionality removed: - The ability to COW tree block Related code is commented out, and can be enabled in the future. - The readahead functionality This is abused in kernel. Remove it completely. With the core function in place, btrfs developers should feel at home now. This also crossports supporting code like btrfs_previous_item() to ctree.[ch]. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport struct btrfs_root to ctree.hQu Wenruo1-0/+17
Crossport struct btrfs_root to ctree.h from btrfs-progs, with write related members deleted. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Rename btrfs_root to __btrfs_rootQu Wenruo8-34/+34
This is to avoid naming conflicts between extent buffer based btrfs_root. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Rename struct btrfs_path to struct __btrfs_pathQu Wenruo9-44/+44
To avoid name conflicting between the extent buffer based btrfs_path from btrfs-progs, rename struct btrfs_path to struct __btrfs_path. Also rename btrfs_free_path() to __btrfs_free_path() to avoid conflicts. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport read_tree_block() from btrfs-progsQu Wenruo5-8/+602
This is the one of the basic stone function for btrfs, which: - Resolves the chunk mappings - Reads data from disk - Does various sanity check With read_tree_block(), we can finally crossport needed btrfs btree operations to U-Boot. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport volumes.[ch] from btrfs-progsQu Wenruo5-1/+1081
This patch crossports volumes.[ch] from btrfs-progs, including: - btrfs_map_block() The core mechanism to map btrfs logical address to physical address. This version includes multi-device support, along with RAID56 support. - btrfs_scan_one_device() This is the function to register one btrfs device to the list. This is the main part of the multi-device btrfs assembling process. Although we're not going to support multiple devices until U-Boot allows us to scan one device without actually opening it. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz> [trini: Use %zu in a debug print to avoid warning] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-09-08fs: btrfs: Crossport structure accessor into ctree.hQu Wenruo3-95/+1064
This brings all structure accessors from btrfs-progs/ctree.h, as in kernel's ctree.h. All these accessors handle the endian convert at runtime, and since all of them are defined as static inline functions, those which aren't used won't take space in resulting binary. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport extent-io.[ch] from btrfs-progsQu Wenruo3-1/+1019
This brings the extent_io_tree infrastructure, with which we can finally bring in proper btrfs_fs_info structure to ctree.h. With read/write_extent_buffer() implemented we also backport read/write_eb_member() to ctree.h. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport extent-cache.[ch] from btrfs-progsQu Wenruo2-0/+422
This patch implements an infrastructure to insert/search/merge an extent range (with variable length). This provides the basis for later extent buffer cache used in btrfs. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport rbtree-utils from btrfs-progsQu Wenruo3-1/+138
This is needed for incoming extent-cache infrastructure. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Crossport btrfs_read_dev_super() from btrfs-progsQu Wenruo8-259/+378
This patch uses generic code from btrfs-progs to read one super block from block device. To support the btrfs-progs coding style, the following is also crossported: - BTRFS_SETGET_FUNC for btrfs_super_block - btrfs_check_super() function - Move btrfs_read_superblock() to disk-io.[ch] Since super.c only contains pretty small amount of code, and the extra check will be covered in later root read patches. Differences between this implementation and btrfs-progs: - No sbflags/sb_bytenr support Since we only need to read the primary super block (like kernel), sbflags/sb_bytenr used by super block recovery is not needed. This also changes the following behavior of U-Boot btrfs: - Only reads the primary super block The old implementation reads all 3 super blocks, and also one non-existing backup. This is not correct, especially if there is another filesystem created on the device but old superblocks are not rewritten. Just like kernel, we only check the primary super block. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz> [trini: Change error to be a define in compat.h] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-09-08fs: btrfs: Add more checksum algorithmsQu Wenruo10-62/+130
This mostly crossports crypto/hash.[ch] from btrfs-progs. The differences are: - No blake2 support No blake2 related library in U-Boot yet. - Use uboot xxhash/sha256 directly No need to implement the code as U-Boot has already provided the interface. This adds the support for the following csums: - SHA256 - XXHASH Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-08fs: btrfs: Sync btrfs_btree.h from kernelQu Wenruo7-982/+1343
This version includes all needed on-disk format from kernel. Only need to modify the include headers for U-Boot, everything else is untouched. Also, since U-Boot btrfs is using a different endian convert timing (at tree block read time), it needs some forced type conversion before proper crossport. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-09-07Merge branch 'remove-config-nr-dram-banks-v9-2020-08-26' of ↵Tom Rini37-142/+41
https://gitlab.denx.de/u-boot/custodians/u-boot-marvell into next
2020-09-07Prepare v2020.10-rc4Tom Rini1-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>
2020-09-07configs: Resync with savedefconfigTom Rini12-17/+5
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2020-09-07Merge tag 'efi-2020-10-rc4' of ↵Tom Rini8-69/+75
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc4 Bug fixes are provided in the following areas: * convert file system debug and print messages go log messages * convert UEFI booting messages to log messages * UEFI related code clean up and simplification
2020-09-06efi_selftest: simplify MakefileHeinrich Schuchardt1-6/+0
CONFIG_EFI_LOADER cannot be selected for ARMv7-M CPUs. So don't check it in the Makefile. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06efi_loader: remove duplicate image size checkHeinrich Schuchardt1-4/+0
The image size is checked in efi_load_pe(). Avoid checking it twice. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06efi: clean up efi commandHeinrich Schuchardt2-18/+22
* Eliminate superfluous enum value EFI_TABLE_END. * Use correct variable type for the memory type. * Check validity of memory type. * Make efi_build_mem_table static. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06efi_loader: error message if image not authenticatedHeinrich Schuchardt1-2/+4
Currently if the bootefi command fails due to missing authentication, the user gets no feedback. Write a log message 'Image not authenticated' if LoadImage() fails due to missing authentication. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06efi_loader: log function in image loaderHeinrich Schuchardt1-22/+22
Use log_err() for error messages. Replace debug() by EFI_PRINT(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06efi_loader: log messages for bootefi commandHeinrich Schuchardt1-3/+9
Write log messages when booting via the bootefi command to allow tracking on the syslog server. Example messages are Booting /snp.efi or Booting /MemoryMapped(0x0,0x4fe00000,0x35a40) Loading image failed Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-06fs: convert error and debug messages to logHeinrich Schuchardt2-14/+18
Use log functions for error and debug messages of the file-system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-09-04Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini2-19/+16
- Fix SATA issue on Armada 3720 - Enable more SPI NOR chips in espressobin defconfig
2020-09-04defconfig: espressobin: Add support for ISSI SPI flashesKonstantin Porotchkin1-0/+1
Enable support of ISSI SPI flashes found on EspressoBIN boards Change-Id: I6de61c48f108fb4f410f321b9db45887d23212e5 Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/61455 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com> Reviewed-by: Stefan Chulski <stefanc@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-09-04defconfig: espressobin: Include support for Gigadevice SPIKonstantin Porotchkin1-0/+1
Include support for CONFIG_SPI_FLASH_GIGADEVICE for supporting newly produces EspressoBin boards (v7) Change-Id: I5d4b972cbe2ee5a9d52ce9908794ad4e1b59ee3b Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/61236 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Igal Liberman <igall@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-09-04phy: marvell: a3700: add sata comphy on lane 2 with invert optionzachary1-19/+14
- This patch moves sata phy powerup from dedicate phy to compphy and adds invert option for sata powerup routine. Change-Id: I1b4e8753e2b2c14c6efa97bca2ffc7d2553d8a90 Signed-off-by: zachary <zhangzg@marvell.com> Signed-off-by: Ken Ma <make@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/53601 Reviewed-by: Igal Liberman <igall@marvell.com> Tested-by: Igal Liberman <igall@marvell.com> [a.heider: adapt to mainline] Signed-off-by: Andre Heider <a.heider@gmail.com> Tested-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-09-03Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini39-101/+1867
- Mostly DFU fixes and r8152 fixes
2020-09-03Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini1-1/+4
- SH serial bugfix
2020-09-03Merge branch 'for-tom' of https://github.com/lftan/u-bootTom Rini3-9/+20
- SoCFPGA bugfix
2020-09-03arm: socfpga: soc64: Check FPGA Config status register before bridge resetChee Hong Ang3-9/+20
Instead of querying SDM for FPGA configuration status through mailbox messages, U-Boot now checks System Manager's FPGA Config status register for FPGA configuration status before resetting bridge. Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com> Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
2020-09-02Azure/GitLab: Update to latest Docker containerTom Rini2-2/+2
- New base snapshot - Fix for high UID/GID numbers on a toolchain Signed-off-by: Tom Rini <trini@konsulko.com>
2020-09-01Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini37-145/+26
- Fix parsing of "mtrr list" command - Introduce USE_EARLY_BOARD_INIT option and remove dead codes for most x86 boards
2020-09-01fastboot: getvar: fix partition-size return valueGary Bisson1-2/+2
The size returned by 'getvar partition-size' should be in bytes, not in blocks as fastboot uses that value to generate empty partition when running format [1]. Note that the function was already returning the proper size in bytes for NAND devices (see struct part_info details). [1] https://android.googlesource.com/platform/system/core/+/refs/heads/android10-release/fastboot/fastboot.cpp#1500 Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>