summaryrefslogtreecommitdiff
path: root/common/board_f.c
AgeCommit message (Collapse)Author
2017-07-03powerpc: remove 4xx supportHeiko Schocher
There was for long time no activity in the 4xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 4xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-16powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512xHeiko Schocher
There was for long time no activity in the mpx5xxx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in mpc5xxx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12board_f: fix calculation of reloc_offLothar Waßmann
relocate_code() calculates the relocation offset wrt. the symbol __image_copy_start which happens to have the same value as CONFIG_TEXT_BASE on most systems. When creating an i.MX boot image with an integrated IVT it is convenient to have CONFIG_TEXT_BASE point to the start of the IVT that is prepended to the actual code. Thus CONFIG_TEXT_BASE will differ from __image_copy_start, while the calculation 'gd->relocaddr - __image_copy_start' still gives the right relocation offset. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
2017-06-12board_f: Use IS_ENABLED instead of #ifdef in initf_bootstage()Simon Glass
The current implementation makes it look like the 'if (from_spl)' part is dead code because these features are not enabled for sandbox. We could enable it for sandbox_spl, but this is not done yet (it requires sharing memory between SPL and U-Boot proper which is in fact supported). It is probably nicer to avoid #ifdef anyway. Change it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163244) Fixes: 824bb1b (bootstage: Support SPL)
2017-06-12powerpc, 5xx: remove support for 5xxHeiko Schocher
There was for long time no activity in the 5xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 5xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12powerpc, 8260: remove support for mpc8260Heiko Schocher
There was for long time no activity in the 8260 area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 8260, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12powerpc, 8xx: remove support for 8xxHeiko Schocher
There was for long time no activity in the 8xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 8xx, so remove it (with a heavy heart, knowing that I remove here the root of U-Boot). Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-05bootstage: Support SPLSimon Glass
At present bootstage only supports U-Boot proper. But SPL can also consume boot time so it is useful to have the record start there. Add bootstage support to SPL. Also support stashing the timing information when SPL finishes so that it can be picked up and reported by U-Boot proper. This provides a full boot time record, excluding only the time taken by the boot ROM. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Record the time taken to set up driver modelSimon Glass
Driver model is set up ones before relocation and once after. Record the time taken in each case. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Init as early as possibleSimon Glass
At present we don't allow use of bootstage before driver model is running. This means we cannot time the init of driver model itself. Now that bootstage requires its own board-specific timer, we can move its init to earlier in the sequence, both before and after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Support relocating boostage dataSimon Glass
Some boards cannot access pre-relocation data after relocation. Reserve space for this and copy it during preparation for relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Convert to use malloc()Simon Glass
At present bootstage uses the data section of the image to store its information. There are a few problems with this: - It does not work on all boards (e.g. those which run from flash before relocation) - Allocated strings still point back to the pre-relocation data after relocation Now that U-Boot has a pre-relocation malloc() we can use this instead, with a pointer to the data in global_data. Update bootstage to do this and set up an init routine to allocate the memory. Now that we have a real init function, we can drop the fake 'reset' record and add a normal one instead. Note that part of the problem with allocated strings remains. They are reallocated but this will only work where pre-relocation memory is accessible after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05arm: Remove include files from common.hSimon Glass
With a small tweak we can avoid including these files for all boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
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>