Commit Graph

19731 Commits

Author SHA1 Message Date
Matt Porter 1d766c419e .checkpatch.conf: ignore udelay->usleep_range warnings
usleep_range() is a Linux facility, ignore it when udelay()
is encountered.

Signed-off-by: Matt Porter <mporter@ti.com>
2013-03-27 15:30:11 -04:00
Tom Rini 0cab42110d checkpatch.pl: Add 'debug' to the list of logFunctions
While the kernel mainly uses pr_debug(...), etc, for debug messages, we
use debug(...).  Add this to the list of logFunctions so that they are
correctly checked (and not warned against) for long string literals.

Signed-off-by: Tom Rini <trini@ti.com>
2013-03-27 15:30:11 -04:00
Tom Rini 268d966dff env_callback: Mark find_env_callback as static
This is not called outside of env_callback.c so mark static, remove from
<env_callback.h>

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2013-03-27 15:30:11 -04:00
Stephen Warren f32c08da82 MAKEALL: allow regex matches for -s option
This allows:

MAKEALL -s tegra

to replace:

MAKEALL -s tegra20 -s tegra30 -s tegra114

The following also works:

MAKEALL -s tegra -s omap

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-03-27 15:29:32 -04:00
Tom Rini 8b906a9f0b Merge branch 'spi' of git://git.denx.de/u-boot-x86 2013-03-20 14:55:10 -04:00
Simon Glass 1e7133e99e sf: Use unsigned type for buffers
The verify code is broken on archs with signed char. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:38 -07:00
Simon Glass 363464f993 x86: Enable time command for coreboot
This command is useful for measuring SPI flash load times and the like.
Enable gettime as well to obtain absolute time tick values.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass e30bd5cfee x86: Enable SPI flash support for coreboot
Turn on SPI flash support and related commands.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass 7ea01d1808 x86: Add FDT SPI node for link
Add a memory-mapped 8GB SPI chip.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass 192868b061 x86: Move PCI init before SPI init
It is possible that our PCI bus will provide the SPI controller, so change
the init order to make this work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass bb8215f437 sf: Enable FDT-based configuration and memory mapping
Enable device tree control of SPI flash, and use this to implement
memory-mapped SPI flash, which is supported on Intel chips.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass 5e6fb69778 x86: spi: Set maximum write size for ICH
This SPI controller can only write 64 bytes at a time. Add this restriction
in so that 'sf write' works correct for blocks larger than 64 bytes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass 1e566bc6db sf: Respect maximum SPI write size
Some SPI flash controllers (e.g. Intel ICH) have a limit on the number of
bytes that can be in a write transaction. Support this by breaking the
writes into multiple transactions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:37 -07:00
Simon Glass 0c456cee95 spi: Add parameter for maximum write size
Some SPI controllers (e.g. Intel ICH) have a limit on the number of SPI
bytes that can be written at a time. Add this as a parameter so that
clients of the SPI interface can respect this value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass 1853030e21 x86: spi: Add Intel ICH driver
This supports Intel ICH7/9. The Intel controller is a little unusual in
that it is mostly intended for use with SPI flash, and has some
optimisations and features specifically for that application. In
particular it is not possible to support ongoing transactions that
continue over many calls with SPI_XFER_BEGIN and SPI_XFER_END.

This driver supports writes of up to 64 bytes at a time, the limit
for the controller. Future work will improve this.

Signed-off-by: Bernie Thompson <bhthompson@chromium.org>
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass c0f87dd4ff sf: Use spi_flash_alloc() in each SPI flash driver
Rather than each device having its own way to allocate a SPI flash
structure, use the new allocation function everywhere. This will make it
easier to extend the interface without breaking devices.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass b5aec1424d sf: Add spi_flash_alloc() to create a new SPI flash struct
At present it is difficult to extend the SPI flash structure since
all devices allocate it themselves, and few of them zero all fields.
Add a new function spi_flash_alloc() which can be used by SPI devices
to perform this allocation, and thus ensure that all devices can
better cope with SPI structure changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass d3504fee73 spi: Use spi_alloc_slave() in each SPI driver
Rather than each driver having its own way to allocate a SPI slave,
use the new allocation function everywhere. This will make it easier
to extend the interface without breaking drivers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass ba6c3ce9bd spi: Add function to allocate a new SPI slave
At present it is difficult to extend the SPI structure since all
drivers allocate it themselves, and few of them zero all fields. Add
a new function spi_alloc_slave() which can be used by SPI drivers
to perform this allocation, and thus ensure that all drivers can
better cope with SPI structure changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Simon Glass 4397a2a80b fdt: Add fdtdec_get_addr_size() to read reg properties
It is common to have a "reg = <address size>" property in the FDT.
Add a function to handle this, similar to the existing
fdtdec_get_addr();

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-19 08:45:36 -07:00
Tom Rini 3c47f2f487 Merge branch 'master' of git://git.denx.de/u-boot-usb 2013-03-18 15:33:47 -04:00
Tom Rini 0ce033d258 Merge branch 'master' of git://git.denx.de/u-boot-arm
Albert's rework of the linker scripts conflicted with Simon's making
everyone use __bss_end.  We also had a minor conflict over
README.scrapyard being added to in mainline and enhanced in
u-boot-arm/master with proper formatting.

Conflicts:
	arch/arm/cpu/ixp/u-boot.lds
	arch/arm/cpu/u-boot.lds
	arch/arm/lib/Makefile
	board/actux1/u-boot.lds
	board/actux2/u-boot.lds
	board/actux3/u-boot.lds
	board/dvlhost/u-boot.lds
	board/freescale/mx31ads/u-boot.lds
	doc/README.scrapyard
	include/configs/tegra-common.h

Build tested for all of ARM and run-time tested on am335x_evm.

Signed-off-by: Tom Rini <trini@ti.com>
2013-03-18 14:37:18 -04:00
Vincent Palatin ae003d0570 usb: Add multiple controllers support for EHCI PCI
Use the ability to have several active EHCI controller on a system
in the PCI EHCI controller implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-18 18:58:55 +01:00
Simon Glass 0641ce5b5a x86: Enable USB features for coreboot
Enable PCI EHCI, storage, keyboard and Ethernet for USB.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-18 18:58:54 +01:00
Michael Spang 032868a432 usb: usbeth: smsc95xx: remove EEPROM loaded check
[port of Linux kernel commit bcd218be5aeb by Steve Glendinning]

The eeprom read & write commands currently check the E2P_CMD_LOADED_ bit is
set before allowing any operations.  This prevents any reading or writing
unless a correctly programmed EEPROM is installed.

Signed-off-by: Michael Spang <spang@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2013-03-18 18:58:54 +01:00
Vincent Palatin 61755c7908 usb: ehci: Fix aliasing issue in EHCI interrupt code
The interrupt endpoint handling code stores the buffer pointer in the QH
padding field. We need to make it the size of a pointer to avoid strict
aliasing issue with the compiler.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-18 18:58:54 +01:00
Patrick Georgi 8f62ca646f usb: ehci: Support interrupt transfers via periodic list
Interrupt transfers aren't meant to be used from the async list
(the EHCI spec indicates trouble with low/full-speed intr on async).

Build a periodic list instead, and provide an API to make use of it.
Then, use that API from the existing interrupt transfer API.

This provides support for USB keyboards using EHCI.

Use timeouts to ensure we cannot get stuck in the keyboard scanning
if something wrong happens (USB device unplugged or fatal I/O error)

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Julius Werner <jwerner@chromium.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-18 18:58:54 +01:00
Vivek Gautam c74b0116b6 usb: ehci: exynos: Enable non-dt path
Enabling the non-dt path for the driver so that
we don't get any build errors for non-dt configuration.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
2013-03-18 18:58:54 +01:00
Vivek Gautam 24a4775f91 usb: ehci: exynos: Fix multiple FDT decode
With current FDT support driver tries to parse device node
twice in ehci_hcd_init() and ehci_hcd_stop(), which shouldn't
happen ideally.
Making provision to store data in a global structure and thereby
passing its pointer when needed.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-03-18 18:58:53 +01:00
Lukasz Majewski 83301b4f8b arm:trats: Use new ums command
This patch enables new "ums" command on Trats board

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
2013-03-18 18:58:53 +01:00
Lukasz Majewski b528f71394 usb:gadget: USB Mass Storage Gadget support
This patch adds the USB Mass Storage Gadget to u-boot
New command called "ums" is implemented to provide access
to on-device embedded persistent memory.

USB Mass Storage is supposed to work on top of the USB
Gadget framework

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Marek Vasut <marek.vasut@gmail.com>
2013-03-18 18:58:53 +01:00
Piotr Wilczek b4d36f6809 usb:composite: USB Mass Storage - f_mass_storage.c from Linux kernel
The f_mass_storage.c source file from v2.6.36 Linux kernel.

commit 8876f5e7d3b2a320777dd4f6f5301d474c97a06c
Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
Date:   Mon Jun 21 13:57:09 2010 +0200

USB: gadget: f_mass_storage: added eject callback

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Marek Vasut <marek.vasut@gmail.com>
2013-03-18 18:58:53 +01:00
Lukasz Majewski dee1d99973 usb:composite: USB Mass Storage - storage_common.c from Linux kernel
The storage_common.c source file from v2.6.36 Linux kernel.

commit d26a6aa08b9f12b44fb1ee65625e7480d3d5bb81
Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
Date:   Mon Nov 9 14:15:23 2009 +0100

USB: g_mass_storage: code cleaned up and comments updated

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Marek Vasut <marek.vasut@gmail.com>
2013-03-18 18:58:53 +01:00
Lukasz Majewski f7b4162eb1 usb:composite:fix Provide function data when addressing device with only one interface
This commit fixes problems with some non-standard requests send with
device address instead of interface address (bmRequestType.Receipent field).

This happens with dfu-util (debian version: 0.5), which address non standard
requests (like w_value=0x21 and bRequest=GET_DESCRIPTOR) to device.
Without this fix, the above request is STALLED, and hence causes dfu-util
to assume some standard configuration (packet size = 1024B instead of 4096B)
In turn it displays following errors:
Error obtaining DFU functional descriptor
Warning: Assuming DFU version 1.0
Warning: Transfer size can not be detected
...
Warning: Trying default transfer size 1024

This fix allows passing non-standard request to function setup code, where
it shall be handled.

Tested at: 	Trats (exynos4210)
Tested with:DFU and UMS gadgets

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-03-18 18:58:52 +01:00
Shiraz Hashim b2caefbb33 usbtty: adapt buffers for large packet support
Increase buffer sizes at driver and tty level to accommodate kermit
large packet support.

Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
2013-03-16 21:12:02 +01:00
Vipin Kumar 39fd6342a4 usb/host/ehci: Add support for EHCI on spear
Add EHCI support for spear boards

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
2013-03-16 21:12:02 +01:00
Pantelis Antoniou a04983d6a9 usb: Fix bug when both DFU & ETHER are defined
When both CONFIG_USB_GADGET & CONFIG_USB_ETHER are defined
the makefile links objects twice.

This patch uses a Makefile specific idiom of
'if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)'
to handle the case.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-03-16 21:12:02 +01:00
Pantelis Antoniou 1b6ca18b42 dfu: Add a partition type target
Dealing with raw block numbers with the dfu is very annoying.
Introduce a partition method.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-03-16 21:12:01 +01:00
Pantelis Antoniou 80eb1bd02d dfu: Properly zero out timeout value
Zero out timeout value; letting it filled with undefined values
ends up with the dfu host hanging.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-03-16 21:12:01 +01:00
Pantelis Antoniou df93cd9c6f dfu: Fix crash when wrong number of arguments given
Fix obvious crash when not enough arguments are given to the dfu
command.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-03-16 21:12:01 +01:00
Pantelis Antoniou ea3e21226f dfu: Only perform DFU board_usb_init() for TRATS
USB initialization shouldn't happen for all the boards.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-03-16 21:12:01 +01:00
Vincent Palatin 2982837e36 usb: ehci: Add 64-bit controller support
On EHCI controller with 64-bit address space support, we must initialize
properly the high word for the PCI bus master accesses.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-16 21:12:01 +01:00
Vincent Palatin 7c38e90aff usb: ehci: generic PCI support
Instead of hardcoding the PCI IDs on the USB controller, use the PCI
class to detect them.

Ensure the busmaster bit is properly set in the PCI configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-16 21:12:01 +01:00
Simon Glass b5bec88434 Use 'unsigned int' for global_data's baudrate
We decided to used unsigned int here, rather than unsigned long. But
for the generic global_data it is still unsigned long. So change it
over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:02 -04:00
Simon Glass 68794b9f73 sparc: Fix build warnings in serial.c
These macros are already defined in io.h so should not be declared in
serial.c.

serial.c:38:0: warning: "READ_BYTE" redefined
/home/sjg/c/src/third_party/u-boot/files/include/asm/io.h:36:0: note: this is the location of the previous definition
serial.c:39:0: warning: "READ_HWORD" redefined
/home/sjg/c/src/third_party/u-boot/files/include/asm/io.h:37:0: note: this is the location of the previous definition
serial.c:40:0: warning: "READ_WORD" redefined
/home/sjg/c/src/third_party/u-boot/files/include/asm/io.h:38:0: note: this is the location of the previous definition
serial.c:41:0: warning: "READ_DWORD" redefined
/home/sjg/c/src/third_party/u-boot/files/include/asm/io.h:39:0: note: this is the location of the previous definition

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:02 -04:00
Simon Glass eb33809f70 sparc: Fix out-of-tree building
It isn't clear why the sparc cpu Makefile has its own compile line, but
it does not work correctly with an out-of-tree build. Removing it fixes
this problem. Perhaps it does not introduce others.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:01 -04:00
Simon Glass 69e0683241 serial: ns16550: Remove unwanted cast
This cast does not seem correct, since we should be writing to a pointer,
not a ulong.

This fixes the following warning on nds32:

-ns16550.c:49: warning: passing argument 2 of 'writeb' makes pointer from integer without a cast

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:01 -04:00
Simon Glass 81e2ff0bf1 avr32: Fix cast warning in board.c
The frame buffer pointer in global_data is not a pointer, so we should
remove these casts.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
2013-03-15 16:14:01 -04:00
Simon Glass 9e97834867 blackfin: Remove noreturn attribute from cpu_init_f()
Now that board_init_f() is not marked as noreturn, we need to do the same
to blackfin's cpu_init_f() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:01 -04:00
Simon Glass 4da2551efa blackfin: Fix up board_type global data
This should be in arch_global_data but was dropped in the change-over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15 16:14:01 -04:00