summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-04-18usb: ehci-mx6: Turn off Vbus on probe failureMarek Vasut
The driver turns on Vbus regulator in probe, but fails to turn it back off in case of probe failure. Add the missing code. Signed-off-by: Marek Vasut <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Peng Fan <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Ye Li <[email protected]> Cc: uboot-imx <[email protected]>
2021-04-18imx: power-domain: Add fsl,imx8mn-gpc compatible stringMarek Vasut
The driver is compatible with iMX8MN, add missing compatible string. Signed-off-by: Marek Vasut <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Peng Fan <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Ye Li <[email protected]> Cc: uboot-imx <[email protected]>
2021-04-18imx: power-domain: Add fsl,imx8mm-gpc compatible stringMarek Vasut
The driver is compatible with iMX8MM, add missing compatible string. Signed-off-by: Marek Vasut <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Peng Fan <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Ye Li <[email protected]> Cc: uboot-imx <[email protected]>
2021-04-18phy: nop-phy: Add standard usb-nop-xceiv compat stringMarek Vasut
The USB no-op PHY uses "usb-nop-xceiv" compatible string. This driver is compatible with USB no-op PHY, so add the compatible string. Signed-off-by: Marek Vasut <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Eugeniy Paltsev <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Jean-Jacques Hiblot <[email protected]> Cc: Murali Karicheri <[email protected]> Cc: Peng Fan <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Ye Li <[email protected]> Cc: uboot-imx <[email protected]>
2021-04-16sunxi: video: select dw-hdmi in Kconfig, not MakefileJernej Skrabec
Currently sunxi Makefile manually specifies full path to dw-hdmi common code. However, that is not needed because it can be selected in Kconfig instead. Select proper symbol in Kconfig and drop path from Makefile. Signed-off-by: Jernej Skrabec <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16clk: sunxi: h6: Add XHCI clocksSamuel Holland
The XHCI controller has its own clock and reset. Add them. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16clk: sunxi: Add a dummy clock driver for the RTCSamuel Holland
The 32kHz clock ("LOSC") on sunxi SoCs is provided by the RTC. It is used, among other things, by the XHCI controller in the H6. To be able to call clk_get_bulk() on the XHCI controller, some device needs to provide all referenced clocks. Since LOSC is a fixed-rate always-on clock, implementation is trivial. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-15Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
update ls1028aqds networking protocol, config in ls1021atwr, env in ls1012a Add seli3 board support, booke watchdog, update eTSEC support in ppc-qemu Add DM_SERIAL and lpuart in sl28, add DM_ETH support for some of powerpc platforms Signed-off-by: Priyanka Jain <[email protected]>
2021-04-15test: dm: Add a test case for simple-bus <ranges>Bin Meng
This adds a test case to verify reading <ranges> of a simple-bus is working as expected. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15dm: core: Correctly read <ranges> of simple-busBin Meng
At present we decode simple bus <ranges> using the following assumption: - parent #address-cells 1 - child #address-cells 1 - child #size-cells 1 However this might not always be the case. Update to use fdt_addr_t and fdt_size_t in 'struct simple_bus_plat', and use fdt_read_ranges() to correctly decode it according to the actual parent and child #address-cells / #size-cells under a Kconfig option CONFIG_SIMPLE_BUS_CORRECT_RANGE which can be turned on for any board that needs it. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: tsec: Support <reg> property from the subnode "queue-group"Bin Meng
At present the tsec driver uses a non-standard DT bindings to get its <reg> base / size. The upstream Linux kernel seems to require the <reg> base / size to be put under a subnode of the eTSEC node with a name prefix "queue-group". This is not documented in the kernel DT bindings, but it looks every dtsi file that contains the eTSEC node was written like this. This commit updates the tsec driver to handle this case. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: tsec: Use map_physmem() directly instead of dev_remap_addr()Bin Meng
dev_remap_addr() eventually calls dev_read_addr_index(), while pdata->iobase holds the return value of dev_read_addr() that calls dev_read_addr_index() too. Such duplication can be avoided by using map_physmem() directly. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15sandbox: Add a DSA sandbox driver and unit testClaudiu Manoil
The DSA sandbox driver is used for unit testing the DSA class code. It implements a simple 2 port switch plus 1 CPU port, and uses a very simple tag to identify the ports. The DSA sandbox device is connected via CPU port to a regular Ethernet sandbox device, called 'dsa-test-eth, managed by the existing eth sandbox driver. The 'dsa-test-eth' is not intended for testing the eth class code however, but it is used to emulate traffic through the 'lan0' and 'lan1' front pannel switch ports. To achieve this the dsa sandbox driver registers a tx handler for the 'dsa-test-eth' device. The switch ports, labeled as 'lan0' and 'lan1', are also registered as eth devices by the dsa class code this time. So pinging through these switch ports is as easy as: => setenv ethact lan0 => ping 1.2.3.5 Unit tests for the dsa class code were also added. The 'dsa_probe' test exercises most API functions from dsa.h. The 'dsa' unit test simply exercises ARP/ICMP traffic through the two switch ports, including tag injection and extraction, with the help of the dsa sandbox driver. I took care to minimize the impact on the existing eth unit tests, though some adjustments needed to be made with the addition of extra eth interfaces used by the dsa unit tests. The additional eth interfaces also require MAC addresses, these have been added to the sandbox default environment. Signed-off-by: Alex Marginean <[email protected]> Signed-off-by: Claudiu Manoil <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Message-Id: <[email protected]> Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: tsec: Use dm_eth_phy_connect() directly for the DM caseVladimir Oltean
Now that the fixed phy driver has been fully adapted to OF APIs, and dm_eth_phy_connect() already can handle the fixed phy, call dm_eth_phy_connect() directly in the DM tsec driver. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]> Message-Id: <[email protected]> [bmeng: split from "net: mdio: teach dm_eth_phy_connect to connect to fixed PHY"] Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: fixed: Support the old DT bindingBin Meng
Update fixedphy_probe() to support the old DT binding. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: fixed: Add the missing ending newlineBin Meng
The printf statement doesn't end with a newline. Add it. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: fixed: Make driver ops staticBin Meng
The PHY driver ops should be made static. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: Simplify the logic of phy_connect_fixed()Bin Meng
Simplify the logic of phy_connect_fixed() by using the new API ofnode_phy_is_fixed_link(), which brings additional bonus of supporting the old DT bindings. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: xilinx: Drop #ifdef CONFIG_DM_ETH around phy_connect_gmii2rgmii()Bin Meng
At present phy_connect_gmii2rgmii() is implemented using a DM API dev_of_offset() hence it cannot support a non-DM configuration. Remove the non-DM version prototype of phy_connect_gmii2rgmii() and make the driver depend on CONFIG_DM_ETH. Signed-off-by: Bin Meng <[email protected]> Acked-by: Michal Simek <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: xilinx: Be compatible with live OF treeBin Meng
Following the same updates that were done to the fixed phy driver, use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver can support live DT. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: fixed: Drop #ifdef CONFIG_DM_ETH around phy_connect_fixedVladimir Oltean
In drivers/net/phy/Kconfig, CONFIG_PHY_FIXED already depends on CONFIG_DM_ETH, so the function prototype definition when CONFIG_DM_ETH=n does nothing, so it can be dropped. It is also never reachable, since the whole function is already under #ifdef CONFIG_PHY_FIXED (which again, as I said, depends on CONFIG_DM_ETH=y). Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]> Message-Id: <[email protected]> Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15net: phy: fixed: Be compatible with live OF treeVladimir Oltean
On systems that use CONFIG_OF_LIVE, the "ofnode" type is defined as const struct device_node *np, while on the flat DT systems it is defined as a long of_offset into gd->fdt_blob. It is desirable that the fixed PHY driver uses the higher-level ofnode abstraction instead of parsing gd->fdt_blob directly, because that enables it to work on live OF systems. The fixed PHY driver has used a nasty hack since its introduction in commit db40c1aa1c10 ("drivers/net/phy: add fixed-phy / fixed-link support"), which is to pass the long gd->fdt_blob offset inside int phydev->addr (a value that normally holds the MDIO bus address at which the PHY responds). Even ignoring the fact that the types were already mismatched leading to a potential truncation (flat OF offset was supposed to be a long and not an int), we really cannot extend this hack any longer, because there's no way an int will hold the other representation of ofnode, the struct device_node *np. So we unfortunately need to do the right thing, which is to use the framework introduced by Grygorii Strashko in commit eef0b8a930d1 ("net: phy: add ofnode node to struct phy_device"). This will populate phydev->node for the fixed PHY. Note that phydev->node will not be valid in the probe function, since that is called synchronously from phy_device_create and we really have no way of passing the ofnode directly through the phy_device_create API. So we do what other drivers do too: we move the OF parsing logic from the .probe to the .config method of the PHY driver. The new function will be called at phy_config() time. I do believe I've converted all the possible call paths for creating a PHY with PHY_FIXED_ID, so there is really no reason to maintain compatibility with the old logic of retrieving a flat OF tree offset from phydev->addr. We just pass 0 to phydev->addr now. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]> Message-Id: <[email protected]> [bmeng: keep fixedphy_probe(); update mdio-uclass.c to handle fixed phy] Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15of: extra: Introduce ofnode_phy_is_fixed_link() APIBin Meng
Introduce a helper API ofnode_phy_is_fixed_link() to detect whether the ethernet controller connects to a fixed-link pseudo-PHY device. Note there are two ways to describe a fixed PHY attached to an Ethernet device: - the new DT binding, where 'fixed-link' is a sub-node of the Ethernet device - the old DT binding, where 'fixed-link' is a property with 5 cells encoding various information about the fixed PHY Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15watchdog: Add booke watchdog driverChris Packham
Add a driver for the PowerPC Book E watchdog driver that is present on a number of Freescale/NXP SoCs. Signed-off-by: Chris Packham <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15pci: add Amlogic Meson Designware PCIe controllerNeil Armstrong
Add support for the DW PCIe controller found in the Amlogic Meson AXG and G12 (G12A, G12B, SM1) SoCs. This uses the common DW PCIe helpers introducted previously. Signed-off-by: Neil Armstrong <[email protected]>
2021-04-15pci: pcie_dw_rockchip: migrate to common Designware PCIe functionsNeil Armstrong
Migrate the dw_rockchip driver to use the common DW PCIe helpers. Signed-off-by: Neil Armstrong <[email protected]>
2021-04-15pci: pcie_dw_ti: migrate to common Designware PCIe functionsNeil Armstrong
Migrate the dw_ti driver to use the common DW PCIe helpers. Signed-off-by: Neil Armstrong <[email protected]>
2021-04-15pci: add common Designware PCIe functionsNeil Armstrong
With the introduction of pcie_dw_rockchip, and need to support the DW PCIe in the Amlogic AXG & G12 SoCs, most of the DW PCIe helpers would be duplicated. This introduce a "common" DW PCIe helpers file with common code merged from the dw_ti and dw_rockchip drivers and adapted to fit with the upcoming dw_meson. The following changes will switch the dw_ti and dw_rockchip to use these helpers. Signed-off-by: Neil Armstrong <[email protected]> Tested-by: Green Wan <[email protected]> [bmeng: remove the blank line at EOF of drivers/pci/pcie_dw_common.c] Signed-off-by: Bin Meng <[email protected]>
2021-04-12scmi: translate the resource only when livetree is not activatedPatrick Delaunay
Call the translation function on the ofnode_read_resource result only when the livetree is not activated. Today of_address_to_resource() calls ofnode_read_resource() for livetree support and fdt_get_resource() when livetree is not supported. The fdt_get_resource() doesn't do the address translation so when it is required when livetree is activated but this address translation is already done by ofnode_read_resource(). Fixes: 240720e9052f ("firmware: scmi: mailbox/smt agent device") Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-12gpio: Drop dm_gpio_set_dir()Simon Glass
This function is not used. Drop it. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2021-04-12gpio: i2c-gpio: Drop use of dm_gpio_set_dir()Simon Glass
This is the only driver that uses this function. Update it to use the alternative which is dm_gpio_clrset_flags(). Signed-off-by: Simon Glass <[email protected]> Tested-by: Harm Berntsen <[email protected]>
2021-04-12qemu: add MMIO driver for QFWAsherah Connor
Add MMIO driver for QFW. Note that there is no consumer as of this patch. Signed-off-by: Asherah Connor <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-04-12test: qemu: add qfw sandbox driver, dm tests, qemu testsAsherah Connor
A sandbox driver and test are added for the qfw uclass, and a test in QEMU added for qfw functionality to confirm it doesn't break in real world use. Signed-off-by: Asherah Connor <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-04-12x86: qemu: move QFW to its own uclassAsherah Connor
We move qfw into its own uclass and split the PIO functions into a specific driver for that uclass. The PIO driver is selected in the qemu-x86 board config (this covers x86 and x86_64). include/qfw.h is cleaned up and documentation added. Signed-off-by: Asherah Connor <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]>
2021-04-12scmi: correctly configure MMU for SCMI bufferPatrick Delaunay
Align the MMU area for SCMI shared buffer on section size; use the ALIGN macro in mmu_set_region_dcache_behaviour call. Since commit d877f8fd0f09 ("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter of mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE aligned. Fixes: 240720e9052f ("firmware: scmi: mailbox/smt agent device") Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
2021-04-12fastboot: Fix possible buffer overrunSean Anderson
This fixes several uses of strn(cpy|cat) which did not terminate their destinations properly. Fixes de1728ce4c ("fastboot: Allow u-boot-style partitions") Reported-by: Coverity Scan Signed-off-by: Sean Anderson <[email protected]>
2021-04-12lib: string: Implement strlcatSean Anderson
This introduces strlcat, which provides a safer interface than strncat. It never copies more than its size bytes, including the terminating nul. In addition, it never reads past dest[size - 1], even if dest is not nul-terminated. This also removes the stub for dwc3 now that we have a proper implementation. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12tee: optee: Change printing during optee_probeIlias Apalodimas
Right now the error messages when optee has a version mismatch or shared memory is not configured are done with a debug(). That's not very convenient since you have to enable debugging to figure out what's going on, although this is an actual error. So let's switch the debug() -> dev_err() and report those explicitly. Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2021-04-12rtc: add support for rv3028 rtcHeiko Schocher
Add support for rtc3028 rtc from microcrystal. based on linux dirver: commit a38fd8748464: ("Linux 5.12-rc2") Signed-off-by: Heiko Schocher <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-04-12firmware: scmi: fix inline comments and minor coding style issuesEtienne Carriere
Fix inline comments and empty line in scmi driver and test files. Remove test on IS_ENABLED(CONFIG_*_SCMI) in test/dm/scmi.c since these configuration are expected enabled when CONFIG_FIRMWARE_SCMI is enabled in sandbox configuration. Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Jaehoon Chung <[email protected]>
2021-04-12firmware: scmi: sandbox test for voltage regulatorEtienne Carriere
Implement sandbox regulator devices for SCMI voltage domains and test them in DM scmi tests. Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Jaehoon Chung <[email protected]>
2021-04-12firmware: scmi: voltage regulatorEtienne Carriere
Implement voltage regulators interfaced by the SCMI voltage domain protocol. The DT bindings are defined in the Linux kernel since SCMI voltage domain and regulators patches [1] and [2] integration in v5.11-rc7. Link: [1] https://github.com/torvalds/linux/commit/0f80fcec08e9c50b8d2992cf26495673765ebaba Link: [2] https://github.com/torvalds/linux/commit/2add5cacff3531e54c50b0832128299faa9f0563 Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Jaehoon Chung <[email protected]>
2021-04-12pci: Mark 64bit Memory BARs as suchPhil Sutter
Just a bit more info to the reader. Signed-off-by: Phil Sutter <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-04-12mtd: Update fail_addr when erase fails due to bad blocksFarhan Ali
For all other erase failures, the fail_addr is updated with the failing address. Only in the case of erase failure due to bad block detection, the fail_addr is not updated. This change simply updates the fail_addr for this specific scenario so that it is consistent with the rest of the code. Signed-off-by: Farhan Ali <[email protected]>
2021-04-12power: pmic: remove pmic_max77696.c fileJaehoon Chung
Remove pmic_max77696.c file. The maintaining pmic_max77696.c file is useless. Signed-off-by: Jaehoon Chung <[email protected]>
2021-04-12test: pinmux: add test for 'pinctrl-single' driverDario Binacchi
The test adds two pinmux nodes to the device tree, one to test when a register changes only one pin's mux (pinctrl-single,pins), and the other to test when more than one pin's mux is changed (pinctrl-single,bits). This required replacing the controller's register access functions when the driver is used on sandbox. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12pinctrl: single: add get_pin_muxing operationDario Binacchi
It allows to display the muxing of a given pin. Inspired by more recent versions of the Linux driver, in addition to the address and the value of the configuration register I added the pin function retrieved from the DT. In doing so, the information displayed does not depend on the platform, being a generic type driver, and it can be useful for debug purposes. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12pinctrl: single: add get_pin_name operationDario Binacchi
It returns the name of the requested pin. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12pinctrl: single: add get_pins_count operationDario Binacchi
It returns the number of selectable pins. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12pinctrl: single: add register access functionsDario Binacchi
The configuration of pinmux registers was implemented with duplicate code which can be removed by adding two functions for read/write access. Access to 8-bit registers has also been added. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>