summaryrefslogtreecommitdiff
path: root/common/board_f.c
AgeCommit message (Collapse)Author
2017-05-15Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini
2017-05-15board_f: skip timer_init() on Coldfire archsAngelo Dureghello
Coldfire arch is not happy with timer_init since interrupt handlers are still not set at that stage, and the boot hangs silently. Signed-off-by: Angelo Dureghello <angelo@sysam.it>
2017-05-15i2c: Finish dropping use of CONFIG_I2C_HARDSimon Glass
Drop use of this long-deprecated option. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-04-13board_f: Rename initdram() to dram_init()Simon Glass
This allows us to use the same DRAM init function on all archs. Add a dummy function for arc, which does not use DRAM init here. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Dummy function on nios2] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-07Remove various unused interrupt related codeTom Rini
With d53ecad92f06 some unused interrupt related code was removed. However all of these options are currently unused. Rather than migrate some of these options to Kconfig we just remove the code in question. The only related code changes here are that in some cases we use CONFIG_STACKSIZE in non-IRQ related context. In these cases we rename and move the value local to the code in question. Fixes: d53ecad92f06 ("Merge branch 'master' of git://git.denx.de/u-boot-sunxi") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05board_f: powerpc: Drop unused headersSimon Glass
These includes don't seem to be needed now. Drop them. Reserve the mp.h header for PowerPC for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05board_f: Make relocation functions genericSimon Glass
This header file is used by three archs. It could be used by all of them since relocation is a common function. Move it into a generic file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05board_f: Make init_helpers genericSimon Glass
This header file is used by two archs. It could be used by all of them since it allows the cache to be on during relocation. Move it into a generic file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05powerpc: Move setup_board_extra() into a PPC fileSimon Glass
We don't need this PPC-specific function in generic code. Move it to the powerpc directory. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05board_f: Move errno.h down to the bottomSimon Glass
This is to keep the header file order consistent. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05board_f: Drop unused headersSimon Glass
Drop headers which are not used or needed in this file. The compiler.h header is included by common.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05board_f: Drop setup_dram_config() wrapperSimon Glass
By making dram_init_banksize() return an error code we can drop the wrapper. Adjust this and clean up all implementations. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05board_f: Drop CONFIG_SPL_BUILD checkSimon Glass
This is never defined when building this file, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05board_f: Put video memory reservation in one functionSimon Glass
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-05board_f: Move the extra #ifdef condition into reserve_mmu()Simon Glass
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-05board_f: Use a single condition for reserve_logbuffer()Simon Glass
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-05xtensa: Place relocated U-Boot in the normal placeSimon Glass
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-05board_f: Drop return value from initdram()Simon Glass
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-05board_f: Drop board_type parameter from initdram()Simon Glass
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-05board_f: x86: Use checkcpu() for CPU initSimon Glass
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-05board_f: powerpc: Make prt_8260_rsr(), prt_8260_clks() privateSimon Glass
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-05board_f: sandbox: Move sandbox_early_getopt_check() into misc_init_f()Simon Glass
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-05board_f: powerpc: Move prt_83xx_rsr() to private codeSimon Glass
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-05powerpc: freescale: Unify the two get_clocks() callsSimon Glass
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-05board_f: Use timer_init() on all archsSimon Glass
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-05board_f: powerpc: Use timer_init() instead of init_timebase()Simon Glass
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-05board_f: powerpc: Unified get_clocks() portion of init sequenceSimon Glass
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-05board_f: Remove adjust_sdram_tbs_8xx() from the init sequenceSimon Glass
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-05board_f: Remove sdram_adjust_866() from the init sequenceSimon Glass
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-05board_f: powerpc: Rename get_clocks_866() to get_clocks()Simon Glass
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-05board_f: powerpc: Join the two CONFIG_8xx_CPUCLK_DEFAULT sectionsSimon Glass
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-05board_f: x86: Rename x86_fsp_init() to arch_fsp_init()Simon Glass
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-05board_f: sandbox: Move setup_ram_buf() to private codeSimon Glass
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-05SPARC: RemoveTom Rini
The SPARC architecture is currently unmaintained, remove. Cc: Francois Retief <fgretief@spaceteq.co.za> Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05Blackfin: RemoveTom Rini
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-03-23dm: Add callback to modify the device treemario.six@gdsys.cc
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-14armv8: layerscape: Rewrite memory reservationYork Sun
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-02-06x86: Do relocation before clearing BSSSimon Glass
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-06board_f/r: Use static const for the init sequencesSimon Glass
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-06x86: board_f: Update init sequence for 64-bit startupSimon Glass
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-01-25Drop prt_mpc5xxx_clks() in favour of print_cpuinfo()Simon Glass
Rather than having an arch-specific function, use the existing generic one. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Drop the static inline print_cpuinfo()Simon Glass
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-25powerpc: Drop CONFIG_SYS_ALLOC_DPRAMSimon Glass
This is not defined anywhere in U-Boot. Drop this dead code. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25powerpc: Drop probecpu() in favour of arch_cpu_init()Simon Glass
To avoid an unnecessary arch-specific call in board_init_f(), rename this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-03common: sh: add necessary define bits to board_fVladimir Zapolskiy
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-10-11board_f: Drop the extra fdtdec_prepare_fdt()Simon Glass
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-07Various, accumulated typos collected from around the tree.Robert P. J. Day
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-09-23treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada
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-21board_f: Add a mach_cpu_init callbackPaul Burton
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-08-15xtensa: add support for the xtensa processor architecture [1/2]Chris Zankel
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>