summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* part: Add support for list filtering on bootable partitionsSjoerd Simons2015-03-25-12/+41
| | | | | | | | Add an optional -bootable parameter to the part list commands to only put the list of bootable partitions in the environment variable Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* remove unnecessary version.h includesRob Herring2015-03-24-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various files are needlessly rebuilt every time due to the version and build time changing. As version.h is not actually needed, remove the include. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Stefano Babic <sbabic@denx.de> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Tom Warren <twarren@nvidia.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Macpaul Lin <macpaul@andestech.com> Cc: Wolfgang Denk <wd@denx.de> Cc: York Sun <yorksun@freescale.com> Cc: Stefan Roese <sr@denx.de> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Simon Glass <sjg@chromium.org> Cc: Philippe Reynes <tremyfr@yahoo.fr> Cc: Eric Jarrige <eric.jarrige@armadeus.org> Cc: "David Müller" <d.mueller@elsoft.ch> Cc: Phil Edworthy <phil.edworthy@renesas.com> Cc: Robert Baldyga <r.baldyga@samsung.com> Cc: Torsten Koschorrek <koschorrek@synertronixx.de> Cc: Anatolij Gustschin <agust@denx.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Łukasz Majewski <l.majewski@samsung.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2015-03-18-1/+2
|\
| * common/board_f.c: Enable IMX watchdog in init_func_watchdog_init()Stefan Roese2015-03-13-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the IMX watchdog will not be initialized. And therefor not active. This patch fixes this by calling hw_watchdog_init() also when CONFIG_IMX_WATCHDOG is defined. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
| * Merge branch 'master' of git://git.denx.de/u-bootStefano Babic2015-03-05-2/+99
| |\
* | \ Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini2015-03-10-0/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: README Signed-off-by: Tom Rini <trini@konsulko.com>
| * | | common: board: support systems with where RAM ends beyond 4GBStephen Warren2015-03-04-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some systems have so much RAM that the end of RAM is beyond 4GB. An example would be a Tegra124 system (where RAM starts at 2GB physical) that has more than 2GB of RAM. In this case, we can gd->ram_size to represent the actual RAM size, so that the actual RAM size is passed to the OS. This is useful if the OS implements LPAE, and can actually use the "extra" RAM. However, U-Boot does not implement LPAE and so must deal with 32-bit physical addresses. To this end, we enhance board_get_usable_ram_top() to detect the "over-sized" case, and limit the relocation addres so that it fits into 32-bits of physical address space. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | | | common: cmd_elf: Add support to disable start of applicationSiva Durga Prasad Paladugu2015-03-09-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support to disable the start of application by using a environment variable autostart Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | | | common/board_r: Restore non-cached memory setupJan Kiszka2015-03-09-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression of e310b93ec1, affecting Ethernet on the Jetson TK1, e.g. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | | | dlmalloc: do memset in malloc init as new default configPrzemyslaw Marczak2015-03-09-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces new config: CONFIG_SYS_MALLOC_CLEAR_ON_INIT. This config is an expert option and is enabled by default. The all amount of memory reserved for the malloc, is by default set to zero in mem_malloc_init(). When the malloc reserved memory exceeds few MiB, then the boot process can slow down. So disabling this config, is an expert option to reduce the boot time, and can be disabled by Kconfig. Note: After disable this option, only calloc() will return the pointer to the zeroed memory area. Previously, without this option, the memory pointed to untouched malloc memory region, was filled with zeros. So it means, that code with malloc() calls should be reexamined. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | | cmd_usb_mass_storage: Remove extra 'ums' string in the usage textFabio Estevam2015-03-05-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the usage text for the 'ums' command looks like this: Usage: ums ums <USB_controller> [<devtype>] <devnum> e.g. ums 0 mmc 0 ,so remove the extra 'ums' in the text. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Marek Vasut <marex@denx.de>
* | | | common/board_f: implement type casting for gd structureAlexey Brodkin2015-03-05-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of global data structure defined as "register volatile" compiler throws an warning about incorrect type used: --->8--- common/board_f.c: In function "board_init_f_r": common/board_f.c:1073:2: warning: passing argument 1 of "&board_init_r +(sizetype)gd->reloc_off" discards "volatile" qualifier from pointer target type [enabled by default] (board_init_r + gd->reloc_off)(gd, gd->relocaddr); ^ common/board_f.c:1073:2: note: expected "struct gd_t *" but argument is of type "volatile struct gd_t *" --->8--- An obvious fix is manual casting to "gd_t *". Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
* | | | spl: fix calling "spl export .." more than onceHeiko Schocher2015-03-05-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | running "spl export ..." more than once fails with: Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order ERROR prep subcommand failed! Subcommand failed reason is commmit: 35fc84fa1f: Refactor the bootm command to reduce code duplication It used "state != BOOTM_STATE_START" but state is a bitfield, so check if the bit BOOTM_STATE_START is not set. With this fix, "spl export ..." can called more than once ... Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | | m68k: Add generic board support for MCF547X/8X and MCF5445XAlison Wang2015-03-05-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds generic board support for MCF547X/8X and MCF5445X. It is based on the patch about common generic board support for M68K architecture sent by Angelo. Signed-off-by: Alison Wang <alison.wang@freescale.com>
* | | | m68k: add generic-board supportangelo@sysam.it2015-03-05-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | Add generic-board support for the m68k architecture. Signed-off-by: Angelo Dureghello <angelo@sysam.it>
* | | | cmd_yaffs: Clean up command usage messagesPeter Tyser2015-03-05-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate command names in usage messages to fix issues such as: => help yls yls - yaffs ls Usage: yls yls [-l] dirname Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | common/lcd: Add command for writing to lcd-displayHannes Petermaier2015-03-05-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we do not want redirect u-boot's console to screen but anyway we want write out some status information out of a u-boot script to the display. So we cannot use the normal "echo ....", instead we write explicitly using "lcdputs ..." for writing to the actual cursor position on LCD. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
* | | | common/lcd: Add command for setting cursor within lcd-consoleHannes Petermaier2015-03-05-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we do not want redirect u-boot's console to screen but anyway we want write out some status information out of a u-boot script to the display. To define the specific position of the string to be written, we have to set the cursor with "setcurs" before writing. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
* | | | gpt: support random UUIDs without setting environment variablesRob Herring2015-03-05-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, an environment variable must be used to store the randomly generated UUID for each partition. This is not necessary, so make storing the UUID optional. Now passing uuid_disk and uuid are optional when random UUIDs are enabled. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
* | | | gpt: fix error reporting on partition table write failuresRob Herring2015-03-05-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gpt command always reports success even if writing the partition table failed. Propagate the return value of gpt_restore so we get proper status reported. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Przemyslaw Marczak <p.marczak@samsung.com>
* | | | kconfig: common: Fix memtest bool nameNikolaos Pasaloukos2015-03-05-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the name appearing in menuconfig for memtest command Signed-off-by: Nikolaos Pasaloukos <Nikolaos.Pasaloukos@imgtec.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com
* | | | Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2015-03-05-0/+6
|\ \ \ \ | | |/ / | |/| / | |_|/ |/| |
| * | Merge branch 'master' of git://git.denx.de/u-bootStefano Babic2015-03-02-101/+177
| |\ \
| * | | cmd_eeprom: make it possible to define the used i2c busChristian Gmeiner2015-02-17-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A SoC like the i.MX6 supports more then one i2c bus. In oder to be able to use the eeprom command add a new define to specify the i2c bus to use. If CONFIG_SYS_I2C_EEPROM_BUS is not defined there is no functional change, else a call to i2c_set_bus_num(..) is done before calling i2c_read(..) and i2c_write(..). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Stefano Babic <sbabic@denx.de>
* | | | arm: spl: Allow board_init_r() to run with a larger stackSimon Glass2015-03-04-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present SPL uses a single stack, either CONFIG_SPL_STACK or CONFIG_SYS_INIT_SP_ADDR. Since some SPL features (such as MMC and environment) require a lot of stack, some boards set CONFIG_SPL_STACK to point into SDRAM. They then set up SDRAM very early, before board_init_f(), so that the larger stack can be used. This is an abuse of lowlevel_init(). That function should only be used for essential start-up code which cannot be delayed. An example of a valid use is when only part of the SPL code is visible/executable, and the SoC must be set up so that board_init_f() can be reached. It should not be used for SDRAM init, console init, etc. Add a CONFIG_SPL_STACK_R option, which allows the stack to be moved to a new address before board_init_r() is called in SPL. The expected SPL flow (for CONFIG_SPL_FRAMEWORK) is documented in the README. Signed-off-by: Simon Glass <sjg@chromium.org> For version 1: Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Bo Shen <voice.shen@atmel.com> Acked-by: Bo Shen <voice.shen@atmel.com> Acked-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
* | | | Merge git://git.denx.de/u-boot-usbTom Rini2015-03-02-2/+64
|\ \ \ \ | |_|/ / |/| | |
| * | | fastboot: Correct fastboot_fail and fastboot_okay stringsDileep Katta2015-02-25-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the string is copied without NULL termination using strncpy(), then strncat() on the next line, may concatenate the string after some stale (or random) data, if the response string was not zero-initialized. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Steve Rae <srae@broadcom.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
| * | | fastboot: Add USB cable detect checkRob Herring2015-02-25-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a check for USB cable attached and only enter fastboot when a cable is attached. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Steve Rae <srae@broadcom.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
| * | | usb: gadget: fastboot: Add fastboot eraseDileep Katta2015-02-25-0/+56
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the fastboot erase functionality, to erase a partition specified by name. The erase is performed based on erase group size, to avoid erasing other partitions. The start address and the size is aligned to the erase group size for this. Currently only supports erasing from eMMC. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriqTom Rini2015-02-25-8/+20
|\ \ \
| * | | crypto/fsl - Add progressive hashing support using hardware acceleration.gaurav rana2015-02-25-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only normal hashing is supported using hardware acceleration. Added support for progressive hashing using hardware. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com> CC: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <yorksun@freescale.com>
| * | | crypto/fsl: Make function names consistent for blob encapsulation/decapsulation.gaurav rana2015-02-25-8/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does the following: 1. The function names for encapsulation and decapsulation were inconsitent in freescale's implementation and cmd_blob file. This patch corrects the issues. 2. The function protopye is also modified to change the length parameter from u8 to u32 to allow encapsulation and decapsulation of larger images. 3. Modified the description of km paramter in the command usage for better readability. Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com> Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
* | | kconfig: remove unneeded dependency on !SPL_BUILDMasahiro Yamada2015-02-24-1/+0
|/ / | | | | | | | | | | | | Now CONFIG_SPL_BUILD is not defined in Kconfig, so "!depends on SPL_BUILD" and "if !SPL_BUILD" are redundant. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | mmc: Implement SD/MMC versioning properlyPantelis Antoniou2015-02-23-2/+6
| | | | | | | | | | | | | | | | | | | | | | The SD/MMC version scheme was buggy when dealing with standard major.minor.change cases. Fix it by using something similar to the linux's kernel versioning method. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Reported-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* | cmd_i2c: Provide option for bulk 'i2c write' in one transactionLubomir Popov2015-02-19-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices. This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if the '-s' option is specified as a final command argument. Else the current re-addressing method is used. Signed-off-by: Lubomir Popov <l-popov@ti.com> hs: adapt to CONFIG_DM_I2C
* | cmd_i2c: quit I2C commands immediately on errorMasahiro Yamada2015-02-19-13/+13
| | | | | | | | | | | | | | | | | | | | | | If the i2c driver returns an error status, error out immediately. Continuing the loop just results in printing error messages again and again. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-fdtTom Rini2015-02-18-7/+7
|\ \
| * | cmd_fdt: Print the control fdt in terms of virtual memoryJoe Hershberger2015-02-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you want to inspect the control device tree using the fdt command, the "fdt address -c" command previously unhelpfully printed the phys memory address of the device tree. That address could not then be used to set the fdt address for inspection. Changed the resulting print to one that can be copied directly to the 'fdt address <addr>' command. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
| * | cmd_fdt: Actually fix fdt command in sandboxJoe Hershberger2015-02-17-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 90bac29a76bc8d649b41a55f2786c0abef9bb2c1 claims to fix this bug that was introduced in commit a92fd6577ea17751ead9b50243e3c562125cf581 but doesn't actually make the change that the commit message describes. Actually fix the bug this time. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* | | Merge branch 'master' of git://git.denx.de/u-boot-avr32Tom Rini2015-02-17-41/+37
|\ \ \
| * | | avr32: add generic board supportAndreas Bießmann2015-02-17-6/+13
| | | | | | | | | | | | | | | | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| * | | common/board_r: allocate bootparamsAndreas Bießmann2015-02-17-0/+15
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | common/board_f: factor out reserve_stacksAndreas Bießmann2015-02-17-35/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | Introduce arch_reserve_stacks() to tailor gd->start_addr_sp and gd->irq_sp to the architecture needs. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini2015-02-17-0/+5
|\ \ \
| * | | arm: spl: Provide for a board-specific loaderSimon Glass2015-02-16-0/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some boards have a special way of loading U-Boot that does not fit with the existing SPL code. For example sunxi uses an 'FEL' mode where U-Boot is loaded over USB. Add a CONFIG option and boot mode for this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | | spl, spl_nor: fix compiler warningHeiko Schocher2015-02-16-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | executing "tools/buildman/buildman mpc5xx" drops this warning: common/spl/spl_nor.c: In function 'spl_nor_load_image': common/spl/spl_nor.c:26:10: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] fix this. Signed-off-by: Heiko Schocher <hs@denx.de>
* | | image: Convert to use fdt_for_each_subnode macroAxel Lin2015-02-16-15/+5
| |/ |/| | | | | | | | | | | Use fdt_for_each_subnode macro to simplify the code a bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: Add CMD_DM and CMD_DEMO to KconfigSimon Glass2015-02-12-0/+23
| | | | | | | | | | | | | | Add Kconfig settings for these two options. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | dm: i2c: Add a dm_ prefix to driver model bus speed functionsSimon Glass2015-02-12-2/+2
| | | | | | | | | | | | | | | | As with i2c_read() and i2c_write(), add a dm_ prefix to the driver model versions of these functions to avoid conflicts. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
* | Introduce board_init_f_mem() to handle early memory layoutSimon Glass2015-02-12-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present on some architectures we set up the following before calling board_init_f(): - global_data - stack - early malloc memory Adding the code to support early malloc and global data setup to every arch's assembler start-up is a pain. Also this code is not actually architecture-specific. We can use common code for all architectures and with a bit of care we can write this code in C. Add a new function to deal with this. It should be called after memory is available, with a pointer to the top of the area that should be used before relocation. The function will set things up and return the lowest memory address that it allocated/used. That can then be set as the top of the stack. Note that on some archs this function will use the stack, so the stack pointer should be set to same value as is pased to board_init_f_mem(). A margin of 128 bytes will be left for this stack, so that it is not overwritten. This means that 64 bytes is wasted by this early call. This is not strictly necessary on several more modern archs, so we could remove this at the cost of some arch-dependent code. With this function there is no-longer any need for the assembler code to zero global_data or set up the early malloc pointers. Signed-off-by: Simon Glass <sjg@chromium.org>