- Oct 06, 2017
-
-
Tom Rini authored
Coverity has found some problems with the return paths in parts of this code. We have a case where we were going to the wrong part of the unwind (open() failed so we cannot close the fd), a case where we were only free()ing our buf on the error path and finally a case where we did not munmap in the failure path. Reported-by: Coverity (CID: 138492, 138495, 143064) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Tom Rini authored
We cannot leave this uninitialized, set it to 0. Reported-by: Coverity (CID: 144426) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Tom Rini authored
For the initrd portion of handling our bootm arguments we do not have a sufficiently long enough buffer for some improbable 64bit cases. Expand this buffer to allow for a 64bit address and almost 256MB initrd to be used. Make use of strncpy/strncat when constructing the values here since we know what the worst case valid values are, length wise. Similarly for bootargs themselves, we need to make use of strlen/sizeof and strncpy/strncat to ensure that we don't overflow bootargs itself. Cc: Simon Glass <sjg@chromium.org> Cc: Alexander Graf <agraf@suse.de> Reported-by: Coverity (CID: 131256) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Tom Rini authored
When we have multiple messages provided, we need to be sure that we do not exceed the length of our 'message' buffer. In the for loop, make sure that pos is not larger than message. Only copy in at most however much of the message buffer remains. Finally, if we have not reached the end of the message buffer, put in a space and NULL, and if we have, ensure the buffer is now NULL termined. Reported-by: Coverity (CID: 165116) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Tom Rini authored
Coverity scan has identified potential buffer overruns in these tests. Correct this by zeroing our buffer and using strncpy not strcpy. Reported-by: Coverity (CID: 155462, 155463) Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Tom Rini authored
With the overlay tests now being built in sandbox Coverity has found a number of issues in the tests. In short, if malloc ever failed we would leak the previous mallocs, so we need to do the usual goto pattern to free each in turn. Finally, we always looked at the free()d location to see how many tests had failed for the return code. Reported-by: Coverity (CID: 167224, 167227, 167230, 167236) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Alison Chaiken authored
Create a common exit for most of the error handling code in do_rename_gpt_parts. Delete the list elements in disk_partitions before calling INIT_LIST_HEAD from get_gpt_info() a second time. The SIZEOF_MISMATCH error is not addressed, since that problem was already fixed by "GPT: incomplete initialization in allocate_disk_part". Signed-off-by:
Alison Chaiken <alison@peloton-tech.com> Reported-by: Coverity (CID: 167222, 167235, 167237) Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Tuomas Tynkkynen authored
The previous commit fixed a problem in FAT code where going back to the root directory using '..' wouldn't work correctly on FAT12 or FAT16. Add a test to exercise this case (which was once fixed in commit 18a10d46 "fat: handle paths that include ../" but reintroduced due to the directory iterator refactoring). This test only very barely catches the problem - without the fix the size command still gives valid output but the additional spurious "Invalid FAT entry" error message makes it not get caught in the 'egrep -A3 ' output. I tried to make a proper test that grows the root directory to two clusters lots of with dummy files but that causes the write tests to crash the sandbox totally... Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Tuomas Tynkkynen authored
If we end up back in the root directory via a '..' directory entry, set itr->is_root accordingly. Failing to do that gives spews like "Invalid FAT entry" and being unable to access directory entries located past the first cluster of the root directory. Fixes: 8eafae20 ("fat/fs: convert to directory iterators") Reviewed-by:
Tom Rini <trini@konsulko.com> Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
-
Tuomas Tynkkynen authored
Currently we can only test FAT32 which is the default FAT version that mkfs.vfat creates by default. Instead make it explicitly create either a FAT16 or a FAT32 volume. This allows us to exercise more code, for instance the root directory handling is done differently in FAT32 than the older FATs. Adding FAT12 support is a much bigger job since the test creates a 2.5GB file and the FAT12 maximum partition size is way smaller than that. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Tuomas Tynkkynen authored
The current code doesn't compute the group descriptor checksum correctly for the filesystems that e2fsprogs 1.43.4 creates (they have 'Group descriptor size: 64' as reported by tune2fs). Extend the checksum calculation to be done as ext4_group_desc_csum() does in Linux. This fixes these errors in dmesg from running fs-test.sh and makes it succeed again: [1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965) [1671902.620706] EXT4-fs (loop1): group descriptors corrupted! Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
-
Felix Brack authored
The regulator bindings state that regulator prefixes are allowd to be in upper or lower case. However pmic_bind_children from pmic_uclass uses strncmp to compare DT node name against prefix. This comparison is case sensitive hence the regulator driver prefix case matters. Signed-off-by:
Felix Brack <fb@ltec.ch>
-
Sam Protsenko authored
When eMMC was formattaed for Linux partition table, "userdata" partition is missing. In this case, part_get_info_by_name() iterates over all registered drivers (which are PART_TYPE_EFI, PART_TYPE_DOS and PART_TYPE_ISO). And when it comes to PART_TYPE_ISO (which has empty partition table), we can see next warning in U-Boot output: ** First descriptor is NOT a primary desc on 1:1 ** This patch switches to part_get_info_by_name_type() API in order to check only EFI partitions for "userdata" partitions. This eliminates mentioned warning. Signed-off-by:
Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Sam Protsenko authored
There is already existing function part_get_info_by_name(). But sometimes user is particularly interested in looking for only specific partition type. This patch implements such an API that provides partition searching by name for specified partition type. Signed-off-by:
Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Sam Protsenko authored
When using regular $partitions variable (for Linux boot), we can see some unwanted messages: > ERROR: cannot find partition: 'userdata' > at arch/arm/mach-omap2/utils.c:96/omap_mmc_get_part_size() > Warning: fastboot.userdata_size: unable to calc Let's remove those, as missing 'userdata' partition is correct behavior for Linux partition, and we don't want to see some Android-related messages in this case. Signed-off-by:
Sam Protsenko <semen.protsenko@linaro.org>
-
Tuomas Tynkkynen authored
Note that this commit requires https://github.com/swarren/uboot-test-hooks/pull/14 to go in first. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
-
Tuomas Tynkkynen authored
This board builds an U-Boot binary that is bootable with QEMU's 'virt' machine on ARM. The minimal QEMU command line is: qemu-system-arm -machine virt,highmem=off -bios u-boot.bin (Note that the 'highmem=off' parameter to the 'virt' machine is required for PCI to work in U-Boot.) This command line enables the following: - u-boot.bin loaded and executing in the emulated flash at address 0x0 - A generated device tree blob placed at the start of RAM - A freely configurable amount of RAM, described by the DTB - A PL011 serial port, discoverable via the DTB - An ARMv7 architected timer - PSCI for rebooting the system - A generic ECAM-based PCI host controller, discoverable via the DTB Additionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus. The following ones are supported by both U-Boot and Linux: - To add a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.: -drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0 - To add an Intel E1000 network adapter, pass e.g.: -net nic,model=e1000 -net user - To add an EHCI-compliant USB host controller, pass e.g.: -device usb-ehci,id=ehci - To add a NVMe disk, pass e.g.: -drive if=none,file=disk.img,id=mydisk -device nvme,drive=mydisk,serial=foo Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
-
Tuomas Tynkkynen authored
QEMU emulates such a device with '-machine virt,highmem=off' on ARM. The 'highmem=off' part is required for things to work as the PCI code in U-Boot doesn't seem to support 64-bit BARs. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Tuomas Tynkkynen authored
Use the new helpers to avoid boilerplate in the driver. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Tuomas Tynkkynen authored
Use the new helper function to avoid boilerplate in the driver. Note that this changes __raw_writel et al. to writel. AFAICT this is no problem because: - The Linux driver for the same hardware uses the non-__raw variants as well (via pci_generic_config_write()). - This driver seems to be used only on MIPS so far, where the __raw and non-__raw accessors are the same. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Tuomas Tynkkynen authored
This sort of pattern for implementing memory-mapped PCI config space accesses appears in U-Boot twice already, and a third user is coming up. So add helper functions to avoid code duplication, similar to how Linux has pci_generic_config_write and pci_generic_config_read. Signed-off-by:
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
Jean-Jacques Hiblot authored
In order to be able to select the right DTB, we need to have identified the board before spl_early_init() is called. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
u-boot can be embedded within a FIT image with multiple DTBs. It then selects at run-time which one is best suited for the platform. Use the same principle here for the SPL: put the DTBs in a FIT image, compress it (LZO, GZIP, or no compression) and append it at the end of the SPL. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> [trini: Move default y of SPL_MULTI_DTB_FIT_DYN_ALLOC to it being the default choice if SYS_MALLOC_F, drop spl.h include from lib/fdtdec.c it's unused.] Signed-off-by Tom Rini <trini@konsulko.com>
-
Jean-Jacques Hiblot authored
Sort include files in accordance to U-Boot coding style. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com>
-
Jean-Jacques Hiblot authored
Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
If board_fit_config_name_match() doesn't match any configuration node, then use the default one (if provided). Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
If the dtb is the first data of the FIT, the its offset is 0x0. Change the test to '<' instead of '<=' Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
Those 2 functions don't modify their input, we can mark it const. This prevents compilation warnings when they are provided const input. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Jean-Jacques Hiblot authored
CONFIG_FIT_EMBED might be confused with CONFIG_OF_EMBED, rename it MULTI_DTB_FIT as it is able to get a DTB from a FIT image containing multiple DTBs. Also move the option to the Kconfig dedicated to the DTS options and create a README for this feature. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Masahiro Yamada authored
These macros are useful to avoid link error on 32-bit systems. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Oct 05, 2017
-
-
Fabio Estevam authored
Since commit ff98cb90 ("part: extract MBR signature from partitions") SPL boot on i.MX6 starts to fail: U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19) Trying to boot from MMC1 (keep in loop) Use the original allocation scheme for the SPL case, so that MX6 boards can boot again. This is a temporary solution to avoid the boot regression. Signed-off-by:
Fabio Estevam <fabio.estevam@nxp.com> Acked-by:
Rob Clark <robdclark@gmail.com> Tested-by:
Peter Robinson <pbrobinson@gmail.com>
-
git://git.denx.de/u-boot-sunxiTom Rini authored
-
Tom Rini authored
While this came in with a default value of 6 I am lowering this to 4. The MTD/UBI code has a large number of error messages that we include now. In addition, "normally" warning messages are not included so this feels like a more natural level to have. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Oct 04, 2017
-
-
Masahiro Yamada authored
As we discussed before in ML, dm_dbg() causes undefined reference error if #define DEBUG is added to users, but not drivers/core/util.c We do not need this macro because we can use pr_debug() instead, and it is pretty easy to enable it for the DM core by using ccflags-y. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Copied from Linux 4.13. Commit log of 3e9b3112ec74 of Linux explains well why this header is useful. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Many drivers had started to use dev_err, dev_info, etc. for log functions. Currently, we are relying on <linux/compat.h>, but I guess the best home is <dm/device.h>, taking into account that Linux defines them in <linux/device.h>. For now, I am leaving the ones in <linux/compat.h> because lots of Linux-originated code uses dev_*(), but the first argument is not struct udevice, so we need to ignore the bogus argument. More efforts are needed to iron out the issues. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Masahiro Yamada authored
Collect runtime BUG/WARN into a self-contained header <linux/bug.h> to make these macros easier to use. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
As commit 84b8bf6d ("bug.h: move BUILD_BUG_* defines to include/linux/bug.h") noted, include/linux/bug.h was locally modified for U-Boot because the name conflict of error() caused build errors at that time. Now error() is gone, so we can fully sync BUILD_BUG* with Linux. These macros are just compile-time utilities. Nothing depends on platform code, so it should make sense to simply copy Linux's ones. Please note Linux split BUILD_BUG stuff out into <linux/build_bug.h> by commit bc6245e5efd7. Let's follow it. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-