summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* dm: scsi: fix divide-by-0 error in scsi_scan()Jean-Jacques Hiblot2017-04-141-9/+26
| | | | | | | | | | | With DM_SCSI enabled, blk_create_devicef() is called with blkz = 0, leading to a divide-by-0 exception. scsi_detect_dev() can be used to get the required parameters (block size and number of blocks) from the drive before calling blk_create_devicef(). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* scsi: move the partition initialization out of the scsi detectionJean-Jacques Hiblot2017-04-141-1/+2
| | | | | | | | We might want to get information about the scsi device without initializing the partition. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* scsi: make the LUN a parameter of scsi_detect_dev()Jean-Jacques Hiblot2017-04-141-7/+7
| | | | | | | | | | This is a cosmetic change. target and LUN have kind of the same role in this function. One of them was passed as a parameter and the other was embedded in a structure. For consistency, pass both of them as parameters. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2017-04-141-3/+1
|\
| * usb: return 0 from usb_stor_get_info even if removable mediaTroy Kisky2017-04-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | board_f: Rename initdram() to dram_init()Simon Glass2017-04-131-15/+0
| | | | | | | | | | | | | | | | | | 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>
* | env: split fw_env.h in public and private partsStefano Babic2017-04-121-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | Rename aes.h to uboot_aes.hStefano Babic2017-04-121-1/+1
|/ | | | | | | | | 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>
* spl: net: Add FIT image support over network bootAndrew F. Davis2017-04-081-3/+31
| | | | | | | | | | 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>
* Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini2017-04-081-0/+69
|\
| * common: Move environment choice to KconfigMaxime Ripard2017-04-071-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | common/xyzModem.c: Do not use hard-coded address for debug bufferAlexandru Gagniuc2017-04-081-9/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | common/xyzModem.c: unifdef (Remove useless #ifdefs)Alexandru Gagniuc2017-04-081-103/+0
| | | | | | | | Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
* | spl: Kconfig: SPL_MMC_SUPPORT depends on GENERIC_MMCAlexandru Gagniuc2017-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | common, kconfig: Fix defaut value of BOOTSTAGE_STASH_SIZENobuhiro Iwamatsu2017-04-081-1/+1
| | | | | | | | | | | | | | | | 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>
* | spl: armv7m: keep ARM v7M in thumb mode while jumping to entry pointVikas Manocha2017-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove extra fdt_fixup_ethernet() callJoakim Tjernlund2017-04-081-1/+0
| | | | | | | | | | | | | | | | | | | | 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>
* | env_mmc: Allow SPL to use any MMC device to load/save the environmentJean-Jacques Hiblot2017-04-081-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove various unused interrupt related codeTom Rini2017-04-061-5/+0
|/ | | | | | | | | | | | | 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>
* board_f: powerpc: Drop unused headersSimon Glass2017-04-051-15/+3
| | | | | | | | | 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>
* board_f: Make relocation functions genericSimon Glass2017-04-051-3/+1
| | | | | | | 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>
* board_f: Make init_helpers genericSimon Glass2017-04-052-6/+2
| | | | | | | | 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>
* powerpc: Move setup_board_extra() into a PPC fileSimon Glass2017-04-051-25/+0
| | | | | | | | 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>
* board_f: Move errno.h down to the bottomSimon Glass2017-04-051-1/+1
| | | | | | | 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>
* board_f: Drop unused headersSimon Glass2017-04-051-5/+0
| | | | | | | | 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>
* board_f: Drop setup_dram_config() wrapperSimon Glass2017-04-051-10/+4
| | | | | | | | 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>
* board_f: Drop CONFIG_SPL_BUILD checkSimon Glass2017-04-051-8/+0
| | | | | | | 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>
* board_f: Put video memory reservation in one functionSimon Glass2017-04-051-31/+5
| | | | | | | 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>
* board_f: Move the extra #ifdef condition into reserve_mmu()Simon Glass2017-04-051-4/+4
| | | | | | | | 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>
* board_f: Use a single condition for reserve_logbuffer()Simon Glass2017-04-051-2/+5
| | | | | | | 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>
* xtensa: Place relocated U-Boot in the normal placeSimon Glass2017-04-051-6/+0
| | | | | | | | 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>
* board_f: Drop return value from initdram()Simon Glass2017-04-051-7/+1
| | | | | | | | | 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>
* board_f: Drop board_type parameter from initdram()Simon Glass2017-04-051-7/+1
| | | | | | | | | 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>
* board_f: x86: Use checkcpu() for CPU initSimon Glass2017-04-051-1/+2
| | | | | | | | | | | | | 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>
* board_f: powerpc: Make prt_8260_rsr(), prt_8260_clks() privateSimon Glass2017-04-051-4/+0
| | | | | | | | 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>
* board_f: sandbox: Move sandbox_early_getopt_check() into misc_init_f()Simon Glass2017-04-051-3/+0
| | | | | | | | | 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>
* board_f: powerpc: Move prt_83xx_rsr() to private codeSimon Glass2017-04-051-3/+0
| | | | | | | 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>
* powerpc: freescale: Unify the two get_clocks() callsSimon Glass2017-04-051-4/+1
| | | | | | | | 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>
* board_f: Use timer_init() on all archsSimon Glass2017-04-051-3/+0
| | | | | | | | | | | | 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>
* board_f: powerpc: Use timer_init() instead of init_timebase()Simon Glass2017-04-051-3/+1
| | | | | | | | | 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>
* board_f: powerpc: Unified get_clocks() portion of init sequenceSimon Glass2017-04-051-6/+2
| | | | | | | | 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>
* board_f: Remove adjust_sdram_tbs_8xx() from the init sequenceSimon Glass2017-04-051-4/+0
| | | | | | | 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>
* board_f: Remove sdram_adjust_866() from the init sequenceSimon Glass2017-04-051-2/+0
| | | | | | | 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>
* board_f: powerpc: Rename get_clocks_866() to get_clocks()Simon Glass2017-04-051-1/+1
| | | | | | | | | | 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>
* board_f: powerpc: Join the two CONFIG_8xx_CPUCLK_DEFAULT sectionsSimon Glass2017-04-051-9/+8
| | | | | | | | 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>
* board_f: x86: Rename x86_fsp_init() to arch_fsp_init()Simon Glass2017-04-051-2/+2
| | | | | | | | | | | | 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>
* board_f: sandbox: Move setup_ram_buf() to private codeSimon Glass2017-04-051-18/+0
| | | | | | | | | | 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>
* SPARC: RemoveTom Rini2017-04-053-50/+3
| | | | | | | The SPARC architecture is currently unmaintained, remove. Cc: Francois Retief <fgretief@spaceteq.co.za> Signed-off-by: Tom Rini <trini@konsulko.com>
* Blackfin: RemoveTom Rini2017-04-052-11/+10
| | | | | | | | | | | | | | | | | | | 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>
* Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2017-04-041-0/+1
|\