Commit Graph

160 Commits

Author SHA1 Message Date
Simon Glass
0f079eb51c board_f: Put video memory reservation in one function
Move the ugly #ifdefs inside the reserve_video() function so we can
collect all this init into one place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:49 -04:00
Simon Glass
80d4bcd3ec board_f: Move the extra #ifdef condition into reserve_mmu()
The arch-specific details of the cache being off are best handled inside
the reserve_mmu(). This cleans up the init sequence a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:49 -04:00
Simon Glass
b56db48615 board_f: Use a single condition for reserve_logbuffer()
CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated
rather than whether to do it at all. So move the #ifdef into the function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:48 -04:00
Simon Glass
c67f432ecd xtensa: Place relocated U-Boot in the normal place
All archs put U-Boot at the bottom of the relocated region. Xtensa does
not, but perhaps not for any good reason. Adjust it to see if things
still work OK.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:48 -04:00
Simon Glass
088454cde2 board_f: Drop return value from initdram()
At present we cannot use this function as an init sequence call without a
wrapper, since it returns the RAM size. Adjust it to set the RAM size in
global_data instead, and return 0 on success.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:59:20 -04:00
Simon Glass
52c411805c board_f: Drop board_type parameter from initdram()
It looks like only cm5200 and tqm8xx use this feature, so we don't really
need it in generic code. Drop it and have the users access gd->board_type
directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:58:44 -04:00
Simon Glass
76d1d02fd2 board_f: x86: Use checkcpu() for CPU init
At present we misuse print_cpuinfo() do so CPU init on x86. This is done
because it is the next available call after the console is enabled. But
several arches use checkcpu() instead. Despite the horrible name (which
we can fix), it seems a better choice.

Adjust the various x86 CPU implementations to move their init code into
checkcpu() and use print_cpuinfo() only for printing CPU info.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:09 -04:00
Simon Glass
8749fa6af3 board_f: powerpc: Make prt_8260_rsr(), prt_8260_clks() private
Move these two function calls into checkcpu(), which is called on this
arch immediately after these two.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:08 -04:00
Simon Glass
689697785e board_f: sandbox: Move sandbox_early_getopt_check() into misc_init_f()
We don't need a special hook for sandbox as one of the later ones will do
just as well. We can print error messages about bad options after we
print the banner. In fact, it seems better.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:07 -04:00
Simon Glass
d891ab95c2 board_f: powerpc: Move prt_83xx_rsr() to private code
This function is called just before checkcpu() on MPX83xx. Move it to the
code for that arch.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 13:55:06 -04:00
Simon Glass
727e94a4ac powerpc: freescale: Unify the two get_clocks() calls
Combine the conditions so this appears in the init list only once.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:05 -04:00
Simon Glass
11b33e64dd board_f: Use timer_init() on all archs
More than half of the architectures use this function so let's make them
all use it.

For those which don't actually define it, we can rely on the weak function
in lib/time.c

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:05 -04:00
Simon Glass
70e2aaf380 board_f: powerpc: Use timer_init() instead of init_timebase()
There is no good reason to use a different name on PowerPC. Change it to
timer_init() like the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:54:29 -04:00
Simon Glass
1793e78225 board_f: powerpc: Unified get_clocks() portion of init sequence
Now that both branches of the #if do the same thing, we can unify them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:53:02 -04:00
Simon Glass
75efc34bfa board_f: Remove adjust_sdram_tbs_8xx() from the init sequence
We can just call this from the only place that needs it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:52 -04:00
Simon Glass
26345552d6 board_f: Remove sdram_adjust_866() from the init sequence
We can just call this from the only function that needs it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:51 -04:00
Simon Glass
d593c61672 board_f: powerpc: Rename get_clocks_866() to get_clocks()
We really don't need to have a name like this in the generic init
sequence. Use the generic get_clocks() name so that we can merge these
two at some point.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:50 -04:00
Simon Glass
c252c06857 board_f: powerpc: Join the two CONFIG_8xx_CPUCLK_DEFAULT sections
We have two chunks of code which depend on this CONFIG options. There is
likely no need to keep them apart, so join them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:49 -04:00
Simon Glass
671549e5b0 board_f: x86: Rename x86_fsp_init() to arch_fsp_init()
While x86 is the only user and this could in principle be moved to
arch_cpu_init() there is some justification for this being a separate
call. It provides a way to handle init which is not CPU-specific, but
must happen before the CPU can be set up.

Rename the function to be more generic.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:36 -04:00
Simon Glass
bb967240bb board_f: sandbox: Move setup_ram_buf() to private code
There is no need to have this call in the generic init sequence and no
other architecture has needed it in the time it has been there. Move it
into sandbox's private code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:35 -04:00
Tom Rini
936478e797 SPARC: Remove
The SPARC architecture is currently unmaintained, remove.

Cc: Francois Retief <fgretief@spaceteq.co.za>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 13:52:20 -04:00
Tom Rini
ea3310e8aa Blackfin: Remove
The architecture is currently unmaintained, remove.

Cc: Benjamin Matthews <mben12@gmail.com>
Cc: Chong Huang <chuang@ucrobotics.com>
Cc: Dimitar Penev <dpn@switchfin.org>
Cc: Haitao Zhang <hzhang@ucrobotics.com>
Cc: I-SYST Micromodule <support@i-syst.com>
Cc: M.Hasewinkel (MHA) <info@ssv-embedded.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Martin Strubel <strubel@section5.ch>
Cc: Peter Meerwald <devel@bct-electronic.com>
Cc: Sonic Zhang <sonic.adi@gmail.com>
Cc: Valentin Yakovenkov <yakovenkov@niistt.ru>
Cc: Wojtek Skulski <info@skutek.com>
Cc: Wojtek Skulski <skulski@pas.rochester.edu>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 13:52:01 -04:00
mario.six@gdsys.cc
2a792753d6 dm: Add callback to modify the device tree
Certain boards come in different variations by way of utilizing daughter
boards, for example. These boards might contain additional chips, which
are added to the main board's busses, e.g. I2C.

The device tree support for such boards would either, quite naturally,
employ the overlay mechanism to add such chips to the tree, or would use
one large default device tree, and delete the devices that are actually
not present.

Regardless of approach, even on the U-Boot level, a modification of the
device tree is a prerequisite to have such modular families of boards
supported properly.

Therefore, we add an option to make the U-Boot device tree (the actual
copy later used by the driver model) writeable, and add a callback
method that allows boards to modify the device tree at an early stage,
at which, hopefully, also the application of device tree overlays will
be possible.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2017-03-23 15:46:23 +01:00
York Sun
36cc0de0b9 armv8: layerscape: Rewrite memory reservation
For ARMv8 Layerscape SoCs, secure memory and MC memorey are reserved
at the end of DDR. DDR is spit into two or three banks. This patch
reverts commit aabd7ddb and simplifies the calculation of reserved
memory, and moves the code into common SoC file. Secure memory is
carved out first. DDR bank size is reduced. Reserved memory is then
allocated on the top of available memory. U-Boot still has access
to reserved memory as data transferring is needed. Device tree is
fixed with reduced memory size to hide the reserved memory from OS.
The same region is reserved for efi_loader.

Signed-off-by: York Sun <york.sun@nxp.com>
2017-03-14 08:44:03 -07:00
Simon Glass
6bda55a38c x86: Do relocation before clearing BSS
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>
2017-02-06 11:38:46 +08:00
Simon Glass
4acff45247 board_f/r: Use static const for the init sequences
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>
2017-02-06 11:38:46 +08:00
Simon Glass
530f27eab5 x86: board_f: Update init sequence for 64-bit startup
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>
2017-02-06 11:38:46 +08:00
Simon Glass
a009f36cfe Drop prt_mpc5xxx_clks() in favour of print_cpuinfo()
Rather than having an arch-specific function, use the existing generic
one.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25 17:38:44 -05:00
Simon Glass
cc664000c2 Drop the static inline print_cpuinfo()
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>
2017-01-25 17:38:43 -05:00
Simon Glass
8f3086aaac powerpc: Drop CONFIG_SYS_ALLOC_DPRAM
This is not defined anywhere in U-Boot. Drop this dead code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25 17:38:42 -05:00
Simon Glass
cbcbf71bf2 powerpc: Drop probecpu() in favour of arch_cpu_init()
To avoid an unnecessary arch-specific call in board_init_f(), rename this
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25 17:38:41 -05:00
Vladimir Zapolskiy
e2099d78c8 common: sh: add necessary define bits to board_f
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>
2016-12-02 21:32:46 -05:00
Simon Glass
006bccbd0d board_f: Drop the extra fdtdec_prepare_fdt()
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>
2016-10-11 11:55:33 +08:00
Robert P. J. Day
fc0b5948e0 Various, accumulated typos collected from around the tree.
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>
2016-10-06 20:57:40 -04:00
Masahiro Yamada
1221ce459d treewide: replace #include <asm/errno.h> with <linux/errno.h>
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>
2016-09-23 17:55:42 -04:00
Paul Burton
8ebf50692e board_f: Add a mach_cpu_init callback
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>
2016-09-21 15:04:04 +02:00
Chris Zankel
de5e5cea02 xtensa: add support for the xtensa processor architecture [1/2]
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>
2016-08-15 18:46:38 -04:00
Tom Rini
66669fcf80 Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	arch/arm/cpu/armv8/Makefile
	arch/arm/lib/bootm-fdt.c
2016-07-19 16:38:57 -04:00
York Sun
50e93b9565 armv8: Add tlb_allocated to arch global data
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>
2016-07-15 09:01:43 -07:00
York Sun
e61a7534e3 armv8: Move secure_ram variable out of generic global data
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>
2016-07-15 09:01:43 -07:00
Anatolij Gustschin
ba169d981f board_f: prevent misleading "Watchdog enabled" output
Output the "Watchdog enabled" message only if hw_watchdog_init()
call really happened.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-07-14 18:33:09 -04:00
Anatolij Gustschin
46d7a3b3d3 board_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=y
The designware watchdog init is skipped even if CONFIG_DESIGNWARE_WATCHDOG
is enabled. Fix it.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-07-14 18:33:08 -04:00
Simon Glass
b0b359536e board_f: Don't require CONFIG_SYS_MONITOR_BASE
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>
2016-05-27 15:39:51 -04: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
1057e6cfe1 timer: Set up the real timer after driver model is available
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>
2016-02-26 08:53:10 -07:00
David Müller (ELSOFT AG)
928f605455 Remove unused CONFIG_MODEM_SUPPORT option and associated dead code.
Signed-off-by: David Müller <d.mueller@elsoft.ch>
2016-02-08 10:22:44 -05:00
Simon Glass
5a54194515 dm: common: Add memory reservation for the video uclass
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>
2016-01-20 19:10:15 -07:00
Simon Glass
8703ef3fdb common: Move LCD and video memory reservation together
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>
2016-01-20 19:10:15 -07:00
York Sun
aabd7ddb88 common: Rewrite hiding the end of memory
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>
2015-12-15 08:57:33 +08:00
York Sun
e81495224f Reserve secure memory
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>
2015-12-15 08:57:32 +08:00