summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2017-07-30watchdog: Introduce watchdog driver for Intel TangierFelipe Balbi
Add watchdog driver for Intel Tangier based platforms. Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-29Merge git://git.denx.de/u-boot-socfpgaTom Rini
2017-07-29Merge git://git.denx.de/u-boot-usbTom Rini
2017-07-28clk: fix compilation errors for poplar platformPatrice Chotard
Move clk_release_all() prototype and definition inside OF_CONTROL flag to avoid following compilation error for poplar platform: aarch64: + poplar +drivers/usb/host/built-in.o: In function `ehci_usb_remove': +drivers/usb/host/ehci-generic.c:159: undefined reference to `clk_release_all' +drivers/usb/host/built-in.o: In function `ehci_usb_probe': +drivers/usb/host/ehci-generic.c:133: undefined reference to `clk_release_all' +make[1]: *** [u-boot] Error 139 +make: *** [sub-make] Error 2 Introduced by 4e542c4 clk: add clk_release_all() Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-07-28usb: host: xhci-dxc3: fix compilation warningsPatrice Chotard
Fix following warnings encountered with platforms dra7xx_evm and dra7xx_hs_evm : arm: + dra7xx_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] arm: + dra7xx_hs_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-07-28phy: add a NO-OP phy driverJean-Jacques Hiblot
This driver is used to stub PHY operations in a driver (USB, SATA). This is useful when the 'client' driver (USB, SATA, ...) uses the PHY framework and there is no actual PHY harwdare to drive. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2017-07-28usb: host: ohci-generic: initialize PHY only when foundPatrice Chotard
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28usb: host: ehci-generic: initialize PHY only when foundPatrice Chotard
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USBPatrice Chotard
Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman : +drivers/usb/host/built-in.o: In function `xhci_dwc3_remove': +drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister' +drivers/usb/host/built-in.o: In function `xhci_dwc3_probe': +drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register' introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM" Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Ran Wang <ran.wang_1@nxp.com>
2017-07-28dfu: add common function to initiate transactionPatrick Delaunay
- factorize code between read and write transaction - always use dfu_transaction_cleanup() to initialize the internal variable: easy maintenance - replace direct access by dfu_get_buf() and dfu_get_buf_size() Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28dfu: factorize transaction cleanupPatrick Delaunay
rename cleanup function, as now called by read Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28dfu: remove limitation on partition sizePatrick Delaunay
Change long (32 bits on arm) to u64 (same type than offset) for size and read offset r_left So partition and device used for DFU can be greater than 4GB Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28dfu: allow dfu read on partition greater than 2GBPatrick Delaunay
solve issue on get_medium_size() function the detection of error is a simple test < 0 but for ARM platform, long is 32bits and 2GB = 0x80000000 is seen as error. I solve the issue by changing the prototype fo the function to separate size and result. This patch prepare the next patch with size change to u64. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28usb: gadget: f_thor: Free the allocated out request bufferSiva Durga Prasad Paladugu
Fix the memory leak by freeing the allocated out request buffer Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-07-28usb: xhci: Enable TT to support LS/FS devices behind a HS hubBin Meng
So far LS/FS devices directly attached to xHC root port can be successfully enumerated by xHCI driver, but if they are connected behind a hub, the enumeration process fails to address the device. It turns out xHCI driver still misses a part that in the device's input slot context, all Transaction Translator (TT) related fields are not programmed. The xHCI spec defines how to enable TT. Now LS/FS devices like USB keyboard/mouse can be enumerated behind a high speed hub. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci: Correct TT_SLOT and TT_PORT macrosBin Meng
These two macros really need a parameter to make them useful. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci: Implement update_hub_device() operationBin Meng
There is no way to know whether the attached device is a hub or not in advance before the device's descriptor is fetched. But once we know it's a high speed hub, per the xHCI spec, we need to tell xHC it's a hub device by initializing hub-related fields in the input slot context. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28dm: usb: Add a new USB controller operation 'update_hub_device'Bin Meng
For USB host controllers like xHC, its internal representation of hub needs to be updated after the hub descriptor is fetched. This adds a new op that does this. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci: Program 'route string' in the input slot contextBin Meng
xHCI spec says: the values of the 'route string' field shall be initialized by the first 'Address Device' command issued to a device slot, and shall not be modified by any other command. So far U-Boot does not program this field, and it does not prevent SS device directly attached to root port, or HS device behind an HS hub, from working, due to the fact that 'route string' is used by the xHC to target SS packets. But in order to enumerate devices behind an SS hub, this field must be programmed. With this commit and along with previous commits, now SS & HS devices attached to a USB 3.0 hub can be enumerated by U-Boot. As usual, this new feature is only available when DM is on. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci: Change xhci_setup_addressable_virt_dev() signatureBin Meng
For future extension, change xhci_setup_addressable_virt_dev() signature to accept a pointer to 'struct usb_device', instead of its members slot_id & speed, as the struct already contains these two plus some other useful information of the device. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: hub: Add a new API to test if a hub device is root hubBin Meng
Sometimes we need know if a given hub device is root hub or not. Add a new API to test this. This removes the xHCI driver's own version is_root_hub() and change to use the new API. While we are here, remove the unused/commented out get_usb_device() in the xHCI driver too. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-28usb: hub: Use 'struct usb_hub_device' as hub device's uclass_privBin Meng
Use USB hub device's dev->uclass_priv to point to 'usb_hub_device' so that with driver model usb_hub_reset() and usb_hub_allocate() are no longer needed. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci-pci: Clean up the driver a little bitBin Meng
This cleans up the driver a little bit. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci-pci: Drop non-DM version of xhci-pci driverBin Meng
As there is no board that currently uses xhci-pci driver without DM USB, drop its support and leave only DM support. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: xhci: Convert CONFIG_USB_XHCI_PCI to KconfigBin Meng
Add CONFIG_USB_XHCI_PCI as a Kconfig option. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: ehci: Get rid of CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTSBin Meng
EHC reports supported maximum number of ports in the HCSPARAMS register, so it's unnecessary to use a hardcoded config option CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Get rid of CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTSBin Meng
xHC reports supported maximum number of ports in the HCSPARAMS1 register, so it's unnecessary to use a hardcoded config option CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Change MAX_HC_PORTS to 255Bin Meng
HCSPARAMS1:MaxPorts field specifies the maximum port number value, and its valid values are in the range of 1 to 255. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: hub: Change USB hub descriptor to match USB 3.0 hubsBin Meng
USB 3.0 hubs have a slightly different hub descriptor than USB 2.0 hubs, with a fixed (rather than variable length) size. Change the host controller drivers that access those last two fields (DeviceRemovable and PortPowerCtrlMask) to use the union. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: hub: Send correct wValue to get hub descriptor of a USB 3.0 hubBin Meng
Testing a USB 3.0 hub by connecting it to the xHCI port on Intel MinnowMax, when issuing 'get hub descriptor' to the hub, xHCI reports a transfer event TRB with a completion code 6 which means 'Stall Error'. In fact super speed USB hub descriptor type is 0x2a, not 0x29. Sending correct SETUP packet to the hub makes it not stall anymore. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Add input slot context in xhci_set_configuration()Bin Meng
A valid input slot context for a 'configure endpoint' command requires the 'Context Entries' field to be initialized to the index of the last valid endpoint context that is defined by the target configuration. We set up the 'Context Entries' field, but we forget to include the input slot context in the input control context 'Add Context flags' bitmap. So xHC will simply ignore input slot context and continue using its own which contains old information of the device. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Initialize scratchpad buffer array and scratchpad buffersBin Meng
The scratchpad buffer array is used to define the locations of statically allocated memory pages that are available for the private use of the xHC. The xHCI spec explicitly mentions that system software shall allocate the scratchpad buffers before placing the xHC in to Run mode (Run/Stop (R/S) = ‘1’), however U-Boot is missing this part. This causes xHC on Intel platform does not respond the very first 'enable slot' command that is given to xHC and the 'enable slot' command completion event TRB is never generated and xHC seems to hang forever. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Correct command TRB 4th dword initializationBin Meng
In xhci_queue_command(), when the command is not 'reset endpoint', 'stop endpoint' or 'set TR dequeue pointer', endpoint ID should not be encoded in the TRB. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: xhci: Remove incorrect comments for struct xhci_container_ctxBin Meng
There is no member called 'dma' in struct xhci_container_ctx. Remove the comments that mentions it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-07-28usb: host: ohci-generic: add generic PHY supportPatrice Chotard
Extend ohci-generic driver with generic PHY framework Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: ohci-generic: add RESET supportPatrice Chotard
use array to save deasserted resets reference in order to assert them in case of error during probe() or during driver removal. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: ohci-generic: add CLOCK supportPatrice Chotard
use array to save enabled clocks reference in order to disabled them in case of error during probe() or during driver removal. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: ehci-generic: add generic PHY supportPatrice Chotard
Extend ehci-generic driver with generic PHY framework Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: ehci-generic: add error path and .remove callbackPatrice Chotard
Use an array to save enabled clocks reference and deasserted resets in order to respectively disabled and asserted them in case of error during probe() or during driver removal. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: ehci-generic: replace printf() by error()Patrice Chotard
this allows to get file, line and function location of the current error message. Signed-off-by: patrice chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28dm: core: add ofnode_count_phandle_with_args()Patrice Chotard
This function is usefull to get phandle number contained in a property list. For example, this allows to allocate the right amount of memory to keep clock's reference contained into the "clocks" property. To implement it, either of_count_phandle_with_args() or fdtdec_parse_phandle_with_args() are used respectively for live tree and flat tree. By passing index = -1, these 2 functions returns the number of phandle contained into the property list. Add also the dev_count_phandle_with_args() based on ofnode_count_phandle_with_args() Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28clk: add clk_release_all()Patrice Chotard
Add clk_release_all() method which Disable/Free an array of clocks that has been previously requested by clk_request/get_by_*() Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28reset: add reset_release_all()Patrice Chotard
Add reset_release_all() method which Assert/Free an array of resets signal that has been previously successfully requested by reset_get_by_*() Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28reset: add reset_request()Patrice Chotard
This is needed in error path to assert previously deasserted reset by using a saved reset_ctl reference. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: xhci-dwc3: Add generic PHY supportPatrice Chotard
Add support of generic PHY framework support Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() failsPatrice Chotard
phy->dev need to be set to NULL in case of generic_phy_get_by_index() fails. Then phy->dev can be used to check if the phy is valid Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: xhci-dwc3: Add dual role mode support from DTPatrice Chotard
DWC3 dual role mode is selected using DT "dr_mode" property. If not found, DWC3 controller is configured in HOST mode by default Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28usb: host: xhci-dwc3: Convert driver to DMPatrice Chotard
Add Driver Model support with use of generic DT compatible string "snps,dwc3" Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-28usb: add static to local symbolsMasahiro Yamada
Sparse reports "... was not declared. Should it be static?" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-07-28dm: power: Convert as3722 to driver modelSimon Glass
Convert this PMIC driver to driver model and fix up other users. The regulator and GPIO functions are now handled by separate drivers. Update nyan-big to work correct. Three boards will need to be updated by the maintainers: apalis-tk1, cei-tk1-som. Also the TODO in the code re as3722_sd_set_voltage() needs to be completed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukasz Majewski <lukma@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Jetson-TK1 Tested-by: Stephen Warren <swarren@nvidia.com>