summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* mtd: spi-nor: Enable QE bit for ISSI flashJagan Teki2020-04-301-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>
* mtd: spi-nand: Import Toshiba SPI-NAND supportRobert Marko2020-04-291-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>
* libfdt: split fdt_region declarations out to <fdt_region.h>Masahiro Yamada2020-04-261-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>
* Merge branch 'next' of git://git.denx.de/u-boot-usb into nextTom Rini2020-03-311-4/+6
|\
| * usb: Migrate to support live DT for some driverKever Yang2020-03-301-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>
* | firmware: tisci: Drop all deprecated messagesLokesh Vutla2020-03-031-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>
* dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>Masahiro Yamada2020-02-191-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>
* dm: core: Drop the inclusion of linux/compat.h in dm.hSimon Glass2020-02-051-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>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-051-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>
* sandbox: Rename strdup() functionsSimon Glass2020-02-051-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>
* string: Allow arch override of strndup() alsoSimon Glass2020-02-051-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>
* mtd: Rename free() to rfree()Simon Glass2020-02-051-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>
* mtd: spi-nor-core: Add octal mode supportVignesh Raghavendra2020-01-271-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>
* clk: Include missing headers for linux/clk-provider.hSean Anderson2020-01-261-0/+4
| | | | | | | This header was missing a couple of include dependencies when included on its own. Signed-off-by: Sean Anderson <seanga2@gmail.com>
* Merge tag '2020-01-20-ti-2020.04' of ↵Tom Rini2020-01-202-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
| * lib: Import few bitmap functions from LinuxVignesh Raghavendra2020-01-202-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>
* | common: Move ROUND() into kernel.hSimon Glass2020-01-171-0/+2
| | | | | | | | | | | | Move this macro in with all the other rounding macros. Signed-off-by: Simon Glass <sjg@chromium.org>
* | common: Move check_member() to kernel.hSimon Glass2020-01-171-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>
* | common: Move type declarations to linux/types.hSimon Glass2020-01-171-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>
* mtd: spi: spi-nor-core: Add SST vendor specific SFDP parserTudor Ambarus2019-12-171-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>
* Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-netTom Rini2019-12-091-0/+19
|\
| * dma: ti: k3-udma: Implement dma_get_cfg() interfaceVignesh Raghavendra2019-12-091-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement dma_get_cfg() interface to pass flow id information for DMA clients to use. This is needed because on K3 SoCs, CPSW (ethernet) and UDMA (DMA provider) support "flows" within a given RX DMA channel. This allows different network packets to be segregated while using same RX DMA channel. In order for basic ethernet to work, CPSW slave must be aware of the flow ID allocated for the RX channel by the DMA driver. This interface allows CPSW to query flow ID from DMA provider and configure it in CPSW HW. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
* | linux/types.h: fix typo uncharHeinrich Schuchardt2019-12-091-1/+1
|/ | | | | | | | unsigned char should be called uchar and not unchar. This fixes a build error in lib/crypto/x509_cert_parser.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* lib: add oid registry utilityAKASHI Takahiro2019-12-061-0/+117
| | | | | | | | | Imported from linux kernel v5.3: build_OID_registry without changes oid_registry.h without changes oid_registry.c with changes marked as __UBOOT__ Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* cmd: add asn1_compilerAKASHI Takahiro2019-12-063-0/+174
| | | | | | | | | | | | | | | Imported from linux kernel v5.3: asn1.h without changes asn1_ber_bytecode.h without changes asn1_decoder.h without changes asn1_compiler.c without changes This host command will be used to create a ASN1 parser, for example, for pkcs7 messages or x509 certificates. More specifically, it will generate *byte code* which will be interpreted by asn1 decoder library. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* linux/time.h: include vsprintf.hAKASHI Takahiro2019-12-061-0/+1
| | | | | | | Without this commit, time.h possibly causes a build error as asctime_r() uses sprintf(). Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* include: kernel.h: include printk.hAKASHI Takahiro2019-12-061-1/+1
| | | | | | | | Adding "printk.h" will help improve portability from linux kernel code (in my case, lib/asn1_decoder.c and others) where printf and pr_* variant functions are used. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* lib: add mktime64() for linux compatibilityAKASHI Takahiro2019-12-061-0/+10
| | | | | | | This function will be used in lib/crypto/x509_cert_parser.c, which will also be imported from linux code in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* cmd: nand/sf: isolate legacy codeMiquel Raynal2019-12-041-6/+0
| | | | | | | | | | | | | | | | | The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack. This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> [trini: Don't export get_part function now] Signed-off-by: Tom Rini <trini@konsulko.com>
* common: Move mii_init() function out of common.hSimon Glass2019-12-021-0/+2
| | | | | | | This function belongs in mii.h so move it over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: Drop linux/crc8.hSimon Glass2019-12-021-23/+0
| | | | | | | | We have an existing U-Boot header for the one function that this defines. Use that instead of the linux/ one. Move over the nice comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: dwc3: Add phy interface for dwc3_ubootJagan Teki2019-11-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot has two different variants of dwc3 initializations, - with dm variant gadget, so the respective dm driver would call the dwc3_init in core. - with non-dm variant gadget, so the usage board file would call dwc3_uboot_init in core. The driver probe would handle all respective gadget properties including phy interface via phy_type property and then trigger dwc3_init for dm-variant gadgets. So, to support the phy interface for non-dm variant gadgets, the better option is dwc3_uboot_init since there is no dedicated controller for non-dm variant gadgets. This patch support for adding phy interface like 8/16-bit UTMI+ code for dwc3_uboot. This change used Linux phy.h enum list, to make proper code compatibility. Cc: Marek Vasut <marex@denx.de> Tested-by: Levin Du <djw@t-chip.com.cn> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2019-11-084-0/+112
|\ | | | | | | - Assorted fixes
| * usb: composite: add BOS descriptor support to composite frameworkT Karthik Reddy2019-11-072-0/+12
| | | | | | | | | | | | | | | | | | | | To add usb-3.0 support to peripheral device add BOS & SS capability descriptors to gadget composite framework. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Roger Quadros <rogerq@ti.com>
| * usb: udc: Introduce ->udc_set_speed() methodSherry Sun2019-11-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was copied from kernel commit: 67fdfda4a99ed. Sometimes, the gadget driver we want to run has max_speed lower than what the UDC supports. In such situations, UDC might want to make sure we don't try to connect on speeds not supported by the gadget driver because that will just fail. So here introduce a new optional ->udc_set_speed() method which can be implemented by interested UDC drivers to achieve this purpose. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
| * usb: gadget: Add match_ep() op to usb_gadget_opsVignesh Raghavendra2019-11-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | Add match_ep() op to usb_gadget_ops similar to Linux kernel which is useful in finding a suitable ep match for the function driver. This will avoid adding more gadget_is_xxx() handling code to usb_ep_autoconfig(). Also sync usb_ep_caps struct thats is usually used in the match_ep() callback by the gadget controller driver Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
| * bitmaps: import for_each_set_bit() macroVignesh Raghavendra2019-11-071-0/+61
| | | | | | | | | | | | | | | | Import for_each_set_bit() and associated macros and functions from Linux. This is useful in parsing interrupt registers and take action on each bit that is set. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
| * list: import list_first_entry_or_null()Vignesh Raghavendra2019-11-071-0/+14
| | | | | | | | | | | | | | Import list_first_entry_or_null() macro from Linux that would be used by Cadence USB driver Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
* | linux err: make ERR_PTR/PTR_ERR architecture specificSimon Goldschmidt2019-11-071-4/+4
|/ | | | | | | | | | This patch changes ERR_PTR/PTR_ERR to use CONFIG_ERR_PTR_OFFSET to map errno values into a pointer region that cannot contain valid pointers. IS_ERR and IS_ERR_OR_NULL have to be converted to use PTR_ERR, too, for this to work. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* fdt: Add INT32_MAX to kernel.h for libfdtSimon Glass2019-11-042-0/+3
| | | | | | | | | | | Unfortunately libfdt needs this value now, which is present in the stdint.h header. That file is just a placeholder in U-Boot and these sorts of constants appear in the linux/kernel.h header instead. To keep libfdt happy, add INT32_MAX too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dmTom Rini2019-11-011-0/+1
|\ | | | | | | | | | | - Fix for patman with email addresses containing commas - Bootstage improvements for TPL, SPL - Various sandbox and dm improvements and fixes
| * fdt: Fix alignment issue when reading 64-bits properties from fdtJean-Jacques Hiblot2019-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | The FDT specification [0] gives a requirement of aligning properties on 32-bits. Make sure that the compiler is aware of this constraint when accessing 64-bits properties. [0]: https://github.com/devicetree-org/devicetree-specification/blob/master/source/flattened-format.rst Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | linux/types.h: Surround 'struct ustat' with __linux__Bin Meng2019-10-281-0/+2
|/ | | | | | | | | | | 'struct ustat' uses linux-specific typedefs to declare its memebers: __kernel_daddr_t and __kernel_ino_t. It is currently not used by any U-Boot codes, but when we build U-Boot tools for other platform like Windows, this becomes a problem. Let's surround it with __linux__. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* mtd: spi: Add 'struct spi_flash {' to the codeSimon Glass2019-10-081-1/+7
| | | | | | | | | At present spi_flash is defined to be spi_nor which is confusing since it is not possible to find the 'spi_flash' by normal text search. Add a comment to help with this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* kconfig: doc: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPLLukasz Majewski2019-09-191-0/+2
| | | | | | | This patch adds some commit info for CONFIG_IS_ENABLED(FOO) when used in TPL context. Signed-off-by: Lukasz Majewski <lukma@denx.de>
* mtd: spi-nor: add missing SST26* flash IC protection opsEugeniy Paltsev2019-09-161-0/+4
| | | | | | | | | | | | | | | Commit c4e8862308d4 (mtd: spi: Switch to new SPI NOR framework) performs switch from previous 'spi_flash' infrastructure without proper testing/investigations which results in a regressions for SST26 flash series. Add missing SST26* flash IC protection ops which were introduced previously by Commit 3d4fed87a5fa (mtd: sf: Add support of sst26wf* flash ICs protection ops) Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* clk: gate: support sandboxPeng Fan2019-07-311-0/+3
| | | | | | Introduce io_gate_val for sandbox clk gate test usage Signed-off-by: Peng Fan <peng.fan@nxp.com>
* clk: add composite clk supportPeng Fan2019-07-311-0/+22
| | | | | | Import clk composite clk support from Linux Kernel 5.1-rc5 Signed-off-by: Peng Fan <peng.fan@nxp.com>
* clk-provider: include clk-uclass.hPeng Fan2019-07-311-0/+1
| | | | | | Because clk-provider use clk_ops, so let's include clk-uclass.h Signed-off-by: Peng Fan <peng.fan@nxp.com>
* clk: fixed_rate: export clk_fixed_ratePeng Fan2019-07-311-0/+7
| | | | | | Export the structure for others to use. Signed-off-by: Peng Fan <peng.fan@nxp.com>