1
0
Fork 0
Commit Graph

3911 Commits (zero-gravitas)

Author SHA1 Message Date
Otavio Salvador 158a5196a5 Prepare v2016.05
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXOdxnAAoJEIf59jXTHXZSvIQQAInTqpaxpGCoiXyGmMAkaGNy
 cliwUE4pFQE1MW5c2ZxMjgExuT7gBq0yRO3jBWm+U1RmjbN56jw3RBwX+HOIJ8X1
 7uYr2amPVvnq0ZOZpP62JCmXGiQqoLfgIlSpcLxzYg7Y1tGwvXj3ds8Tab7Iklg3
 uaq0/tRjE5aTNRl0lpXLscC4VtTQSuakfuHcfwgFLQsVfY8fnoJ9cnwyBPkLVsSL
 +NHmMbup5ZEIOS6LOl5uLYaar8/SZ73N2gxfbrye5Ar47w4VwGeQxAOPHQUGNPB7
 HErL+dMQ0att36Az9saV0ExCC76JXl/2SvG1Da8t1rJqCAfhuPQI9/GjLOoYl9e/
 GuOl8uz0SzimEKqJJKAhQXebmT8fDgZ/IKQ6hPo9npQRmmMXG/tNEqomBgpxJyFO
 x5zCk6dfKywQkcOn1mzw6iLqiozieBkD8Xqh8lTIWo9xAS9twf5VkLYsT4qmHTap
 3g3meWgZr5hxci4Hna97PSwFp32Z/lnD67Lzr6aOPi651EiOHTrddrFtoXYMCCx7
 jIZ4E00tCOE/KfWRGzo0VEATYu51Iumgj49WDrPAnLBbDQC+y4PEMwLU/dkbKY4f
 9bB83qFTpTWsmd8NSoGde5XMHu9uHjm5z7HcYQxiG6Swhmsi4fwv/gUXTaDeaFSB
 KvcIqhxiIwFwZEL/GWFw
 =puMF
 -----END PGP SIGNATURE-----

Merge tag 'v2016.05' into 2016.05+fslc

Prepare v2016.05

* tag 'v2016.05': (65 commits)
  Prepare v2016.05
  sunxi: Enable USB host in CHIP defconfig
  test, tools: update tbot documentation
  tests: py: fix NameError exception if bdi cmd is not supported
  arm/arm64: Move barrier instructions into separate header
  arm: socfpga: Update iomux and pll for c5 socdk RevE
  warp7: Fix boot by selecting CONFIG_OF_LIBFDT
  usb: gadget: dfu: discard dead code
  dfu: avoid memory leak
  usb: dwc2: Add delay to fix the USB detection problem on SoCFPGA
  usb: hub: Don't continue on get_port_status failure
  usb: Assure Get Descriptor request is in separate microframe
  usb: Wait after sending Set Configuration request
  socfpga: fix broken build if CONFIG_ETH_DESIGNWARE disabled
  mtd: cqspi: Simplify indirect read code
  mtd: cqspi: Simplify indirect write code
  arm: socfpga: socrates: Add 'time' command
  ARM: socfpga: Disable USB OC protection on SoCrates
  usb: Don't init pointer to zero, but NULL
  usb: ehci-mx6: allow board_ehci_hcd_init to fail
  ...

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2016-05-16 17:19:56 -03:00
Marek Vasut 70f4d22317 SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGE
When defined, SPL will proceed to another boot method
if the image it has loaded does not have a signature.
This is useful if the subsequent boot methods are much
more complex.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <van.freenix@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
2016-05-09 09:41:52 +02:00
Marek Vasut 5054e50473 SPL: Let spl_parse_image_header() return value
Allow the spl_parse_image_header() to return value. This is convenient
for controlling the SPL boot flow if the loaded image is corrupted.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <van.freenix@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@konsulko.com>
2016-05-09 09:41:25 +02:00
Marek Vasut d81db48d41 usb: hub: Don't continue on get_port_status failure
The code shouldn't continue probing the port if get_port_status() failed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Stephen Warren <swarren@nvidia.com>
2016-05-06 20:06:56 +02:00
Marek Vasut ef71290be9 usb: Assure Get Descriptor request is in separate microframe
The Kingston DT Ultimate USB 3.0 stick is sensitive to this first
Get Descriptor request and if the request is not in a separate
microframe, the stick refuses to operate. Add slight delay, which
is enough for one microframe to pass on any USB spec revision.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Stephen Warren <swarren@nvidia.com>
2016-05-06 20:06:56 +02:00
Marek Vasut f647bf0ba3 usb: Wait after sending Set Configuration request
Some devices, like the SanDisk Cruzer Pop need some time to process
the Set Configuration request, so wait a little until they are ready.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Stephen Warren <swarren@nvidia.com>
2016-05-06 20:06:56 +02:00
Marek Vasut 2f1b4302e3 usb: Don't init pointer to zero, but NULL
The pointer should always be inited to NULL, not zero (0). These are
two different things and not necessarily equal.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Stephen Warren <swarren@nvidia.com>
2016-05-06 18:35:06 +02:00
Lev Iserovich a434fd1d28 fdt: fix setting MAC addresses for multiple interfaces
For multiple ethernet interfaces the FDT offset of '/aliases' will change as we
are adding MAC addresses to the FDT.
Therefore only the first interface ('ethernet0') will get properly updated in
the FDT, with the rest getting FDT errors when we try to set their MAC address.

Signed-off-by: Lev Iserovich <iserovil@deshawresearch.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-05-03 17:52:10 -05:00
Vagrant Cascadian eae4b2b67b Fix spelling of "occurred".
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-02 18:37:09 -04:00
Robert P. J. Day 4eece2602b common/dlmalloc.c: Delete content that was moved to malloc.h
Remove several hundred lines of content surrounded by:

#if 0  /* Moved to malloc.h */
... moved stuff ...
#endif /* 0 */                 /* Moved to malloc.h */

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-25 15:10:36 -04:00
Fabio Estevam 5bbf409909 spl: spl_mmc: Disambiguate error message
The error message "spl: mmc block read error" may come from two
different functions, so we should better annotate the function name
where the error comes from to help debugging.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-25 15:10:36 -04:00
Peng Fan 125d193c4f common: env: support sata device
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and
   define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stuart Longland <stuartl@vrt.com.au>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-18 12:29:14 -04:00
Steve Rae e3793541b1 fastboot: sparse: remove unnecessary logging
remove logging of the 'skipped' blocks

Signed-off-by: Steve Rae <srae@broadcom.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-11 20:48:29 -04:00
Steve Rae c7529dbad1 fastboot: sparse: fix block addressing for don't care chunk type
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented,
it dropped 9981945 (aboot: fix block addressing for don't care chunk type).

This re-implements the required fix for the "don't care chunk type"...

Signed-off-by: Steve Rae <srae@broadcom.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-11 20:48:29 -04:00
Lokesh Vutla 811906aebc spl: mmc: raw: Try to load u-boot if Linux image is not found
If CONFIG_SPL_OS_BOOT is enabled and Linux image is not flashed at
RAW_MODE_KERNEL_SECTOR in MMC, spl still assumes that Linux is
available and tries to boot it and hangs. In order to avoid this,
adding a check to verify if parsed image header is of type IH_OS_LINUX.
If it fails then fall back to load u-boot image.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-04-11 20:48:27 -04:00
Guy Thouret c00c29d8f7 env_eeprom invalidates gd->env_addr by setting it to an offset value
Patch to fix boot hang when using env on i2c eeprom caused by invalid gd->env_addr

Signed-off-by: Guy Thouret <guy.thouret@wems.co.uk>
Cc: Heiko Schocher <hs@denx.de>
2016-04-11 12:44:37 -04:00
Jeffy Chen d3bafe32ca fastboot: sparse: fix sparse blocks calculation
It may overflow in sparse_block_size_to_storage, use uint64_t instead in
the calculation.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2016-04-11 12:44:37 -04:00
Hans de Goede 9a80e71435 usb: kbd: Do not deregister usbkbd twice when using dm
The dm usb_kbd_remove function() will deregister the usb keyboard for
us on a "usb reset" / "usb stop" so there is no need to manually call
usb_kbd_deregister() in the dm case.

This commit removes usb_kbd_deregister() in the dm case fixing the
following "usb reset" errors:

usb_kbd_remove: warning, ret=-6
device_remove: Device 'usb_kbd' failed to remove, but children are gone

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-10 17:18:42 +02:00
Stefan Roese 30eae26b56 common: cli: Fix typo CONFIG_CMDINE -> CONFIG_CMDLINE
Patch f8bb6964 (Drop command-processing code when CONFIG_CMDLINE is
disabled) introduced a small typo. This patch fixes it and unbreaks
all boards again that don't have the Hush parser enabled.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2016-04-04 13:13:07 -04:00
Peng Fan 9a5d993e65 common: env_sf: Add exclamation mark
Add exclamation mark to the errmsg, when error and set_default_env.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Jagan Teki <jteki@openedev.com>
Cc: Ravi Babu <ravibabu@ti.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-01 17:17:43 -04:00
Ahmed Samir Khalil 8122d2161e Common: SPL: spl_nand: Fixed debug correct NAND ECC type.
In case of #define DEBUG 1 (fordebugging SPL). A bug in
spl_nand_load_image() will be triggered, because it prints
using hw ecc regardless of soft ecc configurations and
initializations.

Signed-off-by: Ahmed Samir <engkhalil86@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-01 17:17:42 -04:00
Simon Glass f8bb696435 Drop command-processing code when CONFIG_CMDLINE is disabled
Command parsing and processing code is not needed when the command line is
disabled. Remove this code in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-01 17:17:40 -04:00
Bin Meng ce1a7d1564 debug_uart: Remove duplicated carriage return handling
Since commit b391d74 "debug_uart: output CR along with LF", the
handling in puts() is duplicated, not to mention that it should
output carriage return before line feed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-27 09:12:26 -04:00
Alexander Merkle dd8d8da3d7 Fix typo choosen in comments and printf logs
Minor change: chosen is written with one "o".
No code change here, only comment & printf.

Signed-off-by: Alexander Merkle <alexander.merkle@lauterbach.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-27 09:12:23 -04:00
Alexander Graf f8f58fbb09 lcd: Fix compile warning in 64bit mode
When compiling the code for 64bit, the lcd code emits warnings because it
tries to cast pointers to 32bit values. Fix it by casting them to longs
instead, actually properly aligning with the function prototype.

Signed-off-by: Alexander Graf <agraf@suse.de>
2016-03-27 09:12:17 -04:00
Tom Rini b5b84be8a7 Merge branch 'master' of http://git.denx.de/u-boot-sunxi 2016-03-23 18:35:11 -04:00
Hans de Goede 8f10b5c656 spl: Print from which mmc slot spl is trying to boot
On some sunxi boards (and presumably also non sunxi boards) u-boot can
be either loaded from a sdcard in a micro-sd slot, or from eMMC.

Print which MMC spl tries to boot from, to help debugging.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-23 22:04:13 +01:00
Masahiro Yamada 4976f48275 spl_mmc: allow to load raw image
The function spl_parse_image_header() falls back to a raw image
if the U-Boot header is missing and CONFIG_SPL_PANIC_ON_RAW_IMAGE
is undefined.  While, mmc_load_image_raw_sector() only accepts a
U-Boot legacy image or an FIT image, preventing us from loading a
raw image.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-24 01:36:55 +09:00
Simon Glass b94fc8518e usb: Correct return value in usb_stor_info()
This should return 0 on success, not 1. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:28 -04:00
Vagrant Cascadian a6f70a3d14 Fix spelling of "transferred".
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:16 -04:00
Simon Glass 1872c67359 Allow command-line files to be dropped
These files do not need to be compiled when CONFIG_CMDLINE is disabled.
Update the Makefile to reflect this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:11 -04:00
Simon Glass 045e6f0d4f Panic when no command line processing can be performed
Normally board_run_command() will handle command processed. But if for some
reason it returns then we should panic to avoid further processing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:10 -04:00
Stefan Roese c998da0d67 usb: Change power-on / scanning timeout handling
This patch changes the USB port scanning procedure and timeout
handling in the following ways:

a)
The power-on delay in usb_hub_power_on() is now reduced to a value of
max(100ms, "hub->desc.bPwrOn2PwrGood * 2"). The code does not wait
using mdelay, instead usb_hub_power_on() will wait before querying
the device in the scanning loop later. The total timeout for this
hub, which is 1 second + "hub->desc.bPwrOn2PwrGood * 2" is calculated
and will be used in the following per-port scanning loop as the timeout
to detect active USB devices on this hub.

b)
Don't delay the minimum delay (for power to stabilize) in
usb_hub_power_on(). Instead skip querying these devices in the scannig
loop until the delay time is reached.

c)
The ports are now scanned in a quasi parallel way. The current code did
wait for each (unconnected) port to reach its timeout and only then
continue with the next port. This patch now changes this to scan all
ports of all USB hubs quasi simultaneously. For this, all ports are added
to a scanning list. This list is scanned until all ports are ready
by either a) reaching the connection timeout (calculated earlier), or
by b) detecting a USB device. This results in a faster USB scan time as
the recursive scanning of USB hubs connected to the hub that's currently
being scanned will start earlier.

One small functional change to the original code is, that ports with
overcurrent detection will now get rescanned multiple times
(PORT_OVERCURRENT_MAX_SCAN_COUNT).

Without this patch:
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 20.163 seconds

With this patch:
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 1.822 seconds

So ~18.3 seconds of USB scanning time reduction.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-20 18:00:45 +01:00
Stefan Roese 3ed9eb93c2 usb: Don't reset the USB hub a 2nd time
Debugging has shown, that all USB hubs are being reset twice while
USB scanning. This introduces additional delays and makes USB scanning
even more slow. Testing has shown that this 2nd USB hub reset doesn't
seem to be necessary.

This patch now removes this 2nd USB hub reset. Resulting in faster USB
scan time. Here the current numbers:

Without this patch:
=> time usb start
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 24.003 seconds

With this patch:
=> time usb start
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 20.392 seconds

So ~3.6 seconds of USB scanning time reduction.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Cc: Marek Vasut <marex@denx.de>
2016-03-20 18:00:45 +01:00
Stefan Roese 2ef117fe4f usb: Remove 200 ms delay in usb_hub_port_connect_change()
This patch removes 2 mdelay(200) calls from usb_hub_port_connect_change().
These delays don't seem to be necessary. At least not in my tests. Here
the number for a custom x86 Bay Trail board (not in mainline yet) with
a quite large and complex USB hub infrastructure.

Without this patch:
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 28.415 seconds

With this patch:
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 9 USB Device(s) found

time: 24.003 seconds

So ~4.5 seconds of USB scanning time reduction.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Cc: Marek Vasut <marex@denx.de>
2016-03-20 18:00:44 +01:00
Stefan Roese f7f601002d usb: legacy_hub_port_reset(): Speedup hub reset handling
Start with a short USB hub reset delay of 20ms. This can be enough for
some configurations.

The 2nd delay at the end of the loop is completely removed. Since the
delay hasn't been long enough, a longer delay time of 200ms is assigned
and will be used in the next loop round.

This hub reset handling is also used in the v4.4 Linux USB driver,
hub_port_reset().

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Cc: Marek Vasut <marex@denx.de>
2016-03-20 18:00:44 +01:00
Przemyslaw Marczak 4428f3c87a Revert "fdt: fix address cell count checking in fdt_translate_address()"
This reverts commit 71105f50fe.

The reverted commit was applied for a temporary to unbreak
few Exynos boards on the release.

After the discussion about the change, this commit should be avoided.
Fixed device-tree for Exynos, allows reverting it without any issues.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2016-03-17 21:27:39 -06:00
Simon Glass e4d6ab0c2c x86: Allow use of serial soon after relocation
At present on x86 machines with use cache-as-RAM, the memory goes away just
before board_init_r() is called. This means that serial drivers are
no-longer unavailable, until initr_dm() it called, etc.

Any attempt to use printf() within this period will cause a hang.

To fix this, mark the serial devices as 'unavailable' when it is no-longer
available. Bring it back when serial_initialize() is called. This means that
the debug UART will be used instead for this period.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:24 +08:00
Simon Glass d74d6b444c dm: timer: Correct timer init ordering after relocation
Commit 1057e6c broke use of the timer with driver model. If the timer is used
before relocation, then it becomes broken after relocation. This prevents
some x86 boards from booting. Fix it.

Fixes: 1057e6c (timer: Set up the real timer after driver model is available)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:24 +08:00
Simon Glass 9a01cca750 malloc_simple: Add a little more debugging
Output the pointer returned by each call to malloc(). This can be useful
when debugging memory problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:23 +08:00
Masahiro Yamada 70e6428d8c spl_nor: fix warning when compiled for 64bit target
Fix "warning: cast to pointer from integer of different size".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-15 21:30:20 -04:00
Alexander Graf dea2174d9d efi_loader: Call fdt preparation functions
We have a nice framework around image fils to prepare a device tree
for OS execution. That one patches in missing device tree nodes and
fixes up the memory range bits.

We need to call that one from the EFI boot path too to get all those
nice fixups. This patch adds the call.

Signed-off-by: Alexander Graf <agraf@suse.de>
2016-03-15 21:30:14 -04:00
Alexander Graf 5d00995c36 efi_loader: Implement memory allocation and map
The EFI loader needs to maintain views of memory - general system memory
windows as well as used locations inside those and potential runtime service
MMIO windows.

To manage all of these, add a few helpers that maintain an internal
representation of the map the similar to how the EFI API later on reports
it to the application.

For allocations, the scheme is very simple. We basically allow allocations
to replace chunks of previously done maps, so that a new LOADER_DATA
allocation for example can remove a piece of the RAM map. When no specific
address is given, we just take the highest possible address in the lowest
RAM map that fits the allocation size.

Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Simon Glass <sjg@chromium.org>
2016-03-15 21:30:10 -04:00
Alexander Graf 50149ea37a efi_loader: Add runtime services
After booting has finished, EFI allows firmware to still interact with the OS
using the "runtime services". These callbacks live in a separate address space,
since they are available long after U-Boot has been overwritten by the OS.

This patch adds enough framework for arbitrary code inside of U-Boot to become
a runtime service with the right section attributes set. For now, we don't make
use of it yet though.

We could maybe in the future map U-boot environment variables to EFI variables
here.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-03-15 18:03:10 -04:00
Tom Rini 88033d737d Merge git://git.denx.de/u-boot-dm 2016-03-14 19:21:44 -04:00
Stefan Roese ecb57f69b2 lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value
The original name of this function is unclear. This patch renames this
CRC16 function to crc16_ccitt() matching its name with its
implementation.

To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-14 19:18:42 -04:00
York Sun c1913cb789 common: image-fit: Fix load and entry addresses in FIT image
FIT image supports more than 32 bits in addresses by using #address-cell
field. Fixing 64-bit support by using this field.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:41 -04:00
York Sun 6004765d14 common: image-fit: Use a common function to get address
FIT image supports load address and entry address. Getting these
addresses can use a common function.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:40 -04:00
Simon Glass 96debd1f0b spl: Support loading a FIT from MMC
Detect a FIT when loading from MMC and handle it using the new FIT SPL
support.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:31 -04:00
Simon Glass f1dcee59a2 spl: Add an option to load a FIT containing U-Boot
This provides a way to load a FIT containing U-Boot and a selection of device
tree files. The board can select the correct device tree by probing the
hardware. Then U-Boot is started with the selected device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:30 -04:00