dfu_prepare_function() allocates N+1 descriptor header structures,
the last one being the "DFU Functional Descriptor".
dfu_unbind() handles de-allocation, but fails to free the final
one (eg. "DFU Functional Descriptor"), leading to memory leak.
Fixed by incrementing counter, as in dfu_prepare_function().
Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Registration of USB download gadget might fail for various reasons, so
add a check for g_dnl_register() funtion return value. Without this fix,
thor_init() will try to access the registered gadget structures resulting
in NULL pointer dereference issue.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
"slot-suffixes" variable was dropped in fastboot tool (in [1]). Let's
track AOSP/master and drop this variable in U-Boot as well.
[1] 42b18a518b
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
[lukma: Remove getvar_slot_suffixes() declaration]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
commit 57faca19a8 ("drivers: USB: OHCI: allow compilation for 64-bit targets")
broke ohci support for the mpc85xx based socrates board,
as it removed volatile keyword from ohci_readl/writel.
Fix this so usb works again on socrates board.
Signed-off-by: Heiko Schocher <hs@denx.de>
var ohci_pci_ids is only used if DM_USB is not enabled.
So define this varaible only if
!CONFIG_IS_ENABLED(DM_USB)
Signed-off-by: Heiko Schocher <hs@denx.de>
This patch will enable the MUSB driver to support mass storage
devices connected to the OTG port in host mode.
Signed-off-by: Adam Ford <aford173@gmail.com>
With the recently added phy driver, this patch will enable the
musb driver on the da8xx to operate in host mode.
Signed-off-by: Adam Ford <aford173@gmail.com>
In preparation for supporting the musb driver, this patch
adds support for the usb phy associated with the musb driver.
Signed-off-by: Adam Ford <aford173@gmail.com>
This takes the latest changes from AOSP from the file
include/bootimg/bootimg.h from the repository:
https://android.googlesource.com/platform/system/tools/mkbootimg
and update the U-Boot version with the latest changes.
This file keeps the changes from AOSP to a minimum:
* Comments were converted from C++ to C style.
* Code inside __cplusplus #ifdef blocks were removed.
* C++11 struct extensions replaced with a single struct.
Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
The Linux ramdisk should always be decompressed by the kernel itself,
not by U-Boot. Therefore, the 'compression' node in the FIT image should
always be set to "none" for ramdisk images, since the only point of
using that node is if you want U-Boot to do the decompression itself.
Yet some systems populate the node to the compression algorithm used by
the kernel instead. This used to be ignored, but now that we support
decompression of all image types it becomes a problem. Since ramdisks
should never be decompressed by U-Boot anyway, this patch adds a special
exception for them to avoid these issues. Still, setting the
'compression' node like that is wrong in the first place, so we still
want to print out a warning so that third-party distributions doing this
can notice and fix it.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Avoid to flush buffer when silent console is activated as the
console can be reactivate later, after relocation, when the env will
be updated with the saved one.
Solve issue (missing beginning of U-Boot trace) when:
- CONFIG_SILENT_CONSOLE is activated
- silent=1 is defined in default environment (CONFIG_EXTRA_ENV_SETTINGS)
- silent is removed in saved environment with:
> env delete silent; env save
Only functional when PRE_CONSOLE_BUFFER is activated.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Update the "silent" property with the variable "silent" get from
saved environment, it solves the issue when:
- CONFIG_SILENT_CONSOLE and CONFIG_SYS_CONSOLE_IS_IN_ENV are activated
- silent is not defined in default environment
- silent is requested in saved environment with:
> env set silent 1; env save
On next reboot the console is not disabled as expected after relocation
and the environment load from flash (the callback is not called when
the INSERT is requested in the created hash table)
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
When building U-Boot with AVB enabled, compiler shows next warnings:
cmd/avb.c: In function 'do_avb_read_pvalue':
cmd/avb.c:371:18: warning: format '%ld' expects argument of type
'long int', but argument 2 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
printf("Read %ld bytes, value = %s\n", bytes_read,
~~^ ~~~~~~~~~~
%d
cmd/avb.c: In function 'do_avb_write_pvalue':
cmd/avb.c:404:19: warning: format '%ld' expects argument of type
'long int', but argument 2 has type '__kernel_size_t'
{aka 'unsigned int'} [-Wformat=]
printf("Wrote %ld bytes\n", strlen(value) + 1);
~~^ ~~~~~~~~~~~~~~~~~
%d
Fix those by using "%zu" specified.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
When having only these AVB related configs enabled:
CONFIG_AVB_VERIFY=y
CONFIG_CMD_AVB=y
CONFIG_LIBAVB=y
build fails with next errors:
common/avb_verify.c: In function 'read_persistent_value':
common/avb_verify.c:867:6: warning: implicit declaration of function
'get_open_session'
common/avb_verify.c:870:45: error: 'struct AvbOpsData' has no member
named 'tee'
common/avb_verify.c:894:7: warning: implicit declaration of function
'invoke_func'
common/avb_verify.c: In function 'write_persistent_value':
common/avb_verify.c:931:45: error: 'struct AvbOpsData' has no member
named 'tee'
Guard read_persistent_value() and write_persistent_value() functions
by checking if CONFIG_OPTEE_TA_AVB is enabled (as those are only used in
that case) to fix the build with mentioned configuration.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Fix the following Coverity warning:
CID 244086: Incorrect expression (BAD_COMPARE)
Comparing pointer "ep_bar" against NULL using anything besides == or
is likely to be incorrect.
Fixes: 914026d258 ("drivers: pci_ep: Introduce UCLASS_PCI_EP uclass")
Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
This adds high speed interface subsystem - hifsys (i.e. PCIe and USB)
for MT7623 SoC and enables its reset controller.
The control block is shared with ethsys and accordingly rename the
related defines.
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
This adds missing hifsys reset parts in header files.
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
if CONFIG_AUTOBOOT_KEYED, CONFIG_AUTOBOOT_ENCRYPTION and
CONFIG_AUTOBOOT_STOP_STR_SHA256 are enabled in conjunction
with CONFIG_SHA_HW_ACCEL and CONFIG_FSL_CAAM, we get the
Error when pressing a key while waiting for bootdelay:
Error: Address arguments are not aligned
CAAM was not setup properly or it is faulty
Reason is, that used variables are not cache aligned,
so malloc this variables cache aligned.
Probably this is also a bugfix for other hw accelerators
than CAAM.
Signed-off-by: Heiko Schocher <hs@denx.de>
Provide a concise description of the assert() macro. Point out that the
tested expression is always executed, irrespective of the value of _DEBUG.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
The original mtk_qspi driver has been removed. We change MT7629 to use
newly added mtk-spimem driver.
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
With this pull request a workaround for GRUB on 32bit ARM is re-enabled
and made customizable. Without the patch booting on ARM 32bit with GRUB
prior to version 2.04 or with a cache which is not managed via CP15
fails.
Further work will be needed to achieve a UEFI compliant cache handling.
According to the UEFI spec all caches except those that cannot be
managed via CP15 should be enabled.
An implementation of the ConvertPointer() runtime service is provided.
efi_crt0 is always rebuild to avoid having to call 'make mrproper' when
switching architectures.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl1GhdwACgkQxIHbvCwF
GsTZtg/+KPIv2azKOPqopzIlulDsQE3F0yF4BmyeneoEJtZblSiHOfaZVLFqh66z
9KcULYPhWpFaYb2VN1akKsVWJ/7CqlWKd/x0t68GCtr2ggxCzCGKshtePmM34GOD
sFgk8KPoFdBOmSHd4uEYSH+je6IF6mwSp/bOYDYl2YGuTj79HJsLN7zdzqIoyc8a
GdAHb7yXZ5Ywt+u0jQI4ysp43IwvdiJ5o0elTj6LNrAxCJJ0vHtbXkKeASvU5Axi
UYiMlJ+ctJLSZZ36n1CbLoirXcKswdb811cg6tgIbStrjShu5BS+1U4+cIisT69Y
8IC+KOAEaE75BTLZ/ifN/TE7f4hRw+7BoW/VNv+kKVAvSB/rnrE1ovFSg3c5Ng1L
XJfSIbFoDjK2s7y+leFDMC4W5gJXwncLiFirRFHIOFXIr79rxKMy6vzvc3LELyYQ
aQLRrlD6aH11y2niO6QCEeYDQMW8YG5TxeGOzIu1TCnjucsRMQLo0sDUDZgjHuyS
MQmxfNlHrKOI1IQYe1enR2ERE8iJG0aiYpj6gZzOrC8kmHkBxiZ+PeguqpS9repg
Uuatt1PsFWkPWfaApl2VDOCyZXox0X568+mxI+W8ds0R4zJAqMyGbdzRSytIsXJY
0iGeJQ00sB6DZs+W3FgKoZrsjeuhraniNXdBp7U1Ad2/aqSrhZY=
=jfh5
-----END PGP SIGNATURE-----
Merge tag 'efi-2019-10-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for v2019.10-rc2
With this pull request a workaround for GRUB on 32bit ARM is re-enabled
and made customizable. Without the patch booting on ARM 32bit with GRUB
prior to version 2.04 or with a cache which is not managed via CP15
fails.
Further work will be needed to achieve a UEFI compliant cache handling.
According to the UEFI spec all caches except those that cannot be
managed via CP15 should be enabled.
An implementation of the ConvertPointer() runtime service is provided.
efi_crt0 is always rebuild to avoid having to call 'make mrproper' when
switching architectures.
Mirror the qemu-riscv64 testing we do on Travis. Update to a newer
Docker image that contains riscv64-softmmu for QEMU.
Signed-off-by: Tom Rini <trini@konsulko.com>
As part of copying the logic from Travis to GitLab I kept the TOOLCHAIN
variable. However we don't use that now as the Docker container already
has all toolchains so we don't need to do any downloading. Remove this
variable.
Signed-off-by: Tom Rini <trini@konsulko.com>
Run the Python tests on the RISC-V architecture too.
https://github.com/swarren/uboot-test-hooks has already been updated.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Add comments for this function. Also remove the #ifdef around it so that
it can be called from 'if (IS_ENABLED(...))'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move the variable to the top of the file and adjust the code which uses it
to use if() rather than #ifdef, to make it easier to read.
Signed-off-by: Simon Glass <sjg@chromium.org>
Since this is part of the autoboot functionality, it makes sense to name
it with an AUTOBOOT prefix. No mainline boards use it so this should be
safe, and downstream boards will need to adjust.
Since this option is just an integer value, it really needs another option
to control whether the feature is enabled or not. Add a new
CONFIG_USE_AUTOBOOT_MENUKEY for that. This fits better with how things are
done with Kconfig, avoiding the need to use a specific value to disable
the feature.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not defined by any board. We could use CONFIG_AUTOBOOT_PROMPT
instead perhaps, but this depends on CONFIG_AUTOBOOT_KEYED which is not
used for the single-key case.
So let's just remove CONFIG_MENUPROMPT.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present we have two functions named __autoboot() which do different
things. This is confusing. Fix it by using if() instead of #ifdef for
selecting the functions, and renaming them to meaningful names.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use if() instead for this option, renaming the two different
passwd_abort() functions to indicate their purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
This CONFIG option is only present if CONFIG_AUTOBOOT_ENCRYPTION is
enabled so it cannot be used in code without that #ifdef. But we want to
reduce the use of #ifdef in this file and in particular to avoid having
two different functions both named passwd_abort() but which do different
things.
In preparation for this, create an intermediate value which is set to an
empty string if there is no value for CONFIG_AUTOBOOT_STOP_STR_SHA256.
Signed-off-by: Simon Glass <sjg@chromium.org>
This converts the following to Kconfig:
CONFIG_USE_PREBOOT
CONFIG_PREBOOT
Both are together in one commit, since otherwise the former causes kconfig
to define the latter, which gives duplicate symbol errors.
Includes a manual fixup for CONFIG_PREBOOT in ids8313_defconfig since the
backslash lands in the wrong place. Similarly with socfpga_vining_fpga.
Signed-off-by: Simon Glass <sjg@chromium.org>
In order to use CONFIG_PREBOOT with Kconfig, CONFIG_USE_PREBOOT must be
defined for each board. To prepare for conversion to Kconfig, add this.
Signed-off-by: Simon Glass <sjg@chromium.org>