summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* clk: i.MX6qp: Fix location of the enfc_sel muxSascha Hauer2019-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | On the i.MX6qp the enfc_sel mux is at bits 15-17, not on 16-17. Fix this. During clock tree initialization we reparented the enfc_sel to: clk_set_parent(clks[IMX6QDL_CLK_ENFC_SEL], clks[IMX6QDL_CLK_PLL2_PFD2_396M]); This resulted in a register setting 0b110 for the enfc_sel mux which is reserved. Apparently this reserved setting resulted in the enfc clock being driven from pll3_pfd3_454m. This means our enfc clock was the factor 454/396 too high. With b534f79112f0 ("clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK") we happened to disable pll3_pfd3_454m during init, so with this commit NAND stopped working entirely on i.MX6qp. Both issues are fixed with this patch Fixes: b534f79112f0 ("clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK") Fixes: 92fd61d12723 ("clk: i.MX6: Fix enfc_sel for i.MX6dqp") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-09-1210-0/+1266
|\
| * watchdog: add support for STPMIC1 integrated watchdogAhmad Fatoum2019-09-093-0/+231
| | | | | | | | | | | | | | | | The driver adds support for the PMIC's watchdog, reset, poweroff and reset reason query capabilities. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mfd: add support for STPMIC1Ahmad Fatoum2019-09-093-0/+106
| | | | | | | | | | | | | | | | | | The PMIC is addressable over I2C and, besides power management, integrates a watchdog, a user power on key handling and 64 bit of non-volatile memory. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i2c: add stm32f7 I2C adapter driverAhmad Fatoum2019-09-093-0/+869
| | | | | | | | | | | | | | | | This patch adds initial support for the STM32F7 I2C controller. It was tested to work with the STM32MP157C. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i2c: port Linux i2c_parse_fw_timingsAhmad Fatoum2019-09-091-0/+60
| | | | | | | | | | | | | | | | | | Linux has a generic function for extracting i2c timings parameters from device-associated firmware nodes. Port this function to barebox, but have it only work on device tree nodes for now. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/sandbox'Sascha Hauer2019-09-123-0/+72
|\ \
| * | hwrng: add sandbox driver interface to host /dev/randomAhmad Fatoum2019-09-093-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux as well as other operating systems can provide /dev/random and /dev/urandom device to service userspace need for randomness. Add a driver to use /dev/random for blocking and /dev/urandom for non-blocking barebox random numbers. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/reset-source'Sascha Hauer2019-09-123-10/+3
|\ \ \
| * | | mfd: da9063: use new reset_source_set_device()Uwe Kleine-König2019-09-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of the just introduced reset_source_set_device() to save some boilerplate. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mfd: da9053: use new reset_source_set_device()Uwe Kleine-König2019-09-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of the just introduced reset_source_set_device() to save some boilerplate. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | reset_source: drop reset_source_set_instance()Uwe Kleine-König2019-08-281-2/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantic of reset_source_set_instance() required a separate call to reset_source_set() (or reset_source_set_priority()) and checked right usage only using the type. Make the set of functions a bit easier to use by dropping reset_source_set_instance() and instead introduce a function that can set all relevant parameters (source, priority and instance) in one go. 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/omap'Sascha Hauer2019-09-127-90/+932
|\ \ \
| * | | mtd: peb: Add function to write fileSascha Hauer2019-08-281-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a function to the mtd peb API to write a file spanning multiple blocks to a mtd device. Bad blocks are automatically skipped and before anything is done we check if the image will fit into the remaining space (honouring bad blocks). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: cpsw: Make phy its own driverSascha Hauer2019-08-281-82/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes of_phy_device_connect() work properly when the phy is specified in the device tree. Without it of_mdio_find_phy() will not find the right device. It will match: bus->parent->device_node == phy_node->parent Without this patch bus->parent->device_node will be the ethernet node and phy_node->parent will be the ti,cpsw-mdio node. With the MDIO device node registered as device of its own both nodes above will be the ti,cpsw-mdio node. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: gpmc: Add BCH16 supportSascha Hauer2019-08-282-8/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for BCH16 ECC encoding. The support is mostly taken from Linux-5.3-rc6. One major change is the different wrap mode used. The Kernel uses wrapmode 1, which means "pass all data through the BCH engine". Still the Kernel has to skip the OOB marker which is done by reading all user data, then use NAND_CMD_RNDOUT to position right behind the OOB marker and then read the ECC data. Instead of doing this we use wrap mode 4 which allows us to bypass the OOB marker from the BCH engine automatically. This explains bch_wrapmode = 1, eccsize0 = 0, eccsize1 = 52 vs. bch_wrapmode = 4, eccsize0 = 4, eccsize1 = 52 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: gpmc: Add support for ELMSascha Hauer2019-08-283-0/+424
| |/ / | | | | | | | | | | | | | | | | | | | | | This adds support for the ELM (Error Location Module) found on not-too-old OMAP SoCs. The driver has been taken from Linux-5.3-rc6 with interrupt support removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/net'Sascha Hauer2019-09-122-6/+34
|\ \ \
| * | | net: macb: extend support to Microchip SAMA5D2Ahmad Fatoum2019-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested on Microchip SAMA5D27 SOM1 EK1 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: macb: init multiple dummy TX queuesOleksij Rempel2019-08-162-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Microchip SAMA5D27 has more then one TX queue. So it will go in to TX timeout if only one was initialized. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/mtd'Sascha Hauer2019-09-1215-219/+215
|\ \ \ \
| * | | | mtd: spi-nor: Import missing Micron devicesAndrey Smirnov2019-09-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import entries for n25q00a, mt25qu02g, mt25ql02g, supported by latest Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mtd: spi-nor: Add support for s25fl128s0 s25fl128s1 flashes from LinuxDU HUANPENG2019-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These definitions are taken from Linux's spi-nor driver as of v5.2-rc4 Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mtd: nand: Embed struct mtd_info into struct nand_chipSascha Hauer2019-08-2610-52/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to what is done in the Kernel. In the Kernel we have a struct nand_device embedded into struct nand_chip and the nand_device has an mtd_info embedded into it. Until we have struct nand_device we embed mtd_info directly into the nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mtd: nand: denali: Add variables for mtd_info and nand_chipSascha Hauer2019-08-261-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accessing the mtd_info from the nand_chip will change in the next patch, so instead of accessing it each time when used create a variable for mtd_info to keep the next patch smaller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mtd: nand: Add and use static inline wrapper for getting nand_chip from mtdSascha Hauer2019-08-2612-118/+118
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All drivers in tree use mtd->priv for the nand_chip. Add and use a static inline wrapper mtd_to_nand() which we already have in the kernel for getting the nand_chip from the mtd_info struct. Next step would be to embed a struct mtd_info into struct nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/misc'Sascha Hauer2019-09-1212-26/+78
|\ \ \ \
| * | | | input: add handler for reset and power key input eventsAhmad Fatoum2019-09-093-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel device trees may indicate linux,code = KEY_POWER or KEY_RESTART, mostly for gpio-keys. Make barebox able to act on them by registering an appropriate input notifier. Suggested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | i2c/pca954x: Initialize the mux to disconnected stateAndrey Smirnov2019-09-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of a Linux kernel commit cd823db8b1161ef0d756514d280715a576d65cc3 pca954x power-on default is channel 0 connected. If multiple pca954x muxes are connected to the same physical I2C bus, the parent bus will see channel 0 devices behind both muxes by default. This is bad. Scenario: -- pca954x @ 0x70 -- ch 0 (I2C-bus-101) -- EEPROM @ 0x50 | I2C-bus-1 --- | -- pca954x @ 0x71 -- ch 0 (I2C-bus-111) -- EEPROM @ 0x50 1. Load I2C bus driver: creates I2C-bus-1 2. Load pca954x driver: creates virtual I2C-bus-101 and I2C-bus-111 3. Load eeprom driver 4. Try to read EEPROM @ 0x50 on I2C-bus-101. The transaction will also bleed onto I2C-bus-111 because pca954x @ 0x71 channel 0 is connected by default. Fix: Initialize pca954x to disconnected state in pca954x_probe() Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mfd: rave-sp: Emulate firmware/bootloader mode reporting on RDU2Andrey Smirnov2019-09-091-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to emulate firmware/bootloader mode reporting via "general_status" field on RDU2. This is needed to correctly report if RAVE SP is in bootloader of application mode during startup. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | video/stm: fix return value handling for of_get_display_timings()Uwe Kleine-König2019-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_get_display_timings() returns NULL on failure, not an error pointer. Fixes: 16fd24847d7a ("video: stmfb: Add device tree support") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | console: fix out-of-bounds read in dputc(/dev/*, ...)Ahmad Fatoum2019-09-022-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to output a single character via echo -a /dev/serial0-1 currently results in garbage output after the newline, because console.c's fops_write discards the buffer length and passes the buffer to (struct cdev)::puts which only handles NUL-terminated strings. Fix this by amending (struct cdev)::puts with a new nbytes parameter, which is correctly propagated. All this functions now return at most the nbytes parameter they were passed in. This fixes __console_puts, which used to count new lines twice in its return value. Fixes: b4f55fcf35 ("console: expose consoles in devfs") Cc: Bastian Krause <bst@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: gadget: fsl_udc: remove always-true null pointer checksAhmad Fatoum2019-08-301-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct fsl_ep's name member can never be NULL because it is a character array. Remove these superfluous null pointer checks. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | nvme: use 64 bit types for timeouts even on 32 bit systemsAhmad Fatoum2019-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SHUTDOWN_TIMEOUT value of 5e9 would already exceed the range of unsigned long on a 32-bit system. Fix this by using uint64_t for all time-holding variables. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | smc911x: fix inverted poll-for-readyAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ! operator is applied wrongly to only smc91xx_reg_read's return value, when probably the intention was for it to apply to the whole expression. However, wait_on_timeout keeps looping while the condition is false, so dropping the ! is the right thing to do. Do the right thing. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: phy: mv88e6xxx: remove duplicate member in struct initializerAhmad Fatoum2019-08-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's already an .ops member two lines later. Remove one. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | i2c-mux-pca954x: remove use of uninitialized variableAhmad Fatoum2019-08-301-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | force isn't used except to print its uninitialized value in an error path. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/arm'Sascha Hauer2019-09-127-3/+604
|\ \ \ \ | |_|_|/ |/| | |
| * | | clk: zynqmp: rename driver specific CLK_MUX_READ_ONLYMichael Tretter2019-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit c7cc27d006cc (clk: mux: Support CLK_MUX_READ_ONLY flag) Barebox defines the CLK_MUX_READ_ONLY flag like Linux. The ZynqMP clock driver used the flag before, because this flag is used to convey this information from the PMU firmware to the Linux driver. However, the flags of the common clock framework and the flag of the protocol between PMU firmware and the ZynqMP clock driver should be handled separately. Therefore, add a driver specific prefix to the flag definition in the ZynqMP driver. Fixes the warning drivers/clk/zynqmp/clk-mux-zynqmp.c:18:0: warning: "CLK_MUX_READ_ONLY" redefined In file included from drivers/clk/zynqmp/clk-mux-zynqmp.c:13:0: include/linux/clk.h:350:0: note: this is the location of the previous definition Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | spi: add atmel-quadspi supportOleksij Rempel2019-08-213-0/+551
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Atmel quadspi device. Ported from Linux-5.2. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: spi-nor: add support for sst26vf seriesOleksij Rempel2019-08-211-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ported from linux-4.19-at91 linux4sam_6.1 and needed for SAMA5D27 SOM1 EK. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: spi-nor: add UNLOCK_GLOBAL_BLOCK supportOleksij Rempel2019-08-211-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ported from linux-4.19-at91 linux4sam_6.1 and needed for SAMA5D27 SOM1 EK. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | serial: atmel: set linux_console_nameOleksij Rempel2019-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | serial: stm32: set linux_console_nameAhmad Fatoum2019-08-211-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | Linux names these UARTs ttySTM. Tell barebox about this, so it can be used to correctly compose the console= kernel command line argument. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | / eeprom: at24: Select NVMEM as a dependencyAndrey Smirnov2019-09-091-0/+1
| |/ |/| | | | | | | | | | | | | NVMEM subsystem is now a mandatory dependecy for EEPROM_AT24. Fixes: 815e7140de ("eeprom: at24: Convert the driver to NVMEM") Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX8: Fix piggydata loadingSascha Hauer2019-08-231-8/+13
|/ | | | | | | | | | We are running at MX8MQ_ATF_BL33_BASE_ADDR now, so we can't use this as a temporary buffer. Add 32MiB to that address and use this instead. Also copy the piggydata to the place where we expect it later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-08-153-0/+115
|\
| * reset: add reset controller driver for STM32 RCCAhmad Fatoum2019-07-153-0/+115
| | | | | | | | | | | | | | | | | | On the STM32MP, reset of the I2C, SPI and USB IPs occurs over the RCC. This driver adds support for the controller, so it may be reused by other drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd-gpmi-nand'Sascha Hauer2019-08-152-118/+182
|\ \
| * | mtd: nand-mxs: Make ecc strength configurable via device treeSascha Hauer2019-08-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the binding doc the mxs NAND driver supports the "nand-ecc-strength" and "nand-ecc-step-size" options. This adds support for these options to the driver. The "nand-ecc-step-size" is not really configurable, the only accepted value is 512 so this is merely to sanity check that there's nothing specified that we can't yet support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>