summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/stm32'Sascha Hauer2019-07-127-0/+745
|\
| * watchdog: stm32_iwdg: remove left-over commentAhmad Fatoum2019-07-111-5/+0
| | | | | | | | | | | | | | | | The reset reason part of the code is based on the i.MX6's and duplicated a comment from there, which isn't applicable to the STM32. Delete it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * pinctrl: stm32: fix error path when gpio chip is not foundAhmad Fatoum2019-07-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current error path has two issues: - PTR_ERR is applied to a NULL pointer, so even error conditions return zero, which is a valid successful return. - The return value is stored into an unsigned integer which is checked to be less than zero, so the error is never handled. Fix both issues. Fixes: f4f933a64 ("pinctrl: add driver for STM32 GPIO and pin multiplexer") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * pinctrl: stm32: add debug output in set_state callbackAhmad Fatoum2019-07-091-0/+3
| | | | | | | | | | | | | | | | | | There's already a debug output whenever a pin is configured, extend this by printing a "header" with the node name and how many pins configurations will follow. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * pinctrl: add driver for STM32 GPIO and pin multiplexerAhmad Fatoum2019-06-203-0/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds driver support for the 12 GPIO banks on the STM32MP157. As they are accessible to both the Cortex-A cores as well as the Cortex-M core, modifications to these are protected by a hardware spinlock and clocks are enabled/disabled as required. All register fiddling done by the driver is collected in <soc/stm32/gpio.h>, so future PBL code may make use of it as well to chainload barebox proper. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpiolib: add gpio_get_chip helperAhmad Fatoum2019-06-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pinctrl nodes adhering to the generic pinctrl bindings may contain properties like input-low/input-high, which require pinctrl_ops.set_state to have a handle on the relevant gpio chip. Currently this would lead to code duplication: Both the pinctrl driver and gpiolib will need to store a list of registered gpiochips. Avoid this by providing a helper to query the registered gpio_chip given a gpio's number. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * watchdog: add stm32 watchdog and reset driverAhmad Fatoum2019-06-193-0/+307
| | | | | | | | | | | | | | | | | | | | The driver supports setting watchdog timeout, system reset and querying reset reason. Disabling watchdog isn't possible in hardware, thus users should either only enable it before boot or have the poller take care of feeding it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-07-127-19/+65
|\ \
| * | f_fastboot: remove only image from bootm variablesRouven Czerwinski2019-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Remove only the bootm.image variable which will be set by fastboot. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serial: ns16550: support reg-offset device-tree propertyMarcin Niestroj2019-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Some SoC have serial registers with a fixed offset to the map base. Support them by respecting 'reg-offset' device-tree property. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mfd: syscon: add syscon_regmap_lookup_by_phandle()Marcin Niestroj2019-07-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This function is handy when syscon is passed as phandle to device_node property. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i2c: gpio: add sda/scl-gpios property supportMarco Felsch2019-06-261-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The gpios property is marked as deprecated since kernel 4.15 so we should support the "new" mechanism too. The new mechanism has a higher priority than the deprecated one. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: usb251xb: fix optional reset gpio requestMarco Felsch2019-06-171-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux requests the reset gpio optional by using devm_gpiod_get_optional(). We need to do this here too because the reset can be a global shared reset line e.g. board por. We haven't such a helper so just drop the final else path. Fixes: 937fa50d9c ("usb: Port Microchip USB251x USB hub driver from Linux") Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: spi-nor: Add support for ISSI flashes from LinuxUwe Kleine-König2019-06-171-0/+21
| | | | | | | | | | | | | | | | | | | | | The definitions are taken from Linux's spi-nor driver as of v5.2-rc4. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: remove stale mentions of CONFIG_OF in commentsAhmad Fatoum2019-06-132-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | barebox doesn't define a CONFIG_OF kconfig option, but CONFIG_OFTREE for the device tree handling and CONFIG_OFDEVICE for probing devices out of the device tree. Replace comment mentions of CONFIG_OF with mentions of either as appropriate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2019-07-121-0/+1
|\ \
| * | serial: ar933x: set linux_console_nameAntony Pavlov2019-06-261-0/+1
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2019-07-121-1/+1
|\ \
| * | i.MX: HABv4: use min_t instead of minRouven Czerwinski2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a compiler warning because len is size_t and RNG_FAIL_EVENT_SIZE was cast to uint32_t. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/clk'Sascha Hauer2019-07-121-41/+97
|\ \ \
| * | | clk: divider: export clk_div_mask() helperMarcin Niestroj2019-07-041-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e6d3cc7b1fac3d7f1313faf8ac9b23830113e3ec Linux upstream. clk: divider: export clk_div_mask() helper Export clk_div_mask() in clk-provider header so every clock providers derived from the generic clock divider may share the definition instead of redefining it. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Michael Turquette <mturquette@baylibre.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: divider: Make generic for usage elsewhereMarcin Niestroj2019-07-021-45/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit bca9690b942654f668ffb5124b2bbd0ba0f007bb Linux upstream adjusted to current Barebox codebase. clk: divider: Make generic for usage elsewhere Some devices don't use mmio to interact with dividers. Split out the logic from the register read/write parts so that we can reuse the division logic elsewhere. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Michael Turquette <mturquette@linaro.org> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: divider: Fix best div calculation for power-of-two and table dividersMarcin Niestroj2019-07-021-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit dd23c2cd38da2c64af381b19795d2c4f115e8ecb Linux upstream. clk: divider: Fix best div calculation for power-of-two and table dividers The divider returned by clk_divider_bestdiv() is likely to be invalid in case of power-of-two and table dividers when CLK_SET_RATE_PARENT flag isn't set. Fixes boot on STiH416 platform. Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> [mturquette@linaro.org: trivial merge conflict & updated changelog] Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: divider: Remove unused variable in clk_divider_recalc_rateMarcin Niestroj2019-07-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit "clk: add divider_recalc_rate helper" reworked clk_divider_recalc_rate() function and as part of that left one variable assignment, which is not used later. Fixes: e27c0b64db01 ("clk: add divider_recalc_rate helper") Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | usb: imx-usb-phy: select syscon driverSascha Hauer2019-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since b904eca92f we depend on syscon once the "fsl,anatop" property is found. select MFD_SYSCON to make sure it is available. Fixes: b904eca92f ("usb: imx-usb-phy: Disable charger detect during initialization") Cc: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | net: cpsw: adopt to upstream device tree changesSascha Hauer2019-07-101-6/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream device trees no longer have a "cpsw-phy-sel" property to find the phy_sel register, instead they have a child device of the pinctrl node compatible to "ti,am3352-phy-gmii-sel". Also the "rmii-clock-ext" property is no longer global to the cpsw but instead can be selected per slave. To adopt to these changes take the short way out for now and find the new node by its compatible and hardcode the "rmii-clock-ext" setting (which is set to true in am33xx-l4.dtsi and not overwritten by any board). This makes the cpsw driver work again. Tested on Beaglebone black board. Fixes: 1dc748b3b2 ("dts: update to v5.1-rc1") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / / i.MX: HABv4: Reset index variable after error typeRouven Czerwinski2019-06-271-0/+2
|/ / | | | | | | | | | | | | | | | | The index variable is used for each error type, it should be reset to 0 before retrieving the next error status, otherwise error messages are skipped if the preceding error type incremented index. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / pcf857x: fix CONFIG_OF to OFDEVICEMichael Grzeschik2019-06-171-1/+1
|/ | | | | | | | There is not CONFIG_OF symbol. We fix this by using OFDEVICE instead. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-phy'Sascha Hauer2019-06-112-26/+62
|\
| * usb: imx-usb-phy: Disable charger detect during initializationAndrey Smirnov2019-05-271-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I can't find any erratas this is in refernce to, but apparently external changer detector needs to be disabled to prevent poor USB data signal quality. The problem manifest itself as a intermittent USB transfer corruption that happens to some device under and only under specific circumstances. In my case the failure was observed with Transcent SD/micro-SD card reader (05e3:0745 Genesys Logic, Inc. Logilink CR0012) when connected directly to front panel USB of ZII RDU2 board (the problem would go away if device was conntecte via a hub/USB-analyzer/male-female type A extender cable). Note that this fix is present in Linux kernel as well as some abandoned Barebox code removed in the next patch. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: imx-usb-phy: Use stmp_reset_block() to reset PHYAndrey Smirnov2019-05-272-10/+6
| | | | | | | | | | | | | | | | | | Upstream kernel driver uses stmp_reset_block() to reset the PHY, so convert the code to do so as well to save some code and sync both drivers. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: imx-usb-phy: Wrap lines to silence checkpatchAndrey Smirnov2019-05-211-2/+4
| | | | | | | | | | | | | | | | Those two line are the only thing that checkpatch is complaining about. Wrap them to slince it. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: imx-usb-phy: Import register definitions from Linux driverAndrey Smirnov2019-05-211-17/+18
| | | | | | | | | | | | | | | | Import register definitions from Linux driver to simplify comparing/sharing code a bit. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb-ehci'Sascha Hauer2019-06-112-187/+242
|\ \
| * | usb: host: ehci: Allocate only NUM_QH queue heads for qh_listAndrey Smirnov2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Use NUM_QH, not NUM_TD to specify allocation size. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ush: host: ehci: Simplify QH initialization in ehci_submit_async()Andrey Smirnov2019-05-231-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use a fixed circular list for asynchronous schedule that never changes, so if we drop an explicit memset() that zeros out an entire struct and replace it with code initializine all of the fields explicitly, we can set QH list once in ehci_init() and never touch it again. While at it move qt_altnext initialization to ehci_init() as well since we never change that field either. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Treat ehci->qh_list as an arrayAndrey Smirnov2019-05-231-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since ehci->qh_list is an array, convert the code to use ehci->qh_list[0] to access its first element to make things a bit more clear. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Drop explicit memset() in ehci_init()Andrey Smirnov2019-05-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memory allocated by dma_alloc_coherent() is already zeroed out, ehci->qh_list[0] never changes during the operation of the driver and ehci->qh_list[1] will be explicitly initialized by ehci_submit_async() so this additional memset() shouldn't be necessary. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Replace explicit printf() with dev_err()Andrey Smirnov2019-05-231-3/+7
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Add a comment explaing IOC setting for dataAndrey Smirnov2019-05-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add a comment explaining the rationale behinde QT_TOKEN_IOC(req == NULL). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Use bool to simplify ehci_submit_async()Andrey Smirnov2019-05-231-3/+3
| | | | | | | | | | | | | | | | | | | | | Change the type of 'c' to bool and drop the trigrah. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Drop needless assignments in ehci_submit_async()Andrey Smirnov2019-05-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Neither of those is necessary, since both will be overwritten further down in the code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Simplify ehci_submit_async()'s epilogueAndrey Smirnov2019-05-231-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-organize the epilogue of ehci_submit_async() to bail out early if token is still marked as "active" and drop no longer necessary check for "dev->status != USB_ST_NOT_PROC". While at it return -EIO instead of -1 in the case of error. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Initialize qTDs explicitlyAndrey Smirnov2019-05-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Convert the code to initialize only used qTDs as well as initializing all of the fields explicitly without doing a wholesale memset() first. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Simplify ehci_td_buffer()Andrey Smirnov2019-05-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the code of ehci_td_buffer() with following trivial changes: * Switch to using dma_addr_t for 'delta' and 'next' * Convert while to for loop * Replace explicit magic number with dedicated contants derived via ARRAY_SIZE * Use ALIGN_DOWN to calculate 'next' * Return -ENOMEM instead of -1 when we ran out of buffers Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Simplify qTD buffer synchronizationAndrey Smirnov2019-05-232-43/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only two buffers ever need to be sychronized and DMA direction of it is always known based on the type of request we are processing. Simplify the code by moving synchronization to be a part of ehci_prepare_qtd(). While at it convert the code to use dma_map_single() API. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Introduce ehci_prepare_qtd()Andrey Smirnov2019-05-231-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | Move shared struct qTD initialization code into a subroutine and convert the rest of the code to use it. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Drop unnecessary cleanup codeAndrey Smirnov2019-05-231-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This looks like a leftover from U-Boot. Analogous code there would walk all qTDs and call ehci_free() on each one of them, but since we don't have anything of the sort it seems the whole loop can be dropped. Note that U-Boot dropped that code in de98e8b22a10676fd226318c92a9be7f519208ca Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Replace magic number with macrosAndrey Smirnov2019-05-232-49/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | Import a number of missing macros from U-Boot and convert ehci-hcd to use them instead of explicitly specifying magic shifts. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: host: ehci: Use to USBSTS to wait for transfer completionAndrey Smirnov2019-05-232-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we already set up our last qTD to have IOC flag set we may as well take advange of that and poll USBSTS to wait for transfer completion. Doesn't change much, but allows us to drop a custom polling loop and re-use handshake() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>