Commit Graph

18996 Commits

Author SHA1 Message Date
Albert ARIBAUD e05e5de7fa arm: move C runtime setup code in crt0.S
Move all the C runtime setup code from every start.S
in arch/arm into arch/arm/lib/crt0.S. This covers
the code sequence from setting up the initial stack
to calling into board_init_r().

Also, rewrite the C runtime setup and make functions
board_init_*() and relocate_code() behave according to
normal C semantics (no jumping across the C stack any
more, etc).

Some SPL targets had to be touched because they use
start.S explicitly or for some reason; the relevant
maintainers and custodians are cc:ed.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2013-01-08 22:14:50 +01:00
Albert ARIBAUD 7528cf5f01 Merge branch 'u-boot-imx/master' into 'u-boot-arm/master' 2013-01-08 14:59:37 +01:00
Albert ARIBAUD 79f3877794 Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
This required manual merging drivers/mtd/nand/Makefile
and adding am335x_evm support for CONFIG_SPL_NAND_DRIVERS
2013-01-08 13:15:45 +01:00
Fabio Estevam 1411fb37b5 tools: imximage: Load a size that is multiple of 512
In order to mx53 ROM to properly load the U-boot image, its header size should
be multiple of 512 bytes.

This issue was observed with gcc 4.6.2/4.7.3, which caused data aborts:

U-Boot 2013.01-rc2-00172-gf8cfcf1-dirty (Dec 26 2012 - 13:13:28)

Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:    serial
Out:   serial
Err:   serial
CPU:   Freescale i.MX53 family rev2.1 at 1000 MHz
Reset cause: WDOG
Net:   FEC
Warning: FEC using MAC address from net device

Hit any key to stop autoboot:  0
data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<aff72220>]          lr : [<aff721fc>]
sp : af565e20  ip : af566918     fp : 00000000
r10: 00000003  r9 : affabb5b     r8 : af565f58
r7 : 00000000  r6 : 36747fff     r5 : af5668e8  r4 : 36747fff
r3 : af5668ec  r2 : af5668eb     r1 : 00000000  r0 : af5668e8
Flags: NzcV  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

,and this patch fixes it.

Also, even though the ROUND macro is already defined in common.h,
the reason for redefining it in image.h is explained by Stefano Babic:

"I will remark a previous comment - even if including common.h seems a
good idea to avoid duplications, it makes tools like mkimage to depend
on the selected board, because <board>_config must run. Even if this is
not a problem for us u-boot developers, it becomes an issue when these
tools are included in distros (like u-boot-tools in Ubuntu) and cannot
be packaged."

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-01-05 18:09:00 +01:00
Fabio Estevam 085e728aa5 mx53loco: Improve error handling on power_init()
Make the error handling more robust.

Check if each one of the PMIC writes fail and if they do, just return
immediately.

Also, print the cause for the failures.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-01-05 18:07:53 +01:00
Fabio Estevam d22925108e mx53loco: Remove unneeded 'retval' variable
commit c73368150 (pmic: Extend PMIC framework to support multiple instances
of PMIC devices) introduced an extra 'retval' variable, but this is not
necessary since we have already the variable 'ret' in place.

So use 'ret' to store the return values from the pmic related calls and remove
'retval'.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-01-05 18:06:12 +01:00
Fabio Estevam 7093f85c9e mx51evk: Remove unneeded comment
Looks like the original comment came from a copy and paste from mx31ads.h.

It does not have a context on mx51evk anymore, so delete it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-01-05 18:04:47 +01:00
Shawn Guo 49ea0ff5cc mx6qsabresd: use on-board eMMC to store environment
It makes more sense to use on-board eMMC to store environments.  The
boot partition 1 is selected by default.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2013-01-05 18:01:26 +01:00
Shawn Guo de7d02aeba mx6qsabresd: add usdhc2 and usdhc4 support
The on-board number of available usdhc devices is something board
specific.  The patch moves CONFIG_SYS_FSL_USDHC_NUM out of
mx6qsabre_common.h and adds usdhc2 and usdhc4 support for mx6qsabresd
board.

To keep the default mmc device for environment same as before (usdhc3),
it moves CONFIG_SYS_MMC_ENV_DEV out of mx6qsabre_common.h and changes
it to 1 for mx6qsabresd.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2013-01-05 18:00:14 +01:00
Shawn Guo fb8302bfc5 fsl_esdhc: add MMC_MODE_HC host_caps
All esdhc variants we know should support high capacity MMC cards,
so let's add MMC_MODE_HC host_caps unconditionally to support those
MMC cards (capacity > 2 GB).

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2013-01-05 17:56:42 +01:00
Ashok e660c44d9e mx35pdk:Use IMX_GPIO_NR macro
Use IMX_GPO_NR macro

Signed-off-by: Ashok Kumar Reddy <ashokkourla2000@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2013-01-05 17:44:41 +01:00
Marek Vasut 1f75b54150 mxs: Add NAND fdt and ramdisk partition to m28evk
Adjust the NAND partitioning layout so that there is a separate partition
for the ramdisk and fdt blob on the NAND.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
2013-01-05 17:40:12 +01:00
Fabio Estevam 54bb84115d mx53loco: Call PMIC related functions from board_late_init()
Since commit c733681 (pmic: Extend PMIC framework to support multiple instances
of PMIC devices) mx53loco fails to allocate the memory for PMIC:

U-Boot 2013.01-rc2-dirty (Dec 20 2012 - 15:55:01)

Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
pmic_alloc: No available memory for allocation!
pmic_init: POWER allocation error!
CPU:   Freescale i.MX53 family rev2.0 at 800 MHz
Reset cause: POR
MMC:   FSL_SDHC: 0, FSL_SDHC: 1

Calling the PMIC related functions at a later stage, ie, from board_late_init()
fixes the issue.

Reported-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Stefano Babic <sbabic@denx.de>
2012-12-27 11:03:43 +01:00
Stefan Reinauer e56cdd778c x86: Add coreboot version to u-boot's version command
Since U-Boot runs from coreboot on x86, the Coreboot version is an
important part of the boot state. This version information is
available in the coreboot tables, so print it when the 'version'
command is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-26 10:36:26 -08:00
Simon Glass a08afb398b x86: coreboot: Enable io command
Enable the io command for x86 on coreboot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-26 10:36:25 -08:00
Otavio Salvador 2f994fe622 mx6qsabre_common: Change default loadaddr to 0x12000000
This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-12-26 12:13:56 +01:00
Otavio Salvador 589b1afdb5 mx6qsabrelite: Change default loadaddr to 0x12000000
This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-12-26 12:11:49 +01:00
Otavio Salvador fe51f78714 mx53loco: Change default loadaddr to 0x72000000
This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-12-26 12:08:28 +01:00
Otavio Salvador aef8af6a3d mx53loco: We shouldn't hardcode a rootfs filesystem type
For a generic environment, we shouldn't have a fixed rootfs filesystem
so we drop it from env.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-12-26 12:05:54 +01:00
Fabio Estevam 8dd15b43b0 mx35pdk: Allow booting of a device tree kernel
Select CONFIG_OF_LIBFDT, so that a dt kernel can be launched.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-26 11:58:50 +01:00
Scott Wood f8cfcf1b1c env: don't generate callback list entries for SPL
SPL doesn't write to the environment.  These list entries prevent the
functions from being garbage-collected, even though nothing will look at
the list.  This caused several SPL builds (e.g.  P2020RDB-PC_NAND) to
break due to size limitations and/or unresolved symbols.

A static inline function is used to provide a context in which we
can consume the callback, and thus avoid unused function warnings.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@gmail.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
2012-12-22 05:57:16 -07:00
Tom Rini da77a0e593 Merge branch 'master' of git://git.denx.de/u-boot-arm 2012-12-22 05:55:19 -07:00
Albert ARIBAUD 96764df1b4 Merge samsung, imx, tegra into u-boot-arm/master
This commit merges branches from samsung, imx and tegra
meant to fix merge issues between u-boot/master and
u-boot-arm/master, as well as a few manual merge fixes.
2012-12-22 11:59:14 +01:00
Tom Rini ba6d4b64b3 Merge branch 'master' of git://git.denx.de/u-boot-usb 2012-12-21 16:19:29 -07:00
Prabhakar Kushwaha ba427678a4 driver/mtd/IFC:Wait tWB time, poll R/B before command execution
IFC_FIR_OP_CMD0 issues command for execution without checking flash
readiness. It may cause problem if flash is not ready. Instead use
IFC_FIR_OP_CW0 which Wait for tWB time and poll R/B to return high or
time-out, before issuing command.

NAND_CMD_READID command implemention does not fulfill above requirement. So
update its programming.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Hemant Nautiyal <hemant.nautiyal@freescale.com>
2012-12-21 15:34:54 -06:00
Tom Rini 42e1321874 Merge branch 'master' of git://git.denx.de/u-boot-sh 2012-12-20 10:53:20 -07:00
Nikita Kiryanov 41984e7123 cm_t35: use new low level interface for usb ehci
Update usb host support to use new version of omap_ehci_hcd_init.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2012-12-20 17:04:21 +01:00
Nikita Kiryanov 854a7836dc cm-t35: add USB host support
Add support for USB host ports on cm-t3530 and cm-t3730.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-12-20 17:04:21 +01:00
Nikita Kiryanov 41b13bc7c4 twl4030: add gpio register offsets
Add gpio register offsets for twl4030.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-12-20 17:04:21 +01:00
Tom Rini e3c52f2b87 Revert "fw_env: fix building w/out a config.h"
I had missed Joe's NAK on this patch, so...

This reverts commit 92ace272d0.

Signed-off-by: Tom Rini <trini@ti.com>
2012-12-20 07:30:27 -07:00
Yoshihiro Shimoda bb474b8187 serial_sh: Add support Renesas SH7752
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2012-12-20 13:20:17 +09:00
Yoshihiro Shimoda 1a2621bab8 sh: add support for sh7752evb board
The R0P7752C00000RZ board has SH7752, 512MB DDR3-SDRAM, SPI ROM,
Gigabit Ethernet, and eMMC.

This patch supports the following functions:
 - 512MB DDR3-SDRAM, SCIF4, SPI ROM, Gigabit Ethernet, eMMC

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2012-12-20 13:20:17 +09:00
Jens Scharsig (BuS Elektronik) 46dc5bcade coldfire: eb_cpu5282: fix: boot from internal flash
* By a sequence of unfavorable conditions in the config header file, the eb_cpu5282
  booting from  internal stopped after relocation. Blame it is a faulty value of
  CONFIG_SYS_MONITOR_BASE. This patch fix this by replace the wrong condition in
  config header with option in board.cfg

Signed-off-by: Jens Scharsig (BuS Elektronik) <esw@bus-elektronik.de>
2012-12-19 15:51:58 -07:00
Mike Frysinger 92ace272d0 fw_env: fix building w/out a config.h
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-19 15:51:57 -07:00
Mike Frysinger 7a546db2ff fw_env: fix incorrect usage of open(O_CREAT)
When using open(), the O_CREAT flag must be given a mode, otherwise it
uses random garbage from the stack.  Also, it can fail to build:

In file included from /usr/include/fcntl.h:290:0,
                 from fw_env_main.c:42:
In function 'open',
    inlined from 'main' at fw_env_main.c:97:9:
/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared
	with attribute error: open with O_CREAT in second argument needs 3 arguments

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-19 15:51:57 -07:00
Mike Frysinger 3779c8e319 fw_env: fix type of len
This variable is assigned by a size_t, and is printed that way, but is
incorrectly declared as an int.  Which means we get warnings:
fw_env.c: In function 'fw_setenv':
fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
	but argument 3 has type 'int' [-Wformat]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-19 15:51:57 -07:00
Joe Hershberger 4823b45da2 Add a simple load option to setexpr
Make setexpr accept a 2 parameter variant that will simply load a value
into a variable.  This is useful for loading a value from memory.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-19 15:51:57 -07:00
Simon Glass 2400727318 spi: Add SPI flash test
It is useful to have a basic SPI flash test, which tests that the SPI chip,
the SPI bus and the driver are behaving.

This test erases part of the flash, writes data and reads it back as a
sanity check that all is well.

Use CONFIG_SF_TEST to enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-19 15:51:57 -07:00
James Miller a683c288d4 spi: Add progress percentage and write speed to `sf update`
Output a progress update only at most 10 times per second, to avoid
saturating (and waiting on) the console. Make the summary line
to fit on a single line. Make sure that cursor sits at the end of
each update line instead of the beginning.

Sample output:

SF: Detected W25Q32 with page size 4 KiB, total 4 MiB
Update SPI
1331200 bytes written, 2863104 bytes skipped in 21.912s, speed 199728 B/s

time: 21.919 seconds, 21919 ticks
Skipping verify

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: James Miller <jamesmiller@chromium.org>
Signed-off-by: Taylor Hutt <thutt@chromium.org>
[trini: Drop 'const' from bytes_per_second()]
Signed-off-by: Tom Rini <trini@ti.com>
2012-12-19 15:51:23 -07:00
Allen Martin a098cf41fd Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged
Conflicts:
	README
	arch/arm/cpu/armv7/exynos/clock.c
	board/samsung/universal_c210/universal.c
	drivers/misc/Makefile
	drivers/power/power_fsl.c
	include/configs/mx35pdk.h
	include/configs/mx53loco.h
	include/configs/seaboard.h
2012-12-19 13:02:36 -08:00
Tom Rini 095728803e Merge branch 'master' of git://git.denx.de/u-boot-net 2012-12-17 18:39:50 -07:00
Tom Rini e80e588bb8 Merge branch 'master' of git://git.denx.de/u-boot-nand-flash 2012-12-17 18:39:45 -07:00
Pantelis Antoniou 598cf6062e g_dnl: Properly terminate string list.
Well, not terminating the list causes very interesting crashes.
As in changing the vendor & product ID crashes. Fun.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2012-12-17 15:38:15 +01:00
Pantelis Antoniou 5a413cae6a g_dnl: Issue connect/disconnect as appropriate
Call usb_gadget_connect/usb_gadget_disconnect in g_dnl_bind/g_dnl_unbind.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2012-12-17 15:38:15 +01:00
Vincent Palatin 8b57e2f081 usb: properly detect empty mass storage media reader
When a USB card reader is empty, it will return "Not Ready - medium not
present" as Key Code Qualifier. In that situation, it's useless waiting
for the full timeout since the result won't change until the user
inserts a card.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-17 15:38:15 +01:00
Milind Choudhary 359439d288 usb: Clean up newly allocated device nodes in case of configuration failure
If probe of a newly connected device fails for some reason, clean up
the allocated entry in usb_dev array.

Signed-off-by: Milind Choudhary <milindc@codeaurora.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-17 15:38:15 +01:00
Vipin Kumar b6d7852cf8 usbh/ehci: Increase timeout for enumeration
The current logic reads the port status just once after usb_hub_power_on and
expects the portstatus and portchange to report the connection status
immediately and correctly.

Few pen drives are not able to report both of them immediately ie. those pens
report the connection change but not the connected state after the first read.
This opportunity once lost is gone for ever because the u-boot, unlike linux or
any other OS, works in polling mode.

This patch modifies the logic to read the port status continuously until the
portstatus and portchange both report a connection change as well as a connected
state or no connection change and no connection. This logic is placed in a
timeout of 10 sec. At the end of it, the pen drive would have either reported a
ONE or a ZERO in bit 1 of portstatus as well as portchange.

It enhances the set of pen drives which can eventually be detected by u-boot

Note: This 10 second timeout is based purely on several experiments done with
the broken pen drives

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2012-12-17 15:38:15 +01:00
Richard Genoud c5a927c61f usb documentation: fix typo
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
2012-12-17 15:38:15 +01:00
Lukasz Dalek a33fada1c0 h2200: Add USB CDC ethernet support
Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalek <luk0104@gmail.com>
2012-12-17 15:38:14 +01:00
Lukasz Dalek 27460be60d pxa25x_udc: Remove usbdescriptors.h
usbdescriptors.h conflicts with linux/usb/ch9.h.
Remove it.

Signed-off-by: Lukasz Dalek <luk0104@gmail.com>
2012-12-17 15:38:14 +01:00