summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2020-10-01usb: xhci: create one unified function to calculate TRB TD remainderChunfeng Yun
xhci versions 1.0 and later report the untransferred data remaining in a TD a bit differently than older hosts. We used to have separate functions for these, and needed to check host version before calling the right function. Now Mediatek host has an additional quirk on how it uses the TD Size field for remaining data. To prevent yet another function for calculating remainder we instead want to make one quirk friendly unified function. Porting from the Linux: c840d6ce772d("xhci: create one unified function to calculate TRB TD remainder.") 124c39371114("xhci: use boolean to indicate last trb in td remainder calculation") Signed-off-by: Chunfeng Yun <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2020-10-01usb: xhci: add a member hci_version in xhci_ctrl structChunfeng Yun
Add a member to save xHCI version, it's used some times. Signed-off-by: Chunfeng Yun <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2020-10-01Merge branch 'next' of git://git.denx.de/u-boot-sh into nextTom Rini
2020-10-01Merge branch '2020-09-30-assorted-network-improvements' into nextTom Rini
- Generic UDP framework - TFTP fixes - dwc_eth_qos, smc911x, smc911x and mscc phy fixes
2020-10-01i2c: rcar_i2c: Fix i2c read/write errorsLad Prabhakar
commit 7c8f821e5dde ("i2c: rcar_i2c: Set the slave address from rcar_i2c_xfer") blindly called rcar_i2c_set_addr() with read argument always set to 1 during xfer which introduced read/write errors, whereas earlier rcar_i2c_read_common() called rcar_i2c_set_addr() with read set to 1 and rcar_i2c_write_common() called rcar_i2c_set_addr() with read set 0. Fixes: 7c8f821e5dde ("i2c: rcar_i2c: Set the slave address from rcar_i2c_xfer") Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2020-09-30net: dwc_eth_qos: Convert to use APIs which support live DTPatrick Delaunay
Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT. Signed-off-by: Patrick Delaunay <[email protected]>
2020-09-30phy: add support for stingray PAXB PHY controllerSrinath Mannam
Add support for stingray PAXB PHY controller driver. This driver supports maximum 8 PAXB phys using pipemux data. Signed-off-by: Srinath Mannam <[email protected]> Signed-off-by: Rayagonda Kokatanur <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2020-09-30net: smc911x: Automatically Update ethaddr with MACAdam Ford
The ethernet controller can read the MAC from EEPROM and display it, but if ethaddr is not set, the ethernet is still unavailable. This patch checks will automatically set the MAC address if it has not already been set. Signed-off-by: Adam Ford <[email protected]> Acked-by: Joe Hershberger <[email protected]>
2020-09-30net: ftgmac100: Add support for board specific PHY interface addressThirupathaiah Annapureddy
ftgmac100 driver is using hard-coded PHY interface address of zero. Each board can have different PHY interface address (phy_addr). This commit modifies the driver to make use of board specific address by leveraging CONFIG_PHY_ADDR. Signed-off-by: Thirupathaiah Annapureddy <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]>
2020-09-30net: phy: mscc: sync rx/tx delay settings with Linux on vsc85xxHeiko Stuebner
The Linux kernel does set the clock delays to - 0.2 ns (their default, and lowest, hardware value) if delays should not be enabled - 2.0 ns (which causes the data to be sampled at exactly half way between clock transitions at 1000 Mbps) if delays should be enabled depending on the interface mode See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/mscc/mscc_main.c#n523 So instead of using arbitrary delay values like now, mimic this behaviour. The behaviour is the same for all of vsc8530/8531/8540/8541 so move that to a shared function while at it. Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Philipp Tomsich <[email protected]>
2020-09-30net: phy: mscc: make clock-output configurable on vsc85xxHeiko Stuebner
The vsc8530/8531/8540/8541 phys have a configurable clock output that can emit 25, 50 and 125 MHz rates, which in turn may be needed for stable network connections. This follows a similar change introduced into the Linux kernel at https://lore.kernel.org/netdev/[email protected] Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Philipp Tomsich <[email protected]>
2020-09-30firmware: smci: sandbox test for SCMI reset controllersEtienne Carriere
Add tests for SCMI reset controllers. A test device driver sandbox-scmi_devices.c is used to get reset resources, allowing further resets manipulation. Change sandbox-smci_agent to emulate 1 reset controller exposed through an agent. Add DM test scmi_resets to test this reset controller. Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30reset: add reset controller driver for SCMI agentsEtienne Carriere
This change introduces a reset controller driver for SCMI agent devices. When SCMI agent and SCMI reset domain drivers are enabled, SCMI agent binds a reset controller device for each SCMI reset domain protocol devices enabled in the FDT. SCMI reset driver is embedded upon CONFIG_RESET_SCMI=y. If enabled, CONFIG_SCMI_AGENT is also enabled. SCMI Reset Domain protocol is defined in the SCMI specification [1]. Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30firmware: scmi: sandbox test for SCMI clocksEtienne Carriere
Add tests for SCMI clocks. A test device driver sandbox-scmi_devices.c is used to get clock resources, allowing further clock manipulation. Change sandbox-smci_agent to emulate 3 clocks exposed through 2 agents. Add DM test scmi_clocks to test these 3 clocks. Update DM test sandbox_scmi_agent with load/remove test sequences factorized by {load|remove}_sandbox_scmi_test_devices() helper functions. Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30clk: add clock driver for SCMI agentsEtienne Carriere
This change introduces a clock driver for SCMI agent devices. When SCMI agent and SCMI clock drivers are enabled, SCMI agent binds a clock device for each SCMI clock protocol devices enabled in the FDT. SCMI clock driver is embedded upon CONFIG_CLK_SCMI=y. If enabled, CONFIG_SCMI_AGENT is also enabled. SCMI Clock protocol is defined in the SCMI specification [1]. Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi Signed-off-by: Etienne Carriere <[email protected]> Cc: Lukasz Majewski <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30firmware: scmi: support Arm SMCCC transportEtienne Carriere
This change implements a SMCCC transport for SCMI exchanges. This implementation follows the Linux kernel as references implementation for SCMI message processing, using the SMT format for communication channel meta-data. Use of SMCCC transport in SCMI FDT bindings are defined in the Linux kernel DT bindings since v5.8. SMCCC with SMT is implemented in OP-TEE from tag 3.9.0 [2]. Links: [2] https://github.com/OP-TEE/optee_os/commit/a58c4d706d23 Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30firmware: scmi: mailbox/smt agent deviceEtienne Carriere
This change implements a mailbox transport using SMT format for SCMI exchanges. This implementation follows the Linux kernel and SCP-firmware [1] as references implementation for SCMI message processing using SMT format for communication channel meta-data. Use of mailboxes in SCMI FDT bindings are defined in the Linux kernel DT bindings since v4.17. Links: [1] https://github.com/ARM-software/SCP-firmware Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30firmware: add SCMI agent uclassEtienne Carriere
This change introduces SCMI agent uclass to interact with a firmware using the SCMI protocols [1]. SCMI agent uclass currently supports a single method to request processing of the SCMI message by an identified server. A SCMI message is made of a byte payload associated to a protocol ID and a message ID, all defined by the SCMI specification [1]. On return from process_msg() method, the caller gets the service response. SCMI agent uclass defines a post bind generic sequence for all devices. The sequence binds all the SCMI protocols listed in the FDT for that SCMI agent device. Currently none, but later change will introduce protocols. This change implements a simple sandbox device for the SCMI agent uclass. The sandbox nicely answers SCMI_NOT_SUPPORTED to SCMI messages. To prepare for further test support, the sandbox exposes a architecture function for test application to read the sandbox emulated devices state. Currently supports 2 SCMI agents, identified by an ID in the FDT device name. The simplistic DM test does nothing yet. SCMI agent uclass is designed for platforms that embed a SCMI server in a firmware hosted somewhere, for example in a companion co-processor or in the secure world of the executing processor. SCMI protocols allow an SCMI agent to discover and access external resources as clock, reset controllers and more. SCMI agent and server communicate following the SCMI specification [1]. This SCMI agent implementation complies with the DT bindings defined in the Linux kernel source tree regarding SCMI agent description since v5.8. Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi Signed-off-by: Etienne Carriere <[email protected]> Cc: Simon Glass <[email protected]> Cc: Peng Fan <[email protected]> Cc: Sudeep Holla <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: Add support for regmap fieldsJean-Jacques Hiblot
A regmap field is an abstraction available in Linux. It provides to access bitfields in a regmap without having to worry about shifts and masks. Signed-off-by: Jean-Jacques Hiblot <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
2020-09-30regmap: Allow devices to specify regmap range start and size in configPratyush Yadav
Some devices need to calculate the regmap base address at runtime. This makes it impossible to use device tree to get the regmap base. Instead, allow devices to specify it in the regmap config. This will create a regmap with a single range that corresponds to the start and size given by the driver. Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: Add regmap_init_mem_range()Pratyush Yadav
Right now, the base of a regmap can only be obtained from the device tree. This makes it impossible for devices which calculate the base at runtime to use a regmap. An example of such a device is the Cadence Sierra PHY. Allow creating a regmap with one range whose start and size can be specified by the driver based on calculations at runtime. Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: Allow left shifting register offset before accessPratyush Yadav
Drivers can configure it to adjust the final read/write location. Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: Allow specifying read/write widthPratyush Yadav
Right now, regmap_read() and regmap_write() read/write a 32-bit value only. To write other lengths, regmap_raw_read() and regmap_raw_write() need to be used. This means that any driver ported from Linux that relies on regmap_{read,write}() to know the size already has to be updated at each callsite. This makes the port harder to maintain. So, allow specifying the read/write width to make it easier to port the drivers, since now the only change needed is when initializing the regmap. Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: zero out the regmap on allocationPratyush Yadav
Some fields will be introduced in the regmap structure that should be set to 0 by default. So, once we allocate a regmap, make sure it is zeroed out to avoid unexpected defaults for those values. Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-09-30regmap: Add devm_regmap_init()Jean-Jacques Hiblot
Most of new linux drivers are using managed-API to allocate resources. To ease porting drivers from linux to U-Boot, introduce devm_regmap_init() as a managed API to get a regmap from the device tree. Signed-off-by: Jean-Jacques Hiblot <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
2020-09-30drivers: gpio: Add a managed API to get a GPIO from the device-treeJean-Jacques Hiblot
Add managed functions to get a gpio from the devce-tree, based on a property name (minus the '-gpios' suffix) and optionally an index. When the device is unbound, the GPIO is automatically released and the data structure is freed. Signed-off-by: Jean-Jacques Hiblot <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
2020-09-30test: reset: Add tests for the managed APIJean-Jacques Hiblot
The tests are basically the same as for the regular API. Except that the reset are initialized using the managed API, and no freed manually. Signed-off-by: Jean-Jacques Hiblot <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
2020-09-30drivers: reset: Add a managed API to get reset controllers from the DTJean-Jacques Hiblot
Add managed functions to get a reset_ctl from the device-tree, based on a name or an index. Also add a managed functions to get a reset_ctl_bulk (array of reset_ctl) from the device-tree. When the device is unbound, the reset controllers are automatically released and the data structure is freed. Signed-off-by: Jean-Jacques Hiblot <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
2020-09-30Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini
into next - Disable CMD_IRQ for RISC-V. - Update sipeed/maix doc - Obtain reg of SiFive RAM via dev_read_addr_index() instead of regmap API. - Cleans up RISC-V timer drivers and converts them to DM. - Correctly handle IPIs already pending upon prior stage bootloader (on the K210)
2020-09-30video: stm32: Fix not calling dev_xxx with a deviceSean Anderson
There is no member `dev` in dw_mipi_dsi, but there is one in mipi_dsi_host, so use that. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: musb-new: sunxi: Fix not calling dev_err with a deviceSean Anderson
This driver does not use DM, so we need to use a struct device instead of a struct udevice. Not ideal, but it'll have to do for now. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: dwc3: Don't include asm-generic/io.hSean Anderson
This can conflict with asm/io.h on some archs, and it isn't needed to build dwc3-generic.c Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: dwc3: ti: Fix not calling dev_err with a deviceSean Anderson
This driver does not use DM, so use log_xxx instead. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: dwc3: Fix not calling dev_xxx with a deviceSean Anderson
This logs with the device from struct dwc3. Some files also need to include dm.h so fields in udevice can be accessed. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: dwc2: Fix not calling dev_xxx with a deviceSean Anderson
This adds a dev argument to some functions so dev_xxx always has a device to log with. In one instance we must use use a different log function when we are compiled without DM_USB. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30usb: cdns3: Fix not calling dev_xxx with a deviceSean Anderson
ep0.c also need to include dm.h so dev_xxx can access udevice fields. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30sysreset: ti: Fix not calling dev_err with a deviceSean Anderson
The rst variable doesn't exist. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30spi: zynqmp_gqspi: Fix not calling dev_err with a deviceSean Anderson
Use `bus` instead of `dev`. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Michal Simek <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30spi: sunxi: Fix not calling dev_err with a deviceSean Anderson
Use `bus` and not `dev`. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30soc: qualcomm: Fix not calling dev_err with a deviceSean Anderson
Remove the indirection. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30remoteproc: k3: Fix not calling dev_xxx with a deviceSean Anderson
Pass a device to functions which log with one. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30remoteproc: k3-r5: Fix not calling dev_xxx with a deviceSean Anderson
Usually we can get a device from the current core, but some dev_dbg calls have been converted to debug, since we are called on a cluster. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30remoteproc: Remove unused function rproc_elf_sanity_checkSean Anderson
This function is never used anywhere, and it also tries to log with a nonexistant device. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30phy: usbphyc: Fix not calling dev_err with a deviceSean Anderson
Use the phy's device. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30phy: ti: Fix not calling dev_err with a deviceSean Anderson
`phy` doesn't exist; we need to use `x` instead. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30phy: sun4i-usb: Fix not calling dev_err with a deviceSean Anderson
This uses phy's device Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30phy: rockchip: Fix not calling dev_err with a deviceSean Anderson
Get the device from phy, or pass the phy in. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Kever Yang <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30phy: marvell: Fix not calling dev_err with a deviceSean Anderson
No need for indirection here. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30net: ti: cpsw: Fix not calling dev_dbg with a deviceSean Anderson
Without DM_ETH, cpsw_priv.dev is an eth_device. Just use its name instead. Signed-off-by: Sean Anderson <[email protected]> Tested-by: Patrick Delaunay <[email protected]>
2020-09-30net: sun8i_emac: Fix not calling dev_xxx with a deviceSean Anderson
Pass a udevice into a few functions so `dev` is defined. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Patrick Delaunay <[email protected]>