summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* video: mtl017: fix driver name variableSam Ravnborg2019-01-041-2/+2
| | | | | | | | | It look like a copy-paste bug that the twl_driver name was used. Rename to the more sensible mtl_driver Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: skip of_partitions_register_fixup for boot partitionsAhmad Fatoum2019-01-031-1/+6
| | | | | | | | | The bootN-partitions binding is barebox-specific, so it shouldn't be fixed up into the kernel device tree. Suggested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: fix timeout off by *1000 errorAhmad Fatoum2018-12-171-5/+5
| | | | | | | | | | | | | read*_poll_timeout's final timeout parameter is in microseconds, but the supplied arguments in fec_imx.c were in nanoseconds, which might lead to barebox getting seemingly stuck in fec_halt (loops for a thousand seconds instead of one). I've tested this still works on an i.MX6D by copying a file over TFTP and verifying the hash is correct. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: mtl017: Make sure errno is not used as a regulator pointerAndrey Smirnov2018-12-171-0/+3
| | | | | | | | | | | | Since regulator_get() can return an errno via regulator pointer, we need to make sure we handle that case without passing bogus pointers around. Add code to convert mtl017->regulator to a dummy regulator if regulator_get() fails. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Rely on NULL being a dummy regulatorAndrey Smirnov2018-12-171-10/+9
| | | | | | | | | Since NULL, is a dummy regulator, we can drop a bit of error checking logic and simplify the code if we assing host->supply to NULL in case we can't find an appropriate regulator during probing. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: amba-pl011: Fix regulator_get() return checkAndrey Smirnov2018-12-171-1/+1
| | | | | | | | | | | | NULL is used to designate a dummy regulator, so it it should be safe to use against regulator_enable(). Any value that would retrun true for IS_ERR(), OTOH, is not. Such value would also pass "if (r)" check without any problems. Fix the code to use !IS_ERR() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvmem: ocotp: Make use of postcore_platform_driver macroAndrey Smirnov2018-12-101-8/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: core: Make use of ARRAY_AND_SIZEAndrey Smirnov2018-12-101-2/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: core: Initialize blink_next_event with 0Andrey Smirnov2018-12-101-1/+1
| | | | | | | | | A simpler way to make pattern to trigger immediately is to initialize blink_next_event to 0 instead of current time value. Save a function call and convert the code to do just that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: core: Don't call get_time_us() twiceAndrey Smirnov2018-12-101-2/+3
| | | | | | | | | The code doesn't seem to be time-sensitive enough to warrant calling get_time_ns() twice instead of caching its value and using it no both places. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: rave-sp: Make use of wait_on_timeout()Andrey Smirnov2018-12-101-6/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add .of suffix to device names from devicetreeSascha Hauer2018-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | Previous implementation used to add a number to the device names for devices registered from the device tree which did not have a 'reg' property, thus a device node named "state" resulted in a device name "state.<x>". Current implementation skips that number and we get a device named "state". This conflicts with our barebox state implementation which tries to register a device named "state" itself. We could rename the state device nodes of all our device trees, but it causes less trouble to rename the devices. This adds a ".of" suffix to the device names for devices registered from the device tree which also has the nice effect that they now can easily be recognized. Fixes: 7e497d48acbd11 ("of: Port latest of_device_make_bus_id() implementation") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Jan Lübbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2018-12-0756-549/+59
|\
| * drivers: net: usb: convert drivers to spdxOleksij Rempel2018-12-072-30/+4
| | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: net: phy: convert drivers to spdxOleksij Rempel2018-12-0714-83/+14
| | | | | | | | | | | | Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: net: convert drivers to spdxOleksij Rempel2018-12-0640-436/+41
| | | | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-12-071-3/+1
|\ \
| * | net: designware: socfpga: return error valueSteffen Trumtrar2018-11-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of silently dropping the return value of socfpga_dwc_set_phy_mode, use it as the return value of the function, instead. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2018-12-074-1/+24
|\ \ \
| * | | mtd: spi-nor: Add support for sst25wf040bYao Yuan2018-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Yuan Yao <yao.yuan@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> [Linux upstream commit: c887be71cc39] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: spi-nor: Add support for sst25wf020aAlexis Ballier2018-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a 256KiB flash with 4 KiB erase sectors and 64KiB overlay blocks. This is the one available on Hardkernel's Odroid U3 shield. Signed-off-by: Alexis Ballier <aballier@gentoo.org> [Brian: seems like this does NOT require the usual SST_WRITE hacks] Signed-off-by: Brian Norris <computersforpeace@gmail.com> [Linux upstream commit: a1d97ef96e38] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: denali: quiet down driverSteffen Trumtrar2018-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of always printing the timing registers, make it a debug information only. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: return EOPNOTSUPP when attempting to erase an MTD_NO_ERASE deviceMatthias Schiffer2018-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least some MTD_NO_ERASE devices like MRAM do not specify a sensible erase block size; instead, erasesize is equal to the whole flash size. This leads to an EINVAL return from mtd_erase_align() whenever a partial erase is attempted. At least on the MRAM I tested, a full flash erase did not return an error, but it did not have any effect on the flash either. As erase seems to be entirely unsupported on this class of devices, and it is not necessary anyways, it's better to return early with EOPNOTSUPP. This fixes envfs_save() on a partitioned MRAM. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: fix nand_lock/unlock() functionWhite Ding2018-11-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do nand reset before write protect check. If we want to check the WP# low or high through STATUS READ and check bit 7, we must reset the device, other operation (eg.erase/program a locked block) can also clear the bit 7 of status register. As we know the status register can be refreshed, if we do some operation to trigger it, for example if we do erase/program operation to one block that is locked, then READ STATUS, the bit 7 of READ STATUS will be 0 indicate the device in write protect, then if we do erase/program operation to another block that is unlocked, the bit 7 of READ STATUS will be 1 indicate the device is not write protect. Suppose we checked the bit 7 of READ STATUS is 0 then judge the WP# is low (write protect), but in this case the WP# maybe high if we do erase/program operation to a locked block, so we must reset the device if we want to check the WP# low or high through STATUS READ and check bit 7. Signed-off-by: White Ding <bpqw@micron.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> [Cherry-picked from linux: 57d3a9a89a06 mtd: nand: fix nand_lock/unlock() function] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-0714-34/+27
|\ \ \ \
| * | | | bus: omap-gpmc: make locally used function staticSascha Hauer2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | spi: omap: make locally used functions staticSascha Hauer2018-11-191-4/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: musb: Add missing includesSascha Hauer2018-11-192-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | phy-am335x.c and phy-am335x-control.c both implement functions that they do not include the header file providing the prototype for. Add the missing include and remove the duplicate definition of struct phy_control. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: cpsw: Make locally used function staticSascha Hauer2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mtd: nand: omap: Add header file for bch decoderSascha Hauer2018-11-193-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | omap_gpmc_decode_bch() is defined in its user rather than properly in a header file. Add a header file to be included by both its user and the file implementing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net/e1000: Mark e1000_register_invm() staticAndrey Smirnov2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark e1000_register_invm() static because it is not used outside the source file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net/e1000: Mark e1000_igb_get_flash_size() staticAndrey Smirnov2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark e1000_igb_get_flash_size() static because it is not used outside the source file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | aiodev: mc13xxx: Mark mc13xxx_adc_do_conversion() staticAndrey Smirnov2018-11-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark mc13xxx_adc_do_conversion() static because it is not used outside the source file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | video: vpl: make locally used function staticSascha Hauer2018-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_find_vpl() is only used locally, so make it static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | pinctrl: at91: Add missing includeSascha Hauer2018-11-121-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mach/iomux.h provides prototypes for functions that the pinctrl driver implements, so include it. With this we have a duplicate definition of enum at91_mux so remove it from the pinctrl driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | dma: apbh: make locally used function staticSascha Hauer2018-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid missing prototype warning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | clk: imx: Avoid missing prototype warningsSascha Hauer2018-11-121-8/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | clk_gate2_free() is unused, so remove it. clk_gate2_alloc() is only used locally, so make it static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/imx'Sascha Hauer2018-12-0712-6/+399
|\ \ \ \
| * | | | nvmem: ocotp: Add support for second mac address fuses on imx6ulChristian Hemp2018-12-051-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX 6UL/ULL has fuses for two MAC addresses. Both MAC addresses share the fuse address 0x23. ----------------------------- 0x22 | MAC0 | MAC0 | MAC0 | MAC0 | ----------------------------- 0x23 | MAC0 | MAC0 | MAC1 | MAC1 | ----------------------------- 0x24 | MAC1 | MAC1 | MAC1 | MAC1 | ----------------------------- So to read the second MAC address the first two bytes of 0x23 need to be skipped. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | i.MX: HABv4: always print HAB status at boot timeRoland Hieber2018-12-052-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, board code needs to call habv4_get_status() explicitely, but there is no reason that it cannot be called automatically at startup when HABv4 is enabled. This way the call cannot be forgotten and we can make sure to report all potentially occuring HAB warnings and errors. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | drivers: caam: add RNG software self-testRoland Hieber2018-12-057-3/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is based on a vendor patch in U-Boot, taken from https://portland.source.codeaurora.org/patches/external/imxsupport/uboot-imx/imx_v2016.03_4.1.15_2.0.0_ga/HAB-238-Run-RNG-self-test-for-impacted-i.MX-chips.zip | HAB-238 Run RNG self test for impacted i.MX chips | | Patch is only applicable to imx_v2016.03_4.1.15_2.0.0_ga branch of u-boot. | Please adapt the patch for your respective release version. | | Background: | Few i.MX chips which have HAB 4.2.3 or beyond, have oberserved following | warning message generated by HAB due to incorrect implementation of drng | self test in boot ROM. | | Event |0xdb|0x0024|0x42| SRCE Field: 69 30 e1 1d | | | | | STS = HAB_WARNING (0x69) | | | | | RSN = HAB_ENG_FAIL (0x30) | | | | | CTX = HAB_CTX_ENTRY (0xE1) | | | | | ENG = HAB_ENG_CAAM (0x1D) | | | | | Evt Data (hex): | | | | | 00 08 00 02 40 00 36 06 55 55 00 03 00 00 00 00 | | | | | 00 00 00 00 00 00 00 00 00 00 00 01 | | It is recommended to run this rng self test before any RNG related crypto | implementations are done. | [...] | | Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com> Currently known impacted chips, as determined by NXP, include: * i.MX6DQ+ silicon revision 1.1 * i.MX6DQ silicon revision 1.6 * i.MX6DLS silicon revision 1.4 * i.MX6SX silicon revision 1.4 * i.MX6UL silicon revision 1.2 * i.MX67SD silicon revision 1.3 Port the RNG software self-test from this patch to barebox. It can be enabled by selecting CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST in Kconfig. The original patch included a command line utility to run the self-test, but we choose a different approach here, and run the software self-test automatically when the respective HAB events indicating a RNG ROM self-test failure are found when running habv4_get_status(). Note that habv4_get_status() must be called by the board code before the CAAM device driver is probed for this mechanism to work. Until now there are at least two such known events. The first event was observed on an i.MX6Solo, silicon revision 1.4; the second event is mentioned in the original patch description given above. When an event occured, habv4_get_status() tests if it is one of those known events, and if so, indicates to the CAAM driver to run the software self-test. In this case, printing the respective HAB warning is suppressed to prevent confusion; the software self-test itself will error out in case of recurring RNG self-test failure. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | video: ipuv3: use non-fractional clock for parallel displayLucas Stach2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to keep DI and parent clock in sync for the parallel display interface, but some displays really don't like the jitter introduced by using a fractional clock. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | video: ipuv3: use closest fractional dividerLucas Stach2018-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the divider is always rounded down, which may lead to a rather big overshoot of the display clock. Try to match the clock better by rounding to closest. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | ARM: i.MX5 clock: add clock provider supportMichael Grzeschik2018-11-191-0/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it is impossible to get clks with clk_get(&clk, "name"); on the mx5 platform. Change that by adding clk-imx5 as clk_provider. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/checkpatch'Sascha Hauer2018-12-0715-17/+183
|\ \ \ \ | |_|_|/ |/| | |
| * | | clocksource: Add dw_apb_timer driverJules Maselbas2018-11-303-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt linux kernel dw_apb_timer driver to barebox. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Kconfig: Add clocksource menuJules Maselbas2018-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: musb: fix possible out of bounds accessOleksij Rempel2018-11-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Either the condition 'epnum>=((u8)16)' is redundant or the array 'musb->endpoints[16]' is accessed at index 16, which is out of bounds. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: atmel_nand: remove erroneous caseOleksij Rempel2018-11-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If mm would be 15, then we will corrupt the stack, since p[15]. And as input for this function, mm has only two variants 13 and 14. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: at91_udc: remove useless NULL checkOleksij Rempel2018-11-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if _ep or ep is NULL, we would get at least in two places before this test a NULL pointer dereference. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>