summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* clk: at91: sync with Linux v5.8-rc1Ahmad Fatoum2020-07-0514-63/+1025
| | | | | | | | | | | | | | | | | | | | | | | | | | This ports over a couple of changes that accrued upstream between v5.6, when we last synchronized, and v5.8-rc1: 5bf7f4a24938 clk: at91: sam9x60: Don't use audio PLL b0ecf1c6c6e8 clk: at91: usb: continue if clk_hw_round_rate() return zero 43b203d32b77 clk: at91: sam9x60: fix usb clock parents d7a83d67a169 clk: at91: usb: use proper usbs_mask 9962fb0d1995 clk: at91: usb: introduce num_parents in driver's structure 12dc8d3be9d8 clk: at91: add at91sam9g45 pmc driver 0969b242f7b8 clk: at91: add sama5d3 pmc driver 143e04dab6b4 clk: at91: add at91sam9n12 pmc driver 02ff48e4d7f7 clk: at91: add at91rm9200 pmc driver 99e107439eea clk: at91: Add peripheral clock for PTC f6363c437dc6 clk: at91: pmc: do not continue if compatible not located 7425f246f725 clk: at91: optimize pmc data allocation 99767cd4406f clk: at91: allow setting PCKx parent via DT 03a1ee1dad0e clk: at91: allow setting all PMC clock parents via DT Besides fixes, mostly around sam9x60, this adds support for the new a91 device tree clock bindings that were extended to the sama5d3 in v5.8-rc1. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2020-06-115-55/+13
|\
| * aiodev: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-05-252-29/+6
| | | | | | | | | | | | | | | | | | | | | | | | This adapts all files that were identifed by licensecheck (https://salsa.debian.org/build-common-team/licensecheck.git) as licensed under the GPL and that have a (IMHO) clear copyright statement. The advantage is that these specifiers are machine-parseable which helps license conformance, e.g. for packaging barebox in Debian. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * pwm: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-05-253-26/+7
| | | | | | | | | | | | | | | | | | | | | | | | This adapts all files that were identifed by licensecheck (https://salsa.debian.org/build-common-team/licensecheck.git) as licensed under the GPL and that have a (IMHO) clear copyright statement. The advantage is that these specifiers are machine-parseable which helps license conformance, e.g. for packaging barebox in Debian. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/sandbox-compile-test'Sascha Hauer2020-06-116-13/+8
|\ \
| * | mtd: nand: base: fix use of uninitialized struct memberAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ooblen is read in nand_do_read_ops, despite never having been assigned a value. Because ooblen is used to indicate how many bytes of oobbuf are usable and oobbuf is NULL, use 0 as initial value. Found on ARCH=sandbox using clang-analyzer. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: xhci-hcd: replace opencoded non-atomic 64-bit MMIO with lo_hi helperAhmad Fatoum2020-06-031-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3c5317e9046 ("usb: xhci-hcd: Make use of lo_hi_readq/writeq()") had made use of lo_hi_readq/writeq() to implement xhci_read/write_64(), like Linux does, but this was removed in commit fddd1c7c51a8 ("usb: host: remove xhci driver"). Reinstate it to make code clearer. No functional change. [Note: Linux doesn't use any readq/writeq, but does two 32-bit access always, even on 64-bit systems] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: xhci-hcd: remove unused #include <asm/cache.h>Ahmad Fatoum2020-06-031-1/+0
| | | | | | | | | | | | | | | | | | | | | We don't use anything defined within, so drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: depend on HAS_DMAAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The driver makes use of dma_alloc_coherent and brethren. Depend on HAS_DMA to be sure, we don't run into link errors when compile-testing. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fec_imx: depend on HAS_DMAAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The driver makes use of dma_alloc_coherent and brethren. Depend on HAS_DMA to be sure, we don't run into link errors when compile-testing. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr: fsl: depend on ARMAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We have inline assembly in the driver, so we can't compile-test it unmodified on non-ARM. Indicate so in the Kconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: orion: depend on ARMAhmad Fatoum2020-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We have inline assembly in the driver, so we can't compile-test it unmodified on non-ARM. Indicate so in the Kconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: arm_global_timer.c: remove unused asm/ headerAhmad Fatoum2020-06-031-1/+0
| |/ | | | | | | | | | | | | | | We don't use the header and dropping it allows us to compile-test the driver under non-ARM architectures. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mmc'Sascha Hauer2020-06-1110-87/+24
|\ \
| * | mci: reword MCI_STARTUP textAhmad Fatoum2020-06-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent addition of a generic device_detect for MCI devices, the MCI_STARTUP help text is no longer accurate. Reword it, but leave the option as-is as some boards may be broken if we drop the option (e.g. because they still depend on a probe order or call default_environment_path_set, but don't explicitly detect the device). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: remove now-duplicate dev->detect implementations in host driversAhmad Fatoum2020-06-038-79/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previous commit introduced a fall-back MCI hw_dev->detect implementation. All drivers touched in this commit populate hw_dev, so lets drop their now-superfluous detect implementations. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mci: define fall-back hw_dev->detect for all MCIsAhmad Fatoum2020-06-031-3/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | A barebox environment oftree node may reference its storage by a phandle to a partition node under a MCI node. barebox will then call the device's detect method to detect the card if this hasn't happened before. Out of 17 MCI drivers, 8 host drivers already implement a detect method, which just calls mci_detect_card. Provide a generic implementation that does the same. 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-06-118-10/+24
|\ \
| * | serial: stm: set linux_console_nameMichael Grzeschik2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serial: amba-pl011: set linux_console_nameMichael Grzeschik2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serial: Add flush function to NS16550 driverDavid Dgien2020-06-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Add flush function to NS16550 to remove bad characters being printed during reset Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: replace commas with semicolons where appropriateAhmad Fatoum2020-05-205-10/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | Found by searching drivers/ arch/ common/ and lib/ for /^\s+[^."/\*\[\s\{\(A-Z][^\[\{\(]*=[^\{\(]+,$/ Because the comma has the lowest precedence in C, this shouldn't result in any functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kvx'Sascha Hauer2020-06-111-1/+0
|\ \
| * | clocksource: kvx: remove unused variable npClement Leger2020-05-181-1/+0
| |/ | | | | | | | | | | | | Remove unused variable np from probe function. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fastboot'Sascha Hauer2020-06-1113-977/+54
|\ \
| * | fastboot: split generic code from USB gadgetEdmund Henniges2020-05-203-967/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fastboot specification describes other protocols beyond USB. Allow these to reuse the generic parts of the existing fastboot code when they are implemented. Most of the changes in common/fastboot.c are due to the renaming of struct f_fastboot *f_fb to struct fastboot *fb. Signed-off-by: Edmund Henniges <eh@emlix.com> Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | poller: Give pollers a nameSascha Hauer2020-05-2010-10/+10
| |/ | | | | | | | | | | It helps debugging when pollers have a name, so give them one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mci: sdhci: Fix swapped argument for sdhci_write32Ahmad Fatoum2020-06-101-2/+2
|/ | | | | | | | | sdhci_write32 accepts the register as second argument, not third. Fix this up. Fixes: 075179763a ("mci: sdhci: add Atmel SDHCI (sama5d2, sam9x60) support") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2020-05-144-22/+44
|\
| * regulator: stpmic1: move to coredevice levelLucas Stach2020-05-121-1/+1
| | | | | | | | | | | | | | Those regulators are needed by other devices. Probe them early. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mfd: stpmic1: move to coredevice levelLucas Stach2020-05-121-1/+1
| | | | | | | | | | | | | | | | The PMIC provides regulators, which are needed before other devices can probe. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: stm32_sdmmc2: move command timeout errors to debug levelLucas Stach2020-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Command timeouts are sometimes a normal operating condition (for example when probing whether the connected card is SD or MMC), so we don't want to print an error message for all of them. Move those messages to the debug level, the MCI core will print some more meaningful messages on most command errors anyways. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mci: stm32_sdmmc2: don't retry commandsLucas Stach2020-05-121-14/+2
| | | | | | | | | | | | | | | | | | No other MCI does retry failing commands on its own (if at all this should be done by the MCI core). Remove the retry, as we don't want to paper over board level issues. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nvmem: bsec: remove wrongly named bsec_field typeAhmad Fatoum2020-05-081-1/+1
| | | | | | | | | | | | | | | | | | BSEC_SMC_READ_SHADOW and BSEC_SMC_WRITE_SHADOW aren't fields, but operations to apply on fields. Rename it accordingly and fix up instances where it was used wrongly. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nvmem: bsec: allow reads at unaligned offsetsAhmad Fatoum2020-05-081-4/+38
| | | | | | | | | | | | | | | | | | | | Setting the NVMEM stride to 4 means we can't have nvmem cells pointing at odd addresses. Linux sets it to 1 instead and handles reads at unaligned addresses by splitting them up to aligned chunks. Copy over the code to do the same. Unaligned writes remain illegal. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/powerpc'Sascha Hauer2020-05-147-0/+653
|\ \
| * \ Merge branch 'for-next/mxs' into nextSascha Hauer2020-04-303-25/+31
| |\ \
| | * | clk: mxs: Use device tree provided clock lookupsSascha Hauer2020-04-281-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When probing from the device tree use the device tree provided clock lookups. So far we only used the clock lookups based on the physical base address of the device, but these should go sooner or later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * | clk: mxs: Do not enable enet_out clockSascha Hauer2020-04-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The enet_out clock gate is wrongly abstracted. The bit it is controlling is not just a bit to enable the clock, it also controls the direction of the ethernet reference clock. When the bit is cleared, the ethernet reference clock must be fed into the SoC from an external oscillator; when it's set then the ethernet reference clock is generated internally. The correct setting depends on the board, so we must not set the bit unconditionally during probe of the clock driver. Whether or not the clock is enabled can be selected by the board by removing the clock from the FEC in its dts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * | net: fec_imx: Return with an error when mandatory clock is missingSascha Hauer2020-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a mandatory clock is missing we have to return with an error. Just breaking out of the loop results in ignoring the error. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * | net: fec_imx: Make ptp clock optionalSascha Hauer2020-04-282-3/+3
| | |/ | | | | | | | | | | | | | | | | | | The ptp clock doesn't exist on all SoCs, make it optional. In fact it was optional before due to a bug in the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Merge branch 'for-next/misc' into nextSascha Hauer2020-04-302-1/+9
| |\ \
| * \ \ Merge branch 'for-next/kconfig' into nextSascha Hauer2020-04-308-32/+6
| |\ \ \
| * \ \ \ Merge branch 'for-next/sdhci' into nextSascha Hauer2020-04-287-0/+653
| |\ \ \ \
| | * | | | mci: sdhci: add Atmel SDHCI (sama5d2, sam9x60) supportAhmad Fatoum2020-04-276-0/+627
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already support Ethernet and QSPI on the SAMA5D2, but MMC was so far missing. Port over the at91bootstrap driver to barebox. Some parts are based on the U-Boot and Linux implementations. To support future use in PBL, the driver model and driver implementation parts are split into separate files with the latter being compilable for PBL as well. Registers, which are found in the common Linux sdhci.h have been added to the barebox sdhci.h. Registers which appear to be Atmel specific have been added to atmel-sdhci-common.c instead. The driver still misses some parts, which will follow later: - ADMA is unsupported, PIO only for now - Only the SD/MMC controller already enabled by the first stage bootloader is supported. Further clocking changes appear to be necessary to enable another Both can be retrofitted later on and don't hold us back from booting from MMC. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * | | | mci: sdhci: implement sdhci_reset()Ahmad Fatoum2020-04-272-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDHCI reset is common between many SDHCI variants. Add a library function, so it can be reused. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * | | | mci: sdhci: provide sdhci_readx_poll_timeout helpersAhmad Fatoum2020-04-271-0/+12
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sdhci_readN accessors don't lend themselves for clean use with readx_poll_timeout because they accept two arguments. Add a sdhci-specific helper, so the sdhci drivers can cut down on the timeout loop boilerplate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | Merge branch 'for-next/misc' into nextSascha Hauer2020-04-2875-213/+0
| |\ \ \ \
* | \ \ \ \ Merge branch 'for-next/mxs'Sascha Hauer2020-05-1410-45/+119
|\ \ \ \ \ \
| * | | | | | mmc: mxs: implement detect callbackSascha Hauer2020-05-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to automatically detect the SD card when it contains the barebox environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>