summaryrefslogtreecommitdiff
path: root/common/board_f.c
Commit message (Collapse)AuthorAgeLines
* x86: Do relocation before clearing BSSSimon Glass2017-02-06-1/+1
| | | | | | | | | | | | | The BSS region may overlap with relocations. If we clear BSS we will overwrite the start of the relocation area. This doesn't matter when running from SPI flash, since it is read-only. But when relocating 64-bit U-Boot from one place in RAM to another, relocation will fail because some of its relocations have been zeroed. To fix this, put the ELF fixup call before the BSS clearing call. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* board_f/r: Use static const for the init sequencesSimon Glass2017-02-06-2/+2
| | | | | | | | | | These tables should be declared static const. Unfortunately the table in board_r is updated on machines with manual relocation. Update them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: board_f: Update init sequence for 64-bit startupSimon Glass2017-02-06-3/+7
| | | | | | | | | Adjust the code so that 64-bit startup works. Since we don't need to do CAR changes in U-Boot proper anymore (they are done in SPL) we can simplify the flow and return normally from board_init_f(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Drop prt_mpc5xxx_clks() in favour of print_cpuinfo()Simon Glass2017-01-25-3/+0
| | | | | | | Rather than having an arch-specific function, use the existing generic one. Signed-off-by: Simon Glass <sjg@chromium.org>
* Drop the static inline print_cpuinfo()Simon Glass2017-01-25-0/+2
| | | | | | | This is only called from one place and the function cannot be inlined. Convert it to a normal function. Signed-off-by: Simon Glass <sjg@chromium.org>
* powerpc: Drop CONFIG_SYS_ALLOC_DPRAMSimon Glass2017-01-25-5/+0
| | | | | | This is not defined anywhere in U-Boot. Drop this dead code. Signed-off-by: Simon Glass <sjg@chromium.org>
* powerpc: Drop probecpu() in favour of arch_cpu_init()Simon Glass2017-01-25-4/+0
| | | | | | | To avoid an unnecessary arch-specific call in board_init_f(), rename this function. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: sh: add necessary define bits to board_fVladimir Zapolskiy2016-12-02-6/+9
| | | | | | | | | | Since a platform conversion to generic board support has not been accomplished some architecture specific bits are missing from board_f init sequence, the change adds a number of basic expected callbacks into early init sequence. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* board_f: Drop the extra fdtdec_prepare_fdt()Simon Glass2016-10-11-3/+0
| | | | | | | | This is already called earlier, from fdtdec_setup(), so drop this unnecessary call from the init sequence. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Various, accumulated typos collected from around the tree.Robert P. J. Day2016-10-06-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix various misspellings of: * deprecated * partition * preceding,preceded * preparation * its versus it's * export * existing * scenario * redundant * remaining * value * architecture Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Reviewed-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de>
* treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada2016-09-23-1/+1
| | | | | | | | | | | Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have the same content. (both just wrap <asm-generic/errno.h>) Replace all include directives for <asm/errno.h> with <linux/errno.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Fixup include/clk.] Signed-off-by: Tom Rini <trini@konsulko.com>
* board_f: Add a mach_cpu_init callbackPaul Burton2016-09-21-0/+6
| | | | | | | | | | | | | | | | Currently we have a mismash of architectures which use arch_cpu_init from architecture-wide code (arc, avr32, blackfin, mips, nios2, xtensa) and architectures which use arch_cpu_init from machine/SoC level code (arm, x86). In order to clean this mess up & allow for both use cases, introduce a new mach_cpu_init callback which is run immediately after arch_cpu_init. This will allow for architectures to have arch-wide code without needing individual machines to all implement their own arch_cpu_init with a call to some common function. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* xtensa: add support for the xtensa processor architecture [1/2]Chris Zankel2016-08-15-3/+9
| | | | | | | | | | | | | | The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Cadence. This is the first part of the basic architecture port with changes to common files. The 'arch/xtensa' directory, and boards and additional drivers will be in separate commits. Signed-off-by: Chris Zankel <chris@zankel.net> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2016-07-19-1/+10
|\ | | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: arch/arm/cpu/armv8/Makefile arch/arm/lib/bootm-fdt.c
| * armv8: Add tlb_allocated to arch global dataYork Sun2016-07-15-0/+9
| | | | | | | | | | | | | | | | | | When secure ram is used, MMU tables have to be put into secure ram. To use common MMU code, gd->arch.tlb_addr will be used to host TLB entry pointer. To save allocated memory for later use, tlb_allocated variable is added to global data structure. Signed-off-by: York Sun <york.sun@nxp.com>
| * armv8: Move secure_ram variable out of generic global dataYork Sun2016-07-15-1/+1
| | | | | | | | | | | | | | Secure_ram variable was put in generic global data. But only ARMv8 uses this variable. Move it to ARM specific data structure. Signed-off-by: York Sun <york.sun@nxp.com>
* | board_f: prevent misleading "Watchdog enabled" outputAnatolij Gustschin2016-07-14-1/+1
| | | | | | | | | | | | | | Output the "Watchdog enabled" message only if hw_watchdog_init() call really happened. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | board_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=yAnatolij Gustschin2016-07-14-0/+1
|/ | | | | | | The designware watchdog init is skipped even if CONFIG_DESIGNWARE_WATCHDOG is enabled. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* board_f: Don't require CONFIG_SYS_MONITOR_BASESimon Glass2016-05-27-1/+1
| | | | | | | Allow this to be unset, such that gd->mon_len is invalid. This seems to be what the sh architecture does. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: Allow use of serial soon after relocationSimon Glass2016-03-17-0/+7
| | | | | | | | | | | | | | | 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>
* timer: Set up the real timer after driver model is availableSimon Glass2016-02-26-0/+6
| | | | | | | | | When using the early timer, we need to manually trigger setting up the real timer. This will not happen automatically. Do this immediately after starting driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Remove unused CONFIG_MODEM_SUPPORT option and associated dead code.David Müller (ELSOFT AG)2016-02-08-3/+0
| | | | Signed-off-by: David Müller <d.mueller@elsoft.ch>
* dm: common: Add memory reservation for the video uclassSimon Glass2016-01-20-12/+35
| | | | | | | | | | | | | Before relocation we need to reserve memory for the video driver frame buffers so that they can use this memory when they start up (after relocation). Add a call to the uclass to permit this. The current top and bottom of the region is stored in global_data so that it can be checked post-relocation to ensure enough memory is available. No video device should be probed before relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* common: Move LCD and video memory reservation togetherSimon Glass2016-01-20-14/+14
| | | | | | | | These two functions are conceptually the same. Move them together in the pre-relocation init. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* common: Rewrite hiding the end of memoryYork Sun2015-12-15-8/+15
| | | | | | | | | | | As the name may be confusing, the CONFIG_SYS_MEM_TOP_HIDE reserves some memory from the end of ram, tracked by gd->ram_size. It is not always the top of u-boot visible memory. Rewrite the macro with a weak function to provide flexibility for complex calcuation. Legacy use of this macro is still supported. Signed-off-by: York Sun <yorksun@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Reserve secure memoryYork Sun2015-12-15-0/+9
| | | | | | | | | | | | | | | Secure memory is at the end of memory, separated and reserved from OS, tracked by gd->secure_ram. Secure memory can host MMU tables, security monitor, etc. This is different from PRAM used to reserve private memory. PRAM offers memory at the top of u-boot memory, not necessarily the real end of memory for systems with very large DDR. Using the end of memory simplifies MMU setup and avoid memory fragmentation. "bdinfo" command shows gd->secure_ram value if this memory is marked as secured. Signed-off-by: York Sun <yorksun@freescale.com>
* common: Remove timer_init() call for x86Bin Meng2015-12-09-1/+1
| | | | | | | | With driver model timer support, there should not be an explict call to timer_init(). Remove this call for x86. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* common: board: Dont relocate FDT incase of CONFIG_OF_EMBEDSiva Durga Prasad Paladugu2015-12-05-0/+4
| | | | | | | | | | | | | | | | Don't relocate fdt in case of CONFIG_OF EMBED as the fdt is already embedded with u-boot image. Update fdt_blob after relocation as the fdt will be copied during u-boot relocation. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> (QEMU x86) Tested-by: Thomas Chou <thomas@wytron.com.tw> (Nios2) Acked-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Simon Glass <sjg@chromium.org>
* sparc: Update PROM initialization code for generic boardFrancois Retief2015-12-03-0/+17
| | | | | | | | | | Fixed the prom_relocate() function in start.S file by reserving memory in the board_init_f sequence and saving the offset to the __prom_start_reloc variable. This value is used as the destination when relocating the PROM. Add the prom_init() function to the end of the board_init_r sequence. Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
* sparc: Update cpu_init.c to use generic timer infrastructureFrancois Retief2015-12-03-1/+2
| | | | | | | | | | | Introduce the CONFIG_SYS_TIMER_* macros in include/asm/config.h to make use of the generic timer infrastructure in lib/time.c. Created a timer_init() function to initialize the timer hardware and update the #ifdef in board_init_f to allow this function to be called during the start-up sequence. Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
* console: Add a console bufferSimon Glass2015-11-19-0/+10
| | | | | | | | | | | | | | | | | | | It is useful to be able to record console output and provide console input via a buffer. This provides sandbox with the ability to run a command and check its output. If the console is set to silent then no visible output is generated. This also provides a means to fix the problem where tests produce unwanted output, such as errors or warnings. This can be confusing. We can instead set the console to silent and record this output. It can be checked later in the test if required. It is possible that this may prove useful for non-test situations. For example the console output may be suppressed for normal operations, but recorded and stored for access by the OS. That feature is not implemented at present. Signed-off-by: Simon Glass <sjg@chromium.org>
* Move console definitions into a new console.h fileSimon Glass2015-11-19-0/+1
| | | | | | | | The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* common/board_f.c: move mark_bootstage after arch_cpu_init_dmThomas Chou2015-11-19-1/+1
| | | | | | | | | As mark_bootstage() uses timer, it should go after driver model is initialized. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: Move timer_init() call a bit earlierBin Meng2015-11-13-1/+1
| | | | | | | | | | Currently timer_init() is called in board_r.c which is quite late. Some vgabios execution requires we set up the i8254 timer correctly, but video initialization comes before timer_init(). Move the call to board_f.c. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* common: Simplify get_clocks() #ifdefPeng Fan2015-11-12-4/+1
| | | | | | | | | | | | | | | | | get_clocks is wrapped by CONFIG_FSL_CLK and CONFIG_M68K in seperate piece code. They can be merged into one snippet. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: "angelo@sysam.it" <angelo@sysam.it> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: "Andreas Bießmann" <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Angelo Dureghello <angelo@sysam.it>
* Merge branch 'master' of git://git.denx.de/u-boot-niosTom Rini2015-11-06-2/+2
|\
| * nios2: use common sequence for reserve_ubootThomas Chou2015-11-06-2/+2
| | | | | | | | | | | | | | Use common sequence for reserve_uboot, as the result is the same. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | common/board_f: enable setup_board_part1() for MIPSDaniel Schwierzeck2015-11-06-2/+6
|/ | | | | | | | | | | | The variables bd_t:bi_memstart and bd_t:bi_memsize have to be initialized also on MIPS. Otherwise LMB and cmd_bdinfo do not correctly work. This currently breaks the booting of FIT images on MIPS. Enable the board_init_f hook setup_board_part1() for MIPS to fix this. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common/board_f.c: change the macro name and remove it for PPC platformsGong Qianyu2015-10-29-1/+1
| | | | | | | | | | For most PPC platforms, they will call the first get_clocks() in init_sequence_f[] as they define CONFIG_PPC. CONFIG_SYS_FSL_CLK is then defined to call the second get_clocks(), which should be redundant for PPC. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
* common/board_f.c: modify the macro to use get_clocks() more commonGong Qianyu2015-10-24-1/+1
| | | | | | get_clocks() should not be limited by ESDHC. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
* Move board_init_f_mem() into a common locationSimon Glass2015-10-24-29/+0
| | | | | | | | | This function will be used by both SPL and U-Boot proper. So move it into a common place. Also change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass <sjg@chromium.org>
* nios2: convert altera timer to driver modelThomas Chou2015-10-23-2/+1
| | | | | | | Convert altera timer to driver model. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com>
* nios2: Switch to generic timerThomas Chou2015-10-23-1/+2
| | | | | | | | Zap almost all of the ad-hoc timer code from interrupts.c and use the code in lib/time.c instead. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* NDS32: Generic Board Support and UnsupportKun-Hua Huang2015-08-28-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-26-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-17-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-14-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-14-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-14-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-14-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>