Commit Graph

21600 Commits

Author SHA1 Message Date
Wu, Josh 1bd3e2a823 mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector
The PMECC use BCH algorithm to correct error. In BCH algorithm, the
primitive polynomial value is GF(2^13) for 512-bytes sector size. And it is
GF(2^14) for 1024-bytes sector size.

This patch will choose correct degree of the remainders (13 or 14) for
different sector size.
Tested in AT91SAM9X5-EK with MLC nand flash.

More detail can be refered to section 5.4.1 of:
  AT91SAM ARM-based Embedded MPU Application Note
  <http://www.atmel.com/Images/doc11127.pdf>

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2013-09-04 17:07:21 +02:00
Albert ARIBAUD e62d5fb0da Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' 2013-09-04 14:06:56 +02:00
Albert ARIBAUD 4eef93da26 Merge branch 'u-boot-atmel/master' into 'u-boot-arm/master' 2013-09-04 11:50:25 +02: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
Albert ARIBAUD 31043e20ae Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master' 2013-09-03 14:59:18 +02:00
Albert ARIBAUD 6d4511b2c6 Merge 'u-boot-microblaze/zynq' into (u-boot-arm/master'
Conflicts:
	arch/arm/include/asm/arch-zynq/hardware.h

The conflict above was trivial and solved during merge.
2013-09-03 14:01:02 +02:00
Tom Rini fb18fa95a1 Prepare v2013.10-rc2
Signed-off-by: Tom Rini <trini@ti.com>
2013-09-02 14:20:36 -04:00
Eric Nelson 8467faef7f i.MX6: Set and clear the gating bits for Phase Fractional Dividers
This addresses silicon errata ERR006282 as described in this
document:
	https://community.freescale.com/docs/DOC-94581

Also implemented in Freescale's 2009.08-based release:

	http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/
	Commit id: b7c5badf94ffbe6cd0845efbb75e16e05e3af404

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2013-08-31 18:09:37 +02:00
Eric Nelson 67d54c3917 i.MX6: nitrogen6x: Don't bother setting PLL3(480) PFD1 divisor
This clock isn't feeding anything under U-Boot, so there's no
point in changing it from power-on default.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2013-08-31 18:06:38 +02:00
Eric Nelson 3fc4176dc4 i.MX6: Correct ANATOP_PFD (Phase Fractional Divider) register declarations
Some _CLKGATE_MASK and _FRAC_MASK macros were wrong for PFD_480
and the PFD_528 macros were missing.

Fortunately, the incorrect macros weren't being used.

Since both the PFD_480 and PFD_528 registers have the same
structure, and the fields are identical for [0..3] in bytes
[0..3], so a single set of macros will suffice.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2013-08-31 18:05:49 +02:00
Eric Nelson 1ca244ded5 i.MX6: Add convenience macros cpu_type(rev) and is_cpu_type(cpu)
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2013-08-31 18:03:55 +02:00
Hector Palacios 6f6059e0f1 ARM: mxs: rename function that sets AUTO_RESTART flag
The AUTO_RESTART flag of HW_RTC_PERSISTENT0 register will
power up the chip automatically 180ms after power down.
This bit must be enabled by the boot loader to ensure the
target can start upon hardware reset or watchdog reset
even when powered from a battery.

Currently the function named 'mxs_power_clear_auto_restart()'
is setting this flag although the 'clear' in its name suggest
the opposite.

This patch renames the function to 'mxs_power_set_auto_restart()'
and removes the comment about EVK revision A which was confusing
because the function indeed was setting the flag.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2013-08-31 17:50:38 +02:00
SARTRE Leo 518501da4c ARM: Congatec: README update
README: U-boot works both on SPI-NOR and SDcard

Signed-off-by: Leo Sartre <lsartre@adeneo-embedded.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
2013-08-31 17:39:41 +02:00
Marek Vasut 62d40d14c4 tools: mxsboot: Staticize functions
Make remaining non-static functions static and the same for vars.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
2013-08-31 15:28:11 +02:00
Marek Vasut a5f746f3a2 tools: Sort lists of files in Makefile
Fix the lists of files so they are in order again.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Stefano Babic <sbabic@denx.de>
2013-08-31 15:27:20 +02:00
Marek Vasut bce8837071 ARM: mxs: tools: Add mkimage support for MXS bootstream
Add mkimage support for generating and verifying MXS bootstream.
The implementation here is mostly a glue code between MXSSB v0.4
and mkimage, but the long-term goal is to rectify this and merge
MXSSB with mkimage more tightly. Once this code is properly in
U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage
support.

Note that the mxsimage generator needs libcrypto from OpenSSL, I
therefore enabled the libcrypto/libssl unconditionally.

MXSSB: http://git.denx.de/?p=mxssb.git;a=summary

The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormat

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>
2013-08-31 15:26:52 +02:00
Stefano Babic b83c709e8d imx: add status reporting for HAB status
Add functions to report the HAB (High Assurance Boot) status
of e.g. i.MX6 CPUs.

This is taken from

git://git.freescale.com/imx/uboot-imx.git branch imx_v2009.08_3.0.35_4.0.0
cpu/arm_cortexa8/mx6/generic.c
include/asm-arm/arch-mx6/mx6_secure.h

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:29 +02:00
Stefano Babic 0187c985aa tools: add support for setting the CSF into imximage
Add support for setting the CSF (Command Sequence File) pointer
which is used for HAB (High Assurance Boot) in the imximage by
adding e.g.

CSF 0x2000

in the imximage.cfg file.

This will set the CSF pointer accordingly just after the padded
data image area. The boot_data.length is adjusted with the
value from the imximage.cfg config file.

The resulting u-boot.imx can be signed with the FSL HAB tooling.
The generated CSF block needs to be appended to the u-boot.imx.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:29 +02:00
Stefano Babic 01390aff25 tools: add padding of data image file for imximage
Implement function vrec_header to be able to pad the final
data image file according the what has been calculated for
boot_data.length.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:29 +02:00
Stefano Babic 9bac0bb374 tools: add variable padding of data image in mkimage
Use previously unused return value of function vrec_header
to return a padding size to generic mkimage. This padding
size is used in copy_files to pad with zeros after copying
the data image.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:29 +02:00
Stefano Babic 377e367a85 tools: dynamically allocate imx_header in imximage
Change to dynamically allocate the imx_header to correctly
allocate the IVT, Boot Data and DCD at correct locations
depending on the boot media.

Also check that the Image Vector Table Offset + IVT +
Boot Data + DCD <= Initial Load Region Size.

Previously struct imx_header was always 4096 bytes and was
not dealing correctly with the Image Vector Table Offset.

Now, the memory allocation looks for e.g. SD boot like this

 Storage   u-boot.imx                             RAM
 Device

 00000000                                         177ff000 <--------------
                                                                         |
 00000400  00000000  d1 00 20 40 IVT.header       177ff400 <-------      |
 00000404  00000004  00 00 80 17 IVT.entry        177ff404 -----------   |
 00000408  00000008  00 00 00 00 IVT.reserved1    177ff408        |  |   |
 0000040C  0000000C  2c f4 7f 17 IVT.dcd          177ff40C ------ |  |   |
 00000410  00000010  20 f4 7f 17 IVT.boot         177ff410 ---- | |  |   |
 00000414  00000014  00 f4 7f 17 IVT.self         177ff414 --------  |   |
 00000418  00000018  00 00 00 00 IVT.csf          177ff418    | |    |   |
 0000041C  0000001C  00 00 00 00 IVT.reserved2    177ff41C    | |    |   |
 00000420  00000020  00 f0 7f 17 BootData.start   177ff420 <--- |    | ---
 00000424  00000024  00 60 03 00 BootData.length  177ff424      |    |
 00000428  00000028  00 00 00 00 BootData.plugin  177ff428      |    |
 0000042C  0000002C  d2 03 30 40 DCD.header       177ff42C <-----    |
 ...                                                                 |
 00001000  00000c00  13 00 00 ea U-Boot Start     17800000 <----------

While at it also remove the unused #define HEADER_OFFSET.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:28 +02:00
Stefano Babic 3150f92c29 tools: rename mximage_flash_offset to imximage_ivt_offset
This better reflects the naming from the Reference Manual
as well as fits better since "flash" is not really applicabe
for SATA.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:28 +02:00
Stefano Babic 4655d40f34 tools: imx_header should not include flash_offset
Doing a  make distclean; make mx6qsabresd_config; make
and      hexdump -C u-boot.imx | less

 ...
 00000360  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 000003f0  00 00 00 00 00 00 00 00  00 00 00 00 00 04 00 00  |................|
                                                ^^^^^^^^^^^
 00000400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00001000  13 00 00 ea 14 f0 9f e5  14 f0 9f e5 14 f0 9f e5  |...ê.ð.å.ð.å.ð.å|
 ...

shows the flash_offset value being written into the final
generated image, wich is not correct.

Instead create flash_offset as static variable such that the
generated image is "clean".

 00000360  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00001000  13 00 00 ea 14 f0 9f e5  14 f0 9f e5 14 f0 9f e5  |...ê.ð.å.ð.å.ð.å|

Signed-off-by: Stefano Babic <sbabic@denx.de>
2013-08-31 15:06:28 +02:00
Piotr Wilczek 812d7576cd drivers:power:max77686: add function to set voltage and mode
This patch add new functions to pmic max77686 to set voltage and mode.

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2013-08-30 12:24:54 +09:00
Inderpal Singh cc2b1012cb exynos5250: arndale: Add mmc support
This patch adds mmc support to the arndale board.

Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2013-08-30 12:13:58 +09:00
Chander Kashyap a2ac68fb2b exynos5250: Add arndale board support
Arndale board is based on samsung's exynos5250 soc.

Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2013-08-30 12:13:58 +09:00
Tom Rini 901ce27c6f siemens-am33x-common.h: Always build CONFIG_OMAP_GPIO support
The MMC driver relies on this block now.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 12:01:30 -04:00
Heiko Schocher c0dcece7d9 arm, am335x: add support for 3 siemens boards
add support for the am335x based boards from siemens:

dxr2:
  - DDR3 128MiB
  - NAND 256MiB
  - Ethernet with external Switch SMSC LAN9303
  - no PMIC
  - internal Watchdog
  - DFU support

pxm2:
  - DDR2 512 MiB
  - NAND 1024 MiB
  - PMIC
  - PHY atheros ar803x
  - USB Host
  - internal Watchdog
  - DFU support

rut:
  - DDR3 256 MiB
  - NAND 256 MiB
  - PMIC
  - PHY natsemi dp83630
  - external Watchdog
  - DFU support

Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Roger Meier <r.meier@siemens.com>
Signed-off-by: Samuel Egli <samuel.egli@siemens.com>
Cc: Pascal Bach <pascal.bach@siemens.com>
Cc: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Heiko Schocher b26354cfd5 video: add formike lcd panel init
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2013-08-28 11:44:59 -04:00
Heiko Schocher 988ea35501 arm, am335x: add watchdog support
Add TI OMAP 16xx & 24xx/34xx 32KHz (non-secure) watchdog support.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
2013-08-28 11:44:59 -04:00
Heiko Schocher a09f96498b arm, spl: add watchdog library to SPL
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Heiko Schocher 14c0158b18 arm, am335x: add some missing registers and defines for lcd and epwm support
- add missing register defines in struct cm_perpl
  epwmss0clkctrl
  epwmss2clkctrl
  lcdcclkstctrl
- add missing register defines in struct cm_dpll
  clklcdcpixelclk
- add struct pwmss_regs
- add struct pwmss_ecap_regs
- add LCD Controller base LCD_CNTL_BASE
- add PWM0 controller base PWMSS0_BASE

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Heiko Schocher dafd4db33a arm, am33xx: add defines for gmii_sel_register bits
Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini 457bb50560 dra7xx_evm: Re-order and comment the networking related config options
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini 318aeb4649 omap5_uevm: Better comment why we have TCA642X and the reset time
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini 078aa4f131 TI:omap5: Clarify comments about SPL and DDR timings in common config
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini 78c392f143 TI:am33xx: Move SPL YMODEM support to the per-board config
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini d7ccfc5bd6 am335x_evm: Update README for customization
As this is a reference platform, update the README to note which IP
blocks are required for use due to design choices of the reference
rather than required by the SoC itself.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:59 -04:00
Tom Rini 1dd44e5a4a TI:armv7: Re-order slightly the generic CONFIG options, expand related comments
Re-group the general options to note things that can be removed safely
to reduce binary size when not required, and expand the comment about
what commands we do include to note it could be replaced with a specific
list of required one.  While at it, move the CMD parts of various
blocks IP to the end of the list for consistency.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00
Tom Rini 85a02aa9cc am335x_evm: Regroup USB options
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00
Tom Rini 610af383f1 am335x_evm: Add comment by SPL SPI support
Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00
Tom Rini a7a0640085 TI:am335x: Better comment and organize the networking related options
While in here, drop CONFIG_BOOTP_DEFAULT as it is unused in the code.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00
Tom Rini c3799fceda omap5: Expand CONFIG_SPL_MAX_SIZE and comment upon SRAM_SCRATCH_SPACE_ADDR
After examining both TRMs and doing some experimentation, we can rely on
using the start of the download area for CONFIG_SPL_TEXT_BASE and then
move SRAM_SCRATCH_SPACE_ADDR up, just like am335x.  This is required for
peripheral boot modes such as UART.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00
Tom Rini a7142dd096 TI:armv7: Move CONFIG_SPL_LIBDISK_SUPPORT to MMC section
We only need this library when we're doing "disk" access to MMC/SD.
Update comment around the rest of CONFIG_SPL_LIB* to note that the
others are always required.

Signed-off-by: Tom Rini <trini@ti.com>
2013-08-28 11:44:58 -04:00