summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* clk: add clk-gate supportPeng Fan2019-07-311-0/+18
| | | | | | Import clk-gate support from Linux Kernel 5.1-rc5 Signed-off-by: Peng Fan <peng.fan@nxp.com>
* clk: export mux/divider opsPeng Fan2019-07-311-0/+5
| | | | | | Export mux/divider ops and divider_recalc_rate for composite usage Signed-off-by: Peng Fan <peng.fan@nxp.com>
* clk: mux: add set parent supportPeng Fan2019-07-311-0/+2
| | | | | | Add set parent support for clk mux Signed-off-by: Peng Fan <peng.fan@nxp.com>
* Merge branch '2019-07-26-ti-imports'Tom Rini2019-07-271-0/+11
|\ | | | | | | | | - Bring in the rest of the J271E platform - Various OMAP3/AM3517, DA850 fixes
| * firmware: ti_sci: Add a command for releasing all exclusive devicesLokesh Vutla2019-07-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Any host while requesting for a device can request for its exclusive access. If an exclusive permission is obtained then it is the host's responsibility to release the device before the software entity on the host completes its execution. Else any other host's request for the device will be nacked. So add a command that releases all the exclusive devices that is acquired by the current host. This should be used with utmost care and can be called only at the end of the execution. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
| * firmware: ti_sci: Add processor shutdown API methodAndreas Dannenberg2019-07-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Add and expose a new processor shutdown API that wraps the two TISCI messages involved in initiating a core shutdown. The API will first queue a message to have the DMSC wait for a certain processor boot status to happen followed by a message to trigger the actual shutdown- with both messages being sent without waiting or requesting for a response. Note that the processor shutdown API call will need to be followed up by user software placing the respective core into either WFE or WFI mode. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
| * firmware: ti_sci: Allow for device shared and exclusive requestsLokesh Vutla2019-07-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Sysfw provides an option for requesting exclusive access for a device using the flags MSG_FLAG_DEVICE_EXCLUSIVE. If this flag is not used, the device is meant to be shared across hosts. Once a device is requested from a host with this flag set, any request to this device from a different host will be nacked by sysfw. Current tisci driver enables this flag for every device requests. But this may not be true for all the devices. So provide a separate commands in driver for exclusive and shared device requests. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* | Merge tag 'u-boot-imx-20190719' of ↵Tom Rini2019-07-271-0/+132
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
| * clk: sandbox: Adjust clk-mux.c to emulate reading divider value from HWLukasz Majewski2019-07-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | The generic mux clock code for CCF requires reading the clock multiplexer value from HW registers. As sandbox by design has readl() as no-op it was necessary to provide this value in the other way. The new field in the mux structure (accessible only when sandbox is run) has been introduced for this purpose. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * clk: sandbox: Adjust clk-divider to emulate reading its value from HWLukasz Majewski2019-07-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | The generic divider clock code for CCF requires reading the divider value from HW registers. As sandbox by design has readl() as no-op it was necessary to provide this value in the other way. The new field in the divider structure (accessible only when sandbox is run) has been introduced for this purpose. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * clk: Port Linux common clock framework [CCF] for imx6q to U-boot (tag: v5.1.12)Lukasz Majewski2019-07-191-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch brings the files from Linux kernel (linux-stable/linux-5.1.y SHA1: 5752b50477da)to provide clocks support as it is used on the Linux kernel with Common Clock Framework [CCF] setup. The directory structure has been preserved. The ported code only supports reading information from PLL, MUX, Divider, etc and enabling/disabling the clocks USDHCx/ECSPIx depending on used bus. Moreover, it is agnostic to the alias numbering as the information about the clock is read from the device tree. One needs to pay attention to the comments indicating necessary for U-Boot's driver model changes. If needed, the code can be extended to support the "set" part of the clock management. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * clk: Introduce clk-provider.h to store Common Clock Framework's internalsLukasz Majewski2019-07-191-0/+16
| | | | | | | | | | | | | | This file now stores the dev_get_clk_ptr() wrapper on the dev_get_uclass_priv() function. Signed-off-by: Lukasz Majewski <lukma@denx.de>
* | clk: sifive: Sync-up WRPLL library with upstream LinuxAnup Patel2019-07-191-46/+24
| | | | | | | | | | | | | | | | | | Now that SiFive clock driver is merged in upstream Linux, we sync-up WRPLL library used by SiFive clock driver with upstream Linux sources. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | clk: sifive: Factor-out PLL library as separate moduleAnup Patel2019-07-191-0/+101
|/ | | | | | | | To match SiFive clock driver with latest Linux, we factor-out PLL library as separate module under drivers/clk/analogbits. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* lib: Implement strndup()Thierry Reding2019-06-051-0/+1
| | | | | Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* mpc83xx: Introduce ARCH_MPC836*Mario Six2019-05-201-1/+1
| | | | | | Replace CONFIG_MPC836* with proper CONFIG_ARCH_MPC836* Kconfig options. Signed-off-by: Mario Six <mario.six@gdsys.cc>
* mpc83xx: Introduce ARCH_MPC832*Mario Six2019-05-201-1/+1
| | | | | | Replace CONFIG_MPC832* with proper CONFIG_ARCH_MPC832* Kconfig options. Signed-off-by: Mario Six <mario.six@gdsys.cc>
* mpc83xx: Introduce ARCH_MPC830*Mario Six2019-05-201-1/+1
| | | | | | Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options. Signed-off-by: Mario Six <mario.six@gdsys.cc>
* lib: add Zstandard decompression supportMarek Behún2019-05-051-0/+1147
| | | | | | | | | Add the zstd library from Linux kernel (only decompression support). There are minimal changes to build with U-Boot, otherwise the files are identical to Linux commit dc35da16 from March 2018, the files had not been touched since in kernel. Also SPDX lincese tags were added. Signed-off-by: Marek Behún <marek.behun@nic.cz>