Commit Graph

22026 Commits

Author SHA1 Message Date
Dan Murphy
ea02b653c2 ARM: omap5-evm: Move MAC creation to misc_init
Move the MAC creation from the USB init to an function
that is called on every boot.  This will then populate the
usbethaddr mac that kernel driver can pick up from the
device tree blob.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:42 +02:00
Dan Murphy
3d799c7f5e usb: am437x: Add support for am437x xhci USB host
Add the support for the am437x xhci usb host.

The xHCI host on AM437 is connected to a usb2 phy so need to
add support to enable those clocks.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:41 +02:00
Dan Murphy
834e91af43 usb: dra7xx: Add support for dra7xx xhci USB host
Add the support for the dra7xx xhci usb host.
dra7xx does not contain an EHCI controller so the headers
can be removed from the board file.

The xHCI host on dra7xx is connected to a usb2 phy so need to
add support to enable those clocks.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:41 +02:00
Dan Murphy
ba55453ccf usb: omap: Move the usb phy code to the usb/phy directory
Moving the usb/phy code from xhci-omap to the usb/phy directory
and moving the associated phy code over to the new file.

Newer TI processors adding xHCI support will have different PHY configurations
so therefore abstracting this code away will prevent messing around with the
xhci-omap file itself.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:41 +02:00
Dan Murphy
b216821189 usb: omap5: Update the board_usb_init api
Recent patches declares board_usb_init function prototype for a new
usb architecture.

Turning on the OMAP_XHCI defines cause a redefinition compiler failure.
So update the board_usb_init to the latest prototype.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:41 +02:00
Dan Murphy
41b667b834 usb: omap: Move the xhci-omap header file to common location
Moving the xhci-omap header to a more global location so that
other code can reference this code.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
e96751dad3 trats: Update TRATS config to support TIZEN download
A set of environment variables needs to be updated to provide support for
TIZEN download command (tizendown).

Since DFU is used as a flashing backend, it is also necessary to extent
malloc pool size for DFU buffer allocation.
Moreover, for compatibility reasons (Win vs. Lin) new USB idProduct number
for download gadget had to be added.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
ce2757b66a samsung:common:thor: Define common Samsung code to handle THOR usb descriptor setup
Special, common to Samsung, function for altering usb descriptor's
idVendor and idProduct has been added.
For compatibility reasons (Win vs Linux) the THOR idProduct must be
different than the one for DFU/UMS.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
3402b05343 cmd:thor: Support for TIZEN's download command (thordown)
New command - thordown - has been added to support downloading data
via lthor TIZEN program.
It is similar to dfu command syntax and reuses its code for flashing data.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
b958fb9165 usb:g_dnl: Support for TIZEN's THOR function in generic download code
Support of "thor" function in generic download code (g_dnl.c).

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
c527937796 usb:g_dnl:f_thor: USB download function to support TIZEN's THOR protocol
Implementation of USB download function which supports THOR protocol.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
d6eae7b0b1 usb:g_dnl: Add name parameter to g_dnl_bind_fixup function
New parameter, namely *name has been added to g_dnl_bind_fixup().
It is necessary (for compatibility reasons) to assign new USB idProduct
and idVendor for different usb functions.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:41 +02:00
Lukasz Majewski
7b412ab31f usb:g_dnl: Replace static usb_configuration structure with dynamically allocated one
When the usb_configuration structure is declared as static, it is very
hard to assure, that relevant fields (as e.g. config->interfaces[]) are
cleared out before new call to g_dnl related functions.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:40 +02:00
Lukasz Majewski
d42782631d dfu:core: Export dfu_{get|free}_buf functions
Define the dfu_get_buf() and dfu_free_buf() as global functions.
They are necessary for zero copy buffer management, when DFU backend is
used for storing data.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:40 +02:00
Lukasz Majewski
fed936ed80 dfu:core: Find DFU alt setting number by passing its name
New function - dfu_get_alt() - has been added to dfu core. If present, it
returns alt setting's number corresponding to passed name.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:40 +02:00
Lukasz Majewski
57ffabe371 usb:udc:s3c: Reduce dcache invalidate range for UDC receive buffer
The s3c udc driver sends data in a max packet size. Therefore the dcache
invalidate range shall be equal to max packet, not the entire
DMA_BUFFER_SIZE.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:40 +02:00
Suriyan Ramasami
98f686c26f usb:smsx95xx LED activity for USB net driver
Add LED activity for SMSX95XX USB Ether driver.

Signed-off-by: “Suriyan Ramasami" <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2013-10-20 23:42:40 +02:00
Mateusz Zalega
16297cfb2a usb: new board-specific USB init interface
This commit unifies board-specific USB initialization implementations
under one symbol (usb_board_init), declaration of which is available in
usb.h.

New API allows selective initialization of USB controllers whenever needed.

Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
2013-10-20 23:42:40 +02:00
Troy Kisky
f3d7cff559 nitrogen6x: add CONFIG_MV_UDC
Also, add other USB related config items.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:40 +02:00
Troy Kisky
08ce074e56 nitrogen6x: add otg usb host/device mode support
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:40 +02:00
Troy Kisky
7132869d4c mx6: iomux: add GPR1 defines for use with nitrogen6x
Select GPIO1 as the USB OTG ID pin for Nitrogen6x

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:40 +02:00
Troy Kisky
b065eb7fd7 usb: gadget: mv_udc: clear desc upon ep_disable
desc is set at ep_enable, so for symmetry,
clear it at ep_disable.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:40 +02:00
Troy Kisky
01773ccc0d usb: gadget: mv_udc: zero transfer descriptor memory on probe
Since we flush the TD, we may as well set it to a known value.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Troy Kisky
5fc2e99732 usb: gadget: mv_udc: flush item before head
Make sure the transfer descriptor is flushed
before the queue is updated so that the controller
will not see old information.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Troy Kisky
5a90443048 usb: gadget: mv_udc: set is_dualspeed = 1
This controller support full and high speed.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Troy Kisky
d0928794d9 usb: gadget: mv_udc: fix typo in error message
Change 'nfo=' to 'info='

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Troy Kisky
71fc5f91d2 usb: gadget: ether: return error from rx_submit if no request
This prevents a crash if tftpboot is given a bad filename.

rx_req will be released by eth_reset_config
which is called by eth_disconnect,
which is called using the .disconnect member of usb_gadget_driver by mv_pullup in mv_udc
which is called using the .pullup member of usb_gadget_ops by usb_gadget_disconnect
which is called by usb_eth_halt
which is called using the .halt member of eth_device by eth_halt
which is called by TftpHandler when TFTP_ERR_FILE_NOT_FOUND or TFTP_ERR_ACCESS_DENIED occurs

I trigger this with the following commands
setenv ipaddr 10.0.0.2 && setenv netmask 255.255.255.0 && setenv serverip 10.0.0.1
setenv usbnet_devaddr 00:11:22:33:44:55 && setenv usbnet_hostaddr 00:aa:bb:cc:dd:ee
setenv ethprime usb_ether && setenv ethact usb_ether && setenv ncip 10.0.0.1
tftpboot 10800000 10.0.0.1:missing_file

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Troy Kisky
43880ce5be usb: gadget: ether set wMaxPacketSize
set wMaxPacketSize for full speed descriptors
fs_source_desc, fs_sink_desc to 64.

Full-speed bulk endpoint can have a maximum packet size of
8, 16, 32, or 64 bytes, so choice 64.

The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
set to 512. That is the only legal value for high speed bulk endpoints.

Strictly speaking, this patch is not needed because
usb_ep_autoconfig will call ep_matches which will
override wMaxPacketSize for BULK endpoints only with
the size associated with the endpoint setup by the udc driver.
But if you want to rely on this, you may as well combine the
full speed descriptor with the high speed descriptor to
minimize confusion.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20 23:42:39 +02:00
Dan Murphy
968055321e OMAP5-uevm: USB: Add xHCI host contoller support
Add the call back into the board file for to enable
the SMPS10 VBUS regulator.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:39 +02:00
Dan Murphy
2d2358ac15 OMAP5: USB: Add OMAP xHCI file and header
Add the OMAP file for the xHCI Host controller
This code will initilialize the proper components within the
OMAP5 to enable the xHCI host controller.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:39 +02:00
Dan Murphy
d861a333da ARM: OMAP5: Add registers and defines for USBOTG SS
Add the prcm registers and the bit definitions to enable the
USB SS port of the OMAP5 device.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:39 +02:00
Dan Murphy
1bd435bc70 ARM: OMAP5: Power: Add new function to turn on SMPS10
Add new functionality to turn on SMPS10 regulator.
This supplies the VBUS to devices connected to the
USB host ports

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-10-20 23:42:39 +02:00
Julius Werner
ec89e0a68a exynos: dts: Add USB VBUS GPIOs to the device tree
This patch adds a new samsung,vbus-gpio parameter to the device tree, in
preparation of replacing the currently hardcoded VBUS GPIO mechanism in
exynos5-dt.c with a device tree controlled solution, just as it already
exists in the Linux kernel.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Julius Werner
4a271cb1b4 exynos: usb: Switch USB VBUS GPIOs to be device tree configured
Some Exynos boards, such as the SMDK5250, control USB port power through
a GPIO pin. For now this had been hardcoded in the exynos5-dt board
file, but not all boards use the same pin, requiring local changes to
support different boards.

This patch moves the GPIO initialization into the USB host controller
drivers which they belong to, and uses the samsung,vbus-gpio parameter
in the device tree to configure it.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
8f999f0cbc temp: config: exynos5250: Enable xHCI support for Exynos5
This enables support for xHCI host controller on Exynos5
and further disables EHCI support, to make sure only one
host controller is enabled at a time, since right now
using two controllers at a time is not possible with
current usb core infrastructure.

Anyone who wants to enable EHCI support again needs to
enable CONFIG_USB_EHCI, CONFIG_USB_EHCI_EXYNOS once again
in exynos5-dt config.

Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
a6c86decbb config: arm: exynos5250: Define CONFIG_SYS_CACHELINE_SIZE
XHCI stack driver needs this to align buffers to
CacheLine boundary. So define the same to be '64'

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
28cfef5f41 exynos5: dts: Add device node for XHCI
Adding device node for xhci host controller to enable
usb 3.0 on exynos5250.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
108b85be25 exynos5: dts: Add COMPAT string data for USB 3.0 PHY and XHCI
Adding required compatible string for xHCI host controller
as well as USB 3.0 PHY to enable dt support for usb 3.0 on
exynos5.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
80c4c5964f arm: exynos: Add methods to control power to USB 3.0 PHY
Adding methods to turn on/off power to USB3.0 type PHY
as and when required by the controller.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
13194f3b5f USB: XHCI: Add xHCI host controller support for Exynos5
This adds driver layer for xHCI controller in Samsung's
exynos5 soc. This interacts with xHCI host controller stack.

Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
5853e1335c USB: xHCI: Add stack support for xHCI
This adds stack layer for eXtensible Host Controller Interface
which facilitates use of USB 3.0 in host mode.

Adapting xHCI host controller driver in linux-kernel
by Sarah Sharp to needs in u-boot.

Initial porting from Linux kernel version 3.4, with following
top commit history of drivers/usb/host/xhci* :
cf84055 xHCI: Cleanup isoc transfer ring when TD length mismatch found

This adds the basic xHCI host controller driver with bare minimum
features:
- Control/Bulk transfer support has been added with required
  infrastructure for necessary xHC data structures.
- Stream protocol hasn't been supported yet.
- No support for quirky devices has been added.

Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com>
Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Vivek Gautam
e3d7440c22 usb: Move 'bmRequestType' USB device request macros from EHCI header
Macros defining bmRequestType field of USB device request,
given in table 9.2 USB 2.0 spec, are rather generic macros
which can be further used by other Host controller stacks.
So moving them to usb_defs header.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Vasut <marex@denx.de>
2013-10-20 23:42:38 +02:00
Tom Rini
9dff87a297 Merge branch 'master' of git://git.denx.de/u-boot-i2c 2013-10-17 12:09:49 -04:00
Masahiro Yamada
9a2a73d29f i2c: eliminate warnings in i2c_reloc_fixup function
The prototype of handlers had changed.
This commit uses cast with (void *) rather than
the handler-specific prototype.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-10-17 07:24:41 +02:00
Nobuhiro Iwamatsu
10cee51665 README: I2C: Fix indent
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2013-10-17 07:20:26 +02:00
Naveen Krishna Ch
296a461dca i2c: s3c24xx: add hsi2c controller support
Add support for hsi2c controller available on exynos5420.

Note: driver currently supports only fast speed mode 100kbps

Change-Id: I02555b1dc8f4ac21c50aa5158179768563c92f43
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: R. Chandrasekar <rc.sekar@samsung.com>
2013-10-17 07:20:26 +02:00
Simon Glass
940dd16242 exynos: i2c: Change FDT bus setup code to enumerate ports correctly
At present the i2c ports are enumerated in a strange way - the
fdtdec_find_aliases_for_id() function is used, but then the ID returned
is ignored and the ports are renumbered. The effect is the same provided
that the device tree has the ports in the same order, or uses aliases,
and has no gaps, but it is not correct.

Adjust the code to use the function as intended. This will allows device
tree aliases to change the device order if required.

As a result, the i2c_busses variable is dropped. We can't be sure that
there are no 'holes' in the list of buses, so must check the whole
array.

Note: it seems that non-FDT operation is now broken in this drive and
will need to be reinstated for upstream.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59369
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
2013-10-17 07:20:26 +02:00
Naveen Krishna Ch
e4e2402071 exynos: i2c: Fix i2c driver to handle NACKs properly
The Exynos5 i2c driver does not handle NACKs properly. This change:

- fixes the NACK processing problem (do not continue transaction if
  address cycle was NACKed)

- eliminates a fair amount of duplicate code

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Simon Glass <sjg@google.com>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
2013-10-17 07:20:26 +02:00
Jens Scharsig (BuS Elektronik)
83d271b5ff Fix: nommu I2C adapter relocation error
NoMMU systems have a access violation problem with i2c_reloc_fixup.
Blame for it is a double relocation of the adapter itself. The
i2c_adap_p is already relocated, if i2c_reloc_fixup is called.
This patch removes the relocation of i2c_adap_p from i2c_reloc_fixup
to fix this.

Signed-off-by: Jens Scharsig (BuS Elektronik) <esw@bus-elektronik.de>
2013-10-17 07:20:25 +02:00
Nobuhiro Iwamatsu
b55b8eef35 i2c: sh_i2c: Avoid using I2C prior to relocation
If user uses the I2C in before the relocation, board of sh and rmobile
will not start. This will solve this problem.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2013-10-17 07:20:25 +02:00