summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-04mips: octeon: Add cvmx-helper-sfp.cAaron Williams
Import cvmx-helper-sfp.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-sgmii.cAaron Williams
Import cvmx-helper-sgmii.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-rgmii.cAaron Williams
Import cvmx-helper-rgmii.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-pko3.cAaron Williams
Import cvmx-helper-pko3.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-pko.cAaron Williams
Import cvmx-helper-pko.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-pki.cAaron Williams
Import cvmx-helper-pki.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-npi.cAaron Williams
Import cvmx-helper-npi.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-loop.cAaron Williams
Import cvmx-helper-loop.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-ipd.cAaron Williams
Import cvmx-helper-ipd.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-ilk.cAaron Williams
Import cvmx-helper-ilk.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-fpa.cAaron Williams
Import cvmx-helper-fpa.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-board.cAaron Williams
Import cvmx-helper-board.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-bgx.cAaron Williams
Import cvmx-helper-bgx.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-helper-agl.cAaron Williams
Import cvmx-helper-agl.c from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Misc changes to existing headers for upcoming eth supportStefan Roese
This patch includes misc changes to already present Octeon MIPS header files, which are necessary for the upcoming ethernet support. The changes are mostly: - DM GPIO & I2C infrastructure - Coding style cleanup while reworking the headers Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-xcv-defs.h header fileAaron Williams
Import cvmx-xcv-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-pcsxx-defs.h header fileAaron Williams
Import cvmx-pcsxxx-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-npei-defs.h header fileAaron Williams
Import cvmx-npei-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-lbk-defs.h header fileAaron Williams
Import cvmx-lbk-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-iob-defs.h header fileAaron Williams
Import cvmx-iob-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add cvmx-ilk-defs.h header fileAaron Williams
Import cvmx-igl-defs.h header file from 2013 U-Boot. It will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-04mips: octeon: Add misc cvmx-* header filesAaron Williams
Import misc cvmx-helper header files from 2013 U-Boot. They will be used by the later added drivers to support networking on the MIPS Octeon II / III platforms. Signed-off-by: Aaron Williams <[email protected]> Signed-off-by: Stefan Roese <[email protected]>
2022-05-03Merge branch '2022-05-03-virtio-pci-add-and-fix-consistency-checks'Tom Rini
To quote the author: The virtio PCI drivers forgo a number of consistency checks, particularly around pointer validation and bounds checking. This series focuses on the modern driver to add those checks. The start of the series adds and fixes some basic bounds checks. Later patches ensure PCI addresses fall within the expected regions rather than any arbitrary address. This is acheived by introducing range parameters to a few of the dm_pci_* functions that allow the ranges to be checked. The series also adds a few new configs to allow parts of virtio and PCI to be disabled where the features may be unused and the current implementations don't have the needed consistencty checks.
2022-05-03pci: Add config for Enhanced AllocationAndrew Scull
Add a config to control whether Enhanced Allocation is supported by the driver. Signed-off-by: Andrew Scull <[email protected]>
2022-05-03virtio: pci: Make use of dm_pci_map_bar()Andrew Scull
The virtio PCI capabilities describe regions of memory that should be mapped. Map those with dm_pci_map_bar() which will ensure they are valid PCI regions. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Check virtio configs are mappedAndrew Scull
Prepare for calls to `virtio_pci_map_capability()` failing by returning NULL on error. If this happens, later accesses to the pointers would be unsafe so cause the probe to fail if such an error occurs. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Add mask parameter to dm_pci_map_bar()Andrew Scull
Add a mask parameter to control the lookup of the PCI region from which the mapping can be made. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Update dm_pci_bus_to_virt() parametersAndrew Scull
Add mask parameter and reorder length parameter to match the other PCI address conversion functions. Using PCI_REGION_TYPE as the mask gives the old behaviour. It's converted from a macro to an inline function as the length parameter is now used twice, but should only be calculated once. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Match region flags using a maskAndrew Scull
When converting addresses, apply a mask to the region flags during lookup. This allows the caller to specify which flags are important and which are not, for example to exclude system memory regions. The behaviour of the function is changed such that they don't preferentially search for a non-system memory region. However, system memory regions are added after other regions in decode_regions() leading to a similar outcome. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Map bars with offset and lengthAndrew Scull
Evolve dm_pci_map_bar() to include an offset and length parameter. These allow a portion of the memory to be mapped and range checks to be applied. Passing both the offset and length as zero results in the previous behaviour and this is used to migrate the previous callers. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03test: pci: Test PCI address conversion functionsAndrew Scull
Add tests for the functions dm_pci_bus_to_phys() and dm_pci_phys_to_bus() which convert between PCI bus addresses and physical addresses based on the ranges declared for the PCI controller. The ranges of bus#1 are used for the tests, adding a translation to one of the ranges to cover more cases. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Range check address conversionsAndrew Scull
When converting between PCI bus and physical addresses, include a length parameter that can be used to check that the entire range fits within one of the PCI regions. This prevents an address being returned that might be only partially valid for the range it is going to be used for. Where the range check is not wanted, passing a length of 0 will have the same behaviour as before this change. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Check region ranges are addressableAndrew Scull
When parsing the `ranges` DT node, check that both extremes of the regions are addressable without overflow. This assumption can then be safely made when processing the regions. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03pci: Fix use of flags in dm_pci_map_bar()Andrew Scull
The flags parameter of dm_pci_map_bar() is used for PCI region flags rather than memory mapping flags. Fix the type to match that of the region flags and stop using the regions flags as memory mapping flags. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Read entire capability into memoryAndrew Scull
Read the virtio PCI capability out of the device configuration space to a struct rather than accessing fields directly from the configuration space as they are needed. This both makes access to the fields easier and avoids re-reading fields. Re-reading fields could result in time-of-check to time-of-use problems, should the value in the configuration space change. The range check of the `bar` field and the later call to `dm_pci_read_bar32()` is an example of where this could happen. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Check virtio capability is in boundsAndrew Scull
Ensure the virtio PCI capabilities are contained within the bounds of the device's configuration space. The expected size of the capability is passed when searching for the capability to enforce this check. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Check virtio common config sizeAndrew Scull
Check that the common config is at least as large as the struct it is expected to contain. Only then is it safe to cast the pointer and be safe from out-of-bounds accesses. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Bounds check notification writesAndrew Scull
Make sure virtio notifications are written within their allocated buffer. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Bounds check device config accessAndrew Scull
The device config is optional, so check it was present and mapped before trying to use the pointer. Bounds violations are an error, not just a warning, so bail if the checks fail. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Fix discovery of device config lengthAndrew Scull
The length of the device config was erroneously being taken from the notify capability. Correct this by finding the length in the device capability. Fixes: 550435edf810 ("virtio: pci: Support non-legacy PCI transport device") Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03virtio: pci: Allow exclusion of legacy driverAndrew Scull
Add a new config to control whether the driver for legacy virtio PCI devices is included in the build. VIRTIO_PCI_LEGACY is included by default when VIRTIO_PCI is selected, but it can also be independently toggled. Signed-off-by: Andrew Scull <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2022-05-03bootmenu: add Kconfig option not to enter U-Boot consoleMasahisa Kojima
This commit adds the Kconfig option to disable to enter the U-Boot console from bootmenu. If CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is enabled, "U-Boot console" entry is appeared as the last entry in the bootmenu, then user can enter U-Boot console. If CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is disabled, "Quit" entry is appeared as the last entry instead of "U-Boot console". When user chooses "Quit" from bootmenu, the following default commands are invoked. - "bootefi bootmgr" (if efi bootmgr is enabled) - "run bootcmd" If the both commands are executed and returns to the bootmenu, the bootmenu will appears again. Signed-off-by: Masahisa Kojima <[email protected]>
2022-05-03bootmenu: add UEFI boot entry into bootmenuMasahisa Kojima
This commit adds the UEFI related menu entries into the bootmenu. User can select which UEFI "Boot####" option to execute from bootmenu, then bootmenu sets the "BootNext" UEFI variable and invoke efi bootmgr. The efi bootmgr will handle the "BootNext" UEFI variable. If the "BootNext" UEFI variable is preset and efi bootmgr is enabled, bootmenu invokes efi bootmgr to handle "BootNext" as first priority. The UEFI boot entry has the "UEFI BOOTXXXX" prefix as below. *** U-Boot Boot Menu *** UEFI BOOT0000 : debian UEFI BOOT0001 : ubuntu Signed-off-by: Masahisa Kojima <[email protected]>
2022-05-03bootmenu: update bootmenu_entry structureMasahisa Kojima
This is a preparation for succeeding addition of uefi boot and distro boot menu entries into bootmenu. The bootmenu_entry title is updated to u16 string because uefi use u16 string. This commit also factors out the function to prepare the entries generated by "bootmenu_x" U-Boot environment variable. Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-05-03efi_loader: bootmgr: add booting from removable mediaAKASHI Takahiro
Under the current implementation, booting from removable media using a architecture-specific default image name, say BOOTAA64.EFI, is supported only in distro_bootcmd script. See the commit 74522c898b35 ("efi_loader: Add distro boot script for removable media"). This is, however, half-baked implementation because 1) UEFI specification requires this feature to be implemented as part of Boot Manager's responsibility: 3 - Boot Manager 3.5.1 Boot via the Simple File Protocol When booting via the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, the FilePath will start with a device path that points to the device that implements the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL or the EFI_BLOCK_IO_PROTOCOL. The next part of the FilePath may point to the file name, including subdirectories, which contain the bootable image. If the file name is a null device path, the file name must be generated from the rules defined below. ... 3.5.1.1 Removable Media Boot Behavior To generate a file name when none is present in the FilePath, the firmware must append a default file name in the form \EFI\BOOT\BOOT{machine type short-name}.EFI ... 2) So (1) entails the hehavior that the user's preference of boot media order should be determined by Boot#### and BootOrder variables. With this patch, the semantics mentioned above is fully implemented. For example, if you want to boot the system from USB and SCSI in this order, * define Boot0001 which contains only a device path to the USB device (without any file path/name) * define Boot0002 which contains only a device path to the SCSI device, and * set BootOrder to Boot0001:Boot0002 To avoid build error for sandbox, default file name "BOOTSANDBOX.efi" is defined even if it is out of scope of UEFI specification. Signed-off-by: AKASHI Takahiro <[email protected]> Signed-off-by: Masahisa Kojima <[email protected]> On sandbox use binary name corresponding to host architecture. Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-05-03efi_loader: export efi_locate_device_handle()AKASHI Takahiro
This function will be used in the next commit where some behavior of EFI boot manager will be expanded. Signed-off-by: AKASHI Takahiro <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-05-03menu: menu_get_choice() return -ENOENT if menu item is emptyMasahisa Kojima
menu_get_choice() needs to handle the case that menu item is empty. In this case, menu_get_choice() returns -ENOENT. Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2022-05-03menu: always show the menu regardless of the number of entryMasahisa Kojima
To make user aware of the menu entry selection, menu always appears regardless of the number of entry. Signed-off-by: Masahisa Kojima <[email protected]> Adjust test/py/tests/test_bootmenu.py Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-05-03test: unit test for u16_strlcat()Masahisa Kojima
Provide a unit test for function u16_strlcat(). Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-05-03lib/charset: add u16_strlcat() functionMasahisa Kojima
Provide u16 string version of strlcat(). Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>