Commit Graph

69614 Commits

Author SHA1 Message Date
Oliver Graute
61eb1fe568 imx: clk: added IPG Clock for I2C on imx8qm
This patch fixes this clk issue on I2C on imx8qm

 => i2c bus
 Bus 3:  i2c@5a830000
 => i2c dev 3
 Setting bus to 3
 Failed to enable ipg clk
 Failure changing bus number (-524)

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2020-12-06 15:07:51 +01:00
Heiko Schocher
7a8d18da4b imx: aristainetos: enable U-Boot Environment variables protection
enable Environment protection with:

CONFIG_ENV_APPEND=y
CONFIG_ENV_WRITEABLE_LIST=y
CONFIG_ENV_ACCESS_IGNORE_FORCE

and add board specific env_get_location()
function.

Signed-off-by: Heiko Schocher <hs@denx.de>
2020-12-06 15:07:40 +01:00
Heiko Schocher
68163c3bf0 arm: dts: aristainetos: sync with changes in linux
sync with comaptible changes in linux from
Krzysztof Kozlowski.

https://patchwork.kernel.org/project/linux-arm-kernel/patch/20200930190143.27032-12-krzk@kernel.org/

Signed-off-by: Heiko Schocher <hs@denx.de>
2020-12-06 15:07:35 +01:00
Heiko Schocher
015c026f7a imx6: add support for aristainetos2c_cslb board variant
add support for aristainetos2c_cslb board variant.

Signed-off-by: Heiko Schocher <hs@denx.de>
2020-12-06 15:07:06 +01:00
Heiko Schocher
3cf02f5ffa imx6: remove not longer supported aristainetos boards
Removed aristainetos2, 2b, 2b-csl. This boards have been
recalled and destroyed.

Adapt board code to remove stuff not needed anymore.

Fix checkpatch warning, remove fdt_high and initrd_high
from default environment.

Signed-off-by: Heiko Schocher <hs@denx.de>
zu remove
2020-12-06 15:06:16 +01:00
Tom Rini
837d034d9a Merge https://gitlab.denx.de/u-boot/custodians/u-boot-tegra
- Assorted updates
2020-12-05 15:41:18 -05:00
Patrick Delaunay
4f5128ff89 configs: cei-tk1-som: remove CONFIG_ARMV7_PSCI in include file
Activate ARCH_SUPPORT_PSCI as other TEGRA124 target and remove
CONFIG_ARMV7_PSCI and CONFIG_ARMV7_PSCI_NR_CPUS in configs file as they
are migrated in Kconfig.

Select CONFIG_ARMV7_PSCI_0_1 (the first PSCI version),
because CONFIG_ARMV7_PSCI_0_2 and CONFIG_ARMV7_PSCI_1_0
are not activated in this product.

Hi,

This patch depend on the previous serie [1].

I don't test this patch on real hardware but
after this patch the size of the binary don't change.

In .config we have:
  CONFIG_ARCH_SUPPORT_PSCI=y
  CONFIG_ARMV7_PSCI=y
  # CONFIG_ARMV7_PSCI_1_0 is not set
  # CONFIG_ARMV7_PSCI_0_2 is not set
  CONFIG_ARMV7_PSCI_0_1=y
  CONFIG_ARMV7_PSCI_NR_CPUS=4

In u-boot.cfg, this patch only add the 2 lines
  #define CONFIG_ARCH_SUPPORT_PSCI 1
  #define CONFIG_ARMV7_PSCI_0_1 1

[1] "Convert CONFIG_ARMV7_PSCI_1_0 and CONFIG_ARMV7_PSCI_0_2 to Kconfig"
http://patchwork.ozlabs.org/project/uboot/list/?series=184029

Regards
Patrick

END

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Peter Chubb <peter.chubb@data61.csiro.au>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:39:15 -07:00
Peter Robinson
fe669925cb arm: tegra: add options for BOOTENV_EFI_SET_FDTFILE_FALLBACK for tegra186
Upstream linux DT naming doesn't align with the U-Boot DT, which may
not always be the case so this allows using BOOTENV_EFI_SET_FDTFILE_FALLBACK
where it might be appropriate for some boards.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:30:42 -07:00
Peter Robinson
632fb978a5 arm: tegra: define fdtfile option for distro boot
For booting via UEFI we need to define the fdtfile option so
bootefi has the option to load a fdtfile from disk. For arm64
the kernel dtb is located in a vendor directory so we define
that as nvidia for that architecture.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:30:16 -07:00
Marcel Ziswiler
1b56cd868e colibri_t30: disable rs232 serial transceiver forceoff pins
Use gpio_early_init_uart() function to disable RS232 serial transceiver
ForceOFF# pins on Iris.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:21:15 -07:00
Marcel Ziswiler
8e487f38cc apalis/colibri_t30: add note about colibri vs. nvidia uart mapping
The following mapping is applicable for Apalis T30:

Apalis UART1: NVIDIA UARTA
Apalis UART2: NVIDIA UARTD
Apalis UART3: NVIDIA UARTB
Apalis UART4: NVIDIA UARTC

The following mapping is applicable for Colibri T30:

Colibri UART-A: NVIDIA UARTA
Colibri UART-B: NVIDIA UARTD
Colibri UART-C: NVIDIA UARTB

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:21:15 -07:00
Marcel Ziswiler
4ba4bd0f87 apalis/colibri_t30: avoid uart input from floating pins
Avoid UART input from floating RX pins on UARTB and UARTC (Colibri T30)
and UARTB, UARTC and UARTD (Apalis T30).

Note: Floating pins may cause spurious break conditions potentially
interrupting U-Boot's autoboot.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:21:15 -07:00
Marcel Ziswiler
a6094e1b0a colibri_t30: fix spi1 and uart2/3 resp. uartb/c pinmuxing
Fix SPI1 and UART2/3 resp. UARTB/C pinmuxing.

Note: The former was illegally muxing multiple SoC balls onto the same
internal SoC signal which caused rather strange behaviour regarding
the RS232 serial transceiver ForceOFF# pins as available on Iris.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:21:15 -07:00
Marcel Ziswiler
bfe682e9dd apalis/colibri_t30: add comment about tristate and input vs. output pinmuxing
Add pinmuxing comment stating that TRISTATE means the output driver is
tri-stated and INPUT means the input driver is enabled vs. OUTPUT where
it is disabled.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2020-12-04 13:21:15 -07:00
Tom Rini
ee1e04558f Merge branch '2020-12-02-master-imports'
- Assorted minor fixes
2020-12-03 09:43:47 -05:00
Holger Brunck
a6cd384b9c km/common: remove CONFIG_MTD_CONCAT
This was used for a board which is not supproted anymore and can
therefore be dropped.

CC: Stefan Roese <sr@denx.de>
Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-12-02 16:21:58 -05:00
Holger Brunck
4cb8a10f7e remove obsolete option CONFIG_JFFS2_CMDLINE
This option is obsolete since 2009 and can be removed globally.

CC: Stefan Roese <sr@denx.de>
Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-12-02 16:21:58 -05:00
Michael Walle
382985675c mtd: spi-nor-ids: add Winbond W25Q32JW-IM flash
The Kontron SMARC-sAL28 board uses that flash.

This is the same change as in the linux commit f3418718c0ec ("mtd:
spi-nor: Add support for w25q32jwm").

Signed-off-by: Michael Walle <michael@walle.cc>
Reported-by: Leo Krueger <leo.krueger@zal.aero>
2020-12-02 16:21:58 -05:00
Heinrich Schuchardt
e405efcf4b MAINTAINERS: assign include/log.h
include/log.h belongs to LOGGING.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-02 16:21:58 -05:00
Heinrich Schuchardt
9e925d0c47 log: typos in include/log.h
Correct several typos.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-02 16:21:58 -05:00
AKASHI Takahiro
50efdf2c6f common: update: fix an "unused" warning against update_flash()
Since update_flash() is used only in update_tftp(), it should be
guarded with appropriate config options.

After the commit 3149e524fc, common/update.c will be built under
either CONFIG_UDATE_TFTP, CONFIG_DFU_TFTP or CONFIG_UPDATE_FIT.
Since CONFIG_UPDATE_FIT, hence fit_update(), doesn't rely on
update_flash(), the compiler may cause an "unused" warning if
CONFIG_UPDATE_FIT=y and CONFIG_UPDATE_TFTP=n and CONFIG_DFU_TFTP=n.

This is, for example, the case for sandbox defconfig where
EFI_CAPSULE_FIRMWARE_FIT is enabled for test purpose.

Fixes: 3149e524fc ("common: update: add a generic interface for FIT
       image")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-12-02 16:21:58 -05:00
Simon Glass
d211e0418f global_data: Fix comment for dm_driver_rt
This comment is in the wrong format, so reports an error with
'make htmldocs'. Fix it.

Fixes: a294ead8d2 ("dm: Use an allocated array for run-time device info")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-12-02 16:21:58 -05:00
Simon Glass
d61e784136 log: Fix comment for LOGC_BOOT
This comment is in the wrong format, so reports an error with
'make htmldocs'. Fix it.

Fixes: b73d61a556 ("x86: zimage: Add a little more logging")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-12-02 16:21:58 -05:00
Andy Shevchenko
3cbb026f17 linux/compat.h: Remove debug() from spin_lock_irqsave()
It seems nobody tested the debug() option in spin_lock_irqsave().
Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ‘dwc3_gadget_set_selfpowered’:
include/log.h:235:4: warning: ‘flags’ is used uninitialized in this function [-Wuninitialized]
  235 |    printf(pr_fmt(fmt), ##args); \
      |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ‘flags’ was declared here
 1347 |  unsigned long  flags;
      |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Fixes: 0c06db5983 ("lib, linux: move linux specific defines to linux/compat.h")
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2020-12-02 16:21:58 -05:00
Zhao Qiang
c2ba01c082 watchdog: sbsa: timeout should be in "millisecond"
timeout should be in "millisecond" instead of second,
so divided it by 1000 when calculate the load value.

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
2020-12-02 16:21:58 -05:00
Richard Genoud
7e932ac790 fs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free
This will prevent a double free error if sqfs_close() is called twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-12-02 16:21:58 -05:00
Tom Rini
ab31883ae7 Minor bugfixes
-----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAl/FYSgRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreaQ7Af9GScewoTZPCadXHmBilFH5Z+fetKINuio
 rJNctzLxtq6OBzdjNkB7zU/29tuWDlFuMSoNbnHXyoezAgwCfssGz85G1Ecxl+pN
 pr/iQNXDe+7yfILE6DZGJz7oTCkBPT15nMOxXRdqzP2ZkC7GpDeHxThogbv5ceny
 EwYc3/aOvUk/v0eIUZoNewf4xbJQjrByYHfTjBB8C1NonYpCKvaXdyuOFllLREqE
 OLhcNaiRc8383WWKoHOuSN1foZEX5hbFzwJ/ZeLH/lD1bstQrGPoiFGBh+pq//Cv
 ETDqVua/1HE3fxFPwFeSEK4HKlGaR44Z0YPAWdlcG1af00B46VxhbQ==
 =bRhi
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-30nov20' of git://git.denx.de/u-boot-dm

Minor bugfixes
2020-12-02 11:36:51 -05:00
Tom Rini
80cbd731df - MIPS: octeon: fix allocation bug in DDR driver
- MIPS: octeon: fix init of gd->ram_size
 - MIPS: octeon: add support for Octeon boot header
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiQkHUH+J02LLC9InKPlOlyTyXBgFAl/FLdEACgkQKPlOlyTy
 XBhQSA//cCP8/HBsgrQK8MHIbZedyzsSsaTUyKCTJUZXZAVEClwjFBY7Q2Ko1r89
 svq+UzRjUlPV/F1M73s6D5I15mXHv5PvNdtgi6g+WZqZ7LaMDxqre4JA20wpk5VY
 NyC76DOQ1pwMmutTOIJz7uQ4HnELna3ExdvTjpVb6S41KHHwBx8FbkJZopHWv8ME
 2e9JAaTfFdYfw7ikGSzhuCH6iPbaUFWrLHZ8QASJW2hntSu+48GHl9ONJGD9lrMD
 DyU2/2Jh+0V7pLWdWzOfBEYlp0X+zcJIOK0XHB8zYxLK3AptOhgX86JDZclrawhH
 IYQ0HpF49x5NKvjg7bb91hzMULApxURx2btCpqHs1Wm0p6fOt/IMvC5Czos/uSus
 bhIS9ZiAYUygaNTRPOmS3LMY3IAGkqayrKBJzaIjabyFmlm7JSKbGjQCprzsPdXN
 0XjW4I7Kcy2cuUA5LKiXjt4q+qyxuq1qH240aK8DSBHcjuQZyLe7JDqnM4ePR+Cn
 a4oDfIXGHS6t2+4sAk39UkCwMH+e8xtyShHYBDuGquEZU9tris/qieuEsvXnbDK8
 jWyA5iN8OvGMa9K0fvUk68pU38tJYEZVigu9kKd6DEuZx1uN1slJd8xqXFIuEXX9
 ajBzEAIHY7/U4blX5+vfTx6G5VKqMN9qeKujOC3opE4B9PzHCLc=
 =kJRO
 -----END PGP SIGNATURE-----

Merge tag 'mips-fixes-for-v2021.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-mips

- MIPS: octeon: fix allocation bug in DDR driver
- MIPS: octeon: fix init of gd->ram_size
- MIPS: octeon: add support for Octeon boot header
2020-11-30 21:45:25 -05:00
Michal Simek
a9e73d287b binman: Remove additional backslash
The origin patch didn't have this change and it was caused by manual
resolution where additional backslash was added.

Fixes: 6723b4c6ca ("binman: Call helper function binman_set_rom_offset() to fill offset")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-30 13:14:43 -07:00
Marek Vasut
e7e7e1093b dm: core: Fix incorrect flag check
The test should be checking whether $flags are non-zero and $drv_flags
contain specific flags, however these two sets of flags are separate,
and the two tests should be logically ANDed, not bitwise ANDed.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-30 13:14:43 -07:00
Alper Nebi Yasak
87d07ccc23 sandbox: cros_ec: Basic support for EC_CMD_GET_NEXT_EVENT
Since commit 6900797678 ("cros_ec: Support keyboard scanning with
EC_CMD_GET_NEXT_EVENT") the cros-ec-keyb driver has started using this
command, but the sandbox EC emulator does not recognize it and
continuously prints:

    ** Unknown EC command 0x67

This patch makes the sandbox driver send basic responses to the command,
but the response only supports keyboard scans for now.

The EC side of this command stores and returns events from a queue, and
returns -EC_RES_UNAVAILABLE when there are no new events. This should be
possible to implement by hooking into the SDL event queue (perhaps via
sandbox_sdl_poll_events). Implementing that is a bit harder to do since
the existing sandbox code is discarding pending keyboard events, then
reading the current keyboard state.

Since the EC emulator never explicitly fails to work on this command,
the fallback to the older command will not trigger and will not be
tested anymore.

Fixes: 6900797678 ("cros_ec: Support keyboard scanning with EC_CMD_GET_NEXT_EVENT")
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-30 13:14:43 -07:00
Simon Glass
f31e83d6cf binman: Handle tool paths containing '~' correctly
At present if CROSS_COMPILE contains a tilde, such as
~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc
then binman gives a confusing error:

   binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ...

Fix this by expanding it out before running the tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-30 13:14:43 -07:00
Tom Rini
0719bf4293 Prepare v2021.01-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2020-11-30 13:09:42 -05:00
Tom Rini
53def460d2 configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2020-11-30 12:50:32 -05:00
Stefan Roese
540a2bcec1 mips: octeon: tools: Add update_octeon_header tool
Add a tool to update or insert an Octeon specific header into the U-Boot
image. This is needed e.g. for booting via SPI NOR, eMMC and NAND.

While working on this, move enum cvmx_board_types_enum and
cvmx_board_type_to_string() to cvmx-bootloader.h and remove the
unreferenced (unsupported) board definition.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-11-30 18:32:09 +01:00
Stefan Roese
b7eac19a3d mips: octeon: bootoctlinux: Use gd->ram_size instead of ram_get_info()
Using ram_get_info() is complicated and does not work after relocation.
Now that gd->ram_size holds the full RAM size, let's use it instead and
remove the ram_get_size logic completely.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-11-30 18:31:56 +01:00
Stefan Roese
8bab2c893c mips: octeon: Report full DDR size in dram_init() to gd->ram_size
With this patch, gd->ram_size now holds to full RAM size detected by the
DDR init code. It introduces the get_effective_memsize() function to
report the maximum usable RAM size in U-Boot to the system instead.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-11-30 18:31:56 +01:00
Stefan Roese
8a138257dd mips: octeon: Fix Octeon DDR driver to use the correct struct
Don't use "platdata_auto_alloc_size" but "priv_auto_alloc_size" instead
to auto allocate the private data struct, which is referenced via
dev_get_priv() in this driver. This fixes an ugly bug detected while
trying to boot via SPI NOR.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-11-30 18:31:56 +01:00
Stefan Roese
de24bc7e0e mips: start.S: Add Octeon boot header compatibility
Octeon has a specific boot header, when booted via SPI NOR, NAND or MMC.
Here the only 2 instructions are allowed in the first few bytes of the
image. And these instructions need to be one branch and a nop. This
patch adds the necessary nop after the nop, to that the common MIPS
image is compatible with this Octeon header.

The tool to patch the Octeon boot header into the image will be send in
a follow-up patch.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-11-30 18:31:56 +01:00
Tom Rini
a7ab4b71d5 Merge tag 'mmc-2020-11-29' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
- mmc minor update for better debug and error check
- fsl_esdhc sysctl set and make sure delay check for HS400
2020-11-29 11:12:59 -05:00
Tom Rini
fc4c2f7f85 Pull request for UEFI sub-system for efi-2021-01-rc3 (3)
The following errors are corrected:
 
 * Linux crash when accessing UEFI variables at runtime.
 * UEFI variable using standalone MM on 32 bit systems
   not working due to missing packing of communication
   structure
 * NULL dereference when FAT16 root directory is full
 * FAT files with a short file name starting with 0xE5 (0x05 in directory
   entry) where treated as deleted.
 
 The UEFI SetTime() service is enabled on ARM QEMU.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl/DPScACgkQxIHbvCwF
 GsQDhA/8CZAwTdKeXGkjaaQqDnU2rYS0D6HlQPeRFAjOC7bG2wD1WBEMz27j4on0
 3IgX/E9M3HVk2AtFHT/yOs3fhEXXZLONjciL5bppxZzfyYvhe/b3/GPy1BxjCSJ9
 8N0KohKU8xyGFCQjyyeBv3qnQV8m1WK7rIctFZ/0VZITvNCAdjRm0lcMBANQdG+B
 xlEmOUcPopNs01xmWBKwtZ5FXBb8dKo6+JZkRjBMN3PoBGzM53xiAn6Lv+coKr+c
 Z3DGgCpkOevSi6hYZZ2M5Dfe/Ar7fn4dInuxLjHaT05r7SRkmeqrFOSkvX7rKwa3
 IGpR+D6edb3qZ1XSiiqNLni/vxSVQFxWJwGFa50zk9pnCnD+lzUECLITOh5FD/Qb
 W9HK0lhgWzYX9+l+mrZ6XldhQhvSABa0B3Zxb9Y8+c2bfut04XuaKCtlJM3y83hu
 1AaNE5ClIU87sobn/jpdTiJSLz8F2rOSf7jVgdUmXP1Nc+q8vr+YzjDcM8BmGWrL
 k2Ku8npMkpn2JG1W7lwzlA5en6/+L5hAaujBo/jj1KlwUlNnfyVNVu/AZlK38Ug6
 7QIi7FJ7T4onRAkNqfzqfYlB2yvth1p/v3LomyGlkJgFCB+WW5aHVCK38/BlQ5jR
 Uf2uv7xX510vfct/wBYUAz3fp7S2l7K9Lf/dSNpgegiSSUe+5jc=
 =CgpH
 -----END PGP SIGNATURE-----

Merge tag 'efi-2021-01-rc3-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2021-01-rc3 (3)

The following errors are corrected:

* Linux crash when accessing UEFI variables at runtime.
* UEFI variable using standalone MM on 32 bit systems
  not working due to missing packing of communication
  structure
* NULL dereference when FAT16 root directory is full
* FAT files with a short file name starting with 0xE5 (0x05 in directory
  entry) where treated as deleted.

The UEFI SetTime() service is enabled on ARM QEMU.
2020-11-29 11:12:49 -05:00
Ilias Apalodimas
6974a4a373 charset: make u16_strnlen accessible at runtime
commit 1fabfeef506c ("efi_loader: parameter check in GetNextVariableName()")
introduces a check using u16_strnlen(). This code is used on EFI
runtime variables as well, so unless we mark it as runtime, the kernel
will crash trying to access it.

Fixes: 1fabfeef506c ("efi_loader: parameter check in GetNextVariableName()")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:37 +01:00
Etienne Carriere
03699bc756 lib/efi_loader: fix ABI in efi_mm_communicate_header
Pack struct efi_mm_communicate_header as done in EDK2 as seen in
release 201808 [1]. If not packed sizeof() for the structure adds
4 additional bytes on 32bit targets which breaks the ABI.

Link: [1] https://github.com/tianocore/edk2/blob/edk2-stable201808/MdePkg/Include/Protocol/MmCommunication.h#L21
Fixes: 23a397d2e2 ("efi_loader: Add headers for EDK2 StandAloneMM communication")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2020-11-29 05:18:37 +01:00
Heinrich Schuchardt
31cadc3635 efi_loader: enable EFI_SET_TIME on sandbox and QEMU ARM
Enable EFI_SET_TIME on the sandbox and QEMU ARM to ensure that we compile
and test the relevant code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:37 +01:00
Heinrich Schuchardt
1ec29aa306 fs: fat: use ATTR_ARCH instead of anonymous 0x20
Using constants instead of anonymous numbers increases code readability.

Fixes: 704df6aa0a ("fs: fat: refactor write interface for a file offset")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:16 +01:00
Heinrich Schuchardt
a2c5a92d48 fs: fat: directory entries starting with 0x05
0x05 is used as replacement letter for 0xe5 at the first position of short
file names. We must not skip over directory entries starting with 0x05.

Cf. Microsoft FAT Specification, August 30 2005

Fixes: 39606d462c ("fs: fat: handle deleted directory entries correctly")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-29 05:18:16 +01:00
Heinrich Schuchardt
661d223868 fs: fat: avoid NULL dereference when root dir is full
When trying to create a file in the full root directory of a FAT32
filesystem a NULL dereference can be observed.

When the root directory of a FAT16 filesystem is full fill_dir_slot() must
return -1 to signal that a new directory entry could not be allocated.

Fixes: cd2d727fff ("fs: fat: allocate a new cluster for root directory of fat32")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:16 +01:00
Tom Rini
f6cf78dc6a Merge https://gitlab.denx.de/u-boot/custodians/u-boot-i2c 2020-11-28 10:55:46 -05:00
Pragnesh Patel
f517e5fe98 riscv: sifive/fu540: kconfig: Enable support for Opencores I2C controller
Enable support for SiFive FU540 Opencores I2C master controller.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-11-28 08:30:41 +01:00
Pragnesh Patel
b2d4cbe6d4 i2c: ocores: add i2c driver for OpenCores I2C controller
Add support for the OpenCores I2C controller IP core
(See http://www.opencores.org/projects.cgi/web/i2c/overview).

This driver implementation is inspired from the Linux OpenCores
I2C driver available.

Thanks to Peter Korsgaard <peter@korsgaard.com> for writing Linux
OpenCores I2C driver.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-11-28 08:30:41 +01:00