summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* ARM: at91: Move mci platform data to include/Sascha Hauer2020-05-081-0/+15
| | | | | | | | To be able to add the Atmel mci driver to COMPILE_TEST move the definition of struct atmel_mci_platform_data to include/ where it can be reached from foreign SoCs as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zii'Sascha Hauer2020-04-161-0/+1
|\
| * i2c: Port of_find_i2c_device_by_node() from LinuxAndrey Smirnov2020-04-011-0/+1
| | | | | | | | | | | | | | | | | | | | Port of_find_i2c_device_by_node() from Linux in order to allow looking i2c_client up by corresponding DT node. Useful for interacting with identical raw/driverless I2C devices that are not found on the same bus between board variants. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb'Sascha Hauer2020-04-165-7/+58
|\ \
| * | usb: Add U-Boot xhci driverSascha Hauer2020-03-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the xhci driver from U-Boot-2020.04-rc2. The usual things like adjusting to the barebox driver model and using dev_* instead of printf/puts/debug messages are made. The previously existing PCI support is not present in this driver currently. XHCI PCI support was not enabled in any defconfig, so we boldly assume it was unused. It shouldn't be much effort though to add it again. The memory handling has been changed for barebox. The various descriptor rings and descriptors are allocated with dma_alloc_coherent() which makes the cache flushing/invalidating unnecessary. They are left in the driver in case we want to change that. The XHCI has a nasty limitation in that the TRBs may not cross a 64KiB boundary. This limitation has been handled in the U-Boot driver, but the handling seems to be broken. We help ourselves with using a bounce buffer which is sufficiently aligned, but this limits the maximum bulk transfer size to 64KiB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: Add super speed supportSascha Hauer2020-03-263-0/+39
| | | | | | | | | | | | | | | | | | | | | This adds the missing bits and pieces to add super speed support to the USB stack. It is based on the corresponding U-Boot code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: hub: Translate USB 3.0 hub port status into old versionSascha Hauer2020-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adoption of U-Boot commit: | 1commit 74ffc7cbb1d2d1f218b1bd67d1bd3cc1cba8aa79 | Author: Bin Meng <bmeng.cn@gmail.com> | Date: Wed Jul 19 21:51:12 2017 +0800 | | usb: hub: Translate USB 3.0 hub port status into old version | | USB 3.0 hub port status field has different bit positions from 2.0 | hubs. Since U-Boot only understands the old version, translate the | new one into the old one. | | Since we are going to add USB 3.0 hub support, this feature is only | available with driver model USB. | | Signed-off-by: Bin Meng <bmeng.cn@gmail.com> | Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: net: Allocate tx buffer dynamicallySascha Hauer2020-03-261-0/+1
| | | | | | | | | | | | | | | | | | It's cleaner to have a tx buffer per device and not one for all. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: net: Allocate rx buffer dynamicallySascha Hauer2020-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Allocate an individual rx buffer per device in the size we need it instead of using one global buffer for all devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: support set hub depth request for USB 3.0 hubsSascha Hauer2020-03-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an adoption of U-Boot commit bbc6f06c0031249bf1983b875e54cb7549bafe60: | commit bbc6f06c0031249bf1983b875e54cb7549bafe60 | Author: Bin Meng <bmeng.cn@gmail.com> | Date: Wed Jul 19 21:51:13 2017 +0800 | | usb: hub: Support 'set hub depth' request for USB 3.0 hubs | | USB 3.0 hub uses a hub depth value multiplied by four as an offset | into the 'route string' to locate the bits it uses to determine the | downstream port number. We shall set the hub depth value of a USB | 3.0 hub after it is configured. | | Signed-off-by: Bin Meng <bmeng.cn@gmail.com> | Reviewed-by: Simon Glass <sjg@chromium.org> In this patch we also support recording the depth of a hub in struct usb_device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: hub: Parse and save TT details from device descriptorSascha Hauer2020-03-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adoption of U-Boot commit 5624dfd5aa91c244519ec60b40b4a42b4d9a43ca: | commit 5624dfd5aa91c244519ec60b40b4a42b4d9a43ca | Author: Bin Meng <bmeng.cn@gmail.com> | Date: Wed Jul 19 21:51:16 2017 +0800 | | usb: hub: Parse and save TT details from device descriptor | | A high speed hub has a special responsibility to handle full speed/ | low speed devices connected on downstream ports. In this case, the | hub must isolate the high speed signaling environment from the full | speed/low speed signaling environment with the help of Transaction | Translator (TT). TT details are provided by hub descriptors and we | parse and save it to hub uclass_priv for later use. | | Signed-off-by: Bin Meng <bmeng.cn@gmail.com> | Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: Make driver_info constSascha Hauer2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | driver_info shouldn't be changed, make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/spi'Sascha Hauer2020-04-162-15/+17
|\ \ \
| * | | spi: validate spi messagesSascha Hauer2020-04-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds __spi_validate() to validate spi messages. This function is a stripped down version from the Kernel. The motivation for adding this was to fill in xfer->bits_per_word from spi->bits_per_word so that a spi bus driver can use the former. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regmap-mmio: Add big endian supportSascha Hauer2020-04-141-15/+13
| |/ / | | | | | | | | | | | | | | | Add support for parsing the big-endian device tree property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/pwm'Sascha Hauer2020-04-163-14/+153
|\ \ \
| * | | PWM: add support for STM32Ahmad Fatoum2020-03-311-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver adds support for PWM driver on STM32 platform based on the Linux v5.4 support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of: introduce of_property_count_elems_of_sizeAhmad Fatoum2020-03-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Import the Linux helper, so code using it may be more easily ported. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: add apply API support for polarityAhmad Fatoum2020-03-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some PWM chips support outputting an inverted PWM signal. Add API support for this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: apply initial state in of_pwm_requestAhmad Fatoum2020-03-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functions prepares a state that can later be tweaked and applied to the PWM device with pwm_apply_state(). This is a convenient function that first retrieves the current PWM state and the replaces the period with the reference values defined in pwm->args. Once the function returns, you can adjust the ->enabled and ->duty_cycle fields according to your needs before calling pwm_apply_state(). Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: retire pwm_set_periodAhmad Fatoum2020-03-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Client code can use pwm_apply_state or pwm_config to set period as well as duty cycle. Having a pwm_set_period thus doesn't add any value. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: remove old PWM API in favor of Linux ->applyAhmad Fatoum2020-03-311-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux has the new atomic PWM API in addition to the old one for backward compatibility. We only have three PWM drivers in here, so port them over to the new ->apply API. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: group PWM state into new struct pwm_stateAhmad Fatoum2020-03-311-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a prerequisite for moving to the new apply API, we need to group all state into one struct that we can apply at once. Prepare for this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: remove ineffectual pwm_{set,get}_duty_cycleAhmad Fatoum2020-03-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setter sets a value unused anywhere, but in the getter. As the functions are unused, just drop them. There's pwm_config that can be used for this instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PWM: core: remove FLAG_ENABLEDAhmad Fatoum2020-03-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for moving to a struct pwm_state like Linux does, turn the flag into a variable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/net'Sascha Hauer2020-04-161-1/+6
|\ \ \ \
| * | | | net: Add ifdown support and commandSascha Hauer2020-03-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ifdown is the counterpart to ifup and disables one or all ethernet interfaces. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: Open ethernet devices explicitlySascha Hauer2020-03-311-1/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Open ethernet devices explicitly rather than implicitly when sending packets. This allows us to not only enable, but in the next step to also disable ethernet devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/misc'Sascha Hauer2020-04-162-4/+5
|\ \ \ \
| * | | | libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1Masahiro Yamada2020-04-152-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the relative include path in <linux/libfdt.h> Including <linux/kernel.h> is too much. <linux/limits.h> is enough for INT_MAX. Define INT32_MAX and UINT32_MAX in the same way as Linux does. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | clk: at91: port Linux v5.6 SAM9X60 (new ARM926EJ-S) clock supportAhmad Fatoum2020-04-151-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a bug hunt that ultimately turned out unrelated to the state of the barebox at91 clk driver, I synchronized its state with Linux v5.6. Bug fixes and clean up to minimize the diff were split out in separate prior commits. This last commit imports the rest, which is basically support for Microchip's new ARM926EJ-S SoC, the SAM9x60. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | clk: at91: add sama5d2 audio PLL supportAhmad Fatoum2020-04-151-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7310b976 ("clk: at91: fix compilation errors in sama5d2.c") and follow-up commit ca3077068c ("clk: at91: delete dead i2s/audio code") had deleted the i2s/audio clock related parts of the upstream driver. This was mostly due to unwillingness on my part to understand the code enough for porting them and because I deemed them unnecessary to support in barebox. The former has changed and the latter is not totally true as audio PLL derived clocks may be muxed as inputs for programmable and generated clocks. Port them over and mimize the diff to upstream. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | clk: migrate to SPDX-License-Identifier useAhmad Fatoum2020-04-151-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these are a product of source sync with Linux, the other were done with macro assistance by searching for /later/, deleting license text, adding appropriate SPDX-License-Identifier and manual post-review. Devices without a license indicated where assumed GPL-2.0-only according with the project's license. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | include: linux/kernel.h: port DIV_ROUND_CLOSEST_ULL definitionAhmad Fatoum2020-04-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have DIV_ROUND_CLOSEST, but no DIV_ROUND_CLOSEST_ULL. Import the latter for use by later commits. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | clk: add clk_unregister stubAhmad Fatoum2020-04-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make kernel clk driver import a tiny bit more convenient by allowing clk_unregister calls and control flow to remain as is. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | clk: implement clk_register_fixed_rateAhmad Fatoum2020-04-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We lack a way to instantiate a fixed clock while specifying a parent. This is used in the at91 clock code sync with upstream in a later commit, so prepare by porting clk_register_fixed_rate. It's based on the Linux commit of the same name with the difference that it doesn't use (and thus doesn't require) a struct device_d * as first parameter. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | of: port Linux of_get_compatible_child helperAhmad Fatoum2020-04-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incoming Linux code port makes use of the helper. Add it now instead of having to open-code it later. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | ARM: include: remove unused <asm/processor.h>Ahmad Fatoum2020-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | File has been in source tree for 17 years and is unused. Drop it. The only definition we might want out of the file is cpu_relax(), which we already open code as barrier() with a comment in a couple of places. Move the definition to <linux/barebox-wrapper.h> and drop the file altogether. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | regmap: retire of_node_to_regmap in favor of device_node_to_regmapAhmad Fatoum2020-04-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device_node_to_regmap is the current upstream API for this and is more general, because it allocates a regmap on demand if none exists. As of_node_to_regmap is unused anywhere, remove it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | mfd: syscon: implement device_node_to_regmapAhmad Fatoum2020-04-151-0/+5
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend our syscon API with a device_node_to_regmap function that has the same semantics as upstream: __________________________________________________________________________ | Linux commit 39233b7c611248c0d05209b4854bc63e26485655 | CommitDate: Thu Aug 8 15:30:07 2019 -0700 | | mfd/syscon: Add device_node_to_regmap() | | device_node_to_regmap() is exactly like syscon_node_to_regmap(), but it | does not check that the node is compatible with "syscon", and won't | attach the first clock it finds to the regmap. | | The rationale behind this, is that one device node with a standard | compatible string "foo,bar" can be covered by multiple drivers sharing a | regmap, or by a single driver doing all the job without a regmap, but | these are implementation details which shouldn't reflect on the | devicetree. | | Signed-off-by: Paul Cercueil <paul@crapouillou.net> | Acked-by: Arnd Bergmann <arnd@arndb.de> | Signed-off-by: Paul Burton <paul.burton@mips.com> |__________________________________________________________________________ Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | net: phy: Add missing inline to functionSascha Hauer2020-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add missing inline to static inline no-op wrapper function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | regulator: void function returns voidSascha Hauer2020-04-011-1/+0
| |/ / |/| | | | | | | | | | | | | | Do not return a value from a function returning void. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | reset: remove duplicate imx8mq-reset.h and use correct definesLucas Stach2020-03-231-64/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | The defines in the Barebox copy of imx8mq-reset.h had a typo, which has been fixed in the upstream Linux version of this file. So depending on include ordering the reset driver using those defines would fail to compile. Use the typo fixed versions of the define in the driver and remove the duplicate include file, as we also have the proper upstream version now. Reported-by: Giorgio Dal Molin <giorgio.nicole@arcor.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer2020-03-183-8/+64
|\ \
| * | phy: introduce phy_get_by_indexAhmad Fatoum2020-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream (v5.6-rc1) device tree node of the stm32mp157c-dk2's OHCI has a phys property, but not phy-names. We have no API to reference such a phy easily (passing NULL isn't allowed). Add one. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | phy: remove unused init_data parameterAhmad Fatoum2020-02-251-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | Linux has since migrated to a new lookup API that lacks the init_data parameter. As it's unused in barebox, follow suit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | regulator: import Linux regulator_bulk APIAhmad Fatoum2020-02-251-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | Linux v5.6-rc1 contains 168 references to regultor_bulk_get, which allows getting multiple regulators to set at once. Instead of open coding them when porting code, port over the helpers to barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | reset_source: introduce reset_source_to_stringAhmad Fatoum2020-02-191-2/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | We have a few places where driver code prints reset_source_name() to console after setting the reset source. This working is probe order dependent, because reset_source_name() prints the highest priority reset_source so far, which doesn't necessarily have to be the one that was just computed. Implement reset_source_to_string, so drivers can be migrated to use it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-03-182-2/+8
|\ \
| * | reset: add stub for device_reset when CONFIG_RESET_CONTROLLER=nAhmad Fatoum2020-03-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users of an optional device_reset that have CONFIG_RESET_CONTROLLER=n will trigger compilation errors. Add a static inline stub to fix it. [ Note: device_reset is unused and unusable because we have no reset controller implementing .reset. It's available in Linux though and apparently useful for shared resets, so it's left in ] Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>