summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* video: ssd1307fb: fix null pointer dereference on errorAhmad Fatoum2020-05-041-1/+1
| | | | | | | | | | On error, a goto may jump over the initialization of vmem and free the uninitialized value during clean up. Fix this. Found by compiling the code with clang. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2020-04-162-1/+2
|\
| * mmc: arasan: fix false bitMichael Graichen2020-04-141-1/+1
| | | | | | | | | | | | | | when accessing the SD card arasan_sdhci_send_cmd checks for the wrong bit Signed-off-by: Michael Graichen <michael.graichen@hotmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mmc: add MCI_SDHCI dependency to Arasan driverMichael Graichen2020-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | The Arasan driver depends on the SDHCI driver, without it we will see undefined references while linking arasan-sdhci.c:283: undefined reference to `sdhci_set_cmd_xfer_mode' arasan-sdhci.c:299: undefined reference to `sdhci_read_response' arasan-sdhci.c:303: undefined reference to `sdhci_transfer_data' Signed-off-by: Michael Graichen <michael.graichen@hotmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/zii'Sascha Hauer2020-04-161-0/+13
|\ \
| * | i2c: Port of_find_i2c_device_by_node() from LinuxAndrey Smirnov2020-04-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1616-3335/+5192
|\ \ \
| * | | usb: Add U-Boot xhci driverSascha Hauer2020-03-266-10/+4582
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: host: remove xhci driverSascha Hauer2020-03-264-3643/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current xhci driver support USB 2.0 only. The U-Boot driver is better developed and supports USB 3.0 devices. Remove the xhci driver first as a separate patch to make the patch adding the new U-Boot based driver better readable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: When no connection came up remove from scanning listSascha Hauer2020-03-261-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When after a timeout no connection came up then we have not only bail out, but also remove the device from the scanning list. Otherwise it can happen that the list never becomes empty and we probe forever. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Add super speed supportSascha Hauer2020-03-262-17/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: factor out a usb_setup_descriptor() functionSascha Hauer2020-03-261-52/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This factors out a usb_setup_descriptor() function with the goal to make the code better comparable to the corresponding U-Boot code. This also incorporates this U-Boot commit: | commit 2b338ef41127351089254b748de5cefd95c3e800 | Author: Hans de Goede <hdegoede@redhat.com> | Date: Tue May 5 23:56:04 2015 +0200 | | usb: Fix maxpacketsize for first descriptor read for low-speed usb devs | | This fixes descriptor reading of lowspeed devices through ohci not working. | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: net: Add support for the Asix AX88179Sascha Hauer2020-03-263-0/+765
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Asix AX88179 USB3.0 ethernet converter chip. The driver is based on the kernel driver with influence from the U-Boot driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: usb: add hook for link changesSascha Hauer2020-03-261-1/+10
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: net: Allocate tx buffer dynamicallySascha Hauer2020-03-261-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: remove unnecessary variableSascha Hauer2020-03-201-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "tmp" is only used to store the size of the descriptor. The name is not very meaningful and "tmp" is not even used everywhere it could be used. Just replace by using sizeof() directly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Assign dev_index onceSascha Hauer2020-03-201-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev->devnum is set once in usb_alloc_new_device(), set to 0 again later in usb_new_device() and then set back to the original value. This seems unnecessary, just set devnum once right before calling usb_set_address() on the device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: support set hub depth request for USB 3.0 hubsSascha Hauer2020-03-202-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: host: make init hook optionalSascha Hauer2020-03-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For controllers which do everything relevant during probe time make the init hook optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: Parse and save TT details from device descriptorSascha Hauer2020-03-201-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use dev_*Sascha Hauer2020-03-201-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Give the USB messages some context by using dev_* functions rather than printf()/debug(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Set new USB device name earlierSascha Hauer2020-03-201-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in usb_new_device() set the device name as early as possible to let dev_* functions print a meaningful name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: Do not power-cycle usb devices on initSascha Hauer2020-03-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an adoption of U-Boot commit 0834bb2fb0 ("usb: Do not power-cycle usb devices on init") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Pass portstatus/portchange to usb_hub_port_connect_change()Sascha Hauer2020-03-201-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | portstatus/portchange have just been read in usb_scan_port(), there shouldn't be any need to read them again in usb_hub_port_connect_change(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: Remove hack from the early daysSascha Hauer2020-03-201-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The weird hack about "bad shielded USB devices" goes back to the initial U-Boot git commmit. Let's be bold and remove it 18 years later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: let usb_scan_port() return voidSascha Hauer2020-03-201-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_scan_port() never returns anything else but 0, so let it return void. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: do not reset devices twiceSascha Hauer2020-03-203-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot has this since 3ed9eb93c2 ("usb: Don't reset the USB hub a 2nd time"), so do the same for barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: hub: Make debugging output more consistentSascha Hauer2020-03-201-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the messages print the port they belong to, others don't. Print the port consistently in all debugging messages. Also remove some stray '\' in the messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/spi'Sascha Hauer2020-04-169-39/+867
|\ \ \ \
| * | | | mtd: spi-nor: Add support for cy15x104qSascha Hauer2020-04-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Cypress cy15b104q and cy15v104q are 4Mbit serial SPI F-RAM devices. Add support for them to the spi-nor driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | spi: Add fsl-dspi driverSascha Hauer2020-04-143-0/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fsl-dspi is found on Freescale Vybrid, Coldfire and Layerscape SoCs. This adds the driver based on the Linux driver as of v5.5. Coldfire support has been dropped as it's rather obsolete. Vybrid support has been dropped because it needs the DMA engine support we do not have in barebox. What's left is support for Layerscape where this driver has been tested on. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | spi: validate spi messagesSascha Hauer2020-04-141-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-144-45/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for parsing the big-endian device tree property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | regmap-mmio: Add missing pieces for 64bit supportSascha Hauer2020-03-241-0/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | The 64bit accessor functions are present, but unused. Hook them up when needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/pwm'Sascha Hauer2020-04-1612-136/+744
|\ \ \ \
| * | | | PWM: add support for STM32Ahmad Fatoum2020-03-316-0/+489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | led: pwm: use new pwm_apply_state APIAhmad Fatoum2020-03-311-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support PWM_POLARITY_INVERTED for PWM LEDs, we need to to use the apply API. Do so. 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-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-314-103/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10/+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-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | led: pwm: always initialize PWM LEDs as inactiveAhmad Fatoum2020-03-311-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the active-low property is respected when setting brightness, it's ignored when initializing the LED as off in the probe function and thus LEDs are active on startup. Fix this. Fixes: 769eb5e7bb ("led: pwm: support active-low property") Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/net'Sascha Hauer2020-04-163-5/+8
|\ \ \ \
| * | | | net: phy: Also print link down messagesSascha Hauer2020-03-311-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only print when the link comes up, but also when it goes down. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>