summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* nand: denali: remove undefined GFP_DMA flagEnrico Jorns2018-11-191-1/+1
| | | | | | | | | | | | This was a remnant from porting kernel code to barebox. While being uncritical so far, this will now cause a compiler error since kzalloc is not a define but a static inline function. As the kzalloc() 'mode' argument was ignored before and still will be, it is safe to remove the parameter. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX: When SRSR shows wdog then lookup reset source in wdogSascha Hauer2018-11-161-3/+7
| | | | | | | | | | | | | On i.MX6 when the watchdog has resetted the system then the SRSR register correctly shows that the watchdog has resetted the system. This is not the desired result though, a "reset" in barebox or "reboot" in Linux should result in "RST" as reset source. So instead of making the SRSR register value overwrite the reset source read from the watchdog registers, interpret the SRSR value corresponding to watchdog reset as "lookup details in the watchdog registers". Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
* 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>
| * | net: macb: no need for coherent memory for receive bufferSascha Hauer2018-11-021-2/+1
| | | | | | | | | | | | | | | | | | | | | The receive buffers are properly synchronized with dma_sync_*, no need to use coherent memory for them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2018-11-094-42/+66
|\ \ \
| * | | USB: gadget: prevent unnecessary warning messageSascha Hauer2018-10-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB gadget autostart code issues a warning when no otg device exists: Cannot set parameter otg.mode: No such device This is unnecessary since there may be no otg device at all, but only a gadget device. Drop that warning by checking if there is a otg device first. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: don't break long print messagesLadislav Michl2018-10-262-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 2ac63d901b11 adapted for Barebox: ...However, never break user-visible strings such as printk messages, because that breaks the ability to grep for them. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: add accessors, macros for in-memory BBTLadislav Michl2018-10-261-22/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 771c568bcf91: There is an abundance of magic numbers and complicated shifting/masking logic in the in-memory BBT code which makes the code unnecessary complex and hard to read. This patch adds macros to represent the 00b, 01b, 10b, and 11b memory-BBT magic numbers, as well as two accessor functions for reading and marking the memory-BBT bitfield for a given block. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: atmel_nand: replace printk with dev_infoLadislav Michl2018-10-261-2/+2
| | |/ | |/| | | | | | | | | | Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-11-095-10/+10
|\ \ \
| * | | nvmem: i.MX ocotp: Make locally used functions staticSascha Hauer2018-10-231-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: ulpi: Make locally used functions staticSascha Hauer2018-10-231-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers: clk: imx5: Make locally used functions staticSascha Hauer2018-10-231-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | video: imx-ipu-v3: Make locally used function staticSascha Hauer2018-10-181-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: mxs: make locally used functions staticSascha Hauer2018-10-181-2/+2
| |/ / | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>