summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* mfd: da9063: fix wrong NULL pointer testOleksij Rempel2018-11-211-1/+1
| | | | | | | | checking for priv == NULL and using in this case priv->dev makes no sense. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: tegra30: fix "Possible null pointer dereference: group" warningOleksij Rempel2018-11-211-2/+2
| | | | | | | | The code is correct but it takes more seconds for me to understand. And static code analyzer do not understand it at all. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: e1000: fix "Uninitialized variable: phy_data" warningOleksij Rempel2018-11-211-1/+1
| | | | | | | | After carefully reading the code, this situation should never happen. This patch is to reduce warning noise. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: imx: cpu: avoid use after free on errorOleksij Rempel2018-11-191-1/+3
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/ssd1307fb: fix potential memory leak on errorOleksij Rempel2018-11-191-2/+5
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: set ret for error casesOleksij Rempel2018-11-191-2/+2
| | | | | | | looks like it was forgotten. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rtc: ds1307: Set DS1341_BIT_DOSF in the right registerAndrey Smirnov2018-11-191-2/+2
| | | | | | | | | | DS1341_BIT_DOSF is located in DS1337_REG_STATUS, not DS1337_REG_CONTROL. Fix the code to reflect that. Also fix "additionale" -> "additional" typo while at it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Print message with pr_errSascha Hauer2018-11-141-1/+1
| | | | | | | print "already registered" message with pr_err() rather than printf() to make sure it also appears in the logs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* e1000/flash: Increased erase timeoutMichael Schuhmacher2018-11-121-1/+1
| | | | | | | | Serial flash Adesto AT25DF321A specifies the maximal chip erase time as 40 seconds. Extend timeout accordingly. 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/usb'Sascha Hauer2018-11-0910-175/+162
|\
| * usbgadget: autostart: add DFU supportLadislav Michl2018-10-293-104/+3
| | | | | | | | | | | | | | | | | | | | | | Use global variable dfu_function to autostart DFU. As similar code is used to start multifunction gadget using command, move common code to common/usbgadget.c and consolidate it. It turned out that '-s' option of usbgadget command does nothing, so remove its help text and make it function as '-a'. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: set maxpacket_limitLadislav Michl2018-10-293-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gadget update to 3.15 imported Linux patch e117e742d310 ("usb: gadget: add "maxpacket_limit" field to struct usb_ep"): This patch adds "maxpacket_limit" to struct usb_ep. This field contains maximum value of maxpacket supported by driver, and is set in driver probe. This value should be used by autoconfig() function, because value of field "maxpacket" is set to value from endpoint descriptor when endpoint becomes enabled. So when autoconfig() function will be called again for this endpoint, "maxpacket" value will contain wMaxPacketSize from descriptior instead of maximum packet size for this endpoint. For this reason this patch adds new field "maxpacket_limit" which contains value of maximum packet size (which defines maximum endpoint capabilities). This value is used in ep_matches() function used by autoconfig(). Value of "maxpacket_limit" should be set in UDC driver probe function, using usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function set choosen value to both "maxpacket_limit" and "maxpacket" fields. However said update didn't bring in all driver changes. Do it now. Fixes: 2776d53d7ac8 ("USB: gadget: Update to 3.15") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fsl_udc: pass controller instance to unregisterSascha Hauer2018-10-292-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | ci_udc_unregister() used to unregister "the controller". Since we may register multiple chipidea devices we called ci_udc_unregister() for each of them. This led to messages like: ERROR: imx-usb 53f80000.usb: gadget not registered. Fix this by returning the registered controller. This allows us to call ci_udc_unregister() only when we actually registered one before. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: imx: unregister ehci controller on device removalSascha Hauer2018-10-291-0/+5
| | | | | | | | | | | | | | | | ehci does DMA and hence must be properly quiesced before we leave barebox. Call ehci_unregister() on device removal when we previously registered a ehci controller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci-atmel: unregister host on device removeSascha Hauer2018-10-291-1/+5
| | | | | | | | | | | | | | The ehci code does DMA and really must be properly stopped when we leave barebox, so call ehci_unregister on device removal. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: do not use dev->privSascha Hauer2018-10-293-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An ehci can be registered with ehci_register which is passed a struct device_d *. In that case the priv pointer may already be used by the caller, so we must not use it in the ehci code. At least for the Atmel ehci driver this fixes a bug, here dev->priv is set two times to different values. Since we need dev->priv in the ehci code to get the controller in ehci_detect() we can no longer implement that without the help of the caller, hence we eport ehci_detect() and epect it to be called by the code which registers a ehci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: add ehci_unregister()Sascha Hauer2018-10-293-8/+36
| | | | | | | | | | | | | | | | | | ehci_register() allocates data and registers a ehci host. Add ehci_unregister() to properly halt the controller and to free the memory again.. To do so, change ehci_register() to return the ehci host rather than an error code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: Add usb_unregister_host()Sascha Hauer2018-10-261-0/+5
| | | | | | | | | | | | | | | | We have usb_register_host() which puts a new host on the list of hosts we should also have the opposite which removes the host from the list again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: rename ehci_priv to ehci_hostSascha Hauer2018-10-261-21/+21
| | | | | | | | | | | | | | As we are going to export the structure as a cookie to others rename it to ehci_host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fsl_udc: Drop using global variableSascha Hauer2018-10-261-17/+22
| | | | | | | | | | | | | | No need to use the global udc_controller variable when we are provided an usb_gadget. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/state'Sascha Hauer2018-11-091-0/+12
|\ \
| * | of: fix reproducible node name for legacy vs. new partition bindingSascha Hauer2018-10-181-0/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the of_reproducible_name mechanism is used to find a partition node from the barebox devicetree in the Linux devicetree. Unfortunately we have two different partition bindings. In the legacy one the partition nodes are directly under the hardware devicenode whereas in the new binding the partitions are under an additional partitions subnode. This means we get two different (not so) reproducible names when the barebox devicetree uses the legacy binding and the Linux devicetree uses the new binding (or the other way round). To get the same name then for these cases we drop the partitions subnode from the reproducible name. This makes the partition fixup in barebox-state work when the barebox devicetree uses another binding than the Linux devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Tested-by: Gavin Schenk <g.schenk@eckelmann.de
* | Merge branch 'for-next/net-switch-mv88e6xxx'Sascha Hauer2018-11-0950-122/+2772
|\ \
| * | net: phy: mv88e6xxx: Add support for MAC portsAndrey Smirnov2018-10-234-9/+877
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for MAC-only/no-PHY ports by adding code that will create a pseudo PHY device for such ports and a driver to match against. Original Linux driver exposes all of the ports using DSA subystem, but lacking that in Barebox, creating pseudo PHYs is the simplest option to have code to properly configure various interface parameters. This is needed, for example, on ZII RPU2 board where FEC is connected directly to one of the MAC-only ports. That link requires proper RGMII delay configuration in order to be functional. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: mv88e6xxx: Port EEPROM support codeAndrey Smirnov2018-10-234-0/+388
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: Add basic driver for MV88E6XXX switches from MarvellAndrey Smirnov2018-10-239-0/+1070
| | | | | | | | | | | | | | | | | | | | | | | | | | | Port a very abridged version of MV88E6XXX DSA driver from Linux kernel. Currently only internal MDIO bus connected to switch PHYs is exposed. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mdio_bus: Allow for non PHY-devices on MDIO busesAndrey Smirnov2018-10-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of just creating a simple PHY device for every child of MDIO bus node, add code to check if any of them have "compatible" property set, as well as code to create a proper platform device for such cases. This change is useful for when MDIO bus and some of Ethernet ports are connected to a switch or some other MDIO device that doesn't behave like a generic PHY and can't be probed via its PHY ID. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: Check phy_mask in get_phy_device()Andrey Smirnov2018-10-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not try to probe PHY devices if they are masked in phy_mask. This way we won't try adding devices that are unlikely to be proper PHYs by default. With this change it still remains possible to add such a device explicitly either using "miitool" or calling phy_device_create() explicilty. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mdio_bus: Fix documentation for mdio_bus_match()Andrey Smirnov2018-10-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix documentation for mdio_bus_match(). While at it, re-arrange the code to be easier to follow. Seeing != used as a result of a matching function is extremely confusing. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: Port latest of_device_make_bus_id() implementationAndrey Smirnov2018-10-181-58/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code implementing of_device_make_bus_id() in Barebox uses rather old implementation from Linux kernel and has a very significan limitation in that it will produce identical names for different DT nodes that happen to have the same node name as well as "reg" property. One such example, that tirggered this change, is "switch@0" nodes that can be found in dts/src/arm/vf610-zii-dev-rev-c.dts This commit replaces original code with the current Linux kernel implementation that traverses DT hierarchy from leaf node to its root concatenating node names in the process. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers: base: Convert device_d name to be dynamically allocatedAndrey Smirnov2018-10-181-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | Convert device_d name to be dynamically allocated in order to lift MAX_DRIVER_NAME length limit needed for commits that follow. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | base: Don't use shared buffer for results of dev_id()Andrey Smirnov2018-10-181-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using shared memory buffer to return results of dev_id() leads to incorrect results when used as follows: dev_info(..., "... %s ...\n", ..., dev_name(foo), ...); since result returned for dev_name(foo) will be overwritten by dev_name() call that will happen as a part of dev_* logging functions. To prevent that allocate a dedicated field "unique_name" in struct device_d and use it to store unique name returned by dev_id()/dev_name(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers: Introduce dev_set_name()Andrey Smirnov2018-10-1834-49/+70
| | | | | | | | | | | | | | | | | | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | aiodev: qoriq_thermal: Give aiodev a more descriptive nameAndrey Smirnov2018-10-181-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | aiodev: imx_thermal: Give aiodev a more descriptive nameAndrey Smirnov2018-10-181-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | aiodev: Don't try to use DT node name as aiodev->nameAndrey Smirnov2018-10-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't try to use DT node name as aiodev->name in aiodev_regster() since, for some devices (e. g. tempmon) than name would already be taken by parent platform device. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: Demote "Bad cell count for" to debugAndrey Smirnov2018-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are valid use-cases where getting OF_BAD_ADDR via that codepath is expected. In addition to that analogous code in Linux kernel uses pr_debug as well. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: Introduce ARCH_HAS_IMX_GPTAndrey Smirnov2018-10-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Not all SoCs use i.MX GPT block as a clocksource, so introduce ARCH_HAS_IMX_GPT to mark the ones that do. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i.MX: Move GPT driver to drivers/clocksourceAndrey Smirnov2018-10-183-0/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move GPT driver to drivers/clocksource and rename it to timer-imx-gpt.c to match Linux kernel as well as to keep all clocksource drivers in a common location. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: Add ARM global timer supportAndrey Smirnov2018-10-183-0/+118
| |/ | | | | | | | | | | | | | | | | Port corresponding Linux kernel driver. Currently VFxxx SoC is the intended consumer because it doesn't include common i.MX GPT block used as clocksource by other i.MX SoCs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-11-091-7/+15
|\ \
| * | net: macb: Add compatible for atmel,sama5d3-gemSascha Hauer2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | The macb driver works with the gigabit MAC found on Atmel sama5d3 SoCs. Add a compatible for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: add remove callbackSascha Hauer2018-11-021-0/+8
| | | | | | | | | | | | | | | | | | | | | The macb driver does DMA and thus should be quiesced on shutdown. Add the remove callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: simplify private data allocationSascha Hauer2018-11-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Instead of allocating struct macb_device and a struct eth_device separately just use the eth_device structure that is already embedded in struct macb_device but currently unused. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: remove unused variableSascha Hauer2018-11-021-2/+1
| | | | | | | | | | | | | | | | | | tx_tail is unused. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>