aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2018-12-12spl: fix build failure with !CONFIG_SPL_PCI_SUPPORTSekhar Nori1-2/+2
Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but CONFIG_SPL_PCI_SUPPORT disabled, results in following linker error: lib/built-in.o: In function `fdtdec_get_pci_bar32': lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32' fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32' This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c while SPL build does not descend into drivers/pci directory in drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled. Fix this by applying appropriate #define guards in lib/fdtdec.c. It looks like ns16550.c has the same problem, so fixed that too. To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI (enables use of CONFIG_IS_ENABLED() macro). Suggested-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-12blk: Rework guard around part_init callTom Rini1-0/+3
The function part_init() will only be built when we have both CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set. Protect the call to this function with both of these tests now. Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: York Sun <york.sun@nxp.com> Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Cc: Mingkai Hu <mingkai.hu@nxp.com> Cc: Stefan Roese <sr@denx.de> Cc: Marek Behún <marek.behun@nic.cz> Cc: Vanessa Maegima <vanessa.maegima@nxp.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Adam Ford <aford173@gmail.com> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-10Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini1-3/+3
- DWC3 and UDC cleanup
2018-12-08Roll CRC16-CCITT into the hash infrastructurePhilipp Tomsich1-0/+36
The CRC16-CCITT checksum function is useful for space-constrained applications (such as obtaining a checksum across a 2KBit or 4KBit EEPROM) in boot applications. It has not been accessible from boot scripts until now (due to not having a dedicated command and not being supported by the hash infrstructure) limiting its applicability outside of custom commands. This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the list of available hashes and adds a new crc16_ccitt_wd_buf() to make this possible. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [trini: Fix building crc16.o for SPL/TPL] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-08lib: merge CRC16-CCITT into u-boot/crc.hPhilipp Tomsich1-1/+1
This merges the CRC16-CCITT headers into u-boot/crc.h to prepare for rolling CRC16 into the hash infrastructure. Given that CRC8, CRC32 and CRC32-C already have their prototypes in a single header file, it seems a good idea to also include CRC16-CCITT in the same. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-07usb: gadget: Do not call board_usb_xxx() directly in USB gadget driversJean-Jacques Hiblot1-3/+3
Add 2 functions to wrap the calls to board_usb_init() and board_usb_cleanup(). This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-12-06main: Drop more #ifdefsSimon Glass1-12/+10
Now that many things are converted to Kconfig we can drop most of the Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2-32/+0
- Various MTD fixes from Boris - Zap various unused / legacy paths. - pxa3xx NAND update from Miquel Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-05Merge tag 'video-updates-for-2019.01-rc2' of git://git.denx.de/u-boot-videoTom Rini1-9/+0
video, bmp and cls command updates
2018-12-04video: use BMP_ALIGN_CENTER define from splash.hAnatolij Gustschin1-1/+0
Drop BMP_ALIGN_CENTER define in lcd.c and video_bmp.c as it is already defined by splash.h. Include splash.h in bmp code. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2018-12-04cmd: add clear screen 'cls' commandAnatolij Gustschin1-8/+0
Add common clear screen command for configurations CONFIG_DM_VIDEO, CONFIG_LCD and CONFIG_CFB_CONSOLE. Remove the existing cls command implementation from lcd.c code and activate the command for all boards enabling CONFIG_LCD for compatibility reasons. Signed-off-by: Anatolij Gustschin <agust@denx.de> Tested-by: Patrick.Delaunay <patrick.delaunay@free.fr>
2018-12-03Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2-2/+4
Patch queue for efi - 2018-12-03 This release is fully packed with lots of glorious improvements in UEFI land again! - Make PE images more standards compliant - Improve sandbox support - Improve correctness - Fix RISC-V execution on virt model - Honor board defined top of ram (fixes a few boards) - Imply DM USB access when distro boot is available - Code cleanups
2018-12-03board_r: fix build with DM_SPIChristophe Leroy1-1/+1
CC common/board_r.o common/board_r.c:747:2: error: ‘initr_spi’ undeclared here (not in a function) initr_spi, ^ make[1]: *** [common/board_r.o] Error 1 Fixes: ebe76a2df9f6 ("dm: Remove spi_init() from board_r.c when using driver model") Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-12-03rsa: add support of padding pssPhilippe Reynes1-0/+6
We add the support of the padding pss for rsa signature. This new padding is often recommended instead of pkcs-1.5. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-03rsa: add a structure for the paddingPhilippe Reynes2-0/+34
The rsa signature use a padding algorithm. By default, we use the padding pkcs-1.5. In order to add some new padding algorithm, we add a padding framework to manage several padding algorithm. The choice of the padding is done in the file .its. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-02fdt_support: fdt reservations on the sandboxHeinrich Schuchardt1-1/+2
On the sandbox the memory addresses in the device tree refer to the virtual address space of the sandbox. This implies that the memory reservations for the fdt also have to be converted to this address space. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-12-02fdt: sandbox: correct use of ${fdtcontroladdr}Heinrich Schuchardt1-1/+2
The sandbox uses a virtual address space that is neither the physical nor the virtual address space of the operating system. All address used on the command line live in this address space. So also the environment variable ${fdtcontroladdr} has to be in this address space. Commands like bootefi and booti receive the fdt address as parameter. Without the patch ${fdtcontroladdr} cannot be used as parameter value on the sandbox. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-11-29malloc_simple: Add logging of allocationsSimon Glass1-21/+37
It is sometimes useful to see what memory is being allocated early during boot. Add logging to support this, using a new LOGC_ALLOC category. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-28tools: MediaTek: add MTK boot header generation to mkimageRyder Lee1-0/+1
This patch adds support for MTK boot image generation. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-27board_r: Remove initr_spiJagan Teki1-11/+0
Drop unused initr_spi, which just return 0, no usage. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-11-27spi: Zap CONFIG_HARD_SPIJagan Teki1-12/+0
In legacy CONFIG_HARD_SPI initalizing spi_init code, which was removed during dm conversion cleanup. So remove the dead instances of CONFIG_HARD_SPI, and related code. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-11-27spi: Remove unused mpc8xx codeJagan Teki1-7/+0
- spi_init_f - spi_init_r - spi_read - spi_write these spi calls are exclusively for mpc8xx, but the relevant driver is not available so remove it. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-11-27spi: Remove used spi_initJagan Teki1-2/+0
spi_init used in some areas in tree, but the respective drivers will remove in future patches. So remove the same instances. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-11-26usb: storage: s/CONFIG_BLK/CONFIG_IS_ENABLED(BLK)/Sven Schwermer1-14/+14
This fixes link issues when building the SPL without USB driver model but with USB storage support. CONFIG_BLK can be enabled and disabled independently for SPL and non-SPL builds. We leverage that existing functionality here. Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2018-11-26usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/Sven Schwermer4-20/+20
This allows to disable the USB driver model in SPL because it checks the CONFIG_SPL_DM_USB variable for SPL builds. Nothing changes for regular non-SPL builds. Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2018-11-26usb: Remove CMD_USB dependency for common codeSven Schwermer1-1/+1
Common USB code is built whenever USB is enabled (in non-SPL builds). The USB uclass is built whenever (SPL_)DM_USB is enabled. Both need to be independent from CMD_USB. Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2018-11-26spl: Add support for passing handoff info to U-Boot properSimon Glass5-12/+158
There is some basic informaton that SPL normally wants to pass through to U-Boot, such as the SDRAM size and bank information. Mkae use of the new bloblist structure for this. Add a new 'handoff' blob which is set up in SPL and passed to U-Boot proper. Also adda test for sandbox_spl that checks that this works correctly and a new 'sb' command to show the information passed from SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26sandbox: Allow puts() output before global_data is set upSimon Glass1-0/+7
We support putc() in this case but not puts(), but this is more useful since it is what printf() uses. This particularly affects debugging early in SPL, where currently printf() statements result in no output. Fix this by adding a special case into puts() for sandbox, just like putc(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2018-11-26spl: Add a comment to spl_set_bd()Simon Glass1-0/+4
There is a strange feature to set global_data to a data-section variable early in SPL. This only works if SPL actually has access to SRAM which is not the case on x86, for eaxmple. Add a comment to this effect. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Make SPL_DISABLE_BANNER_PRINT a positive optionSimon Glass2-5/+14
Rather than having a negative option, make this a positive option and enable it by default. This makes it easier to understand. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Add a define for SPL_TPL_PROMPTSimon Glass1-12/+15
We should use a macro rather than hard-coding the SPL prompt to 'spl' since the code can be used by TPL too. Add a macro that works for both and use it in various places. This allows TPL to use the same code without printing confusing messages. Note that the string is lower case ('spl', 'tpl') which is a change from previously. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Support hash, input, pch, pci, rtc, tpm in SPLSimon Glass1-1/+47
At present these subsystems are only supported in U-Boot proper but it is sometimes necessary to support them in SPL, or even TPL. Update the Kconfig and Makefile to support this. Also adjust GPIO so that it can be used in TPL if required. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26bloblist: Locate bloblist in U-BootSimon Glass1-0/+34
Add support for locating a bloblist in U-Boot that has been set up by SPL. It is copied into RAM during relocation. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Set up the bloblist in SPLSimon Glass1-2/+16
The bloblist is normally set up in SPL ready for use by U-Boot. Add a simple implementation of this to the common SPL code. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26Add core support for a bloblist to convey data from SPLSimon Glass3-0/+288
At present there is no standard way in U-Boot to pass information from SPL to U-Boot proper. But sometimes SPL wants to convey information to U-Boot that U-Boot cannot easily figure out. For example, if SPL sets up SDRAM then it might want to pass the size of SDRAM, or the location of each bank, to U-Boot proper. Add a new 'bloblist' feature which provides this. A bloblist is set up in the first phase of U-Boot that runs (i.e. TPL or SPL). The location of this info may be in SRAM or CAR (x86 cache-as-RAM) or somewhere else. Information placed in this region is preserved (with a checksum) through TPL and SPL and ends up in U-Boot. At this point it is copied into SDRAM so it can be used after relocation. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andreas Dannenberg <dannenberg@ti.com>
2018-11-26spl: Add support for logging in SPL and TPLSimon Glass3-4/+43
It is sometimes useful to log information in SPL and TPL. Add support for this. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20spl: Support bootstage, log, hash and early malloc in TPLSimon Glass2-3/+42
At present these features are supported in SPL but not TPL. Update the Kconfig and Makefile to allow this. Also add a few Makefile comments to make earier to track what is going on. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20sandbox: cros_ec: exynos: Drop use of cros_ec_get_error()Simon Glass1-12/+0
This function is really just a call to uclass_get_device() and there is no reason why the caller cannot do it. Update sandbox and snow accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Minkyu Kang <mk7.kang@samsung.com>
2018-11-16image-sig: Ensure that hashed-nodes is null-terminatedKonrad Beckmann1-0/+5
A specially crafted FIT image leads to memory corruption in the stack when using the verified boot feature. The function fit_config_check_sig has a logic error that makes it possible to write past the end of the stack allocated array node_inc. This could potentially be used to bypass the signature check when using verified boot. This change ensures that the number of strings is correct when counted. Signed-off-by: Konrad Beckmann <konrad.beckmann@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-16arm: at91: wdt: Convert watchdog driver to dm/dtPrasanthi Chellakumar1-1/+1
Convert the Watchdog driver for AT91SAM9x processors to support the driver model and device tree. Changes "CONFIG_AT91SAM9_WATCHDOG" to new "CONFIG_WDT_AT91" Kconfig option. Signed-off-by: Prasanthi Chellakumar <prasanthi.chellakumar@microchip.com>
2018-11-14blk: Call part_init() in the post_probe() methodBin Meng1-3/+1
part_init() is currently called in every DM BLK driver, either in its bind() or probe() method. However we can use the BLK uclass driver's post_probe() method to do it automatically. Update all DM BLK drivers to adopt this change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14dm: cpu: Fix print_cpuinfo() outputBin Meng1-1/+1
It was observed that current output of print_cpuinfo() on QEMU x86 targets does not have an ending '\n', neither have a leading 'CPU:' any more. However it used to have these before. It turns out commit c0434407b595 introduced a unified DM version of print_cpuinfo() that exposed such issue on QEMU x86. Fixes: c0434407b595 ("board_f: Use static print_cpuinfo if CONFIG_CPU is active") Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14board_f: Use static print_cpuinfo if CONFIG_CPU is activeMario Six1-0/+28
When the DM CPU drivers are active, printing information about a CPU should be delegated to a matching driver. Hence, add a static print_cpuinfo that implements this delegation when DM CPU drivers are active. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc> Changed condition to CONFIG_IS_ENABLED(CPU): Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-09common: build ymodem only on needJun Nie1-1/+2
Build ymodem only on need to shrink spl image size. Signed-off-by: Jun Nie <jun.nie@linaro.org>
2018-11-09common: Compile error with CONFIG_MULTI_DTB_FIT and not SPLLars Povlsen1-1/+0
common/common_fit.c is including <spl.h>, but not actually using it. The inclusion will cuase compile error on platforms using CONFIG_OF_SEPARATE and not SPL. Signed-off-by: Lars Povlsen <lars.povlsen@microsemi.com> Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-11-09spl: fix debug prints for tiny printfSimon Goldschmidt1-8/+6
Tiny printf does not support %.*s and %lX. Since tiny printf should be very common in SPL, replace these by %32s (for printing image name) and %lx. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-09fit: Add missing CR in debug output in fit_find_config_node()Stefan Roese1-1/+1
Testing has shown that a line-break is missing in one debug line in fit_find_config_node(). Signed-off-by: Stefan Roese <sr@denx.de>
2018-11-07Revert "board_f: Use static print_cpuinfo if CONFIG_CPU is active"Bin Meng1-28/+0
This reverts commit c0434407b595f785fc7401237896c48c791b45fd. It turns out commit c0434407b595 broke some boards which have DM CPU driver with CONFIG_DISPLAY_CPUINFO option on. These boards just fail to boot when print_cpuinfo() is called during boot. Fixes are already sent to ML and in u-boot-dm/next, however since we are getting close to the v2018.11 release, it's safer we revert the original commit. This commit should be reverted after v2018.11 release. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-10-25Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini1-0/+5
2018-10-25Merge tag 'u-boot-imx-20181025' of git://git.denx.de/u-boot-imxTom Rini1-0/+1
Merged imx8 architecture, fix build for imx8 + warnings