oweals/u-boot.git
11 years agoarm: Make all linker scripts compatible with per-symbol sections
Benoît Thébaudeau [Thu, 11 Apr 2013 09:36:03 +0000 (09:36 +0000)]
arm: Make all linker scripts compatible with per-symbol sections

Let all ARM linker scripts handle properly -ffunction-sections
and -fdata-sections. This will be useful for future changes in order to create
symbol-specific sections in common .S files.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm1176: Remove unused MMU setup from start.S
Benoît Thébaudeau [Thu, 11 Apr 2013 09:36:02 +0000 (09:36 +0000)]
arm1176: Remove unused MMU setup from start.S

Following the removal of the smdk6400 board, the MMU setup code in
arm1176/start.S becomes unused, so remove it. It will still be possible to
restore it later from the Git history if necessary, in which case it should be
moved out of the relocate_code() function.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: Remove deprecated and now unused NAND SPL
Benoît Thébaudeau [Thu, 11 Apr 2013 09:36:01 +0000 (09:36 +0000)]
arm: Remove deprecated and now unused NAND SPL

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: Remove support for unused s3c64xx
Benoît Thébaudeau [Thu, 11 Apr 2013 09:36:00 +0000 (09:36 +0000)]
arm: Remove support for unused s3c64xx

Following the removal of the smdk6400 board, the s3c64xx SoC becomes unused, so
remove associated code. It will still be possible to restore it later from the
Git history if necessary.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoRevert "mkconfig: start deprecating Makefile config targets"
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:59 +0000 (09:35 +0000)]
Revert "mkconfig: start deprecating Makefile config targets"

This reverts commit 1285a2808a254f3d1a809c1a541f0c0f746e03d7 since the migration
of boards from Makefile to boards.cfg is now complete.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: Remove support for smdk6400
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:58 +0000 (09:35 +0000)]
arm: Remove support for smdk6400

The migration of boards from Makefile to boards.cfg was due for v2012.03, but
smdk6400 did not follow, and it does not build, so move it to scrapyard. It will
still be possible to restore it from the Git history before fixing it.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoimx: Add u-boot-with-nand-spl.imx make target
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:57 +0000 (09:35 +0000)]
imx: Add u-boot-with-nand-spl.imx make target

This image combines the SPL with the i.MX header, the FCB and U-Boot.

For i.MX25/35/51, the FCB is ignored by the boot ROM, so this image is just
useful because it can be programmed on a NAND Flash page boundary.

For i.MX53, the FCB is required by the boot ROM.

This does not support i.MX6 so far because its FCB is more complicated.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoimx: Add u-boot-with-spl.imx make target
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:56 +0000 (09:35 +0000)]
imx: Add u-boot-with-spl.imx make target

This image combines the SPL with the i.MX header and U-Boot. This is a
convenient way of having a single image to program on some boot devices.

The i.MX header has to be added to the SPL before appending U-Boot, so that the
boot ROM loads only the SPL.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years ago.gitignore: Add /SPL
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:55 +0000 (09:35 +0000)]
.gitignore: Add /SPL

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoMakefile: Move SHELL setup to config.mk
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:54 +0000 (09:35 +0000)]
Makefile: Move SHELL setup to config.mk

make never uses the SHELL variable from the environment. Instead, it
uses /bin/sh, or the value assigned to the SHELL variable by the Makefile. This
makes the export of the SHELL variable useless for sub-makes (but still useful
for the environment of recipes). However, we want all makes to use the same
shell.

This patch fixes this issue by moving the SHELL variable setup and export to the
top config.mk, so that all Makefile-s including it use the same shell.

Since BASH is used by default, this makes it possible to use things
like 'echo -e ...' in sub-makes, which would otherwise fail e.g. with /bin/sh
symlinked to /bin/dash on Ubuntu.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agoarm: Remove unused relocate_code() parameters
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:53 +0000 (09:35 +0000)]
arm: Remove unused relocate_code() parameters

Commit e05e5de7fae5bec79617e113916dac6631251156 made the 2 1st parameters of
ARM's relocate_code() useless since it moved the code handling them to crt0.S.
So, drop these parameters.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm926ejs: Remove deprecated and now unused NAND SPL
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:52 +0000 (09:35 +0000)]
arm926ejs: Remove deprecated and now unused NAND SPL

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agonand: mxc: Switch NAND SPL to generic SPL
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:51 +0000 (09:35 +0000)]
nand: mxc: Switch NAND SPL to generic SPL

This also fixes support for mx31pdk and tx25, which had been broken by commit
e05e5de7fae5bec79617e113916dac6631251156.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agoimx: Fix automatic make targets for imx images
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:50 +0000 (09:35 +0000)]
imx: Fix automatic make targets for imx images

Automatically build the 'u-boot.imx' (i.e. imx header + u-boot.bin) and 'SPL'
(i.e. imx header + u-boot-spl.bin) make targets for all imx processors
supporting this header, so for arm926ejs, arm1136 and armv7. Some combinations
were missing.

At the same time, fix the build of SPL targets not supporting the imx header on
arm1136. For arm1136, the 'SPL' make target was forced to build in all cases if
CONFIG_SPL_BUILD was defined, even for non-imx platforms or imx setups without
an imx header.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoMakefile: Change CONFIG_SPL_PAD_TO to image offset
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:49 +0000 (09:35 +0000)]
Makefile: Change CONFIG_SPL_PAD_TO to image offset

Change CONFIG_SPL_PAD_TO from a link address to an image offset since this is
more handy and closer to the purpose of this config.

Automatically define CONFIG_SPL_PAD_TO to CONFIG_SPL_MAX_SIZE (or 0 without
CONFIG_SPL_MAX_SIZE).

Test that CONFIG_SPL_PAD_TO >= CONFIG_SPL_MAX_SIZE if CONFIG_SPL_PAD_TO is
non-zero.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoautoconfig.mk: Make it possible to define configs from other configs
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:48 +0000 (09:35 +0000)]
autoconfig.mk: Make it possible to define configs from other configs

Give more flexibility to define configs that can be interpreted by make, e.g. to
define fallback values of configs like in the example below.

Before this change, the config lines:
 #define CONFIG_SPL_MAX_SIZE 2048
 #define CONFIG_SPL_PAD_TO CONFIG_SPL_MAX_SIZE
would have been changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO="CONFIG_SPL_MAX_SIZE"

Hence, a make recipe using as an argument to $(OBJCOPY):
 --pad-to=$(CONFIG_SPL_PAD_TO)
would have issued:
 --pad-to="CONFIG_SPL_MAX_SIZE"
which means nothing for $(OBJCOPY) and makes it fail.

Thanks to this change, the config lines above are changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO=$(CONFIG_SPL_MAX_SIZE)

Hence, the make recipe above now issues:
 --pad-to=2048
as expected from the defined config.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agoarm: crt0.S: Remove bogus .globl
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:47 +0000 (09:35 +0000)]
arm: crt0.S: Remove bogus .globl

The purpose of .globl is to export symbols for ld, not to declare external
symbols.

By the way, use the ENTRY() and ENDPROC() macros to define functions rather than
using .global directly.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: relocate_code(): Use __image_copy_end for end of relocation
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:46 +0000 (09:35 +0000)]
arm: relocate_code(): Use __image_copy_end for end of relocation

Use __image_copy_end instead of __bss_start for the end of the image to
relocate. This is the same as commit 033ca72, but applied to all ARM start.S.

This is a more appropriate symbol naming for an image copy & relocate feature,
and this also saves a useless copy of data put between __image_copy_end and
__bss_start in linker scripts (e.g. relocation information, or MMU
initialization tables used only before jumping to the relocated image).

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: relocate_code(): Remove useless relocation offset computation
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:45 +0000 (09:35 +0000)]
arm: relocate_code(): Remove useless relocation offset computation

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm1136: Remove redundant relocate_code() return
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:44 +0000 (09:35 +0000)]
arm1136: Remove redundant relocate_code() return

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: relocate_code() is no longer noreturn
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:43 +0000 (09:35 +0000)]
arm: relocate_code() is no longer noreturn

Commit e05e5de7fae5bec79617e113916dac6631251156 made ARM's relocate_code()
return to its caller, but it did not update its declaration accordingly.

Fixing this function declaration fixes dropped C code following calls to
relocate_code().

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoarm: start.S: Fix _TEXT_BASE for SPL
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:42 +0000 (09:35 +0000)]
arm: start.S: Fix _TEXT_BASE for SPL

_TEXT_BASE must be set to CONFIG_SPL_TEXT_BASE for generic SPL, and to
CONFIG_SYS_TEXT_BASE for non-SPL builds.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agonand: mxc: Use appropriate page number in syndrome functions
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:41 +0000 (09:35 +0000)]
nand: mxc: Use appropriate page number in syndrome functions

The syndrome functions should use the page number passed as argument instead of
the page number saved upon NAND_CMD_READ0.

This does not make any difference if the NAND_NO_AUTOINCR option is set, but
otherwise this fixes accesses to the wrong pages.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Scott Wood <scottwood@freescale.com>
11 years agonand: mxc: Fix debug trace in mxc_nand_read_oob_syndrome()
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:40 +0000 (09:35 +0000)]
nand: mxc: Fix debug trace in mxc_nand_read_oob_syndrome()

The page number indicated in the debug trace of mxc_nand_read_oob_syndrome() did
not match the page being worked on.

By the way, replace the GCC-specific __FUNCTION__ with __func__.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Scott Wood <scottwood@freescale.com>
11 years agoimx: mx53ard: Add support for NAND Flash
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:39 +0000 (09:35 +0000)]
imx: mx53ard: Add support for NAND Flash

Add support for the Samsung K9LAG08U0M NAND Flash (2-GiB MLC NAND Flash, 2-kiB
pages, 256-kiB blocks, 30-ns R/W cycles, 1 CS) on mx53ard.

eNFC_CLK_ROOT is set up with a cycle time of 37.5 ns (400 MHz / 3 / 5) for this
board, which satisfies the 30-ns NF R/W cycle requirement.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agoimx: mx5: lowlevel_init: Simplify code
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:38 +0000 (09:35 +0000)]
imx: mx5: lowlevel_init: Simplify code

Don't use several instructions to build constant values.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Stefano Babic <sbabic@denx.de>
11 years agonand: mxc: Add support for i.MX5
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:37 +0000 (09:35 +0000)]
nand: mxc: Add support for i.MX5

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agonand: mxc: Prepare to add support for i.MX5
Benoît Thébaudeau [Thu, 11 Apr 2013 09:35:36 +0000 (09:35 +0000)]
nand: mxc: Prepare to add support for i.MX5

Add some abstraction to NFC definitions so that some parts of the current code
can also be used for future i.MX5 code.

Clean up a few things by the way.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomtd: nand: mxc_nand: Fix is_16bit_nand()
Fabio Estevam [Thu, 11 Apr 2013 09:35:35 +0000 (09:35 +0000)]
mtd: nand: mxc_nand: Fix is_16bit_nand()

Currently is_16bit_nand() is a per SoC function and it decides the bus nand
width by reading some boot related registers.

This method works when NAND is the boot medium, but does not work if another
boot medium is used. For example: booting from a SD card and then using NAND
to store the environment variables, would lead to the following error:

NAND bus width 16 instead 8 bit
No NAND device found!!!
0 MiB

Use CONFIG_SYS_NAND_BUSWIDTH_16BIT symbol to decide the bus width.

If it is defined in the board file, then consider 16-bit NAND bus-width,
otherwise assume 8-bit NAND is used.

This also aligns with Documentation/devicetree/bindings/mtd/nand.txt, which
states:

nand-bus-width : 8 or 16 bus width if not present 8

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agomtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT
Fabio Estevam [Thu, 11 Apr 2013 09:35:34 +0000 (09:35 +0000)]
mtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT

Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT option so that other NAND controller
drivers could use it when a 16-bit NAND is deployed.

drivers/mtd/nand/ndfc has CONFIG_SYS_NDFC_16BIT, so just rename it, so that
other NAND drivers could reuse the same symbol.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
11 years agoomap5_common.h: Use fallback CONFIG_SYS_BAUDRATE_TABLE
Tom Rini [Fri, 5 Apr 2013 06:21:46 +0000 (06:21 +0000)]
omap5_common.h: Use fallback CONFIG_SYS_BAUDRATE_TABLE

Cc: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
11 years agoomap5_uevm.h: Move uEVM-specific choices to omap5_uevm.h
Tom Rini [Fri, 5 Apr 2013 06:21:45 +0000 (06:21 +0000)]
omap5_uevm.h: Move uEVM-specific choices to omap5_uevm.h

The omap5_uevm platform has eMMC, and it makes sense to say that our
default env storage shall reside there.  Other platforms may not, so
move this choice to the EVM config.  In addition, we should provide some
way to partition the flash for later usage, so take advantage of the GPT
partition table support code and allow that to be setup with some
reasonable defaults.

Cc: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
11 years agoOMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC
Tom Rini [Fri, 5 Apr 2013 06:21:44 +0000 (06:21 +0000)]
OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC

In the case of booting from certain peripherals, such as UART, we must
not see what the device descriptor says for RAW or FAT mode because in
addition to being nonsensical, it leads to a hang.  This is why we have
a test currently for the boot mode being within range.  The problem
however is that on some platforms we get MMC2_2 as the boot mode and not
the defined value for MMC2, and in others we get the value for MMC2_2.
This is required to fix eMMC booting on omap5_uevm.

Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on
classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC).

Signed-off-by: Tom Rini <trini@ti.com>
11 years agoarm: omap4: Fix SDRAM AUTO DETECTION
Lokesh Vutla [Thu, 4 Apr 2013 19:51:14 +0000 (19:51 +0000)]
arm: omap4: Fix SDRAM AUTO DETECTION

Commit "8602114 omap: emif: configure emif only when required"
breaks SDRAM_AUTO_DETECTION.
The issue is dmm_init() depends on emif_sizes[](SDRAM Auto detection)
done in do_sdram_init(). The above commit moves dmm_init() above
do_sdram_init() because of which dmm_init() uses uninitialized
emif_sizes[].
So instead of using global emif_sizes[], get sdram details locally
and calculate emif sizes.

Reported-by: Michael Cashwell <mboards@prograde.net>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
11 years agoOMAP: Fix copy-paste bug that did not enable UART4 clock
Lubomir Popov [Thu, 4 Apr 2013 05:51:45 +0000 (05:51 +0000)]
OMAP: Fix copy-paste bug that did not enable UART4 clock

V2 fixes line wrap issue of the patch itself.

UART3 was enabled twice instead of UART4.

One more cosmetic change in a comment on EMIF clock.

Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
Reviewed-by: R Sricharan <r.sricharan@ti.com>
11 years agodoc/feature-removal-schedule.txt: Add CONFIG_SYS_(CLOCKS|PADS)_ENABLE_ALL
Tom Rini [Tue, 2 Apr 2013 07:39:43 +0000 (07:39 +0000)]
doc/feature-removal-schedule.txt: Add CONFIG_SYS_(CLOCKS|PADS)_ENABLE_ALL

We shall remove these OMAP4/5-specific options in v2013.07, barring
insufficient progress on the kernel side.

Cc: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
11 years agoARM: OMAP4/5: Make bootz as the default boot command
SRICHARAN R [Thu, 4 Apr 2013 23:39:47 +0000 (23:39 +0000)]
ARM: OMAP4/5: Make bootz as the default boot command

So with OMAP added to multi platform kernel,
the uImage no more contains a valid load address.
With the uboot already supporting zImage,
change the default boot command to bootz
instead.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
11 years agoARM: OMAP4/5: Change the default boot command to work with device tree
SRICHARAN R [Thu, 4 Apr 2013 23:39:27 +0000 (23:39 +0000)]
ARM: OMAP4/5: Change the default boot command to work with device tree

Now with kernel moving to all device tree, the default
boot command is changed to pass the device tree blob.
Also, adding the findfdt command to get the dt-blob
based on the board.

Thanks to Tom Rini <trini@ti.com> for suggesting this.

Signed-off-by: Sricharan R <r.sricharan@ti.com>
11 years agoomap5: Allow use of a plain text env file
Nishanth Menon [Mon, 1 Apr 2013 05:52:40 +0000 (05:52 +0000)]
omap5: Allow use of a plain text env file

For production systems it is better to use script images since
they are protected by checksums and carry valuable information
like name and timestamp. Also, you can't validate the content
passed to env import.

But for development, it is easier to use the env import command and
plain text files instead of script-images.

Since both OMAP5evm/uevm boards are used primarily for development,
we allow U-Boot to load env var from a text file in case that an
boot.scr script-image is not present.

The variable uenvcmd (if existent) will be executed (using run) after
uEnv.txt was loaded. If uenvcmd doesn't exist the default boot sequence
will be started.

Inspired by commit: d70f54808dfa83b574e1239c3eccbcf3317343e1
(omap4: allow the use of a plain text env file instead boot scripts)

Signed-off-by: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Sricharan R <r.sricharan@ti.com>
11 years agoARM: OMAP5: Set fdt_high to enable booting with Device tree
SRICHARAN R [Mon, 1 Apr 2013 05:52:39 +0000 (05:52 +0000)]
ARM: OMAP5: Set fdt_high to enable booting with Device tree

While booting with dt blob, if fdt_high is not set to
0xffffffff, the dt blob gets relocated to a high ram address,
which the kernel is not able to use without HIGHMEM.

So set it to 0xffffffff to avoid the issue.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
11 years agoARM: OMAP5: Rename omap5_evm to omap5_uevm
SRICHARAN R [Mon, 1 Apr 2013 05:52:38 +0000 (05:52 +0000)]
ARM: OMAP5: Rename omap5_evm to omap5_uevm

The omap5-uevm is the reference board name for OMAP5 soc
based platform. So rename it accordingly.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
11 years agoomap2420-h4: Fix get_timer() and CONFIG_SYS_HZ
Hunter, Jon [Wed, 3 Apr 2013 09:35:36 +0000 (09:35 +0000)]
omap2420-h4: Fix get_timer() and CONFIG_SYS_HZ

The function get_timer() should return time in ms and CONFIG_SYS_HZ
should be set to 1000 by default. Fix both of these items.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
11 years agoomap2420-h4: Add device tree support
Hunter, Jon [Wed, 3 Apr 2013 09:35:35 +0000 (09:35 +0000)]
omap2420-h4: Add device tree support

Enable device-tree support for the omap2420-h4 board.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
11 years agoomap2420-h4: Fix booting from NOR flash
Hunter, Jon [Wed, 3 Apr 2013 09:35:34 +0000 (09:35 +0000)]
omap2420-h4: Fix booting from NOR flash

The omap2420-h4 board is using a RAM based address as the linker
location for code. This is causing several problems when attempting
to run the latest u-boot code base on this board from flash. Update
the default linker location for code to be in NOR flash. Please note
that OMAP maps the NOR flash to address 0x08000000 by default and so
use this as the default address for the NOR flash.

Also remove legacy code that attempts to calculate where in flash the
sdata structure, that holds the memory interface configuration data,
is located. By changing the default linker location for code to flash
this is no longer necessary.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
11 years agoomap2420-h4: Fix DRAM initialisation
Hunter, Jon [Wed, 3 Apr 2013 09:35:33 +0000 (09:35 +0000)]
omap2420-h4: Fix DRAM initialisation

The size of the DRAM for the omap2420-h4 board is getting setup in the
dram_init() function. However, for the current u-boot release this is
too late and needs to be done in dram_init_banksize(). Therefore, add
a dram_init_banksize() function for the omap2420-h4 board and setup the
DRAM size there.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
11 years agotricorder: enable hw assisted BCH8 in SPL and u-boot
Andreas Bießmann [Tue, 2 Apr 2013 06:05:58 +0000 (06:05 +0000)]
tricorder: enable hw assisted BCH8 in SPL and u-boot

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Thomas Weber <weber@corscience.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Scott Wood <scottwood@freescale.com>
11 years agoomap_gpmc: add support for hw assisted BCH8
Andreas Bießmann [Fri, 5 Apr 2013 04:55:21 +0000 (04:55 +0000)]
omap_gpmc: add support for hw assisted BCH8

The kernel states:

---8<---
The OMAP3 GPMC hardware BCH engine computes remainder polynomials, it does not
provide automatic error location and correction: this step is implemented using
the BCH library.
--->8---

And we do so in u-boot.

This implementation uses the same layout for BCH8 but it is fix. The current
provided layout does only work with 64 Byte OOB.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Mansoor Ahamed <mansoor.ahamed@ti.com>
Cc: Thomas Weber <thomas.weber.linux@googlemail.com>
11 years agoomap_gpmc: change nandecc command
Andreas Bießmann [Thu, 4 Apr 2013 23:52:50 +0000 (23:52 +0000)]
omap_gpmc: change nandecc command

With uppcoming BCH support on OMAP devices we need to decide between differnt
algorithms when switching the ECC engine.  Currently we support 1-bit hammign
and 8-bit BCH on HW backend.

In order to switch between differnet ECC algorithms we need to change the
interface of omap_nand_switch_ecc() also.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Thomas Weber <thomas.weber.linux@googlemail.com>
11 years agoomap3/omap_gpmc.h: add ooblayout for BCH8 as in kernel
Andreas Bießmann [Tue, 2 Apr 2013 06:05:55 +0000 (06:05 +0000)]
omap3/omap_gpmc.h: add ooblayout for BCH8 as in kernel

This patch adds BCH8 ooblayout for NAND as provided by
0e618ef0a6a33cf7ef96c2c824402088dd8ef48c in linux kernel. This Layout is
currently only provided for 64 byte OOB.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Scott Wood <scottwood@freescale.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agoasm/omap_gpmc.h: consolidate common defines
Andreas Bießmann [Tue, 2 Apr 2013 06:05:54 +0000 (06:05 +0000)]
asm/omap_gpmc.h: consolidate common defines

arch/arm/include/asm/arch-am33xx/omap_gpmc.h and
arch/arm/include/asm/arch-omap3/omap_gpmc.h are almost the same, consolidate
the common parts into a new header.

Introduce a new asm/omap_gpmc.h which defines the command part and pulls in
the architecture specific one.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agoomap3/cpu.h: add BCH support
Andreas Bießmann [Tue, 2 Apr 2013 06:05:53 +0000 (06:05 +0000)]
omap3/cpu.h: add BCH support

This patch adds the BCH result registers to register mapping for OMAP3 gpmc.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Scott Wood <scottwood@freescale.com>
Reviewed-by: Tom Rini <trini@ti.com>
11 years agoomap3_beagle: Flush UART3 xmit on enable if TEMT is broken
Manfred Huber [Fri, 29 Mar 2013 02:52:36 +0000 (02:52 +0000)]
omap3_beagle: Flush UART3 xmit on enable if TEMT is broken

Flush UART3 xmit on enable if TEMT is broken

On some OMAP3 devices when UART3 is configured for boot mode before SPL starts
only THRE bit is set. We have to empty the transmitter before initialization
starts. This patch avoids the use of CONFIG_SYS_NS16550_BROKEN_TEMT.

Signed-off-by: Manfred Huber <man.huber@arcor.de>
Tested-by: Javier Martinez Canillas <javier@dowhile0.org>
Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
11 years agoam335x: Enable MMC1 clock
Tom Rini [Wed, 3 Apr 2013 08:50:01 +0000 (08:50 +0000)]
am335x: Enable MMC1 clock

We must not assume ROM has enabled the clock for MMC1.

Reported-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
11 years agopcm051: Enable DDR PHY dynamic power down bit
Lars Poeschel [Wed, 3 Apr 2013 04:37:52 +0000 (04:37 +0000)]
pcm051: Enable DDR PHY dynamic power down bit

This is done already for am335x in
59dcf970d11ebff5d9f4bbbde79fda584e9e7ad4 and also applies for pcm051.

It powers down the IO receiver when not performing read which helps
reducing the overall power consuption in low power states
(suspend/standby).

Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
11 years agomusb: set MUSB speed based on CONFIG
Bin Liu [Thu, 21 Mar 2013 05:27:49 +0000 (05:27 +0000)]
musb: set MUSB speed based on CONFIG

Do not config MUSB to highspeed mode if CONFIG_USB_GADGET_DUALSPEED
is not set, in which case Ether gadget only operates in fullspeed.

Reviewed-by: Tom Rini <trini@ti.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
11 years agomusb: am335x: disable bulk split-combine feature
Bin Liu [Thu, 21 Mar 2013 05:27:48 +0000 (05:27 +0000)]
musb: am335x: disable bulk split-combine feature

On TI AM335x devices, MUSB has bulk split/combine feature enabled
in the ConfigData register, but the current MUSB driver does not
support it yet. Therefore, disable the feature for now, until the
driver adds the support.

One usecase which is broken because of this feature is that Ether
gadget stops working in Fullspeed mode (by un-defining
CONFIG_USB_GADGET_DUALSPEED)

After desabled this feature, MUSB driver send packets in proper size
(no more than 64 bytes) in Fullspeed mode.

This has been validated with Ether gadget in Fullspeed mode on AM335x
EVM.

Signed-off-by: Bin Liu <b-liu@ti.com>
11 years agologo: update to the new logo for ATMEL
Josh Wu [Thu, 28 Mar 2013 10:37:49 +0000 (18:37 +0800)]
logo: update to the new logo for ATMEL

Atmel change to new logo since 2012. This patch update the logo to new one.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
11 years agoMerge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
Albert ARIBAUD [Thu, 4 Apr 2013 13:44:57 +0000 (15:44 +0200)]
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'

11 years agoexynos: change indentation of defines in cpu.h
Minkyu Kang [Mon, 1 Apr 2013 19:22:40 +0000 (19:22 +0000)]
exynos: change indentation of defines in cpu.h

Fix the indentation of some defines by tab.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoMerge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Albert ARIBAUD [Thu, 4 Apr 2013 09:49:32 +0000 (11:49 +0200)]
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'

11 years agospi: mxc_spi: Fix ECSPI reset handling
Dirk Behme [Wed, 20 Mar 2013 22:03:44 +0000 (22:03 +0000)]
spi: mxc_spi: Fix ECSPI reset handling

Reviewing the ECSPI reset handling shows two issues:

1. For the enable/reset bit (MXC_CSPICTRL_EN) in the control reg
   (ECSPIx_CONGREG) the i.MX6 technical reference manual states:

   -- cut --
   ECSPIx_CONREG[0]: EN: Writing zero to this bit disables the block
   and resets the internal logic with the exception of the ECSPI_CONREG.
   -- cut --

   Note the exception mentioned: The CONREG itself isn't reset.

   Fix this by manually writing the reset value 0 to the whole register.
   This sets the EN bit to zero, too (i.e. includes the old
   ~MXC_CSPICTRL_EN).

2. We want to reset the whole SPI block here. So it makes no sense
   to first read the old value of the CONREG and write it back, later.
   This will give us the old (historic/random) value of the CONREG back.
   And doesn't reset the CONREG.

   To get a clean CONREG after the reset of the block, too, don't use
   the old (historic/random) value of the CONREG while doing the reset.
   And read the clean CONREG after the reset.

This was found while working on a SPI boot device where the i.MX6 boot
ROM has already initialized the SPI block. The initialization by the
boot ROM might be different to what the U-Boot driver wants to configure.
I.e. we need a clean reset of SPI block, including the CONREG.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
CC: Stefano Babic <sbabic@denx.de>
CC: Fabio Estevam <fabio.estevam@freescale.com>
11 years agoARM: bcm2835: fix get_timer() to return ms
Stephen Warren [Wed, 27 Mar 2013 18:43:23 +0000 (18:43 +0000)]
ARM: bcm2835: fix get_timer() to return ms

Apparently, CONFIG_SYS_HZ must be 1000. Change this, and fix the timer
driver to conform to this.

Have the timer implementation export a custom API get_timer_us() for use
by the BCM2835 MMC API, which needs us resolution for a HW workaround.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
11 years agoi.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
Javier Martinez Canillas [Tue, 2 Apr 2013 23:57:23 +0000 (23:57 +0000)]
i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command

board/freescale/mx6qsabrelite/README explain a procedure to
update the SPI-NOR on the SabreLite board without Freescale
manufacturing tool but following this procedure leads to both
"sf erase" and "sf write" failing on a mx6qsabrelite board:

MX6QSABRELITE U-Boot > sf probe 1
MX6QSABRELITE U-Boot > sf erase 0 0x40000
SPI flash erase failed
MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
SPI flash write failed

This is because the chip-select 1 is wrong and the correct
value is 0x7300.

Since commit c1173bd0 ("sf command: allow default bus and chip selects")
the chip-select and bus arguments for the sf probe command are optional
so let's just remove it and use "sf probe" instead.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
11 years agowandboard: Remove CONFIG_SYS_FSL_USDHC_NUM
Fabio Estevam [Mon, 1 Apr 2013 16:03:38 +0000 (16:03 +0000)]
wandboard: Remove CONFIG_SYS_FSL_USDHC_NUM

CONFIG_SYS_FSL_USDHC_NUM is not used for wandboard.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6qsabrelite: Remove duplicate 'mmc dev'
Fabio Estevam [Mon, 1 Apr 2013 16:03:37 +0000 (16:03 +0000)]
mx6qsabrelite: Remove duplicate 'mmc dev'

No need to call 'mmc dev' twice.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agowandboard: Remove duplicate 'mmc dev'
Fabio Estevam [Mon, 1 Apr 2013 16:03:36 +0000 (16:03 +0000)]
wandboard: Remove duplicate 'mmc dev'

No need to call 'mmc dev' twice.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6: Fix get_board_rev() for the mx6 solo case
Fabio Estevam [Wed, 27 Mar 2013 07:36:55 +0000 (07:36 +0000)]
mx6: Fix get_board_rev() for the mx6 solo case

When booting a Freescale kernel 3.0.35 on a Wandboard solo, the get_board_rev()
returns 0x62xxx, which is not a value understood by the VPU
(Video Processing Unit) library in the kernel and causes the video playback to
fail.

The expected values for get_board_rev are:
0x63xxx: For mx6quad/dual
0x61xxx: For mx6dual-lite/solo

So adjust get_board_rev() accordingly and make it as weak function, so that we
do not need to define it in every mx6 board file.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Eric Nelson <eric.nelson@boundarydevices.com>
11 years agomx23_olinuxino: Fix netboot console
Alexandre Pereira da Silva [Mon, 25 Mar 2013 18:23:45 +0000 (18:23 +0000)]
mx23_olinuxino: Fix netboot console

The netargs variable was referencing the non-existing variable
console_mainline. Change that to console variable instead.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agommc: i.MX6: fsl_esdhc: Define maximum bus width supported by a board
Abbas Raza [Mon, 25 Mar 2013 09:13:34 +0000 (09:13 +0000)]
mmc: i.MX6: fsl_esdhc: Define maximum bus width supported by a board

Maximum bus width supported by some i.MX6 boards is not 8bit like
others. In case where both host controller and card support 8bit transfers,
they agree to communicate on 8bit interface while some boards support only 4bit interface.
Due to this reason the mmc 8bit default mode fails on these boards. To rectify this,
define maximum bus width supported by these boards (4bit). If max_bus_width is not
defined, it is 0 by default and 8bit width support will be enabled in host
capabilities otherwise host capabilities are modified accordingly.

It is tested with a MMCplus card.

Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
cc: stefano Babic <sbabic@denx.de>
cc: Andy Fleming <afleming@gmail.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
11 years agomx23_olinuxino: Change definitions to use spaces instead of tabs
Otavio Salvador [Sun, 24 Mar 2013 16:17:33 +0000 (16:17 +0000)]
mx23_olinuxino: Change definitions to use spaces instead of tabs

Change all "#define/ifdef<TAB>" sequences into "#define/ifdef<SPACE>".

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx25pdk: Enable imxdi RTC
Benoît Thébaudeau [Fri, 22 Mar 2013 09:30:29 +0000 (09:30 +0000)]
mx25pdk: Enable imxdi RTC

The mx25pdk board supports the i.MX25 DryIce RTC (imxdi), so enable it. This
allows to compile-test the imxdi driver in the mainline tree.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Acked-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx6qsabrelite: README: No need to pass 'u-boot.imx'
Fabio Estevam [Wed, 20 Mar 2013 04:07:58 +0000 (04:07 +0000)]
mx6qsabrelite: README: No need to pass 'u-boot.imx'

The u-boot.imx binary is generated by default, so no need to pass it in the
'make' line.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx28evk: Introduce a new target for saving env vars to NAND
Fabio Estevam [Thu, 7 Mar 2013 11:28:19 +0000 (11:28 +0000)]
mx28evk: Introduce a new target for saving env vars to NAND

Introduce 'mx28evk_nand' target for saving environment variables into NAND.

The mx28evk board does not come with a NAND flash populated from the
factory. It comes with an empty slot (U23), which allows the insertion of a
48-pin TSOP flash device.

Tested with a K9LBG08U0D.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6qsabre{sd,auto}: Add boot mode select
Otavio Salvador [Sat, 16 Mar 2013 08:05:07 +0000 (08:05 +0000)]
mx6qsabre{sd,auto}: Add boot mode select

Adds support for 'bmode' command which let user to choose where to
boot from; this allows U-Boot to load system from another storage
without messing with jumpers.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6qsabresd: Fix card detection for invalid card id case
Otavio Salvador [Sat, 16 Mar 2013 08:05:06 +0000 (08:05 +0000)]
mx6qsabresd: Fix card detection for invalid card id case

This changes the code so in case an unkown value is passed it will
return as invalid.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6qsabresd: Document the mapping of USDHC[2-4]
Otavio Salvador [Sat, 16 Mar 2013 08:05:05 +0000 (08:05 +0000)]
mx6qsabresd: Document the mapping of USDHC[2-4]

This documents the SD card identifier so it is easier for user to spot
which card number will be used, if need.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agoExynos: pwm: Remove dead code of function exynos5_get_pwm_clk
Akshay Saraswat [Thu, 28 Mar 2013 04:32:24 +0000 (04:32 +0000)]
Exynos: pwm: Remove dead code of function exynos5_get_pwm_clk

As we shall now be using clock_get_periph_rate function.
We find no reason for keeping code in function exynos5_get_pwm_clk.
Hence, removing it.

Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: pwm: Use generic api to get pwm clk freq
Padmavathi Venna [Thu, 28 Mar 2013 04:32:23 +0000 (04:32 +0000)]
Exynos: pwm: Use generic api to get pwm clk freq

Use generic api to get the pwm clock frequency

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: clock: Correct pwm source clk selection
Padmavathi Venna [Thu, 28 Mar 2013 04:32:22 +0000 (04:32 +0000)]
Exynos: clock: Correct pwm source clk selection

MPLL is selected as the source clk of pwm by default

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: clock: Add generic api to get the clk freq
Padmavathi Venna [Thu, 28 Mar 2013 04:32:21 +0000 (04:32 +0000)]
Exynos: clock: Add generic api to get the clk freq

Add generic api to get the frequency of the required peripherial. This
API gets the source clock frequency and returns the required frequency
by dividing with first and second dividers based on the requirement.

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: Add peripherial id for pwm
Padmavathi Venna [Sun, 31 Mar 2013 18:42:24 +0000 (18:42 +0000)]
Exynos: Add peripherial id for pwm

Add peripherial id for pwm inorder to support
generic api to get the clk frequency

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: Tidy up the pwm_config function in the exynos pwm driver
Gabe Black [Thu, 28 Mar 2013 04:32:20 +0000 (04:32 +0000)]
Exynos: Tidy up the pwm_config function in the exynos pwm driver

Some small fixes in the exynos pwm driver:

1. NS_IN_HZ is non-sensical since these are not compatible units. This
constant actually describes the number of nanoseconds in a second. Renamed it
to NS_IN_SEC. Also dropped the unnecessary parenthesis.
2. The variable "period" is not used to hold a period, it's used to hold a
frequency. Renamed it to "frequency".
3. tcmp is an unsigned value, so (tcmp < 0) will never be true and the if
which checks that condition will never execute. Also, there should be no
problem if the pwm never switches, so there's no reason to subtract one from
tcmp and therefore no reason to compare it against zero. Removed both ifs. If
they weren't removed, tcmp should be a signed value.
4. Add a check for a 0 period.

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Gabe Black <gabeblack@google.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: Avoid a divide by zero by specifying a non-zero period for pwm 4
Gabe Black [Thu, 28 Mar 2013 04:32:19 +0000 (04:32 +0000)]
Exynos: Avoid a divide by zero by specifying a non-zero period for pwm 4

The pwm_config function in the exynos pwm driver divides by its period
period parameter. A function was calling pwm_config with a 0ns period and a
0ns duty cycle. That doesn't actually make any sense physically, and results
in a divide by zero in the driver. This change changes the parameters to be a
100000ns period and duty cycle.

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Gabe Black <gabeblack@google.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: pwm: Fix two bugs in the exynos pwm configuration code
Gabe Black [Thu, 28 Mar 2013 04:32:18 +0000 (04:32 +0000)]
Exynos: pwm: Fix two bugs in the exynos pwm configuration code

First, the "div" value was being used incorrectly to compute the frequency of
the PWM timer. The value passed in is a constant which reflects the value
that would be found in a configuration register, 0 to 4. That should
correspond to a scaling factor of 1, 2, 4, 8, or 16, 1 << div, but div + 1 was
being used instead.

Second, the reset value of the timers were being calculated to give an overall
frequency, thrown out, and set to a maximum value. This was done so that PWM 4
could be used as the system clock by counting down from a high value, but it
was applied indiscriminantly. It should at most be applied only to PWM 4.

This change also takes the opportunity to tidy up the pwm_init function.

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained
Build and boot U-boot with this patch, backlight works properly.

Signed-off-by: Gabe Black <gabeblack@google.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: Add timer_get_us function
Che-Liang Chiou [Thu, 28 Mar 2013 04:32:17 +0000 (04:32 +0000)]
Exynos: Add timer_get_us function

timer_get_us returns the time in microseconds since a certain reference
point of history.  However, it does not guarantee to return an accurate
time after a long period; instead, it wraps around (that is, the
reference point is reset to some other point of history) after some
periods. The frequency of wrapping around is about an hour (or 2^32
microseconds).

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: Change get_timer() to work correctly
Simon Glass [Thu, 28 Mar 2013 04:32:16 +0000 (04:32 +0000)]
Exynos: Change get_timer() to work correctly

At present get_timer() does not return sane values. It should count up
smoothly in milliscond intervals.

We can change the PWM to count down at 1MHz, providing a resolution
of 1us and a range of about an hour between required get_timer() calls.

Test with command "sf probe 1:0; time sf read 40008000 0 1000".
Try with different numbers of bytes and see that sane values are obtained

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos5: config: enable time command
Akshay Saraswat [Thu, 28 Mar 2013 04:32:15 +0000 (04:32 +0000)]
Exynos5: config: enable time command

This patch enables time command.

Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos5: clock: Fix a typo bug in exynos clock init
Akshay Saraswat [Thu, 21 Mar 2013 02:13:13 +0000 (02:13 +0000)]
Exynos5: clock: Fix a typo bug in exynos clock init

We intended to clear the bits of CLK_SRC_TOP2 register, instead we were
writing on the reserved bits of src_core1 register. Since the default
value of clk_src_top2 register were itself zero, this typo was not
creating any big issue. But it is better to fix this error for better
readability of the code.

Signed-off-by: Hatim Ali <hatim.rv@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoExynos: config: Enable hash command
Akshay Saraswat [Wed, 20 Mar 2013 21:00:59 +0000 (21:00 +0000)]
Exynos: config: Enable hash command

This enables hash command.

Tested with command "hash sha256 0x40008000 0x2B 0x40009000".
Used mm and md to write a standard string to memory location
0x40008000 and ran the above command to verify the output.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
11 years agogen: Add sha h/w acceleration to hash
Akshay Saraswat [Wed, 20 Mar 2013 21:00:58 +0000 (21:00 +0000)]
gen: Add sha h/w acceleration to hash

Adding H/W acceleration support to hash which can be used
to test SHA 256 hash algorithm.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
11 years agoExynos: config: Enable ACE HW for SHA 256 for Exynos
Akshay Saraswat [Wed, 20 Mar 2013 21:00:57 +0000 (21:00 +0000)]
Exynos: config: Enable ACE HW for SHA 256 for Exynos

This enables SHA 256 for exynos.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
11 years agoExynos: Add hardware accelerated SHA256 and SHA1
Akshay Saraswat [Wed, 20 Mar 2013 21:00:56 +0000 (21:00 +0000)]
Exynos: Add hardware accelerated SHA256 and SHA1

SHA-256 and SHA-1 accelerated using ACE hardware.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
11 years agoExynos: clock: Fix a bug in PLL lock check condition
Akshay Saraswat [Fri, 15 Mar 2013 02:29:09 +0000 (02:29 +0000)]
Exynos: clock: Fix a bug in PLL lock check condition

The condition for testing of PLL getting locked was incorrect. Rectify
this error in this patch.

Reported-by: Alexei Fedorov <alexie.fedorov@arm.com>
Signed-off-by: Hatim Ali <hatim.rv@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agospl:falcon:trats: Fix SPL image size computing.
Przemyslaw Marczak [Tue, 12 Mar 2013 03:41:49 +0000 (03:41 +0000)]
spl:falcon:trats: Fix SPL image size computing.

"spl_imgsize" was set as decimal variable by "setexpr"
and this causes wrong image size written by "ext4write".
Preset this val with "0x" prefix allow to fix this issue.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agospi: exynos: Fix compiler warnings for non-dt systems
Vivek Gautam [Tue, 5 Mar 2013 03:49:57 +0000 (03:49 +0000)]
spi: exynos: Fix compiler warnings for non-dt systems

Enclosing process_nodes() and spi_get_config() inside
CONFIG_OF_CONTROL, since they are compiled only for DT systems.

This fixes following warning:
exynos_spi.c:391:12: warning: 'process_nodes' defined but not used [-Wunused-function]

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoSMDK5250: Fix compiler warning for non-dt systems
Vivek Gautam [Tue, 5 Mar 2013 03:49:56 +0000 (03:49 +0000)]
SMDK5250: Fix compiler warning for non-dt systems

Compiling for non-dt systems gives folowing warning:
smdk5250.c: In function 'board_eth_init':
smdk5250.c:152:6: warning: unused variable 'node' [-Wunused-variable]

Declare variable 'node' only for dt enabled systems to remove this
warning.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 years agoMerge branch 'u-boot/master' into 'u-boot-arm/master'
Albert ARIBAUD [Thu, 28 Mar 2013 17:50:01 +0000 (18:50 +0100)]
Merge branch 'u-boot/master' into 'u-boot-arm/master'

Conflicts:
drivers/spi/tegra20_sflash.c
include/fdtdec.h
lib/fdtdec.c

11 years agoarmv7: do not relocate _start twice
Vincent Stehlé [Fri, 15 Mar 2013 06:54:00 +0000 (06:54 +0000)]
armv7: do not relocate _start twice

The _start symbol is already relocated, so do not add the relocation the second
time in c_runtime_cpu_setup.

This fixes e.g. the abort exception handling path, which ended in double fault
due to bad address in VBAR.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Reported-by: Lubomir Popov <lpopov@mm-sol.com>
11 years agoARM: mmu: Set domain permissions to client access
R Sricharan [Mon, 4 Mar 2013 20:04:45 +0000 (20:04 +0000)]
ARM: mmu: Set domain permissions to client access

 The 'XN' execute never bit is set in the pagetables. This will
 prevent speculative prefetches to non executable regions. But the
 domain permissions are set as master in the DACR register.
 So the pagetable attribute for 'XN' is not effective. Change the
 permissions to client.

 This fixes lot of speculative prefetch aborts seen on OMAP5
 secure devices.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Tested-by: Vincent Stehle <v-stehle@ti.com>
Cc: Vincent Stehle <v-stehle@ti.com>
Cc: Tom Rini <trini@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agoARM: mmu: Introduce weak dram_bank_setup function
R Sricharan [Mon, 4 Mar 2013 20:04:44 +0000 (20:04 +0000)]
ARM: mmu: Introduce weak dram_bank_setup function

Introduce a weak version of dram_bank_setup function
to allow a platform specific function.

This is used in the subsequent patch to setup dram region
without 'XN' attribute in order to enable the region
under client permissions.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Cc: Vincent Stehle <v-stehle@ti.com>
Cc: Tom Rini <trini@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>