Skip to content
Snippets Groups Projects
  1. Jan 07, 2024
  2. Jan 06, 2024
  3. Jan 05, 2024
    • Anthony Loiseau's avatar
      fw_env: autodetect NAND erase size and env sectors · d73a6641
      Anthony Loiseau authored and Tom Rini's avatar Tom Rini committed
      
      As already done for NOR chips, if device ESIZE and ENVSECTORS static
      configurations are both zero, then autodetect them at runtime.
      
      Cc: Joe Hershberger <joe.hershberger@ni.com>
      cc: Stefan Agner <stefan@agner.ch>
      cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: default avatarAnthony Loiseau <anthony.loiseau@allcircuits.com>
      d73a6641
    • Rafał Miłecki's avatar
      fw_env: keep calling read() until whole flash block is read · 9e3003f7
      Rafał Miłecki authored and Tom Rini's avatar Tom Rini committed
      
      It's totally valid for read() to provide less bytes than requested
      maximum. It may happen if there is no more data available yet or source
      pushes data in small chunks.
      
      This actually happens when trying to read env data from NVMEM device.
      Kernel may provide NVMEM content in page size parts (like 4096 B).
      
      This fixes warnings like:
      Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 16384 bytes but got 4096
      Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 12288 bytes but got 4096
      Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 8192 bytes but got 4096
      
      Since the main loop in flash_read_buf() is used to read blocks this
      patch adds a new nested one.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      9e3003f7
    • Rafał Miłecki's avatar
      fw_env: rename variables holding env data content · 73b30800
      Rafał Miłecki authored and Tom Rini's avatar Tom Rini committed
      
      Rename "addr0" and "addr1" to "buf0" and "buf1" accordingly. Name "addr"
      suggests that variable contains a numeric value being some kind of
      address. Name "buf" is de facto a standard name for pointer to allocated
      memory for reading data to.
      
      While at it drop redundant checks for NULL before calling free().
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      73b30800
    • Rafał Miłecki's avatar
      fw_env: fix reading NVMEM device's "compatible" value · f29c5ca3
      Rafał Miłecki authored and Tom Rini's avatar Tom Rini committed
      
      Call to fread() was changed to check for return value. The problem is it
      can't be checked for returning 1 (as it is) to determine success.
      
      We call fread() with buffer size as "size" argument. Reading any
      "compatible" value shorter than buffer size will result in returning 0
      even on success.
      
      Modify code to use fstat() to determine expected read length.
      
      This fixes regression that broke using fw_env with NVMEM devices.
      
      Fixes: c059a22b ("tools: env: fw_env: Fix unused-result warning")
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      f29c5ca3
    • Svyatoslav Ryhel's avatar
      board: htc: endeavoru: add an early SPL RCM hook · 86e581a5
      Svyatoslav Ryhel authored
      
      Unlike all other supported Tegra devices and most known Tegra devices, the
      HTC One X has no hardware way to enter APX/RCM mode, which may lead to a
      dangerous situation when, if BCT is set correctly and the bootloader is
      faulty, the device will hang in a permanent brick state. Exiting from this
      state can be done only by disassembling the device and shortening the
      testpad to the ground.
      
      To prevent this or to minimize the probability of such an accident, it was
      proposed to add the RCM rebooting hook as early into SPL as possible since
      SPL is much more robust and has minimal changes that can break bootflow.
      
      gpio_early_init_uart() function was chosen as it is the earliest function
      exposed for setup by the device. Hook performs a check for volume up button
      state and triggers RCM if it is pressed.
      
      Signed-off-by: default avatarSvyatoslav Ryhel <clamor95@gmail.com>
      86e581a5
  4. Jan 04, 2024
Loading