summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* of: demote most debug output to loglevel 8 (vdebug)Roland Hieber2019-12-111-12/+12
| | | | | | | | | | | Loglevel 7 (debug) is often useful to get barebox running on new hardware; however, the heavy output of "OF:" messages makes most boards take several minutes to boot to a prompt, printing things which are probably interesting when debugging OF code itself, but not very helpful otherwise. Degrade most of the message to loglevel 8 (vdebug). Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: Add support for en25qh64Ulrich Ölmann2019-12-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This is a port of Linux kernel commit | commit 30a2c8aa3c520d54bcaf3015ca8141b0156448b1 | Author: Roger Pueyo Centelles <roger.pueyo@guifi.net> | Date: Thu Feb 7 20:09:35 2019 +0100 | | mtd: spi-nor: Add support for en25qh64 | | The Eon EN25QH64 is a 64 Mbit SPI NOR flash memory chip found | on recent wireless routers. Its 32, 128 and 256 Mbit siblings | are already supported. | | Tested on a COMFAST CF-E120A v3 router board. | | Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net> | Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> | Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2019-12-104-2/+530
|\
| * clk: zynq: remove clkdevsLucas Stach2019-11-111-9/+0
| | | | | | | | | | | | | | | | They aren't needed anymore, as all the Zynq devices now use a DT based clock lookup. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: zynq: partially sync with LinuxLucas Stach2019-11-111-16/+71
| | | | | | | | | | | | | | | | | | | | Sync the clock enum with the clocks used by Linux and the DT binding. Implement AMBA bus clocks and SPI and SDIO peripheral clocks and register a DT clock controller, so the clocks can be looked up by DT handle. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: zynq: fix up address from DTLucas Stach2019-11-111-1/+23
| | | | | | | | | | | | | | | | | | | | The upstream Zynq 7000 DT describes the SLCR child devices physical address as an offset within the SLCR. The driver thus needs to add the SLCR base offset to the address before trying to map the MMIO region. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: zynq: improve PLL enable handlingLucas Stach2019-11-111-1/+12
| | | | | | | | | | | | | | | | | | | | | | Ensure that both the powerdown and reset bits are cleared when the PLL gets enabled, as any of those set would prevent the PLL from working. Also add a status readback function, so the real status of the PLL is reflected in the Barebox clock state. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: zynq: use base address of clock controllerLucas Stach2019-11-111-15/+15
| | | | | | | | | | | | | | | | | | The clock controller is a subregion of the SLCR, use the real base of this region for mapping the registers. This will allow to switch to DT based probing later. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynq: move clock controller driver to drivers/clkLucas Stach2019-11-113-0/+428
| | | | | | | | | | | | | | No functional change, just adjusting the Zynq code to common practise. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: macb: add Zynq compatibleLucas Stach2019-11-111-0/+1
| | | | | | | | | | | | | | Add compatible for the GEM on the Zynq 7000 device. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: macb: handle more clocksLucas Stach2019-11-111-2/+22
| | | | | | | | | | | | | | | | | | Both pclk and hclk are required clocks in the DT binding. rx_clk and tx_clk are optional, but must be enabled if a system has separate gates for them. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/watchdog'Sascha Hauer2019-12-106-20/+52
|\ \
| * | watchdog: core: use new dev_add_param_tristate helper for .running paramAhmad Fatoum2019-12-051-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previous commit added a dev_add_param_tristate_ro that can be readily used instead of the enum parameter here. Use it. This also fixes the issue that running_names had external linkage. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: stm32_iwdg: explicitly set .running to UNSUPPORTEDAhmad Fatoum2019-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've spent some time trying to get the ONF (Watchdog enable status) bit in the IWDG_SR register to read as something other than zero. It has since been confirmed to be non-functional[1]. To avoid someone else spending time on this, document that running status is unsupported on this hardware explicitly. No functional change as UNSUPPORTED is already the default. [1]: https://www.spinics.net/lists/arm-kernel/msg770527.html Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: f71808e: support .running device parameterAhmad Fatoum2019-11-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The American Megatrends BIOS I am using can be configured to start the Fintek watchdog prior to the UEFI payloads. To avoid BIOS updates that reset this functionality going unnoticed, implement support for WDOG_HW_RUNNING. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: imxwd: support .running device parameter on i.MX2+Ahmad Fatoum2019-11-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX can be fused to start the watchdog on power-on reset. To give users an easy way to determine whether the watchdog is running, implement support for WDOG_HW_RUNNING. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: implement generic support for .running device parameterAhmad Fatoum2019-11-111-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux watchdog have an optional WDOG_HW_RUNNING bit that is used in conjunction with CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED to automatically ping running watchdogs until userspace takes over. So far, when we ported Linux drivers, we dropped this detection, but it would be useful to have this information in barebox as well: The American Megatrends BIOS I am using allows configuring the hardware watchdog from the BIOS. barebox enables the WDT as well, so in normal operation we would never notice if after a BIOS update, the watchdog is no longer enabled. If we maintain a running parameter on watchdog devices, board code can be written to check whether the watchdog device is indeed running. To achieve this, add the necessary bits to the watchdog API. How we go about it differs from Linux a little: - We use an enum instead of a single bit, so we can differentiate between watchdogs that are not running and watchdogs whose running status is unknown. - Because we can check whether watchdog_hw_running is supported, it now can fail and return a negative value in that case - We do the maintenance of the running parameter after barebox feeds/disables the watchdog in the core, so it doesn't need to be replicated across drivers. Drivers hould only initialize the running parameter once at probe time. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: always populate watchdog priority from device tree if possibleAhmad Fatoum2019-11-113-18/+18
| |/ | | | | | | | | | | | | | | | | | | | | So far, only the da9063 and da9053 have made use of the optional barebox watchdog-priority binding. Move it into the core, so other device drivers automatically have their watchdog-priority property parsed as well. This patch doesn't introduce any functional changes for upstream boards. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb'Sascha Hauer2019-12-1010-121/+110
|\ \
| * | usb: musb: use usb_register_otg_device()Sascha Hauer2019-11-212-37/+8
| | | | | | | | | | | | | | | | | | | | | We now have usb_register_otg_device() to register an "otg" device. Use it and drop the custom code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: i.MX: Use usb_register_otg_device()Sascha Hauer2019-11-212-73/+13
| | | | | | | | | | | | | | | | | | | | | We now have usb_register_otg_device() to register an "otg" device. Use it and drop the custom code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: dwc3: register otg deviceSascha Hauer2019-11-213-4/+12
| | | | | | | | | | | | | | | | | | | | | When the role in the device tree is specified as "otg" then register a otg device in barebox so that the user can configure the desired mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: Add function to register otg devSascha Hauer2019-11-213-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | We have two drivers in the tree which register an "otg" device to configure the host/peripheral switching. Before introducing a third driver create a common function for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: dwc3: remove unnecessary warningSascha Hauer2019-11-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The dwc3 driver warns when the value written to DWC3_GFLADJ happens to be same as already read from the register. This always happens when the driver was previously running when started 2nd stage from another barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/stm32'Sascha Hauer2019-12-109-35/+252
|\ \ \
| * | | remoteproc: add support for starting st,stm32mp1-m4Ahmad Fatoum2019-11-253-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The STM32MP157C-DK2 has a Cortex-M4 MCU in addition to the two Cortex-A7 MPUs. This remoteproc driver allows barebox running on a Cortex-A7 core to bootstrap the MCU with an ELF binary. Code ported from Linux v5.3 with rpmsg bits removed. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | remoteproc: register a device for new remoteproc instancesAhmad Fatoum2019-11-251-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct rproc has a device_d dev field, but so far it was unregistered. The implementation had a few downsides: - dev_printf prints NULL, because the unique_name of the device is NULL - The name used by firmwareload is the device tree node's name, which might be unnecessarily verbose, e.g. mlahb:m4@10000000.of - All remoteproc devices are given the same (unused) name and index Fix these by registering a device for the remoteproc and using it where appropriate. While at it, allow the remoteproc name to come from a device tree alias as well. This breaks user behavior in that firmwareload now uses the alias or remoteprocN to reference the remoteproc instance. This is probably acceptable as the driver is a very recent addition. Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nvmem: bsec: fix typo in function name (s/st32/stm32/)Ahmad Fatoum2019-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A m was missing. Reinstate it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | i2c: stm32: use device_reset_us helper instead of open-codingAhmad Fatoum2019-11-131-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The exact sequence is already available in form of device_reset_us. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | watchdog: stm32_iwdg: return -ENOSYS on attempt to disableAhmad Fatoum2019-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stm32_iwdg watchdog can't be disabled. To have the wd commant report this fact correctly to the user, the ->set_timeout needs to return -ENOSYS which is interpreted as "Watchdog cannot be disabled" instead of -EINVAL which means "Timeout value out of range". Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mfd: stpmic1: use register define from headerAhmad Fatoum2019-11-132-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous commit has copied over the upstream <linux/mfd/stpmic1.h> header. Use it instead of replicating register definitions in the MFD and watchdog cell driver. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/sdhci'Sascha Hauer2019-12-1012-1074/+1338
|\ \ \ \
| * | | | mci: imx-esdhc: Share code for esdhc_send_cmd()Andrey Smirnov2019-12-044-202/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Versions of esdhc_send_cmd() in imx-esdhc.c and imx-esdhc-pbl.c implement almost the same algorithm. To avoid code repetition, move that code to imx-esdhc-common.c and adjust all of the users accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Introduce esdhc_poll()Andrey Smirnov2019-12-044-39/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all of the explcitly coded timeout loops with a shared subroutine that is used by both regular driver and PBL code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Share code for esdhc_(setup|do)_data operationsAndrey Smirnov2019-12-044-81/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PBL and PIO case of the regular driver do exaclty the same thing during esdhc_(setup|do)_data stages of esdhc_send_cmd(). Move the code to a common file and adjust all of the users accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Use sdhci_set_cmd_xfer_mode()Andrey Smirnov2019-12-041-31/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop extra code by converting imx-esdhc-pbl.c to use sdhci_set_cmd_xfer_mode(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Use sdhci_transfer_data()Andrey Smirnov2019-12-044-35/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop some extra code by converting esdhc_do_data() to use sdhci_transfer_data(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Share IO accessors with regular driverAndrey Smirnov2019-12-045-208/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a bit of a change to PBL ESDHC initialization code it is possible to share all of the low-level I/O accessor code with the regular driver, including sharing definitions of flags describing HW's quirks. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Drop 'wrap_wml' flagAndrey Smirnov2019-12-041-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMX_SDHCI_WML doesn't change its value during PBL opearation, so it should be possible to configure it once. Doing it once also allows us to move the call into SoC specific code making 'wrap_wml' flag unnecessary. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Share initialization codeAndrey Smirnov2019-12-041-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move common ESDHC initialization code into subroutines and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc-pbl: Don't setup DMA registersAndrey Smirnov2019-12-041-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PBL code is PIO only, so setting up DMA related registers shouldn't be necessary. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Drop extra helper varaibleAndrey Smirnov2019-12-041-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's already 'ret' availible, no need to declare another return value variable. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Drop unused type definitionAndrey Smirnov2019-12-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There doesn't seem to be any users of struct fsl_esdhc_cfg in the tree. Drop it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Drop unnecessary type conversionAndrey Smirnov2019-12-041-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nether esdhc_setup_data() nor esdhc_do_data() really need struct mci_host, so we can drop a bit of extra type conversion code by changing their signature to accept struct fsl_esdhc_host instead Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: dove: fix dereference of nullable pointerAhmad Fatoum2019-11-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data->{blocks, blocksize, flags} are all used outside of the if clause checking whether data is not NULL. Fix this to avoid dereferencing null pointers. Fixes: bdcf89d274 ("mci: add Marvell Dove SDHCI driver") Cc: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: add Arasan SDHCI controller driverThomas Haemmerle2019-11-214-0/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Arasan SDHCI controller, which is found on the Xilinx Zynq 7000 and ZynqMP SoCs. This just adds very basic PIO read/write support. This submission is also missing the tap delay configuration, which is required for the high speed modes on the ZynqMP, but this can be added in a separate patch once it is clear how the interface for this feature should look like. The driver skeleton was provided by Michael, most of the actual driver porting work was done by Thomas and some coding style fixes and write support bug fixes added by Lucas. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: mci-bcm2835: Use generic PIO transfer functionSascha Hauer2019-11-211-84/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sdhci_transfer_data() to share more code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhci: Use generic PIO transfer functionSascha Hauer2019-11-211-68/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sdhci_transfer_data() in PIO mode to share mode code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: tegra: Use sdhci_set_cmd_xfer_mode()Sascha Hauer2019-11-211-30/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sdhci_set_cmd_xfer_mode() to share more code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: bcm2835: Use sdhci_set_cmd_xfer_mode()Sascha Hauer2019-11-211-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sdhci_set_cmd_xfer_mode() to share more code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>