summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2017-11-18Kconfig: Introduce USE_BOOTCOMMAND and migrate BOOTCOMMANDTom Rini1-0/+17
We first introduce CONFIG_USE_BOOTCOMMAND, similar to CONFIG_USE_BOOTARGS. We then migrate CONFIG_BOOTCOMMAND for most CONFIG_DISTRO_DEFAULT users. In some cases platforms have a complex scheme around this usage, and these have been defered for the moment so that platform maintainers can work on a migration plan. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2017-11-17SPL: fix printing of image nameAndré Draszik1-1/+1
The maximum length of the name of the image is obviously not sizeof(), which is just the length of a pointer, but IH_NMLEN. fixes: 62cf11c0921a90c6bd62344f4bc069668e6c698c ("SPL: Limit image name print length") Signed-off-by: André Draszik <adraszik@tycoint.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-11-13Revert "console: simplify puts()"Soeren Moch1-2/+42
This reverts commit c61d0009feb966e0e93254a8c435a1889085e6b8. A tbs2910 board user reported a very slow console frambuffer as regression in current u-boot. I could bisect this down to the above mentioned commit. This revert brings back the fast framebuffer console (one cache flush per string in puts(), not after each char). Reported-by: Uwe Scheffler <scheffler.u@web.de> Signed-off-by: Soeren Moch <smoch@web.de> Tested-by: Uwe Scheffler <scheffler.u@web.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-07spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchipKever Yang1-1/+2
Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-06image-sig: use designated initializers for algorithmMasahiro Yamada1-22/+22
Designated initializers are more readable because we do not have to check the order in the struct definitions. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-06stm32: fix STMicroelectronics copyrightPatrice Chotard1-1/+2
Uniformize STMicroelectronics copyrights headers for STM32 related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-10-16common: Remove genimg_get_image()Tuomas Tynkkynen3-33/+0
Removal of the legacy DataFlash code turned genimg_get_image() into a no-op. Drop all calls to it and the function itself. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-10-16Drop CONFIG_HAS_DATAFLASHTuomas Tynkkynen2-77/+0
Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-10-12Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini1-1/+9
2017-10-09spl: fix assignment of board info to global dataYork Sun1-1/+9
Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to global data") intended to move assignment of board info earlier, into board_init_r(). However, function preload_console_init() is called either from spl_board_init() or from board_init_f(). For the latter case, the board info assignment is much earlier than proposed board_init_r(). Create a new function to fill gd->bd and call this function when needed. Signed-off-by: York Sun <york.sun@nxp.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Ravi Babu <ravibabu@ti.com> CC: Lukasz Majewski <lukma@denx.de> CC: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-06fit: If no matching config is found in fit_find_config_node(), use the ↵Jean-Jacques Hiblot1-0/+20
default one If board_fit_config_name_match() doesn't match any configuration node, then use the default one (if provided). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-06fit: fixed bug in locate_dtb_in_fit()Jean-Jacques Hiblot1-1/+1
If the dtb is the first data of the FIT, the its offset is 0x0. Change the test to '<' instead of '<=' Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-06fit: use 'const' for the input of fdt_offset() and locate_dtb_in_fit()Jean-Jacques Hiblot1-2/+2
Those 2 functions don't modify their input, we can mark it const. This prevents compilation warnings when they are provided const input. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-06dts: renamed FIT_EMBED to MULTI_DTB_FIT and moved it to the dts KconfigJean-Jacques Hiblot2-17/+1
CONFIG_FIT_EMBED might be confused with CONFIG_OF_EMBED, rename it MULTI_DTB_FIT as it is able to get a DTB from a FIT image containing multiple DTBs. Also move the option to the Kconfig dedicated to the DTS options and create a README for this feature. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-05common: Drop LOGLEVEL to 4Tom Rini1-1/+1
While this came in with a default value of 6 I am lowering this to 4. The MTD/UBI code has a large number of error messages that we include now. In addition, "normally" warning messages are not included so this feels like a more natural level to have. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-04treewide: replace with error() with pr_err()Masahiro Yamada6-32/+32
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-04printk: collect printk stuff into <linux/printk.h> with loglevel supportMasahiro Yamada1-0/+21
When we import code from Linux, with regular re-sync planned, we want to use printk() and pr_*(). U-Boot does not support them in a clean way. So, people end up with local macros, or compat headers here and there, then we occasionally see build errors of definition conflicts. We have include/linux/compat.h, but putting all sorts of unrelated things into a single header is just a temporal workaround. Hence this patch, to find the best home for all printk variants. If you want to use printk() and friends, please include <linux/printk.h>. This header is self-contained, and pulls in only a few headers. When I was testing this clean-up, I noticed the image size exceeded its platform limit on some boards. This is because all pr_*() that were previously defined as no-op in include/linux/mtd/mtd.h (unless CONFIG_MTD_DEBUG is set), are now enabled. To make such boards happy, this commit also implements CONFIG_LOGLEVEL. The concept is similar to the kernel parameter "loglevel". (Actually, the Kconfig help message was taken from kernel-paremeter.txt of Linux) Messages with a loglevel smaller than console loglevel will be printed. The difference is the loglevel is build-time determined. To save the image size, lower priority pr_*() are compiled out. I set the default of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages are compiled in. I adjusted CONFIG_LOGLEVEL to avoid build error for some boards. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Add in SPL_LOGLEVEL that is the same as LOGLEVEL] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-02Merge git://git.denx.de/u-boot-usbTom Rini3-22/+41
2017-10-01usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()Bin Meng1-1/+1
The stored 'blk' value is overwritten to 'size / 512' before it can be used in usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX * 512), we should simply assign 'size' to the upper limit. Reported-by: Coverity (CID: 167250) Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: hub: Clear BH reset status change for a 3.0 hubBin Meng1-0/+6
USB 3.0 hubs report bit[5] in the port status change response as BH reset. The hub shall set the C_BH_PORT_RESET field for this port. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: hub: Clear port reset before usb_hub_port_connect_change()Bin Meng1-5/+5
During usb_hub_port_connect_change(), a port reset set feature request is issued to the port, and later a port reset clear feature is done to the same port before the function returns. However at the end of usb_scan_port(), we attempt to clear port reset again on a cached port status change variable, which should not be done. Adjust the call to clear port reset to right before the call to usb_hub_port_connect_change(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: Read device descriptor after device is addressed for xHCIBin Meng1-0/+11
For xHCI it is not possible to read a device descriptor before it has been assigned an address. That's why usb_setup_descriptor() was called with 'do_read' being false. But we really need try to read the device descriptor before starting any real communication with the default control endpoint. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: Only get 64 bytes device descriptor for full speed devicesBin Meng1-14/+15
Full speed device endpoint 0 can have 8/16/32/64 bMaxPacketSize0. Other speed devices report fixed value per USB spec. So it only makes sense if we send a get device descriptor with 64 bytes to full speed devices. While we are here, update the comment block to be within 80 cols. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: Handle audio extension endpoint descriptor in usb_parse_config()Bin Meng1-2/+3
Normal endpoint descriptor size is 7, but for audio extension it is 9. Handle that correctly when parsing endpoint descriptor. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-29TI: ARCH_OMAP2PLUS: Enable SPL_STACK_R and provide default valueTom Rini1-0/+1
On ARCH_OMAP2PLUS platforms we know what the DDR layout is going to be, and that it is safe to use SPL_STACK_R and provide a default value for it. select this and re-sync the defconfigs. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-29spl: spl_mmc: add __maybe_unused to mmc_load_image_raw_sector()Seung-Woo Kim1-2/+3
If there are no CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and CONFIG_SPL_OS_BOOT, there is unused-function build warning. Add __maybe_unused macro to remove the warning. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2017-09-27dm: usb: storage: Fix broken read/write when both EHCD and xHCD are enabledBin Meng1-2/+17
When EHCD and xHCD are enabled at the same time, USB storage device driver will fail to read/write from/to the storage device attached to the xHCI interface, due to its transfer blocks exceeds the xHCD driver limitation. With driver model, we have an API to get the controller's maximum transfer size and we can use that to determine the storage driver's capability of read/write. Note: the non-DM version driver is still broken with xHCD and the intent here is not to fix the non-DM one, since the xHCD itself is already broken in places like 3.0 hub support, etc. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-27usb: storage: Refactor to use max_xfer_blk from struct us_dataBin Meng1-19/+30
This adds a new memeber max_xfer_blk in struct us_data to record the maximum number of transfer blocks for the storage device. It is set per HCD setting, and so far is to 65535 for EHCD and 20 for everything else. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-22spl: Fix compiling warning on gunzip argumentYork Sun1-1/+4
common/spl/spl_fit.c:201:12: warning: passing argument 4 of ‘gunzip’ from incompatible pointer type [-Wincompatible-pointer-types] src, &length)) Signed-off-by: York Sun <york.sun@nxp.com> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Jean-Jacques Hiblot <jjhiblot@ti.com>
2017-09-22spl: stash bootstage info before jump to next stageKever Yang1-7/+7
Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-18bootstage: adjust Makefile to allow including bootstage in SPL, but not in TPLPhilipp Tomsich1-1/+1
For timing our bootstages on the RK3368, which has a minimal TPL (and where we consequently don't want to time the bootstages) and a full-featured SPL (where we can bootstage recording), we need to adjust the Makefile. Use the $(SPL_TPL_) macro in the Makefile for bootstage.o Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-09-17Merge git://git.denx.de/u-boot-x86Tom Rini3-12/+13
2017-09-16bootstage: Provide a separate record count setting for SPLSimon Glass2-3/+10
With SPL we often have limited memory and do not need very many bootstage records. Add a separate Kconfig option for SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-16bootstage: Drop unused optionsSimon Glass2-10/+1
The CONFIG_BOOTSTAGE_USER_COUNT option is no-longer needed since we can now support any number of user IDs. Also BOOTSTAGE_ID_COUNT is not needed now. Drop these unused options. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-16board_f: Drop the timer after relocationSimon Glass1-0/+3
Once U-Boot relocates itself the existing driver-model timer (if any) is no-longer valid until the device is reinitialised. Any use of the device may cause a crash. To handle this, set the timer to NULL after relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-15fit: Introduce methods for applying overlays on fit-loadPantelis Antoniou2-8/+180
Introduce an overlay based method for constructing a base DT blob to pass to the kernel. It is based on a specific method now to get the FDT from a FIT image named boot_get_fdt_fit(). Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-15fit: Do not throw away extra configuration on fit_image_load()Pantelis Antoniou1-4/+7
fit_image_load() threw away the extra configuration parts when loading. We need them around for applying extra overlays for building the boot fdt. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-15fit: Allow multiple images per propertyPantelis Antoniou1-3/+15
As part of the fdt overlay support which need it, allow a list of configurations per property. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-15fdt: Introduce helper method fdt_overlay_apply_verbose()Pantelis Antoniou1-0/+31
Introduce fdt_overlay_apply_verbose, a method that applies an overlay but in the case of an error produces a helpful message. In addition if a base tree is found to be missing the __symbols__ node the message will point out that the probable reason is that the base tree was miscompiled without the -@ option. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-13spl: add newline in debug outputAnatolij Gustschin1-2/+2
With debug enabled, SPL output following these debug prints is on the same line and it is hard to read. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-13image: Add TI PMMC image typeAndrew F. Davis1-0/+1
Add a new image type representing TI Power Management Micro-Controller (PMMC) Firmware image type. Signed-off-by: Andrew F. Davis <afd@ti.com>
2017-09-11spl: fit: Add booting OS firstYork Sun1-19/+41
If CONFIG_SPL_OS_BOOT is enabled, boot OS if kernel image is found in FIT structure. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-11spl: fit: Support both external and embedded dataYork Sun1-19/+33
SPL supports U-Boot image in FIT format which has data outside of FIT structure. This adds support for embedded data for normal FIT images. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-11spl: fit: Eanble GZIP support for image decompressionYork Sun1-2/+30
Add Kconfig option SPL_GZIP and SPL_ZLIB to enable gunzip support for SPL boot, eg. falcon boot compressed kernel image. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-07spl: typo fix for SPL_ATF_SUPPORT descriptionKever Yang1-1/+1
Delete one redundant 'which' for SPL_ATF_SUPPORT description. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-09-05splash_source: Verify FIT magicNiko Mauno1-0/+5
Before reading entire FIT image, add sanity check by testing image header against FDT_MAGIC. This should help avoid problems in situations where FIT is not yet available from storage device, for example when performing initial programming of device. Cc: Anatolij Gustschin <agust@denx.de> Acked-by: Tomas Melin <tomas.melin@vaisala.com>
2017-09-01Revert "Merge git://git.denx.de/u-boot-video"Tom Rini1-5/+0
This reverts commit 1d20170467b079642be96996dcd71db64c3c365c, reversing changes made to 6aee2ab68c362ace5a59f89a63abed82e0bf19e5. The mxc_ipuv3_fb.c changes introduce build failures on some targets. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-01Merge git://git.denx.de/u-boot-videoTom Rini1-0/+5
2017-09-01Merge git://git.denx.de/u-boot-imxTom Rini4-1/+45
Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: configs/imx6qdl_icore_mmc_defconfig configs/imx6qdl_icore_rqs_defconfig
2017-08-29spl: do not repeat timer init on i.MX6Anatolij Gustschin1-1/+1
The GPT timer was already initialised in board_init_f() as it is needed in dram init. Do not repeat timer init in board_init_r(). Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>