summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-23fuzz: virtio: Add fuzzer for vringAndrew Scull
Add a fuzzer to test the vring handling code against unexpected mutations from the virtio device. After building the sandbox with CONFIG_FUZZ=y, the fuzzer can be invoked with by: UBOOT_SB_FUZZ_TEST=fuzz_vring ./u-boot This fuzzer finds unvalidated inputs in the vring driver that allow a buggy or malicious device to make the driver chase wild pointers. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23sandbox: Implement fuzzing engine driverAndrew Scull
Add a fuzzing engine driver for the sandbox to take inputs from libfuzzer and expose them to the fuzz tests. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23sandbox: Add libfuzzer integrationAndrew Scull
Add an implementation of LLVMFuzzerTestOneInput() that starts the sandbox on a secondary thread and exposes a function to synchronize the generation of fuzzing inputs with their consumption by the sandbox. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23sandbox: Decouple program entry from sandbox initAndrew Scull
Move the program's entry point to os.c, in preparation for a separate fuzzing entry point to be added. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23test: fuzz: Add framework for fuzzingAndrew Scull
Add the basic infrastructure for declaring fuzz tests and a command to invoke them. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23fuzzing_engine: Add fuzzing engine uclassAndrew Scull
This new class of device will provide fuzzing inputs from a fuzzing engine. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23CI: Azure: Build with ASAN enabledAndrew Scull
In order to prevent build regressions with ASAN, add the builds to CI. The longer term objective will be to enabled test targets with ASAN enabled, but there are too many at the moment. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23test/py: test_stackprotector: Disable for ASANAndrew Scull
The stack protector test intentionally overflows a buffer in order to corrupt the stack canary so that it can test that the corruption is detected as expected. However, this is incompatible with ASAN, which detects the buffer overflow and interrupts the test, so disable the test for such configurations. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23sandbox: Add support for Address SanitizerAndrew Scull
Add CONFIG_ASAN to build with the Address Sanitizer. This only works with the sandbox so the config is likewise dependent. The resulting executable will have ASAN instrumentation, including the leak detector that can be disabled with the ASAN_OPTIONS environment variable: ASAN_OPTIONS=detect_leaks=0 ./u-boot Since u-boot uses its own dlmalloc, dynamic allocations aren't automatically instrumented, but stack variables and globals are. Instrumentation could be added to dlmalloc to poison and unpoison memory as it is allocated and deallocated, and to introduce redzones between allocations. Alternatively, the sandbox may be able to play games with the system allocator and somehow still keep the required memory abstraction. No effort to address dynamic allocation is made by this patch. The config is not yet enabled for any targets by default. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23linker_lists: Rename sections to remove . prefixAndrew Scull
Rename the sections used to implement linker lists so they begin with '__u_boot_list' rather than '.u_boot_list'. The double underscore at the start is still distinct from the single underscore used by the symbol names. Having a '.' in the section names conflicts with clang's ASAN instrumentation which tries to add redzones between the linker list elements, causing expected accesses to fail. However, clang doesn't try to add redzones to user sections, which are names with all alphanumeric and underscore characters. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-23sandbox: Rename getopt sectionsAndrew Scull
Rename the sections used for defining sandbox command line options so that they don't start with a '.'. ELF says that sections starting with a '.' are reserved for system use, but the sandbox runs as a normal user process so should be using user sections instead. Clang's ASAN adds redzones to non-user sections and the extra padding meant that the list of options was being corrupted. Naming the sections as user sections avoids this issue as clang handles them as we intended. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23sandbox: Rename EFI runtime sectionsAndrew Scull
Rename the sections used for placing the EFI runtime so that they don't start with a '.'. ELF says that sections starting with a '.' are reserved for system use, but the sandbox runs as a normal user process so should be using user sections instead. Clang's ASAN adds redzones to non-user sections and the extra padding meant that the list of options was being corrupted. Naming the sections as user sections avoids this issue as clang handles them as we intended. Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23serial: sandbox: Fix buffer underflow in putsAndrew Scull
Fix the buffer underflow that would occur if puts is called with length of zero. Fixes: efa51f2bd64 ("serial: sandbox: Implement puts") Cc: Sean Anderson <sean.anderson@seco.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2022-06-23Merge branch '2022-06-22-platform-updates-and-additions' into nextTom Rini
- Add hpe gxp architecture and platform, Arm corstone1000 platform. - ast2600, devkit8000, NPCM7xx improvements
2022-06-22corstone1000: Convert to text file environmentTom Rini
Convert this platform to using the text file environment rather than defining CONFIG_EXTRA_ENV_SETTINGS. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-22gxp: Convert to text file environmentTom Rini
Convert this platform to using the text file environment rather than defining CONFIG_EXTRA_ENV_SETTINGS. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-22misc: nuvoton: Add NPCM7xx otp controller driverJim Liu
Add Nuvoton BMC npcm750 otp driver Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-06-22crypto: nuvoton: Add NPCM7xx SHA driverJim Liu
add nuvoton BMC npcm750 SHA driver Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-06-22crypto: nuvoton: Add NPCM7xx AES driverJim Liu
add nuvoton BMC npcm750 AES driver Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-06-22ast2600: spl: Add boot mode detectionChia-Wei Wang
AST2600 supports boot from SPI(mmap), eMMC, and UART. This patch adds the boot mode detection and return the corresponding boot device type. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2022-06-22configs: ast2600: Move SPL bss section to DRAM spaceChia-Wei Wang
The commit b583348ca8c8 ("image: fit: Align hash output buffers") places the hash output buffer at the .bss section. However, AST2600 by default executes SPL in the NOR flash XIP way. This results in the hash output cannot be written to the buffer as it is located at the R/X only region. We need to move the .bss section out of the SPL body to the DRAM space, where hash output can be written to. This patch includes: - Define the .bss section base and size - A new SPL linker script is added with a separate .bss region specified - Enable CONFIG_SPL_SEPARATE_BSS kconfig option Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>
2022-06-22MAINTAINERS: Introduce HPE GXP ArchitectureNick Hawkins
Create a section in MAINTAINERS for the GXP HPE architecture Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22configs: gxp: add gxp_defconfigNick Hawkins
This is the initial very basic config that enables the U-Boot console on the hpe gxp soc. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22configs: gxp: add core supportNick Hawkins
Add the include file for the gxp soc. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22ARM: dts: Add device tree files for hpe gxp socNick Hawkins
The HPE SoC is new to linux. A basic device tree layout with minimum required for linux to boot including a timer and watchdog support has been created. The dts file is empty at this point but will be updated in subsequent updates as board specific features are enabled. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22dt-bindings: spi: Add hpe gxp spiNick Hawkins
Add support for the HPE GXP SPI Controller. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22board: hpe: gxp: add HPE GXP soc supportNick Hawkins
Add basic support for the HPE GXP SoC. Reset the EHCI controller at boot. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22spi: gxp_spi: Add GXP SPI controller driverNick Hawkins
The GXP supports 3 separate SPI interfaces to accommodate the system flash, core flash, and other functions. The SPI engine supports variable clock frequency, selectable 3-byte or 4-byte addressing and a configurable x1, x2, and x4 command/address/data modes. The memory buffer for reading and writing ranges between 256 bytes and 8KB. This driver supports access to the core flash. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22timer: gxp: Add HPE GXP timer supportNick Hawkins
Add support for the HPE GXP SOC timer. The GXP supports several different kinds of timers but for the purpose of this driver there is only support for the General Timer. The timer has a 1us resolution and is 56 bits. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22ARM: hpe: gxp: add core supportNick Hawkins
The GXP is the HPE BMC SoC that is used in the majority of current generation HPE servers. Traditionally the asic will last multiple generations of server before being replaced. Info about SoC: HPE GXP is the name of the HPE Soc. This SoC is used to implement many BMC features at HPE. It supports ARMv7 architecture based on the Cortex A9 core. It is capable of using an AXI bus to whicha memory controller is attached. It has multiple SPI interfaces to connect boot flash and BIOS flash. It uses a 10/100/1000 MAC for network connectivity. It has multiple i2c engines to drive connectivity with a host infrastructure. There currently are no public specifications but this process is being worked. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
2022-06-22cmd/misc: Stop using a function pointerTom Rini
Currently, enabling CMD_MISC gives: cmd/misc.c:67:25: warning: assignment to 'int (*)(struct udevice *, int, void *, int)' from incompatible pointer type 'int (*)(struct udevice *, int, const void *, int)' [-Wincompatible-pointer-types] Because 'misc_read' takes a void * and 'misc_write' takes a const void *, both of which make sense for their operation. Given there's one place we make use of the function pointer, just call read or write directly for the operation we're called with. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-22arm: add support to corstone1000 platformRui Miguel Silva
Corstone1000 is a platform from arm, which includes pre verified Corstone SSE710 sub-system that combines Cortex-A and Cortex-M processors [0]. This code adds the support for the Cortex-A35 implementation at host side, it contains also the necessary bits to support the Corstone 1000 FVP (Fixed Virtual Platform) [1] and also the FPGA MPS3 board implementation of this platform. [2] 0: https://developer.arm.com/documentation/102360/0000 1: https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps 2: https://developer.arm.com/documentation/dai0550/c/ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-06-22cmd: load: add load command for memory mappedRui Miguel Silva
cp.b is used a lot as a way to load binaries to memory and execute them, however we may need to integrate this with the efi subsystem to set it up as a bootdev. So, introduce a loadm command that will be consistent with the other loadX commands and will call the efi API's. ex: loadm $kernel_addr $kernel_addr_r $kernel_size with this a kernel with CONFIG_EFI_STUB enabled will be loaded and then subsequently booted with bootefi command. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-06-22ARM: dts: omap3-devkit8000: Fix CONFIG_DM_ETH warningAnthoine Bourgeois
Add the missing ethernet node in u-boot dts. Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2022-06-22ARM: dts: omap3-devkit8000: Fix CONFIG_DM_I2C warningAnthoine Bourgeois
Seems that u-boot can't probe i2c bus at 2.6Mhz speed, so lower the speed to the default value 100Khz. v2: fix i2c1 frequency in the root omap3-u-boot.dtsi include. Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2022-06-22ARM: dts: omap3-devkit8000: Add support for Devkit8000Anthoine Bourgeois
This commit adds OMAP3 BeagleBoard devicetree files from Linux v5.16.0. This commit fixes CONFIG_DM_MMC warning. v3: patch clean-up Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2022-06-20Merge branch 'master' into nextTom Rini
Merge in v2022.07-rc5.
2022-06-20Prepare v2022.07-rc5v2022.07-rc5Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-20configs: Resync with savedefconfigTom Rini
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-20Merge tag 'u-boot-stm32-20220620' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm into next - Add STM32MP13 SoCs support with associated board STM32M135F-DK - Correct livetree support in stm32mp1 boards - Activate livetree for stm32mp15 DHSOM boards
2022-06-20Merge tag 'fsl-qoriq-2022-6-20-v2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next Layerscape: add sfp driver Kconfig cleanup sl28 board update support hdp firmware loading powerpc: dts update for p2020 p1_p2_rdb_pc board update fsl_esdhc fallback to 1-bit mode support
2022-06-20board: sl28: rename include guard macroMichael Walle
Avoid name clashes with an include file on board level. Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-20board: sl28: support 8 GiB memoryMichael Walle
The board supports up to 8 GiB memory. The memory is soldered on the board but the configuration is equivalent to a dual chip select, dual rank DIMM module. Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-20board: sl28: remove unneeded ddr config parameterMichael Walle
config_2 doesn't need to be set to zero because that is already the default value. Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-20board: sl28: set CPO valueMichael Walle
With a 8GiB memory board, it seems that the "very unlikely event" of a DDR initialization with non-optimal values are not really that unlikely. It happens in about every other reboot. As described in erratum A-009942, preset the DEBUG_28 register with an optimal value. The value iself depends on the memory configuration of the board, but the used value seems to work well for all variants. Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-20armv8: layerscape: add missing RCW source definesMichael Walle
A board might need to get the source of the RCW word, which is also the boot source in most cases. These defines are taken from the LS1028A and I expect they are the same across the SoCs with the same chassis, after all, there was already a reset source for NOR flash. Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-20powerpc: bootm: Fix sizes in memory adjusting warningPali Rohár
Old size is stored in size variable and new size is in bootm_size variable. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-06-20board: freescale: p1_p2_rdb_pc: Move boot reset macros to p1_p2_bootsrc.hPali Rohár
Code for changing boot source is platform generic and can be used by any P1* and P2* compatible RDB board. Not only by boards which use config header file p1_p2_rdb_pc.h. So move this code from p1_p2_rdb_pc.h to p1_p2_bootsrc.h and cleanup macros for generating boot source env variables in CONFIG_EXTRA_ENV_SETTINGS. This allows to use code for resetting board and rebooting to other boot source also by other boards in future. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-06-20powerpc: dts: p2020: Define PMC nodePali Rohár
Copy definition of PMC node from upstream Linux kernel P2020 dts files. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-06-20mmc: fsl_esdhc: Add new config option for default fallback modePali Rohár
Currently default fallback SDHC mode is 1-bit. Add new config option CONFIG_SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH to allow specifying default fallback mode. This is useful e.g. for SPL builds which loads other parts from SD card during boot process. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>