summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2020-07-02riscv: sbi: Add newline to error messageSean Anderson
Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Bin Meng <bin.meng@windriver.com>
2020-06-28splash: Fix build warning on 64 bits CPUYe Li
Get below warning on ARM64 platform, because the bmp_load_addr is defined to u32. common/splash.c: In function ‘splash_video_logo_load’: common/splash.c:74:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 74 | memcpy((void *)bmp_load_addr, bmp_logo_bitmap, Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # bpi-m1+, bpi-m64
2020-06-04sifive: fu540: Add U-Boot proper sector startJagan Teki
Add U-Boot proper sector start offset for SiFive FU540. This value is based on the partition layout supported by SiFive FU540. u-boot.itb need to write on this specific offset so-that the SPL will retrieve it from here and load. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-06-02image: android: fix abootimg supportChristian Gmeiner
abootimg creates images where all load addresses are 0. Android Boot Image Info: * file name = artifacts/fastboot.img * image size = 31381504 bytes (29.93 MB) page size = 2048 bytes * Boot Name = "" * kernel size = 9397406 bytes (8.96 MB) ramdisk size = 21981144 bytes (20.96 MB) * load addresses: kernel: 0x00000000 ramdisk: 0x00000000 tags: 0x00000000 Without this fix we end in a data abort: Booting kernel at 0x15000000... * kernel: cmdline image address = 0x15000000 Kernel load addr 0x00000000 size 9178 KiB Kernel command line: ip=dhcp console=ttymxc0,115200n8 kernel data at 0x15000800, len = 0x008f649e (9397406) * ramdisk: cmdline image address = 0x15000000 RAM disk load addr 0x00000000 size 21473 KiB ramdisk start = 0x158f7000, ramdisk end = 0x16def35c kernel loaded at 0x00000000, end = 0x00000000 Loading Kernel Image data abort pc : [<8ff8c004>] lr : [<5d7ac70f>] sp : 8f57ed64 ip : 48f17668 fp : 00000000 r10: 00000002 r9 : 8f58aed0 r8 : 03fa4c58 r7 : 5e842497 r6 : fbe73965 r5 : 7c459955 r4 : df020fde r3 : 1b7aa45b r2 : 007f23fe r1 : 15104820 r0 : 00104000 Flags: nzCv IRQs off FIQs off Mode SVC_32 (T) Code: f07c e8b1 51f8 3a20 (e8a0) 51f8 Resetting CPU ... resetting ... Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2020-05-31spl: add fixed memory node in target fdt also when loading ATFHeiko Stuebner
In a loading chain SPL -> ATF (->OP-TEE) -> U-Boot, ATF and a subsequent OP-TEE will re-use the same fdt as the U-Boot target and may need the information about usable memory ranges. Especially OP-TEE needs this to initialize dynamic shared memory (the only type U-Boot implements when talking to OP-TEE). So allow spl_fixup_fdt() to take a fdt_blob argument, falling back to the existing CONFIG_SYS_SPL_ARGS_ADDR if needed and call it from the ATF path as well. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2020-05-20Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
- Add DM_ETH support for lx2160aqds, ls2080aqds, ls1088aqds - QSI related fixes on ls1012a, ls2080a, ls1046a, ls1088a, ls1043a based platforms - Bug-fixes/updtaes related to ls1046afrwy, fsl-mc, msi-map property
2020-05-19board_r: Detect ifc-nor flash at run-timePankit Garg
CONFIG_MTD_NOR_FLASH flag needs to be enable for all boot sources,as all flash drivers need to compile in TFA Boot.Probe ifc nor flash only when there is nor flash available on board.So needs to detect ifc-nor flash at run-time for probing. Signed-off-by: Pankit Garg <pankit.garg@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/bug.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop asm/ptrace.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18Fix some checkpatch warnings in calls to debug()Simon Glass
Fix up some incorrect code style in calls to functions in the log.h header, mostly debug(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop init.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop image.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop bootstage.h from common headerSimon Glass
Move this fairly uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18bootstage: Use BOOTSTAGE instead of BOOTSTATESimon Glass
Some of the enum members are wrong. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop part.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18part: Drop disk_partition_t typedefSimon Glass
We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop flash.h from common headerSimon Glass
Move this uncommon header out of the common header. Fix up some style problems in flash.h while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18flash: Tidy up coding style for flash functionsSimon Glass
Some functions use the wrong code style and generate checkpatch errors. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-15board_r: Introduce CONFIG_PCI_INIT_R Kconfig optionOvidiu Panait
With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they are without that config option enabled. However, there are cases such as DM PCI-based Ethernet devices that need the PCI bus enumerated so that they can be discovered by their drivers. Currently, to solve this, some boards enumerate the pci bus using "pci enum" preboot command, while others do it manually in board files (in board_init/board_late_init/etc. functions). In order to possibly make the pci enumeration process uniform across all boards, introduce CONFIG_PCI_INIT_R Kconfig option. This change also preserves the current behavior in the !DM_PCI case (pci_init is run unconditionally at boot). Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-05-15board_r: env: Use IS_ENABLED() instead of #ifdefsOvidiu Panait
Use IS_ENABLED() instead of #ifdef in should_load_env and initr_env functions. No functional change intended. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-05-15common/board_f: avoid -Wtype-limits warningHeinrich Schuchardt
CONFIG_SYS_SDRAM_BASE maybe zero. Avoid a build warning when compiling with -Wtype-limits. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-15spl: Always define preloader_console_initSamuel Holland
A large number of boards call preloader_console_init unconditionally. Currently, they fail to build with CONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always define preloader_console_init, but make it no-op when CONFIG_SPL_SERIAL=n. For the few boards that did check for CONFIG_SPL_SERIAL before calling preloader_console_init, remove the checks, since the function can now be called unconditionally. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-05-15rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRATrevor Woerner
Have this symbol follow the pattern of all other such symbols. Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2020-05-10Merge branch 'master' of git://git.denx.de/u-bootStefano Babic
2020-05-07menu: add support for client defined statusline functionThirupathaiah Annapureddy
Currently displaying status line is done in a weak function menu_display_statusline(). bootmenu.c overrides the weak default function. It calls menu_default_choice() and interprets the data as struct bootmenu_entry. pxe boot also uses common menu code for pxe menus. If there is a system that enables both bootmenu and pxe, menu_display_statusline() defined in bootmenu.c will be called and it will interpret struct pxe_label as struct bootmenu_entry. This leads to data aborts and pxe menu corruptions. This patch adds support for client defined statusline function to resolve the above bug. Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
2020-05-04Merge tag 'u-boot-imx-20200502' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx i.MX for 2020.07 ---------------- - imxrt: fix LCD clock, fix doc - new board: Coral Dev - imx8: enable Cache in SPL. SNVS, update SCFW API - imx8MM: fix reset, 8MQ quand and QuadLite, CPU speed grading - MX6ULL : is_imx6ull to include i.MX6ULZ - Net: add config to enable TXC delay Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/682033914
2020-05-03common: board_f: Use cpu_get_current_dev in print_cpuinfoYe Li
Current print_cpuinfo gets the first udevice in CPU class to return the cpu info. This has problem if the boot CPU is not fixed. Changing to use new API cpu_get_current_dev to fix the issue. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-03spl: sdp: Add DM gadget support for sdpSherry Sun
When enable CONFG_SPL_DM_USB_GADGET, sdp should use usb_gadget_initialize() and usb_gadget_release() to support DM gadget driver. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-03spl: sdp: Add a callback to clean up USB driverYe Li
Because SDP directly jumps to next level boot image, we'd better clean up the USB driver before it. Implement a weak callback function, that spl sdp can use it to clean up USB driver. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-03spl: sdp: Add CONFIG_SPL_SDP_USB_DEV for USB deviceYe Li
Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the usb index for spl sdp driver, so that we change use different device. The default value is 0. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-03spl: sdp: call board_usb_init at spl_sdp_load_imageFrank Li
Need initialize UDC before run sdp download Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-01Revert "imx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon ↵Harald Seiler
mode" The CONFIG_SPL_FORCE_MMC_BOOT config flag is not needed as its behavior is the correct one in all cases; using spl_boot_device() instead of the boot_device parameter will lead to inconsistency issues, for example, when a board_boot_order() is defined. In fact, this is the reason the parameter was introduced in the first place, in commit 2b1cdafa9fdd ("common: Pass the boot device into spl_boot_mode()"). This reverts commit 772b55723bcbe8ebe84f579d9cdc831d8e18579d. Link: https://lists.denx.de/pipermail/u-boot/2020-April/405979.html Signed-off-by: Harald Seiler <hws@denx.de>
2020-05-01common/board_r: Drop initr_bedbug wrapperOvidiu Panait
Drop initr_bedbug wrapper and call bedbug_init directly during the init sequence. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-01common/board_r: arm: Merge initr_enable_interrupts into interrupts_initOvidiu Panait
initr_enable_interrupts() is an ARM-specific wrapper over enable_interrupts(), which is run during the common init sequence. It can be eliminated by moving the enable_interrupts() call to the end of interrupt_init() function, in arch/arm/lib/interrupts*.c. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-01malloc: dlmalloc: add an ability for the malloc to be re-init/init multiple ↵Marek Bykowski
times Malloc gets initialized with a call to mem_malloc_init() with the address the allocation starts to and its size. Currently it is not possible to move the malloc from one memory area to another as the malloc would eventually fail. This patch adds in the ability to re-init the malloc with the updated start address and the size. One of the use cases of this feature is SPL U-Boot running from within the static memory and calling to malloc init from within board_init_f(): arch/arm/cpu/armv8/start.S:reset vector arch/arm/cpu/armv8/start.S:main() arch/arm/lib/crt0_64.S:board_init_f() board/<my_board>/common/spl.c:board_init_f() board/<my_board>/common/spl.c:mem_malloc_init((ulong)CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); Shortly after the DDR (main) memory is init and ready we call to malloc init again but this time with the start address in the DDR memory and a much greater size for moving the allocation off the static to the DDR memory: board/<my_board>/common/spl.c:mem_malloc_init((ulong)CONFIG_SPL_MALLOC_OFFSET, CONFIG_SPL_MALLOC_SIZE); Where CONFIG_SYS_SPL_MALLOC_START and CONFIG_SPL_MALLOC_OFFSET are the start addresses of the malloc in the static and DDR memories respectively and CONFIG_SYS_SPL_MALLOC_SIZE=SZ_16K and CONFIG_SPL_MALLOC_SIZE=SZ_2M are the sizes of the mallocs in these memories. Note, now we have a much greater memory, enlarging from 16K to 2M, available for allocation. There is an alternative approach already existing in U-Boot with the use of an early (simplified) malloc and the proper (dlamalloc) malloc however necessitating managing the two mallocs whereas this approach proposes using a single dlmalloc. Signed-off-by: Marek Bykowski <marek.bykowski@gmail.com>
2020-05-01rsa: sig: fix config signature check for fit with paddingPhilippe Reynes
The signature check on config node is broken on fit with padding. To compute the signature for config node, U-Boot compute the signature on all properties of requested node for this config, except for the property "data". But, when padding is used for binary in a fit, there isn't a property "data" but two properties: "data-offset" and "data-size". So to fix the check of signature, we also don't use the properties "data-offset" and "data-size" when checking the signature on config node. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-05-01hush: avoid NULL check before free()Heinrich Schuchardt
free() checks if its argument is NULL. Don't duplicate this in the calling code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-28Merge tag 'dm-pull-27apr20' of git://git.denx.de/u-boot-dmTom Rini
Move Python tools to use absolute paths Minor buildman fixes for new features Make libfdt code more similar to upsteam
2020-04-27spl: spl_legacy: Add lzma decompression support for legacy imageWeijie Gao
This patch adds support for decompressing LZMA compressed u-boot payload in legacy uImage format. Using this patch together with u-boot-lzma.img may be useful for some platforms as they can reduce the size and load time of u-boot payload. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Stefan Roese <sr@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2020-04-27spl: spl_nor: Remove unused variable 'ret' warningStefan Roese
With the if statement now for the legacy image handling, the compiler now generates this compile time warning: common/spl/spl_nor.c:27:6: warning: unused variable 'ret' [-Wunused-variable] This patch removes this warning by changing the 'ret' variable handling. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-04-27spl: spl_nor: Move legacy image loading into spl_legacy.cStefan Roese
Move the legacy image loading into spl_legacy.c. This makes it easier to extend the legacy image handling with new features that other SPL loaders might use (e.g. spl_spi.c etc). No functional change intended. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-04-27spl: spl_legacy: Use IS_ENABLED() to remove #ifdefStefan Roese
Use IS_ENABLED() instead of #ifdef CONFIG_ to remove one #ifdef. No functional change intended. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-04-27spl: Extract legacy image handling into separate fileStefan Roese
This patch moves the legacy image handling into a separate file, which will be extended with other legacy image features later. No function change intended. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-04-26log: remove useless castHeinrich Schuchardt
There is no need to cast from (void *) before assigning to a pointer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-26libfdt: split fdt_region declarations out to <fdt_region.h>Masahiro Yamada
fdt_region APIs are not part of libfdt. They are U-Boot extension for the verified boot. Split the declarations related to fdt_region out of <fdt_region.h>. This allows <linux/libfdt.h> to become a simple wrapper file, like Linux does. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>