summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Collapse)AuthorFilesLines
2020-11-05Add an assembly guard around linux/bitops.hSimon Glass1-2/+2
This file can be included by any header but it includes C code. Guard it to avoid errors when compiling ASL, etc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-10-20usb: common: add define of usb_speed_string()Chunfeng Yun1-4/+0
There is only declaration of usb_speed_string(), but no definition, so add it to avoid build error when call it. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-10-20usb: add USB_SPEED_SUPER_PLUSChunfeng Yun1-0/+1
Add enum USB_SPEED_SUPER_PLUS for USB3.1 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-10-16linux/compat.h: Remove redefinition of dev_xxx macrosSean Anderson1-28/+0
All users of these functions now include dm/device_compat.h directly. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-05Merge tag 'u-boot-atmel-2021.01-a' of ↵Tom Rini1-0/+247
https://gitlab.denx.de/u-boot/custodians/u-boot-atmel into next First set of u-boot-atmel features for 2021.01 cycle: This feature set includes a new CPU driver for at91 family, new driver for PIT64B hardware timer, support for new at91 family SoC named sama7g5 which adds: clock support, including conversion of the clock tree to CCF; SoC support in mach-at91, pinctrl and mmc drivers update. The feature set also includes updates for mmc driver and some other minor fixes and features regarding building without the old Atmel PIT and the possibility to read a secondary MAC address from a second i2c EEPROM.
2020-09-30linux/compat.h: Remove netdev_xxx functionsSean Anderson1-19/+0
No drivers in U-Boot use these functions. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-09-22clk: at91: add pre-requisite headers for AT91 clock architectureClaudiu Beznea1-0/+247
Add pre-requisite headers for AT91 clock architecture. These are based on already present files on Linux and will be used by following commits for AT91 CCF clock drivers. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2020-08-24include: kernel.h: define SSIZE_MAXHeinrich Schuchardt1-0/+3
Define SSIZE_MAX, the largest value fitting into a variable of type ssize_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-14linux/compat.h: Add wait_event_timeout macroOleksandr Andrushchenko1-0/+54
Add wait_event_timeout - sleep until a condition gets true or a timeout elapses. This is a stripped version of the same from Linux kernel with the following u-boot specific modifications: - no wait queues supported - use u-boot timer to detect timeouts - check for Ctrl-C pressed during wait Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> [trini: Drop atomic_read from gadget/ether.c as this has existed for a while and now causes problems] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-04clk: Drop dm.h header file in clk-provider.hSimon Glass1-5/+3
This header file should not be included in other header files. Remove it and use a forward declaration and un-inlining of dev_get_clk_ptr() instead. Fix up the kendryte header files to avoid build errors. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2020-07-20mtd: spinand: micron: identify SPI NAND device with Continuous Read modeShivamurthy Shastri1-0/+1
Add SPINAND_HAS_CR_FEAT_BIT flag to identify the SPI NAND device with the Continuous Read mode. Some of the Micron SPI NAND devices have the "Continuous Read" feature enabled by default, which does not fit the subsystem needs. In this mode, the READ CACHE command doesn't require the starting column address. The device always output the data starting from the first column of the cache register, and once the end of the cache register reached, the data output continues through the next page. With the continuous read mode, it is possible to read out the entire block using a single READ command, and once the end of the block reached, the output pins become High-Z state. However, during this mode the read command doesn't output the OOB area. Hence, we disable the feature at probe time. Signed-off-by: Shivamurthy Shastri <sshivamurthy@micron.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
2020-07-13soc: ti: k3-ringacc: Add an API to request pair of ringsVignesh Raghavendra1-0/+4
Add new API k3_ringacc_request_rings_pair() to request pair of rings at once, as in the most case Rings are used with DMA channels which required to request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and one to receive completions (RX/TX CQ). This will allow to simplify Ringacc API users. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2020-07-10Merge tag 'rpi-next-2020.10' of ↵Tom Rini1-0/+53
https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi - add support for PCI and XHCI for RPi4 (64 bit only) - optionally reset XHCI device on registration - enable USB_KEYBOARD for rpi_4_defconfig
2020-07-10linux/bitfield.h: Add primitives for manipulating bitfields both in host- ↵Nicolas Saenz Julienne1-0/+53
and fixed-endian Imports Al Viro's original Linux commit 00b0c9b82663a, which contains an in depth explanation and two fixes from Johannes Berg: e7d4a95da86e0 "bitfield: fix *_encode_bits()", 37a3862e12382 "bitfield: add u8 helpers". Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> [s.nawrocki: added empty lines between functions and macros] Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> [mb: squash fix including byteorder.h] Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-07-09linux/kconfig.h: create two- and three-argument versions of CONFIG_IS_ENABLEDRasmus Villemoes1-3/+45
This adds a bunch of preprocessor magic to extend the capabilities of CONFIG_IS_ENABLED. The existing semantics of CONFIG_IS_ENABLED(FOO) expanding to a 1 or 0 (depending on build context and the defined-ness or not of the appropriate CONFIG_FOO/CONFIG_SPL_FOO/CONFIG_TPL_FOO) are of course preserved. With this, one is also allowed a two-argument form CONFIG_IS_ENABLED(FOO, (something)) which expands to something precisely when CONFIG_IS_ENABLED(FOO) would expand to 1, and expands to nothing otherwise. It is, in other words, completely equivalent to the three lines #if CONFIG_IS_ENABLED(FOO) something #endif The second argument must be parenthesized in order to allow any tokens, including a trailing comma, to appear - one use case for this is precisely to make it a bit more ergonomic to build an array and only include certain items depending on .config. That should increase both readability and not least "git grep"ability. A third variant is also introduced, CONFIG_IS_ENABLED(FOO, (xxx), (yyy)) which corresponds to #if CONFIG_IS_ENABLED(FOO) xxx #else yyy #endif Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09linux/kconfig.h: remove unused helper macrosRasmus Villemoes1-35/+5
U-Boot does not have loadable modules, and nothing currently uses any of the (CONFIG_)?IS_(BUILTIN|MODULE) macros - only the (CONFIG_)?IS_ENABLED variants are ever used. While I understand the desire to keep this somewhat synchronized with linux, we've already departed by the introduction of the CONFIG_IS_ENABLED extra logic, and deleting these makes the next patch much simpler, since I won't have to duplicate a lot of logic for no real gain (as there are no users). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09linux/kconfig.h: simplify logic for choosing CONFIG_{SPL_, TPL_, }*Rasmus Villemoes1-19/+8
Instead of using the arg1_or_junk trick to pick between two choices, with a bit of duplication between the branches (and most of the CONFIG_TPL_BUILD case being redundant, as _IS_TPL is known to be defined to 1 in that case), simply define a prefix that we inject between CONFIG_ and the given config symbol. This only requires one level of indirection (to get the _CONFIG_PREFIX macro expanded before the token concatenation takes place), and makes it easy to, say, introduce a CONFIG_HOSTTOOL_ prefix. [I would expect most HOSTTOOL_ symbols to just be def_bool y, but it would allow us to clean up some of the ifdef HOSTCC mess in the sources shared between U-Boot and host tools.] Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-01compilers: Introduce options for forcing inlining on SPL/TPLTom Rini1-1/+1
There are cases where when we allow the compiler to decide about making inline decisions rather than forcing them it can save us space. For now, we keep the default values for inlining that we have had historically. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-01compiler_types.h: Re-introduce CONFIG_OPTIMIZE_INLINING for U-BootTom Rini1-1/+10
In the Linux kernel, support for forcing inline functions to be made inline, rather than allowing the compiler to make its own choice has been removed. With respect to performance, modern GCC (and Clang) do a good job at deciding when to, or not to, inline code and there are no run-time requirements in Linux anymore. There is one downside to this, which is final binary size. On average in U-Boot removing this support grows SPL by almost 1 kilobyte. But there are cases where it shrinks the binary by making better inline choices than we had forced. Start by re-introducing CONFIG_OPTIMIZE_INLINING as a global which essentially reverts 889b3c1245de ("compiler: remove CONFIG_OPTIMIZE_INLINING entirely") from Linux. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-01compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5Tom Rini6-558/+774
Copy these from Linux v5.7-rc5 tag. This brings in some handy new attributes and is otherwise important to keep in sync. We drop the reference to smp_read_barrier_depends() as it is not relevant on the architectures we support at this time, based on where it's implemented in Linux today. We drop the call to kasan_check_read() as that is not relevant to U-Boot as well. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-06-23psci: add 'static inline' to invoke_psci_fn() stubMasahiro Yamada1-2/+2
Avoid potential multiple definitions when CONFIG_ARM_PSCI_FW is disabled. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-06-02dma-mapping: Add header file for ARCH_DMA_MINALIGNSimon Glass1-0/+1
This is defined in the asm/cache.h header file. Update this header file to include it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Adam Ford <aford173@gmail.com> #da850-evm
2020-05-29usb: dwc3: amend UTMI/UTMIW phy interface setupFrank Wang1-0/+18
Let move 8/16-bit UTMI+ interface initialization into DWC3 core init that is convenient for both DM_USB and u-boot traditional process. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-05-19common: Drop linux/bitops.h from common headerSimon Glass3-0/+6
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/bug.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18arm: Don't include common.h in header filesSimon Glass2-0/+2
It is bad practice to include common.h in other header files since it can bring in any number of superfluous definitions. It implies that some C files don't include it and thus may be missing CONFIG options that are set up by that file. The C files should include these themselves. Update some header files in arch/arm to drop this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-10iopoll: Add readl_poll_sleep_timeoutJagan Teki1-0/+6
Add readl poll API with sleep and timeout support. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-05-10iopoll: Add dealy to read pollJagan Teki1-2/+6
Some drivers and other bsp code not only poll the register with timeout but also required to delay on each transaction. This patch add that requirement by adding sleep_us variable so-that read_poll_timeout now support delay as well. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-05-10iopoll: Add read_poll_timeout common APIJagan Teki1-2/+4
Add read_poll_timeout common API similar to Linux iopoll. readx_poll_timeout will trigger read_poll_timeout with proper op. This will help to extend the functionalities like sleep_us to poll timeout in future. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-04-30mtd: spi-nor: Enable QE bit for ISSI flashJagan Teki1-0/+1
Enable QE bit for ISSI flash chips. QE enablement logic is similar to what Macronix has, so reuse the existing code itself. Cc: Sagar Shrikant Kadam <sagar.kadam@sifive.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-04-28mtd: spi-nand: Import Toshiba SPI-NAND supportRobert Marko1-0/+1
Linux has good support for Toshiba SPI-NAND, so lets import it. Signed-off-by: Robert Marko <robert.marko@sartura.hr> Tested-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-04-26libfdt: split fdt_region declarations out to <fdt_region.h>Masahiro Yamada1-299/+0
fdt_region APIs are not part of libfdt. They are U-Boot extension for the verified boot. Split the declarations related to fdt_region out of <fdt_region.h>. This allows <linux/libfdt.h> to become a simple wrapper file, like Linux does. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-04-01Merge branch 'next' of git://git.denx.de/u-boot-usb into nextTom Rini1-4/+6
2020-03-30usb: Migrate to support live DT for some driverKever Yang1-4/+6
Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT. This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use ofnode as parameter instead of fdt offset. And all the drivers who use these APIs update to use live dt APIs at the same time. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2020-03-03firmware: tisci: Drop all deprecated messagesLokesh Vutla1-6/+0
SYSFW v2020.01 and later versions no longer supports the below messages: - TI_SCI_MSG_RM_RING_GET_CFG - TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG 0x1206 - TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG 0x1216 - TISCI_MSG_RM_UDMAP_FLOW_GET_CFG 0x1232 - TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG 0x1233 There are no users in U-Boot for any of the above messages, So drop the support for all the corresponding messages. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-02-19dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>Masahiro Yamada1-0/+63
The implementation of dma_map_single() and dma_unmap_single() is exactly the same for all the architectures that support them. Factor them out to <linux/dma-mapping.h>, and make all drivers to include <linux/dma-mapping.h> instead of <asm/dma-mapping.h>. If we need to differentiate them for some architectures, we can move the generic definitions to <asm-generic/dma-mapping.h>. Add some comments to the helpers. The concept is quite similar to the DMA-API of Linux kernel. Drivers are agnostic about what is going on behind the scene. Just call dma_map_single() before the DMA, and dma_unmap_single() after it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-06dm: core: Drop the inclusion of linux/compat.h in dm.hSimon Glass1-0/+3
Most files don't need this header and it pulls in quite of lots of stuff, malloc() in particular. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Create a new header file for 'compat' featuresSimon Glass1-0/+1
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06sandbox: Rename strdup() functionsSimon Glass1-0/+5
These functions include calls to a memory-allocation routine and so need to use the system routine when called from a library. To preserve access to these functions for libraries that need it, such as SDL, rename these functions within U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06string: Allow arch override of strndup() alsoSimon Glass1-1/+1
At present architectures can override strdup() but not strndup(). Use the same option for both. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06mtd: Rename free() to rfree()Simon Glass1-2/+2
This function name conflicts with our desire to #define free() to something else on sandbox. Since it deals with resources, rename it to rfree(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-27mtd: spi-nor-core: Add octal mode supportVignesh Raghavendra1-0/+8
Add support for Octal flash devices. Octal flash devices use 8 IO lines for data transfer. Currently only 1-1-8 Octal Read mode is supported. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-26clk: Include missing headers for linux/clk-provider.hSean Anderson1-0/+4
This header was missing a couple of include dependencies when included on its own. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-01-20Merge tag '2020-01-20-ti-2020.04' of ↵Tom Rini2-0/+145
https://gitlab.denx.de/u-boot/custodians/u-boot-ti K3 J721E: * DMA support. * MMC and ADMA support. * EEPROM support. * J721e High Security EVM support. * USB DT nodes K3 AM654: * Fixed boot due to pmic probe error. * USB support and DT nodes. * ADMA support DRA7xx/AM57xx: * BBAI board support * Clean up of net platform code under board/ti AM33/AM43/Davinci: * Reduce SPL size for omap3 boards. * SPL DT support for da850-lcdk * PLL divider fix for AM335x
2020-01-20lib: Import few bitmap functions from LinuxVignesh Raghavendra2-0/+145
Import few basic bitmap functions (bitmap_{weight,fill,set,clear,or}()) and their dependencies from Linux. These are required for upcoming DMA resource allocation support for TI's K3 SoCs. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-01-18common: Move ROUND() into kernel.hSimon Glass1-0/+2
Move this macro in with all the other rounding macros. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-18common: Move check_member() to kernel.hSimon Glass1-0/+11
The kernel.h file has a number of useful macros including a few related to structures. Move check_member() there too. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move type declarations to linux/types.hSimon Glass1-0/+4
This file already has lots of type declarations so it seems better to put all of them there. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-17mtd: spi: spi-nor-core: Add SST vendor specific SFDP parserTudor Ambarus1-0/+2
JESD216 allow vendors to define their own SFDP tables. Add SST SFDP parser. The vendor table is allocated using resource-managed kmalloc - the table will be freed on driver detach. It will be accessible by getting the UCLASS_SPI_FLASH's private data. The SST's SFDP table is particularly of interest because contains pre-programmed globally unique EUI-48 and EUI-64 identifiers. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
2019-12-09Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-netTom Rini1-0/+19