aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-18mips: octeon: Add minimal Octeon 3 EBB7304 EVK supportStefan Roese
This patch adds very basic minimal support for the Marvell Octeon 3 CN73xx based EBB7304 EVK. Please note that the basic Octeon port does not support DDR3/4 initialization yet. To still use U-Boot on with this port, the L2 cache (4MiB) is used as RAM. This way, U-Boot can boot to the prompt on this board. Supported devices: - UART - reset - CFI parallel NOR flash Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: octeon: use mips_mach_early_init() to copy to L2 cacheStefan Roese
This patch adds the code to copy itself from bootrom location to a different location (TEXT_BASE) to the Octeon platform. Its used in this case to copy the complete U-Boot image into L2 cache, which greatly improves the bootup time - especially in regard to the very long and complex DDR4 init code. The Kconfig symbol CONFIG_MIPS_MACH_EARLY_INIT is enabled with this patch for Octeon. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: octeon: dts: Add Octeon 3 cn73xx base dtsi fileStefan Roese
This patch adds the base dtsi file for the Octeon 3 cn73xx SoC. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: octeon: Initial minimal support for the Marvell Octeon SoCAaron Williams
This patch adds very basic support for the Octeon III SoCs. Only CFI parallel NOR flash and UART is supported for now. Please note that the basic Octeon port does not include the DDR3/4 initialization yet. This will be added in some follow-up patches later. To still use U-Boot on with this port, the L2 cache (4MiB on Octeon III CN73xx) is used as RAM. This way, U-Boot can boot to the prompt on such boards. Signed-off-by: Aaron Williams <awilliams@marvell.com> Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18sysreset: Add Octeon sysreset driverStefan Roese
This patch adds a UCLASS_SYSRESET sysreset driver for the Octeon SoC family. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-07-18mips: Add CONFIG_MIPS_MACH_EARLY_INIT for very early mach init codeStefan Roese
This patch adds the optional call to mips_mach_early_init() to start.S at a very early stage. Its disabled per default. It can be used for very early machine / platform specific init code. Its called very early and at this stage the PC is allowed to differ from the linking address (CONFIG_TEXT_BASE) as no absolute jump has been performed until this call. It will be used by thje Octeon platform. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-07-18mips: sync asm/mipsregs.h with Linux 5.7Daniel Schwierzeck
Sync asm/mipsregs.h with Linux 5.7. Also replace the custom symbols EBASE_CPUNUM and EBASE_WG with the according symbols from Linux. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: sync asm/addrspace.h with Linux 5.7Daniel Schwierzeck
Sync asm/addrspace.h with Linux 5.7 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: sync asm/asm.h with Linux 5.7Daniel Schwierzeck
Sync asm/asm.h with Linux 5.7. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: remove deprecated UNCACHED_SDRAM() macroDaniel Schwierzeck
This macro only served as a wrapper for CKSEG1ADDR() with an exception for CONFIG_TB0229. CONFIG_TB0229 doesn't exist, thus use CKSEG1ADDR() directly. This also prepares for an upcoming asm header sync with Linux. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: add config options for generic cache setup codeDaniel Schwierzeck
Add an own Kconfig symbol for the initial disabling of caches invoked from generic start code. Also add an own Kconfig symbols for the initialization of caches invoked from generic start code. Until now both code paths could only be disabled with CONFIG_SKIP_LOWLEVEL_INIT. But this is not flexible enough for RAM boot scenarios like EJTAG or SPL payload or for machines which don't require cache initialization or which want to provide their own cache implementation. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: refactor disabling of cachesDaniel Schwierzeck
Logically this code belongs to cache_init.S. If a complex SoC needs to replace the generic cache init, mips_cache_disable() can now be called from custom start.S files. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: add KSEG1 wrapper for change_k0_ccaDaniel Schwierzeck
change_k0_cca() is called multiple times. Move the code for changing to KSEG1 to a macro to avoid code duplication. Also fix missing change to KSEG1 when changing to CONF_CM_CACHABLE_COW. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: start.S: remove dead codeDaniel Schwierzeck
Since commit 703ec9ddf965 ("MIPS: Stop building position independent code") the relocation code was completely reworked and removed from start.S. Remove some left-overs of the old code. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2020-07-18mips: cache: Make invalidate_dcache_range() weak to enable overwriteStefan Roese
This patch adds __weak to invalidate_dcache_range() in lib/cache.c. This makes it possible to overwrite this function by a platforms specific version, which will be done for Octeon. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: cache: Make flush_cache() weak to enable overwriteStefan Roese
This patch adds __weak to flush_cache() in lib/cache.c. This makes it possible to overwrite this function by a platforms specific version, like done with the Octeon base port. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: cache: Allow using CONFIG_MIPS_L2_CACHE without CONFIG_MIPS_CMStefan Roese
This patch enables the usage of CONFIG_MIPS_L2_CACHE without CONFIG_MIPS_CM, which is what is needed for the newly added Octeon platform. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: reloc: Change R_MIPS_NONE to catch pre-reloc BSS usageStefan Roese
This patch changes the R_MIPS_NONE define from 0 to a magic value. This makes it possible to better detect any forbidden pre-relocation usage of BSS variables, as they are often zero'ed and then relocation is stopped too early. Additionally the error message is improved to also print the faulting address. This helps finding the root-cause for this breakage by comparing this address with the values in System.map. This patch helps a lot when working on pre-relocation code, like the Octeon DDR init code, where such variables have hit me multiple times now. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Aaron Williams <awilliams@marvell.com> Cc: Chandrakala Chavva <cchavva@marvell.com>
2020-07-18mips: traps: Set WG bit in EBase register on OcteonStefan Roese
WG (bit 11) needs to be set on Octeon to enable writing bits 63:30 of the exception base register. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-18mips: time: Only compile the weak get_tbclk() when neededStefan Roese
This patch opts-out the compilation of get_tbclk() if CONFIG_SYS_MIPS_TIMER_FREQ is not defined. This is used on the Octeon platform, where the weak get_tbclk() function is overwritten by its platform specific one. Signed-off-by: Stefan Roese <sr@denx.de>
2020-07-17Merge branch '2020-07-17-misc-fixes'Tom Rini
A large number of assorted fixes, including but not limited to: - Correct fixdep and CONFIG_IS_ENABLED(...) - lz4 on big endian - Assorted LMB hardening - Remove bd_t typedef
2020-07-17include: pci_ids: Add Cavium devicesSuneel Garapati
Add VendorID and DeviceID for supported devices on OcteonTX/TX2 platforms. Signed-off-by: Suneel Garapati <sgarapati@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-07-17doc: fit: Write hex address as hex instead of intMichal Simek
When update_uboot.its is used directly there is syntax error for no reason. Error report: mkimage -f update_uboot.its boot Error: update_uboot.its:18.12-13 syntax error FATAL ERROR: Unable to parse input tree mkimage: Can't read boot.tmp: Invalid argument Fixes: 4bae90904b69 ("Automatic software update from TFTP server") Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-07-17mtd: mtdpart: use uint64_t instead of int for cur_offMartin Kaistra
The types of "offset" and "size" of "struct mtd_partition" are uint64_t, while mtd_parse_partitions() uses int to work with these values. When the offset reaches 2GB, it is interpreted as a negative value, which leads to error messages like mtd: partition "<partition name>" is out of reach -- disabled eg. when using the "ubi part" command. Fix this by using uint64_t for cur_off and cur_sz. Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2020-07-17board/km: update MAINTAINERS emailHolger Brunck
Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com> CC: Valentin Longchamp <valentin.longchamp@hitachi-powergrids.com>
2020-07-17doc: correct description of crash dumpsHeinrich Schuchardt
Correct the description of the ESR register. Fix a typo. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-17fixdep: fix CONFIG_IS_ENABLED etc. handlingStephen Warren
When fixdep detects CONFIG_IS_ENABLED and other similar macros, it must parse the macro parameter to determine which actual CONFIG_ option is being referenced. This involves moving a pointer forward through the entire CONFIG_ option "word". Currently, the code uses variable q to walk through the word, but doesn't actually initialize it to point at the parameter before doing so. Consequently, the walking process immediately fails since it sees the macro invocatoins's ( rather than the expected alpha-numeric characters in the macro parameter. Fix this by adding the missing initialization. Fixes: 67f2ee86ccbe ("kbuild: fixdep: Resync this with v4.17") Fixes: 7012865e961c ("gpio: fix test.py for gpio label lookup") Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-17mkimage: Fix error message if write less data then expectedMylène Josserand
Add a new error message in case the size of data written are shorter than the one expected. Currently, it will lead to the following error message: "mkimage: Write error on uImage: Success" This is not explicit when the error is because the device doesn't have enough space. Let's use a more understandable message: "mkimage: Write only 4202432/4682240 bytes, probably no space left on the device" Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2020-07-17remove include/config_defaults.hRasmus Villemoes
Since commit 4b0bcfa7c4ec (Kconfig: Migrate CONFIG_BOOTM_* options), the config_defaults.h file has been void of any actual content - and these days, "sane defaults for everyone" is achieved by appropriate default values in Kconfig. Remove it, and thus make every translation unit process one less header file. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-07-17doc: multi-dtb-fit: Remove double underscoresFabio Estevam
Remove the incorrect usage of double underscores for the CONFIG_OF_LIST and CONFIG_SPL_OF_LIST symbols. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-07-17fs: error handling in do_load()Heinrich Schuchardt
If a file cannot be loaded, show an error message. Set the EFI boot device only after successfully loading a file. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-17asm/u-boot.h: remove bd_t definitionsMasahiro Yamada
All the users of bd_t were converted to struct bd_info. Remove the definitions. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-17treewide: convert bd_t to struct bd_info manuallyMasahiro Yamada
Some code was not converted by coccinelle, somehow. I manually fixed up the remaining, and comments, README docs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [trini: Add arch/arm/mach-davinci/include/mach/sdmmc_defs.h and include/fdt_support.h] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-17arm64: Remove CONFIG_SYS_FULL_VA macroMichal Simek
All configurations have been removed in 2016 by commit 7985cdf74b28 ("arm64: Remove non-full-va map code"). Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-07-17Makefile: Silence relocate-rela callJan Kiszka
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-07-17lib: zlib: Remove offset pointer optimization in inftrees.cChin Liang See
This fixes the CVE-2016-9840. Commit imported from [1]. inftrees.c was subtracting an offset from a pointer to an array, in order to provide a pointer that allowed indexing starting at the offset. This is not compliant with the C standard, for which the behavior of a pointer decremented before its allocated memory is undefined. Per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this tiny optimization was removed, in order to avoid the possibility of undefined behavior. [1]: https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0 Signed-off-by: Mark Adler <madler@alumni.caltech.edu> Signed-off-by: Chin Liang See <chin.liang.see@intel.com> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2020-07-17Convert CONFIG_ARMV7_PSCI_1_0 and CONFIG_ARMV7_PSCI_0_2 to KconfigPatrick Delaunay
This converts the following to Kconfig: CONFIG_ARMV7_PSCI_1_0 CONFIG_ARMV7_PSCI_0_2 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-17spl: fix ext4fs_mount return code handlingThomas Schaefer
- Despite other ext4 filesystem functions, ext4fs_mount returns 0 in case of error. - This leads to u-boot crash in case that an SD card with valid partition table but without ext4 filesystem created in a partition is found on SD card. - Fix this by returning a proper error code of '-1' from spl_load_image_ext function in case of ext4fs_mount error. Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com> [hthiery: slightly reword the commit message] Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-07-17cmd: booti: convert the debug print about image move to printfTero Kristo
Moving of the OS image may have some nasty side effects like corrupting DTB. Convert the current debug print to printf so that the relocation of the OS is always obvious to the user. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-07-17common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS imageTero Kristo
These cases are typically fatal and are difficult to debug for random users. Add checks for detecting overlapping images and abort if overlap is detected. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-07-17image: fdt: bail out with error if no boot time FDT image foundTero Kristo
Currently the boot continues if the FDT image is clearly corrupted, which just causes the loaded OS to hang. Abort boot properly if the FDT is corrupted. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-07-17Convert CONFIG_MXC_UART to KconfigTom Rini
This converts the following to Kconfig: CONFIG_MXC_UART Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Peng Fan <peng.fan@nxp.com>
2020-07-17lz4: fix decompressor on big-endian powerpcRasmus Villemoes
Booting an lz4-compressed kernel image fails on our powerpc board with -EPROTONOSUPPORT. Adding a bit of debug prints, we get magic: 0x184d2204 flags: 0x64 reserved0: 1 has_content_checksum: 1 has_content_size: 0 has_block_checksum: 0 independent_blocks: 1 version: 0 block_descriptor: 70 reserved1: 7 max_block_size: 0 reserved2: 0 So the magic is ok, but the version check fails, also some reserved bits are apparently set. But that's because the code interprets the "flags" and "block_descriptor" bytes wrongly: Using bit-fields to access individual bits of an "on the wire" format is not portable, not even when restricted to the C flavour implemented by gcc. Quoting the gcc manual: * 'The order of allocation of bit-fields within a unit (C90 6.5.2.1, C99 and C11 6.7.2.1).' Determined by ABI. and indeed, the PPC Processor ABI supplement says * Bit-fields are allocated from right to left (least to most significant) on Little-Endian implementations and from left to right (most to least significant) on Big-Endian implementations. The upstream code (github.com/lz4/lz4) uses explicit shifts and masks for encoding/decoding: /* FLG Byte */ *dstPtr++ = (BYTE)(((1 & _2BITS) << 6) /* Version('01') */ + ((cctxPtr->prefs.frameInfo.blockMode & _1BIT ) << 5) + ((cctxPtr->prefs.frameInfo.blockChecksumFlag & _1BIT ) << 4) + ((unsigned)(cctxPtr->prefs.frameInfo.contentSize > 0) << 3) + ((cctxPtr->prefs.frameInfo.contentChecksumFlag & _1BIT ) << 2) + (cctxPtr->prefs.frameInfo.dictID > 0) ); /* Flags */ { U32 const FLG = srcPtr[4]; U32 const version = (FLG>>6) & _2BITS; blockChecksumFlag = (FLG>>4) & _1BIT; blockMode = (FLG>>5) & _1BIT; contentSizeFlag = (FLG>>3) & _1BIT; contentChecksumFlag = (FLG>>2) & _1BIT; dictIDFlag = FLG & _1BIT; /* validate */ if (((FLG>>1)&_1BIT) != 0) return err0r(LZ4F_ERROR_reservedFlag_set); /* Reserved bit */ if (version != 1) return err0r(LZ4F_ERROR_headerVersion_wrong); /* Version Number, only supported value */ } Do the same here, and while at it, be more careful to use unaligned accessors to what is most likely unaligned. Also update the comment to make it clear that it only refers to the lz4.c file, not the following code of lz4_wrapper.c. This has been tested partly, of course, by seeing that my lz4-compressed kernel now boots, partly by running the (de)compression test-suite in the (x86_64) sandbox - i.e., it should still work just fine on little-endian hosts. Reviewed-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-07-17doc: Coccinelle: move to HTML docHeinrich Schuchardt
Move doc/README.coccinelle to doc/develop/coccinelle.rst using the current linux-next version of the text. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-17Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini
- New timer API to allow delays with a 32-bit microsecond timer - Add dynamic ACPI structs (DSDT/SSDT) generations to the DM core - x86: Enable ACPI table generation by default - x86: Enable the copy framebuffer on Coral - x86: A few fixes to FSP2 with ApolloLake - x86: Drop setup_pcat_compatibility() - x86: Primary-to-Sideband Bus minor fixes
2020-07-17Merge tag 'u-boot-imx-20200716' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx i.MX for 2020.10 ---------------- - i.MX DDR driver fix/update for i.MX8M - i.MX pinctrl driver fix. - Use arm_smccc_smc to remove imx sip function - i.MX8M clk update - support booting aarch32 kernel on aarch64 hardware - fused part support for i.MX8MP - imx6: pcm058 to DM Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/708734785
2020-07-17acpi: Enable ACPI table generation by default on x86Simon Glass
This should ideally be used by all x86 boards in U-Boot. Enable it by default. If some boards don't use it, the cost is small. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17x86: Rename board_final_cleanup() to board_final_init()Simon Glass
This function sounds like something that is called when U-Boot is about to jump to Linux. In fact it is an init function. Rename it to reduce confusion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2020-07-17x86: acpi: Correct the version of the MADTSimon Glass
Currently U-Boot implements version 2 but reports version 4. Correct it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>