summaryrefslogtreecommitdiffstats
path: root/common/board_r.c
Commit message (Collapse)AuthorAgeFilesLines
* common: board_r: make local functions staticJeroen Hofstee2014-10-251-4/+4
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* common: board: use __weakJeroen Hofstee2014-10-241-8/+2
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* dm: Remove spi_init() from board_r.c when using driver modelSimon Glass2014-10-221-1/+1
| | | | | | | | | | | Driver model does its own init, so we don't need this. There is still a call in board_f.c but it is only enabled by CONFIG_HARD_SPI. It is easy enough to disable that option when converting boards which use it to driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* common/board_r: remove warning in initr_mem for 64-bit phys_size_tValentin Longchamp2014-10-101-1/+1
| | | | | | | | Since on powerpc phys_size_t can be unsigned long long, this printout line can result in a not nice compile warning. Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Acked-by: Simon Glass <sjg@chromium.org>
* common/board_r: Fix booting issue on T4240QDSYork Sun2014-10-101-3/+3
| | | | | | | | | | | | | | | | | Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation. This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS. Signed-off-by: York Sun <yorksun@freescale.com> CC: Scott Wood <scottwood@freescale.com> CC: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-dmTom Rini2014-09-131-8/+11
|\
| * dm: Make driver model available before board_init()Simon Glass2014-09-101-13/+11
| | | | | | | | | | | | | | | | | | | | | | For some boards board_init() will change GPIOs, so we need to have driver model available before then. Adjust the board init to arrange this, but enable it for driver model only, just to be safe. This does create additional #ifdef logic, but it is safer than trying to make a pervasive change which may cause some boards to break. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Set up stdio earlier when using driver modelSimon Glass2014-09-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Since driver model registers itself with the stdio subsystem, and we want to avoid delayed registration and other complexity associated with the current serial console, move the stdio subsystem init earlier when driver model is used for serial. This simplifies the implementation. Should there be any problems with this approach they can be dealt with as boards are converted over to use driver model for serial. Signed-off-by: Simon Glass <sjg@chromium.org>
* | board_r: ARM[64] do not set gd againJeroen Hofstee2014-09-091-1/+1
|/ | | | | | | | | For ARM / ARM64 the relocation routines already updated gd to the new value. Don't set it again. This allows compilation with clang as it cannot update gd directly. cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* nios2: add generic board supportThomas Chou2014-08-241-1/+1
| | | | | | | | | This patch implements the generic board init as described in doc/README.generic-board. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Scott McNutt <smcnutt@psyent.com> Reviewed-by: Stefan Roese <sr@denx.de>
* board_r: Add missing return to initr_docIan Campbell2014-08-091-0/+1
| | | | | | | | I happened to spot this while working in the area. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org>
* dm: Support driver model prior to relocationSimon Glass2014-07-231-21/+4
| | | | | | | Initialise devices marked 'pre-reloc' and make them available prior to relocation. Note that this requires pre-reloc malloc() to be available. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Allow drivers to be marked 'before relocation'Simon Glass2014-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Driver model currently only operates after relocation is complete. In this state U-Boot typically has a small amount of memory available. In adding support for driver model prior to relocation we must try to use as little memory as possible. In addition, on some machines the memory has not be inited and/or the CPU is not running at full speed or the data cache is off. These can reduce execution performance, so the less initialisation that is done before relocation the better. An immediately-obvious improvement is to only initialise drivers which are actually going to be used before relocation. On many boards the only such driver is a serial UART, so this provides a very large potential benefit. Allow drivers to mark themselves as 'pre-reloc' which means that they will be initialised prior to relocation. This can be done either with a driver flag or with a 'dm,pre-reloc' device tree property. To support this, the various dm scanning function now take a 'pre_reloc_only' parameter which indicates that only drivers marked pre-reloc should be bound. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add a simple malloc() implementation for pre-relocationSimon Glass2014-07-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are to have driver model before relocation we need to support some way of calling memory allocation routines. The standard malloc() is pretty complicated: 1. It uses some BSS memory for its state, and BSS is not available before relocation 2. It supports algorithms for reducing memory fragmentation and improving performace of free(). Before relocation we could happily just not support free(). 3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since this has been loaded anyway this is not really a problem. The simplest way to support pre-relocation malloc() is to reserve an area of memory and allocate it in increasing blocks as needed. This implementation does this. To enable it, you need to define the size of the malloc() pool as described in the README. It will be located above the pre-relocation stack on supported architectures. Note that this implementation is only useful on machines which have some memory available before dram_init() is called - this includes those that do no DRAM init (like tegra) and those that do it in SPL (quite a few boards). Enabling driver model preior to relocation for the rest of the boards is left for a later exercise. Signed-off-by: Simon Glass <sjg@chromium.org>
* board_r: run scsi init() on ARM tooIan Campbell2014-07-221-4/+1
| | | | | | | | | | | | | | | | | This has been disabled for ARM in initr_scsi since that function was introduced. However it works fine for me on Cubieboard and Cubietruck (with the upcoming AHCI glue patch). I also tested on two random ARM platforms which seem to define CONFIG_CMD_SCSI: - highbank worked fine (on midway hardware) - omap5_uevm built OK and I confirmed using objdump that things were as expected (i.e. the default weak scsi_init nop was used). While there remove the mismatched comment from the #endif (omitting the comment seems to be the prevailing style in this file). Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Simon Glass <sjg@chromium.org>
* m68k: powerpc: Clean up do_mdm_initSimon Glass2014-05-291-14/+0
| | | | | | | | This code seems unnecessarily complex. We really just need to check the global_data. Now that is it all in one place, and not arch-specific, this is pretty easy. Signed-off-by: Simon Glass <sjg@chromium.org>
* board_r: return 0 from show_model_rPaul Burton2014-04-181-0/+1
| | | | | | | | | | | | | | The show_model_r function should return an int but didn't. Return 0 to indicate inevitable success and avoid the following if it is used: common/board_r.c: In function 'show_model_r': common/board_r.c:531:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: Set up driver model after relocationSimon Glass2014-03-041-0/+33
| | | | | | | | Make driver model available after relocation, by setting up data structures and scanning for devices using compiled-in platform_data and (when available) the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm: remove unneeded symbol offsets and _TEXT_BASEAlbert ARIBAUD2014-02-261-2/+2
| | | | | | | | Remove the last uses of symbol offsets in ARM U-Boot. Remove some needless uses of _TEXT_BASE. Remove all _TEXT_BASE definitions. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* board_r - fixup functions table after relocationAlexey Brodkin2014-01-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | This is only required for "PIC" relocation and doesn't apply to modern "PIE" relocation which does data relocation as well as code. "init_sequence_r" is just an array that consists of compile-time adresses of init functions. Since this is basically an array of integers (pointers to "void" to be more precise) it won't be modified during relocation - it will be just copied to new location as it is. As a consequence on execution after relocation "initcall_run_list" will be jumping to pre-relocation addresses. As long as we don't overwrite pre-relocation memory area init calls are executed correctly. But still it is dangerous because after relocation we don't expect initially used memory to stay untouched. Cc: Tom Rini <trini@ti.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Doug Anderson <dianders@chromium.org> Cc: Thomas Langer <thomas.langer@lantiq.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Add trace support to generic boardSimon Glass2013-06-261-0/+11
| | | | | | | | | | | Add hooks for tracing to generic board, including: - allow early tracing to start early as possible in U-Boot - reserve memory for trace buffer - copy early trace buffer to main trace buffer after relocation - setup full tracing support after relocation Signed-off-by: Simon Glass <sjg@chromium.org>
* generic_board: reduce the redundancy of gd_t struct membersMasahiro Yamada2013-06-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | This commit refactors common/board_f.c and common/board_r.c in order to delete the dest_addr and dest_addr_sp from gd_t struct. As mentioned as follows in include/asm-generic/global_data.h, /* TODO: is this the same as relocaddr, or something else? */ unsigned long dest_addr; /* Post-relocation address of U-Boot */ dest_addr is the same as relocaddr. Likewise, dest_addr_sp is the same as start_addr_sp. It seemed dest_addr/dest_addr_sp was used only as a scratch variable to calculate relocaddr/start_addr_sp, respectively. With a little refactoring, we can delete dest_addr and dest_addr_sp. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org>
* Call bootstage_relocate() after malloc is inittedDoug Anderson2013-05-131-0/+1
| | | | | | | | | In a previous CL we added the bootstage_relocate(), which should be called after malloc is initted. Now we call it on generic board. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* sandbox: Switch over to generic boardSimon Glass2013-05-011-2/+6
| | | | | | | | | Add generic board support for sandbox. and remove the old board init code. Select CONFIG_SYS_GENERIC_BOARD for sandbox now that this is supported. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* x86: Allow setup code to manage its own global dataSimon Glass2013-04-151-3/+0
| | | | | | | | | | | | Currently x86 has its own means of managing the global data and board data (bd_t), and this code resides in start.S. With generic board, we need to ensure that we leave this alone - i.e. don't clear it as we do on other archs. This fixes a problem where the memory init data is cleared which causes the video driver to operate very slowly. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: Enable generic board supportSimon Glass2013-03-151-0/+2
| | | | | | | This enables generic board support so that x86 boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: Adjust board_r.c for x86Simon Glass2013-03-151-2/+21
| | | | | | | For x86 the global_data is managed entirely by the start.S code so we do not need to touch it. However, we do have some more initcalls to add. Signed-off-by: Simon Glass <sjg@chromium.org>
* Adjust board_r.c for ppcSimon Glass2013-03-151-3/+477
| | | | | | This adds ppc features to the generic post-relocation board init. Signed-off-by: Simon Glass <sjg@chromium.org>
* Introduce generic post-relocation board_r.cSimon Glass2013-03-151-0/+422
This file handles common post-relocation init for boards which use the generic framework. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud