summaryrefslogtreecommitdiffstats
path: root/common/board_f.c
Commit message (Collapse)AuthorAgeFilesLines
* NDS32: Generic Board Support and UnsupportKun-Hua Huang2015-08-281-2/+6
| | | | | | Add nds32 ag101p generic board support. Signed-off-by: Kun-Hua Huang <kunhua@andestech.com>
* x86: fsp: Delay x86_fsp_init() call a little bitBin Meng2015-08-261-3/+3
| | | | | | | | Move x86_fsp_init() call after initf_malloc() so that we can fix up the gd->malloc_limit later. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* Revert "Align global_data to a 16-byte boundary"Simon Glass2015-08-171-1/+0
| | | | | | | | | | This causes widespread breakage due to the operation of the low-level code in crt0.S and cro0_64.S for ARM at least. The fix is not complicated but it seems safer to revert this for now. This reverts commit 2afddae07523f23f77acd066ad1719f53d289f98. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: Switch to using generic global_data setupSimon Glass2015-08-141-1/+2
| | | | | | | | | | | There is quite a bit of assembler code that can be removed if we use the generic global_data setup. Less arch-specific code makes it easier to add new features and maintain the start-up code. Drop the unneeded code and adjust the hooks in board_f.c to cope. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Allow arch-specific setting of global_data in board_init_f_mem()Simon Glass2015-08-141-2/+11
| | | | | | | | | | | | | At present we have a simple assignment to gd. With some archs this is implemented as a register or through some other means; a simple assignment does not suit in all cases. Change this to a function and add documentation to describe how this all works. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <yorksun@freescale.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Align global_data to a 16-byte boundarySimon Glass2015-08-141-0/+1
| | | | | | | | Some archs like to have larger alignment for their global data. Use 16 bytes which suits all current archs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* common: Display >=4GiB memory bank sizeBin Meng2015-08-141-1/+2
| | | | | | | | bd->bi_dram[] has both start address and size defined as 32-bit, which is not the case on some platforms where >=4GiB memory bank is used. Change them to support such memory banks. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* Add a way to skip relocationSimon Glass2015-08-051-0/+9
| | | | | | | | | | | When running U-Boot as an EFI application we cannot relocate since we do not have relocation information. U-Boot has already been relocated to a suitable address. Add a global_data flag to control skipping relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* efi: Avoid using non-existent text baseBen Stoltz2015-08-051-3/+4
| | | | | | | | | | | | | When U-Boot runs as an EFI application is does not have a definition of CONFIG_SYS_TEXT_BASE. U-Boot is a relocatable application and the relocation is done by EFI. U-Boot can be loaded at any address. This is similar to how sandbox works. Adjust the early board init to deal with this. Signed-off-by: Ben Stoltz <stoltz@google.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: fsp: Move FspInitEntry call to board_init_f()Bin Meng2015-07-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The call to FspInitEntry is done in arch/x86/lib/fsp/fsp_car.S so far. It worked pretty well but looks not that good. Apart from doing too much work than just enabling CAR, it cannot read the configuration data from device tree at that time. Now we want to move it a little bit later as part of init_sequence_f[] being called by board_init_f(). This way it looks and works better in the U-Boot initialization path. Due to FSP's design, after calling FspInitEntry it will not return to its caller, instead it jumps to a continuation function which is given by bootloader with a new stack in system memory. The original stack in the CAR is gone, but its content is perserved by FSP and described by a bootloader temporary memory HOB. Technically we can recover anything we had before in the previous stack, but that is way too complicated. To make life much easier, in the FSP continuation routine we just simply call fsp_init_done() and jump back to car_init_ret() to redo the whole board_init_f() initialization, but this time with a non-zero HOB list pointer saved in U-Boot's global data so that we can bypass the FspInitEntry for the second time. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Tested-by: Simon Glass <sjg@chromium.org>
* Fix comment nits in board_f.cSimon Glass2015-04-291-5/+4
| | | | | | | Try to make it a little clearer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Move initf_malloc() to a common placeSimon Glass2015-04-231-11/+1
| | | | | | | To allow this function to be used from SPL, move it to the malloc() code. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Rename setup_fdt() and make it prepare alsoSimon Glass2015-04-231-4/+1
| | | | | | | There is little reason to split these two functions. Bring them together which simplifies the init sequence. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: sandbox: Move setup code from board_f to fdtdecSimon Glass2015-04-231-65/+2
| | | | | | | We want to be able to set up the device tree in SPL, so move this code to a common place. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Make sure arch-specific map_sysmem() is definedJoe Hershberger2015-04-181-0/+1
| | | | | | | | | | | In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: Add a new CPU init function which can use driver modelSimon Glass2015-04-161-0/+6
| | | | | | | | | | | Since driver model is set up after arch_cpu_init(), that function cannot use drivers. Add a new arch_cpu_init_dm() function which is called immediately after driver model is ready, and can reference devices. This can be used to probe essential devices for the CPU. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* arc: clean-up init procedureAlexey Brodkin2015-04-031-4/+4
| | | | | | | | | | | | | | | | Intention behind this work was elimination of as much assembly-written code as it is possible. In case of ARC we already have relocation fix-up implemented in C so why don't we use C for U-Boot copying, .bss zeroing etc. It turned out x86 uses pretty similar approach so we re-used parts of code in "board_f.c" initially implemented for x86. Now assembly usage during init is limited to stack- and frame-pointer setup before and after relocation. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org>
* m68k: fix 3 broken boardsangelo@sysam.it2015-03-281-2/+2
| | | | | | | | | | | Fix eb_cpu5282 and eb_cpu5282_internal unresolved external error. These boards have video but don't need any ppc related video_setmem(). Fix M53017EVB moving away embedded env to a different offset, as in M52277EVB. Signed-off-by: Angelo Dureghello <angelo@sysam.it>
* common/board_f: move board_init_f_mem() from #else CONFIG_X86Alexey Brodkin2015-03-281-2/+4
| | | | | | | | | | | | | | | | | | | | Purpose of this change is to make it possible to re-use code currently used on X86 solely for other architectures. For example: * init_sequence_f_r * board_init_f_r Even though board_init_f_mem() has nothing to do with any particular architecture it won't work (at least in current implementation) for X86. This is because on X86 "gd" is an alias to function get_fs_gd_ptr(), thus we cannot assign anything to it. So this change separates selection of board_init_f_mem() from X86 while keeping it disabled for X86 still. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2015-03-181-1/+2
|\
| * common/board_f.c: Enable IMX watchdog in init_func_watchdog_init()Stefan Roese2015-03-131-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-boot-tegraTom Rini2015-03-101-0/+12
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: README Signed-off-by: Tom Rini <trini@konsulko.com>
| * | common: board: support systems with where RAM ends beyond 4GBStephen Warren2015-03-041-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/board_f: implement type casting for gd structureAlexey Brodkin2015-03-051-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>
* | m68k: Add generic board support for MCF547X/8X and MCF5445XAlison Wang2015-03-051-0/+8
| | | | | | | | | | | | | | | | 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-051-6/+16
|/ | | | | | Add generic-board support for the m68k architecture. Signed-off-by: Angelo Dureghello <angelo@sysam.it>
* avr32: add generic board supportAndreas Bießmann2015-02-171-1/+1
| | | | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
* common/board_f: factor out reserve_stacksAndreas Bießmann2015-02-171-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>
* Introduce board_init_f_mem() to handle early memory layoutSimon Glass2015-02-121-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>
* Merge branch 'master' of git://git.denx.de/u-boot-atmelTom Rini2015-02-101-1/+1
|\
| * common/board_f: add at91 wdtHeiko Schocher2015-02-071-1/+1
| | | | | | | | | | | | | | | | call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG is used. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | microblaze: Move architecture to use generic board initMichal Simek2015-02-091-2/+2
|/ | | | | | | Compile code with -fPIC to get GOT. Do not build SPL with fPIC because it increasing SPL size for nothing. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* generic-board: show model name in board_init_f() tooMasahiro Yamada2015-01-291-1/+1
| | | | | | | | | | | | | The common/board_r.c has show_model_r() to display the model name if the DTB has a "model" property. It sounds useful to have a similar function in common/board_f.c too because most of the boards show their board name before relocation. Instead of implementing the same function in both common/board_f.c and common/board_r.c, let's split it up into common/show_board_info.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* Allow architecture-specific memory reservationSimon Glass2015-01-241-0/+7
| | | | | | | All memory to be reserved for use after relocation by adding a new call to perform this reservation. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: board_f: Adjust x86 boot order for performanceSimon Glass2015-01-131-3/+5
| | | | | | | | For bare platforms we turn off ROM-caching before calling board_init_f_r() It is then very slow to copy U-Boot from ROM to RAM. So adjust the order so that the copying happens before we turn off ROM-caching. Signed-off-by: Simon Glass <sjg@chromium.org>
* common/board_f.c: fix compile error when tracing disabledKevin Hilman2014-12-291-0/+2
| | | | | | | | | | | | When CONFIG_TRACE is disabled, linking fails with: common/built-in.o:(.data.init_sequence_f+0x8): undefined reference to `trace_early_init' To fix, wrap the call to trace_early_init() with #ifdef CONFIG_TRACE. Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
* Revert "common/board_f: add setup of initial stack frame for MIPS"Tom Rini2014-11-241-7/+1
| | | | | | | | | Daniel discovered a better solution to the problem this was solving, so don't do what this patch was doing anymore. This reverts commit 666ba8444e81c3785a427ae6922e2feededab9a3. Signed-off-by: Tom Rini <trini@ti.com>
* Merge git://git.denx.de/u-boot-x86Tom Rini2014-11-241-12/+2
|\ | | | | | | | | | | | | Conflicts: arch/x86/cpu/Makefile Signed-off-by: Tom Rini <trini@ti.com>
| * x86: Remove unnecessary find_fdt(), prepare_fdt() functionsSimon Glass2014-11-211-5/+0
| | | | | | | | | | | | | | These are no-longer needed so drop them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * Move early malloc() to before arch_cpu_init()Simon Glass2014-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | For some CPUs, having malloc() available very early is useful. There is no reason to delay this since early malloc is allocated before board_init_f() is called. Move early malloc() init nearer to the start of the init sequence. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Use the standard arch_cpu_init() functionSimon Glass2014-11-211-1/+0
| | | | | | | | | | | | | | | | Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one for this purpose. Also remove a useless/misleading comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * x86: Use the standard dram_init() functionSimon Glass2014-11-211-5/+1
| | | | | | | | | | | | | | | | Instead of having an x86-specific DRAM init function, adjust things so we can use the normal one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | sandbox: Prepare API change for files greater than 2GBSuriyan Ramasami2014-11-231-4/+4
| | | | | | | | | | | | | | | | Change the internal sandbox functions to use loff_t for file offsets. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* | common/board_f: fix gcc warning on MIPS64Daniel Schwierzeck2014-11-231-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | This fixes following warning when compiled with MIPS64 common/board_f.c: In function 'display_text_info': common/board_f.c:150:2: warning: format '%X' expects argument i of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat=] debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* | common/board_f: add setup of initial stack frame for MIPSDaniel Schwierzeck2014-11-231-1/+7
|/ | | | | | | The MIPS specific setup of the initial stack frame was not ported to generic board_f. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* common: board: use __weakJeroen Hofstee2014-10-241-8/+2
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=yMasahiro Yamada2014-09-161-4/+6
| | | | | | | | | gd->fdt_blob is used for FDT control of U-Boot. If CONFIG_OF_CONTROL is not defined, it is useless. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* common: fix include guards for CONFIG_MPGabriel Huau2014-09-161-2/+2
| | | | | | | | | | | | | This was breaking the build for some boards: MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500 Include only these features for some PPC boards if the configuration for MultiProcessor is enabled. Signed-off-by: Gabriel Huau <contact@huau-gabriel.fr> Cc: Tom Rini <trini@ti.com> Cc: York Sun <yorksun@freescale.com> Acked-by: York Sun <yorksun@freescale.com>
* dm: Move pre-reloc init earlier to cope with board_early_init_f()Simon Glass2014-09-101-2/+2
| | | | | | | | | In order to support GPIO access in board_early_init_f() we must set up driver model before this function is called. In any case, earlier is better since driver model is (or will become) a key function for most init. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2014-08-291-4/+4
|\
OpenPOWER on IntegriCloud