Commit Graph

21484 Commits

Author SHA1 Message Date
Rob Herring
344ca0b40c ahci: convert to use libata functions and definitions
libata already has similar functions as implemented in the ahci code.
Refactor the code to use the libata variants and remove the dependency on
ata.h. Convert some defines to use the version from libata.h. Also, remove
some unnecessary memset's of bss data.

This is a step toward hopefully merging ahci.c and dw_ahsata.c which are
essentially the same driver.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-09-06 13:09:07 -04:00
Rob Herring
7610b41ddf ahci: increase spin-up timeout to 20 sec
Based on Linux libata code, most drives are less than 10 sec, but some
need up to 20 sec.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-09-06 13:09:07 -04:00
Rob Herring
178210847f ahci: handle COMINIT received during spin-up
Some Intel SSDs can send a COMINIT after the initial COMRESET. This causes
the link to go down and we need to re-initialize the link.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2013-09-06 13:09:07 -04:00
Rob Herring
124e9fa132 ahci: move link bring-up handling to separate function
Move the link bring-up handling to a separate weak function in order to
allow platforms to override it. This is needed on highbank platform which
needs special phy handling.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2013-09-06 13:09:07 -04:00
Rob Herring
2bdb10dbf5 ahci: add defines for PORT_SCR_STAT register bits
Replace hard-coded register values with proper defines for PORT_SCR_STAT
register.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2013-09-06 13:09:07 -04:00
Rob Herring
796c2ebd6f ahci: fix memory leak in ata_scsiop_inquiry
This fixes a memory leak when scsi inquiry fails.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-09-06 13:09:07 -04:00
Rob Herring
48c3a87c0a ahci: fix unaligned access
gcc 4.7 will generate unaligned accesses to local char arrays, so make
them static to avoid that.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-09-06 13:09:07 -04:00
Richard Gibbs
2915a0223a ahci: use ports implemented map instead of num_ports
The AHCI driver was incorrectly using the Capabilities register NP (number
of ports) field to determine which ports to activate. This commit changes
it to correctly use the PORTS_IMPL register as a port map.

Signed-off-by: Richard Gibbs <richard.gibbs@calxeda.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-09-06 13:09:07 -04:00
Jack Mitchell
4412db4646 standalone-examples: support custom GCC lib
Add support for defining the gcc lib in standalone examples as is
done in the main u-boot Makefile

Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
2013-09-06 13:09:07 -04:00
Wu, Josh
6b8f185faf fs: fat: don't call disk_write with zero sector num
In the set_cluster() function, it will convert the buffer size to sector
numbers. Then call disk_write() to write by sector.
For remaining buffer, the size is less than a sector, call disk_write()
again to write them in one sector.

But if the total buffer size is less then one sector, the original code
will call disk_write() with zero sector number. It is unnecessary.
So this patch fix this. Now it will not call disk_write() if total buffer size
is less than one sector.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
2013-09-06 13:09:07 -04:00
Jeroen Hofstee
7ea50d5284 compiler_gcc: do not redefine __gnu_attributes
gcc allows extensions to be non compiler specific by defining
__* macros for the attributes supported by gcc. Having a
different definition causes many warnings during the build
(cdefs.h on FreeBSD uses __attribute((__pure__)) where u-boot
uses __attribute__((pure)) for example). Do not redefine
these macros to suppress these warnings.

This patch ignores the checkpatch warning:
WARNING: __packed is preferred over __attribute__((packed))

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2013-09-06 13:09:07 -04:00
Pantelis Antoniou
dc19ec11d7 git-mailrc: Update MMC custodian
Update git-mailrc with my nick and replace afleming as mmc custodian.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2013-09-06 13:09:07 -04:00
Tom Rini
938138c708 Merge branch 'master' of git://git.denx.de/u-boot-nios 2013-09-06 09:37:04 -04:00
Robert P. J. Day
3c950c4fca am335x_evm.h: Add back the actual load of the kernel image
Somewhere along the line of refactoring the am335x header files, the
kernel image load was lost, so put it back in.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2013-09-06 09:36:51 -04:00
Thomas Chou
1a05b5f91e nios2: fix missing comment terminator from SPDX License commit
The commit 1a4596601f
  Add GPL-2.0+ SPDX-License-Identifier to source files

generated a warning due to a missing comment terminator.
  longlong.h:7:1: warning: "/*" within comment

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2013-09-06 11:03:42 +08:00
Kees Cook
315c0ace7c bootm: allow correct bounds-check of destination
While nothing presently examines the destination size, it should at
least be correct so that future users of sys_mapmem() will not be
surprised. Without this, it might be possible to overflow memory.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:26 -06:00
Kees Cook
ff9d2efdbf lzo: correctly bounds-check output buffer
This checks the size of the output buffer and fails if it was going to
overflow the buffer during lzo decompression.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:23 -06:00
Kees Cook
afca294289 lzma: correctly bounds-check output buffer
The output buffer size must be correctly passed to the lzma decoder or
there is a risk of overflowing memory during decompression. Switching
to the LZMA_FINISH_END mode means nothing is left in an unknown state
once the buffer becomes full.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:21 -06:00
Kees Cook
b75650d84d gzip: correctly bounds-check output buffer
The output buffer size must not be reset by the gzip decoder or there
is a risk of overflowing memory during decompression.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:14 -06:00
Kees Cook
8ef7047845 documentation: add more compression configs
This adds the missing compression config items to the README.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:12 -06:00
Kees Cook
3153e915b4 sandbox: add compression tests
This adds the "test_compression" command when building the sandbox. This
tests the existing compression and decompression routines for simple
sanity and for buffer overflow conditions.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2013-09-03 13:30:05 -06:00
Simon Glass
628af1790a sandbox: Correct compiler warnings in cmd_bootm/cmd_ximg
Correct the following warnings found with sandbox when compression
is enabled.

cmd_bootm.c: In function 'bootm_load_os':
cmd_bootm.c:443:11: warning: passing argument 4 of 'lzop_decompress' from incompatible pointer type [enabled by default]
/usr/local/google/c/cosarm/src/third_party/u-boot/files/include/linux/lzo.h:31:5: note: expected 'size_t *' but argument is of type 'uint *'
cmd_ximg.c: In function 'do_imgextract':
cmd_ximg.c:225:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cmd_ximg.c:225:14: warning: 'hdr' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
2013-09-03 13:29:24 -06:00
Tom Rini
fb18fa95a1 Prepare v2013.10-rc2
Signed-off-by: Tom Rini <trini@ti.com>
2013-09-02 14:20:36 -04:00
Tom Rini
a228296c54 omap5: Correct include order, drop CONFIG_SYS_PROMPT define
With the new include structure for TI platforms, we need to not define
our own CONFIG_SYS_PROMPT and also need to include
<configs/omap5_common.h> much sooner, so do both of these.  Also drop
the unused CONFIG_NET_MULTI

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-27 10:56:18 -04:00
Tom Rini
529c0d9b8c Merge branch 'master' of git://git.denx.de/u-boot-usb 2013-08-27 09:49:43 -04:00
Heiko Schocher
880a412732 i2c: fix i2c dev command for not using new framework
i2c dev command does not work anymore for legacy drivers
because a check is executed that is valid only
in the new framework.

Signed-off-by: Heiko Schocher <hs@denx.de>
Tested-by: Stefano Babic <sbabic@denx.de>
2013-08-27 05:49:52 +02:00
Jim Lin
c95e2b9eae console: usb: kbd: To fix slow TFTP booting
TFTP booting is slow when a USB keyboard is installed and
stdin has usbkbd added.
This fix is to change Ctrl-C polling for USB keyboard to every second
when NET transfer is running.
My previous patch is expected to be put into usb_kbd_testc(). But it went
into usb_kbd_getc() after applied.
This patch is to put change in correct place.

Signed-off-by: Jim Lin <jilin@nvidia.com>
2013-08-26 21:56:35 +02:00
Jim Lin
07551f2343 console: usb: kbd: To improve TFTP booting performance
TFTP booting is slow when a USB keyboard is installed and
stdin has usbkbd added.
This fix is to change Ctrl-C polling for USB keyboard to every second
when NET transfer is running.

Signed-off-by: Jim Lin <jilin@nvidia.com>
2013-08-26 21:56:35 +02:00
Jim Lin
b63056d6a4 NET: Add net_busy_flag if CONFIG_USB_KEYBOARD is defined
This flag is to make console aware that NET transfer is running or not.

Signed-off-by: Jim Lin <jilin@nvidia.com>
2013-08-26 21:56:35 +02:00
Fabio Estevam
76b6b19614 usb: ehci-mx5: Use 'bool' instead of 'unsigned char'
The 'enable' argument can be better expressed as boolean.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
2013-08-26 21:56:34 +02:00
Fabio Estevam
c3904128ad usb: ehci-mx5: Remove unneeded write to cscmr1 register
Currently we have the following behavior in ehci_hcd_init()

- Read csmr1 register, clear bit 26 and then set bit 26.

However a little bit later we call set_usb_phy_clk() which clears bit 26, so
let's get rid of the unnecessary code.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-08-26 21:56:34 +02:00
Lukasz Majewski
c4219a82cd usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver
The manufacturer and product IDs are dynamically assigned when gadget is
bind.
Now the IDs aren't assigned at struct g_dnl_string_defs definition.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: "Egli, Samuel" <samuel.egli@siemens.com>
2013-08-26 21:56:34 +02:00
Lukasz Majewski
cfc2d0d632 usb:dfu:g_dnl: Change number of exported configurations at composite gadget
USB composite gadget (g_dnl) supports only one configuration. Due to that
the corresponding field - bConfigurationValue has been changed.

Moreover more descriptive names were chosen for relevant fields.

Windows XP setup:
- Thesyscon USB Descriptor Dumper
- zadig_xp program for WinUSB installation (which is required by dfu-util)
- dfu-util for windows (version 0.6)
- TRATS target connected via USB hub to test Win XP machine.

Tested at: Trats - Exynos4210

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: "Egli, Samuel" <samuel.egli@siemens.com>
2013-08-26 21:56:34 +02:00
Heiko Schocher
815c30b2b6 dfu, nand, ubi: add partubi alt settings for updating ubi partition
updating an ubi partition needs a completely erased mtd partition,
see:
http://lists.infradead.org/pipermail/linux-mtd/2011-May/035416.html

So, add partubi alt setting for the dfu_alt_info environment
variable to mark this partition as an ubi partition. In case we
update an ubi partition, we erase after flashing the image into the
partition, the remaining sektors.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Tom Rini <trini@ti.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
2013-08-26 21:56:34 +02:00
Julius Werner
eaf3e613ea usb: Use well-known descriptor sizes when parsing configuration
The existing USB configuration parsing code relies on the descriptors'
own length values when reading through the configuration blob. Since the
size of those descriptors is always well-defined, we should rather use
the known sizes instead of trusting device-provided values to be
correct. Also adds some safety to potential out-of-order descriptors.

Change-Id: I16f69dfdd6793aa0fe930b5148d4521f3e5c3090
Signed-off-by: Julius Werner <jwerner@chromium.org>
2013-08-26 21:56:34 +02:00
Dan Murphy
1572eadfbc ARM: OMAP5-uevm: Add usb device reset API
Add the call back to reset the LAN9730 after
the FEAT_POWER has been called.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-08-26 21:56:34 +02:00
Dan Murphy
3615a996ab USB: usb-hub: Add a weak function for resetting devices
Add a __weak function that can be overridden to reset devices
attached to an ehci devices after the FEAT_POWER has been submitted

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-08-26 21:56:34 +02:00
Dan Murphy
04025b42dc ARM: OMAP5-uevm: Add USB MAC ethernet address
Set the usbethaddr based on the OMAP DIE_ID registers
which should be unique for each processor.

Then set this as the usb ethernet MAC address.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-08-26 21:56:34 +02:00
Dan Murphy
5e5cfaf997 ARM: OMAP5-uevm: Add USB ehci support for the uEVM
Add the USB ehci support for the OMAP5 uEVM.

Configure the uEVM mux data
Add the flags to build the appropriate modules
Add the usb call backs to initialize the EHCI controller

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-08-26 21:56:31 +02:00
Dan Murphy
120503f32e ARM: OMAP: USB: Fix linker error when ULPI is not defined
Fix the linker error for missing ulpi_reset when ulpi is not defined
in the board config.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
2013-08-26 21:55:46 +02:00
Dan Murphy
d3d037ae18 ARM: OMAP5: USB: Add OMAP5 common USB EHCI information
* Enable the OMAP5 EHCI host clocks
* Add OMAP5 EHCI register definitions
* Add OMAP5 ES2 host revision

Signed-off-by: Dan Murphy <dmurphy@ti.com>
2013-08-26 21:55:46 +02:00
Dan Murphy
5a7bd38437 omap5: uevm: Change the board name to correct name
Change the board name for the sys info to
5432 uEVM

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
2013-08-26 21:55:45 +02:00
Phil Sutter
2b26201a2a env_nand.c: support falling back to redundant env when writing
Without this patch, when the currently chosen environment to be written
has bad blocks, saveenv fails completely. Instead, when there is
redundant environment fall back to the other copy. Environment reading
needs no adjustment, as the fallback logic for incomplete writes applies
to this case as well.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
2013-08-22 17:49:47 -05:00
Masahiro Yamada
47b6dad319 nand_util: delete a useless variable
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-08-22 17:25:03 -05:00
Masahiro Yamada
46aabcc446 cmd_nand: Do not show usage when scrub is aborted
When executing nand scrub, the user gets the prompt:

  Really scrub this NAND flash? <y/N>

We do not want the annoying usage displayed when saying N here.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-08-22 17:25:03 -05:00
Masahiro Yamada
7d25cd34e9 cmd_nand: slight optimization of nand_dump function
If a non-zero value is given to only_oob argument,
printing the main area is skipped.

With a little modification, we can skip the whole
while loop.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-08-22 17:25:02 -05:00
Masahiro Yamada
e40520b5b5 cmd_nand: fix a memory leak in nand_dump function
If datbuf = memalign(ARCH_DMA_MINALIGN, nand->writesize);
succeeds and
  oobbuf = memalign(ARCH_DMA_MINALIGN, nand->oobsize);
fails, nand_dump function should free databuf.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-08-22 17:25:02 -05:00
Tom Rini
6612ab3395 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2013-08-21 16:27:47 -04:00
York Sun
b6df9b01fb Makefile: Fix build in a separated directory tree
Fix a bug introduced by commit 3aa29dee
	TPL : introduce the TPL based on the SPL

Signed-off-by: York Sun <yorksun@freescale.com>
2013-08-21 09:03:29 -07:00
Николай Пузанов
e6394e9e8f Fix for incorrect conversion hex string to number (FMAN firmware address).
Signed-off-by: Николай Пузанов <punzik@gmail.com>
Acked-by: York Sun <yorksun@freescale.com>
2013-08-20 11:51:26 -07:00