summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* common: Simplify get_clocks() #ifdefPeng Fan2015-11-121-4/+1
| | | | | | | | | | | | | | | | | get_clocks is wrapped by CONFIG_FSL_CLK and CONFIG_M68K in seperate piece code. They can be merged into one snippet. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: "angelo@sysam.it" <angelo@sysam.it> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: "Andreas Bießmann" <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Angelo Dureghello <angelo@sysam.it>
* mmc: Use lldiv() for 64-bit division in write_raw_image()Siarhei Siamashka2015-11-121-1/+2
| | | | | | | | | | | | | This fixes compilation problems when using a hardfloat toolchain on ARM, which manifest themselves as "libgcc.a(_udivmoddi4.o) uses VFP register arguments, u-boot does not". These problems have been reported in the U-Boot mailing list: http://lists.denx.de/pipermail/u-boot/2015-October/230314.html http://lists.denx.de/pipermail/u-boot/2015-October/231908.html Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* gpt: add optional parameter type in gpt commandPatrick Delaunay2015-11-121-0/+17
| | | | | | | | | | | | | | | | code under flag CONFIG_PARTITION_TYPE_GUID add parameter "type" to select partition type guid example of use with gpt command : partitions = uuid_disk=${uuid_gpt_disk}; \ name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \ name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \ type=0fc63daf-8483-4772-8e79-3d69d8477de4; gpt write mmc 0 $partitions Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
* sparse: Rename the file and headerMaxime Ripard2015-11-124-4/+4
| | | | | | | | | | | | The Android sparse image format is currently supported through a file called aboot, which isn't really such a great name, since the sparse image format is only used for transferring data with fastboot. Rename the file and header to a file called "sparse", which also makes it consistent with the header defining the image structures. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: nand: Add pre erase and write hooksMaxime Ripard2015-11-121-0/+18
| | | | | | | | | | | Some devices might need to do some per-partition initialization (ECC/Randomizer settings change for example) before actually accessing it. Add some hooks before the write and erase operations to let the boards define what they need to do if needed. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: Implement NAND backendMaxime Ripard2015-11-122-1/+201
| | | | | | | | | So far the fastboot code was only supporting MMC-backed devices for its flashing operations (flash and erase). Add a storage backend for NAND-backed devices. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* sparse: Implement several chunks flashingMaxime Ripard2015-11-121-2/+15
| | | | | | | | | | | | | | | The fastboot client will split the sparse images into several chunks if the image that it tries to flash is bigger than what the device can handle. In such a case, the bootloader is supposed to retain the last offset to which it wrote to, so that it can resume the writes at the right offset when flashing the next chunk. Retain the last offset we used, and use the session ID to know if we need it or not. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: Implement flashing session counterMaxime Ripard2015-11-122-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fastboot flash command that writes an image to a partition works in several steps: 1 - Retrieve the maximum size the device can download through the "max-download-size" variable 2 - Retrieve the partition type through the "partition-type:%s" variable, that indicates whether or not the partition needs to be erased (even though the fastboot client has minimal support for that) 3a - If the image is smaller than what the device can handle, send the image and flash it. 3b - If the image is larger than what the device can handle, create a sparse image, and split it in several chunks that would fit. Send the chunk, flash it, repeat until we have no more data to send. However, in the 3b case, the subsequent transfers have no particular identifiers, the protocol just assumes that you would resume the writes where you left it. While doing so works well, it also means that flashing two subsequent images on the same partition (for example because the user made a mistake) would not work withouth flashing another partition or rebooting the board, which is not really intuitive. Since we have always the same pattern, we can however maintain a counter that will be reset every time the client will retrieve max-download-size, and incremented after each buffer will be flashed, that will allow us to tell whether we should simply resume the flashing where we were, or start back at the beginning of the partition. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Implement storage abstractionMaxime Ripard2015-11-122-31/+91
| | | | | | | | | | | The current sparse image parser relies heavily on the MMC layer, and doesn't allow any other kind of storage medium to be used. Rework the parser to support any kind of storage medium, as long as there is an implementation for it. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: Move fastboot response functions to fastboot coreMaxime Ripard2015-11-122-45/+32
| | | | | | | | | | The functions and a few define to generate a fastboot message to be sent back to the host were so far duplicated among the users. Move them all to a common place. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Simplify multiple logicMaxime Ripard2015-11-121-4/+10
| | | | | | | | | To check the alignment of the image blocks to the storage blocks, the current code uses a convoluted syntax, while a simple mod also does the work. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Refactor chunk parsing functionMaxime Ripard2015-11-121-133/+239
| | | | | | | | | | | | The chunk parsing code was duplicating a lot of code among the various chunk types, while all of them could be covered by generic and simple functions. Refactor the current code to reuse as much code as possible and hopefully make the chunk parsing loop more readable and concise. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Move main header parsing to a function of its ownMaxime Ripard2015-11-121-21/+24
| | | | | | | | | | | The current sparse image format parser is quite tangled, with a lot of code duplication. Start refactoring it by moving the header parsing function to a function of its own. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-niosTom Rini2015-11-062-4/+9
|\
| * nios2: use common sequence for reserve_ubootThomas Chou2015-11-061-2/+2
| | | | | | | | | | | | | | Use common sequence for reserve_uboot, as the result is the same. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
| * nios2: use dram bank in board infoThomas Chou2015-11-061-2/+7
| | | | | | | | | | | | | | | | Use dram bank in board info, so that it displays correct memory values in bdinfo command. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* | Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini2015-11-061-2/+6
|\ \
| * | common/board_f: enable setup_board_part1() for MIPSDaniel Schwierzeck2015-11-061-2/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | The variables bd_t:bi_memstart and bd_t:bi_memsize have to be initialized also on MIPS. Otherwise LMB and cmd_bdinfo do not correctly work. This currently breaks the booting of FIT images on MIPS. Enable the board_init_f hook setup_board_part1() for MIPS to fix this. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | sf: Add SPI NOR protection mechanismFabio Estevam2015-11-051-0/+35
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Many SPI flashes have protection bits (BP2, BP1 and BP0) in the status register that can protect selected regions of the SPI NOR. Take these bits into account when performing erase operations, making sure that the protected areas are skipped. Tested on a mx6qsabresd: => sf probe SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB => sf protect lock 0x3f0000 0x10000 => sf erase 0x3f0000 0x10000 offset 0x3f0000 is protected and cannot be erased SF: 65536 bytes @ 0x3f0000 Erased: ERROR => sf protect unlock 0x3f0000 0x10000 => sf erase 0x3f0000 0x10000 SF: 65536 bytes @ 0x3f0000 Erased: OK Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> [re-worked to fit the lock common to dm and non-dm] Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Jagan Teki <jteki@openedev.com>
* Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2015-11-053-5/+4
|\
| * video: Drop DEV_FLAGS_SYSTEM flagBin Meng2015-11-053-5/+4
| | | | | | | | | | | | DEV_FLAGS_SYSTEM does not have any actual meaning, hence drop it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* | common/usb_storage.c: Clean up usb_storage_probe()Tom Rini2015-11-031-27/+2
|/ | | | | | | | | | We have the protocol and subclass variables which are used only in disabled debug code. This code dates back to the initial git import and seemingly dead code so remove it. This was detected by Coverity (CID 131117) Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriqTom Rini2015-10-302-4/+9
|\
| * common/board_f.c: change the macro name and remove it for PPC platformsGong Qianyu2015-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | For most PPC platforms, they will call the first get_clocks() in init_sequence_f[] as they define CONFIG_PPC. CONFIG_SYS_FSL_CLK is then defined to call the second get_clocks(), which should be redundant for PPC. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * fdt_support: Don't panic if stdout alias is missingScott Wood2015-10-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, using fdt_fixup_stdout() on a device tree that is missing the relevant alias results in this: WARNING: could not set linux,stdout-path FDT_ERR_NOTFOUND. ERROR: /chosen node create failed - must RESET the board to recover. FDT creation failed! hanging...### ERROR ### Please RESET the board ### There is no reason for this to be a fatal error rather than a warning, and removing this allows for a smooth transition on a platform where the device tree currently lacks the correct aliases but will have them in the future. Signed-off-by: Scott Wood <scottwood@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <yorksun@freescale.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2015-10-291-0/+19
|\ \
| * | net: mdio: Add mdio_free() and mdio_unregister() APIBin Meng2015-10-291-0/+19
| |/ | | | | | | | | | | | | Currently there is no API to uninitialize mdio. Add two APIs for this. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2015-10-275-20/+12
|\ \
| * | env: export fdt_blob to the environment variableThomas Chou2015-10-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Export fdt_blob to the environment variable. So that we may use it to boot Linux. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Simon Glass <sjg@chromium.org>
| * | dm: tpm: Remove every compilation switch for TPM driver modelChristophe Ricard2015-10-231-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As every TPM drivers support UCLASS_TPM, we can only rely on DM_TPM functions. This simplify a bit the code. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
| * | dm: Rename dev_get_parentdata() to dev_get_parent_priv()Simon Glass2015-10-233-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | The current name is inconsistent with other driver model data access functions. Rename it and fix up all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | image.c: Fix non-Android booting with ramdisk and/or device treeTom Rini2015-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 1fec3c5 I added a check that if we had an Android image we default to trying the kernel address for a ramdisk. However when we don't have an Android image buf is NULL and we oops here. Ensure that we have 'buf' to check first. Reported-by: elipe Balbi <balbi@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* | | ubi,ubifs: sync with linux v4.2Heiko Schocher2015-10-261-3/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sync with linux v4.2 commit 64291f7db5bd8150a74ad2036f1037e6a0428df2 Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Aug 30 11:34:09 2015 -0700 Linux 4.2 This update is needed, as it turned out, that fastmap was in experimental/broken state in kernel v3.15, which was the last base for U-Boot. Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
* | common/board_f.c: modify the macro to use get_clocks() more commonGong Qianyu2015-10-241-1/+1
| | | | | | | | | | | | get_clocks() should not be limited by ESDHC. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
* | board_init_f_mem(): Don't create an unused early malloc() areaSimon Glass2015-10-241-1/+2
| | | | | | | | | | | | | | | | | | Change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | board_init_f_mem(): Don't require memset()Simon Glass2015-10-241-0/+18
| | | | | | | | | | | | | | Unfortunately memset() is not always available, so provide a substitute when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Move board_init_f_mem() into a common locationSimon Glass2015-10-244-29/+49
| | | | | | | | | | | | | | | | | | This function will be used by both SPL and U-Boot proper. So move it into a common place. Also change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass <sjg@chromium.org>
* | itest: make memory access work under sandboxStephen Warren2015-10-241-5/+16
| | | | | | | | | | | | | | | | itest accesses memory, and hence must map/unmap it. Without doing so, it accesses invalid addresses and crashes. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* | ubifs: Modify ubifs u-boot wrapper function prototypes for generic fs useHans de Goede2015-10-241-10/+2
| | | | | | | | | | | | | | | | | | | | | | Modify the ubifs u-boot wrapper function prototypes for generic fs use, and give them their own header file. This is a preparation patch for adding ubifs support to the generic fs code from fs/fs.c. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* | Allow imxtract to extract part of script image.Pierre Aubert2015-10-241-1/+2
| | | | | | | | | | | | | | Scripts are multi-file images, the imxtract command should handle them in the same manner. Signed-off-by: Pierre Aubert <p.aubert@staubli.com>
* | allow LED initialization without STATUS_LED_BOOTBernhard Nortmann2015-10-241-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For current U-Boot to initialize status LEDs via status_led_init(), it is required to have both CONFIG_STATUS_LED and STATUS_LED_BOOT defined. This may be a particular concern with GPIO LEDs, where __led_init() is required to correctly set up the GPIO (gpio_request and gpio_direction_output). Without STATUS_LED_BOOT the initialization isn't called, which could leave the user with a non-functional "led" command - due to the fact that the LED routines in gpio_led.c use gpio_set_value() just fine, but the GPIO never got set up properly in the first place. I think having CONFIG_STATUS_LED is sufficient to justify a corresponding call to status_led_init(), even with no STATUS_LED_BOOT defined. To do so, common/board_r.c needs call that routine, so it now is exposed via status_led.h. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de> [trini: Add dummy __led_init to pca9551_led.c] Signed-off-by: Tom Rini <trini@konsulko.com>
* | nios2: convert altera timer to driver modelThomas Chou2015-10-231-2/+1
| | | | | | | | | | | | | | Convert altera timer to driver model. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com>
* | timer: start a new timer after relocationThomas Chou2015-10-231-0/+3
| | | | | | | | | | | | | | | | Start a new timer after relocation, just in case the timer has been used in per-relocation. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Simon Glass <sjg@chromium.org>
* | nios2: Switch to generic timerThomas Chou2015-10-231-1/+2
|/ | | | | | | | Zap almost all of the ad-hoc timer code from interrupts.c and use the code in lib/time.c instead. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* drivers: Introduce a simplified remoteproc frameworkNishanth Menon2015-10-223-0/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many System on Chip(SoC) solutions are complex with multiple processors on the same die dedicated to either general purpose of specialized functions. Many examples do exist in today's SoCs from various vendors. Typical examples are micro controllers such as an ARM M3/M0 doing a offload of specific function such as event integration or power management or controlling camera etc. Traditionally, the responsibility of loading up such a processor with a firmware and communication has been with a High Level Operating System(HLOS) such as Linux. However, there exists classes of products where Linux would need to expect services from such a processor or the delay of Linux and operating system being able to load up such a firmware is unacceptable. To address these needs, we need some minimal capability to load such a system and ensure it is started prior to an Operating System(Linux or any other) is started up. NOTE: This is NOT meant to be a solve-all solution, instead, it tries to address certain class of SoCs and products that need such a solution. A very simple model is introduced here as part of the initial support that supports microcontrollers with internal memory (no MMU, no execution from external memory, or specific image format needs). This basic framework can then (hopefully) be extensible to other complex SoC processor support as need be. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-x86Tom Rini2015-10-213-186/+230
|\
| * cmd: bootvx: Add asmlinkage to the VxWorks x86 entryBin Meng2015-10-211-0/+6
| | | | | | | | | | | | | | | | VxWorks on x86 uses stack to pass parameters. Reported-by: Jian Luo <jian.luo4@boschrexroth.de> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
| * cmd: bootvx: Pass E820 information to an x86 VxWorks kernelBin Meng2015-10-211-0/+30
| | | | | | | | | | | | | | | | | | | | E820 is critical to the kernel as it provides system memory map information. Pass it to an x86 VxWorks kernel. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Jian Luo <jian.luo4@boschrexroth.de>
| * cmd: bootvx: Always get VxWorks bootline from envBin Meng2015-10-211-53/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far VxWorks bootline can be contructed from various environment variables, but when these variables do not exist we get these from corresponding config macros. This is not helpful as it requires rebuilding U-Boot, and to make sure these config macros take effect we should not have these environment variables. This is a little bit complex and confusing. Now we change the logic to always contruct the bootline from environments (the only single source), by adding two new variables "bootdev" and "othbootargs", and adding some comments about network related settings mentioning they are optional. The doc about the bootline handling is also updated. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
| * cmd: bootvx: Pass netmask and gatewayip to VxWorks bootlineBin Meng2015-10-211-2/+15
| | | | | | | | | | | | | | | | | | There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud