summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2017-04-14Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2017-04-14usb: return 0 from usb_stor_get_info even if removable mediaTroy Kisky
This fixes a regression caused by commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c dm: usb: Convert USB storage to use driver-model for block devs which caused part_init to be called when it was not previously. Without this patch, the following happens when a USB sd card reader is used. => usb start starting USB... USB0: Port not available. USB1: USB EHCI 1.00 scanning bus 1 for devices... 3 USB Device(s) found scanning usb for storage devices... Device NOT ready Request Sense returned 02 3A 00 ### ERROR ### Please RESET the board ### This happens because dev_desc->blksz is 0. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.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-12env: split fw_env.h in public and private partsStefano Babic
Move U-Boot private data into a separate file. This lets export fw_env.h to be used by external programs that want to change the environment using the library built in tools/env. Signed-off-by: Stefano Babic <sbabic@denx.de>
2017-04-12Rename aes.h to uboot_aes.hStefano Babic
aes.h is a too generic name if this file can be exported and used by a program. Rename it to avoid any conflicts with other files (for example, from openSSL). Signed-off-by: Stefano Babic <sbabic@denx.de>
2017-04-08spl: net: Add FIT image support over network bootAndrew F. Davis
FIT support in the net boot case is much like the RAM boot case in that we load our image to "load_addr" and pass a dummy read function into "spl_load_simple_fit()". As the load address is no longer hard-coded to the final execution address, legacy image loading will require load_addr to be set correctly in the image header. Signed-off-by: Andrew F. Davis <afd@ti.com>
2017-04-08Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
2017-04-08common/xyzModem.c: Do not use hard-coded address for debug bufferAlexandru Gagniuc
Under the plethora of #ifdefs, the xyzModem code hid this pearl: static char *zm_out = (char *) 0x00380000; This was only enabled when DEBUG is defined, so it's probably why it went unnoticed for so long. No idea what platform had memory at that exact location, but the this approach is extremely hacky. Use a static buffer instead. Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
2017-04-08common/xyzModem.c: unifdef (Remove useless #ifdefs)Alexandru Gagniuc
Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
2017-04-08spl: Kconfig: SPL_MMC_SUPPORT depends on GENERIC_MMCAlexandru Gagniuc
spl_mmc.c calls mmc_initialize(). This symbol is provided in drivers/mmc/mmc.c when CONFIG_GENERIC_MMC is enabled. The sunxi Kconfig case is an oddball because it redefines SPL_MMC_SUPPORT. Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com> [trini: Update arch/arm/cpu/armv8/zynqmp/Kconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-08common, kconfig: Fix defaut value of BOOTSTAGE_STASH_SIZENobuhiro Iwamatsu
The default value of BOOTSTAGE_STASH_SIZE should be set to hexadecimal, but an integer value is set. This fixes the BOOTSTAGE_STASH_SIZE number from hexadecimal to integer. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2017-04-08spl: armv7m: keep ARM v7M in thumb mode while jumping to entry pointVikas Manocha
On ARM v7M, the processor will return to ARM mode when executing blx instruction with bit 0 of the address == 0. Always set it to 1 to stay in thumb mode. Similar commit: f99993c10882f7dc8ec35993d5febe59aac01e6a Author: Matt Porter <mporter@konsulko.com> Date: Tue May 5 15:00:23 2015 -0400 common/cmd_boot: keep ARM v7M in thumb mode during do_go_exec() Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
2017-04-08Remove extra fdt_fixup_ethernet() callJoakim Tjernlund
ft_cpu_setup() already calls fdt_fixup_ethernet(), calling it in image_setup_libfdt() is both redundant and breaks any modifications done by ft_board_setup(). Restore the old behavior by removing the call in image_setup_libfdt() Fixes: 13d06981a982 ("image: Add device tree setup to image library") Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
2017-04-08env_mmc: Allow SPL to use any MMC device to load/save the environmentJean-Jacques Hiblot
SPL has been restricted to use only dev 0 based on the assumption that only one MMC device is registered. This is not always the case and many platforms now register several devices as expected by the spl mmc boot code For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0. A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that do not register the same MMC controllers in SPL and in u-boot (mostly iMX6 based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in their default configuration. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2017-04-07common: Move environment choice to KconfigMaxime Ripard
The environment location is something that might change per board (depending on what storage options are availaible there) or depending on the user choice (when we have several options). Instead of hardcoding it in our configuration header, create a Kconfig choice with the options we use for now, and the symbols that depend on it. Once done, also remove the irrelevant sunxi defines. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-04-06Remove 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-04-04Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini
2017-03-28mtd: nand: remove nand size print from nand_init functionHou Zhiqiang
Add nand_size() function to move the nand size print into initr_nand(). Remove nand size print from nand_init() to allow other function to call nand_init() without printing nand size. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2017-03-26fdt_support: Fixup 'ethernet' aliases not ending in digitsTuomas Tynkkynen
The Raspberry Pi device tree files since Linux v4.9 have a "ethernet" alias pointing to the on-board Ethernet device node. However, U-Boot's fdt_fixup_ethernet() only looks at ethernet aliases ending in digits. As the spec doesn't mandate that aliases must end in numbers and there have been much older uses of an "ethernet" aliases in the wild (according to Tom Rini), change the code to accept "ethernet" as well. Without this Linux isn't told of the MAC address provided by the RPI firmware and the ethernet interface is always assigned a random MAC address. Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Joe Hershberger <joe.hershberger@ni.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>