Skip to content
Snippets Groups Projects
  1. Feb 26, 2021
  2. Feb 02, 2021
    • Simon Glass's avatar
      common: Drop asm/global_data.h from common header · 401d1c4f
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Move this out of the common header and include it only where needed.  In
      a number of cases this requires adding "struct udevice;" to avoid adding
      another large header or in other cases replacing / adding missing header
      files that had been pulled in, very indirectly.   Finally, we have a few
      cases where we did not need to include <asm/global_data.h> at all, so
      remove that include.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      401d1c4f
  3. Feb 01, 2021
  4. Jan 30, 2021
  5. Jan 29, 2021
  6. Jan 16, 2021
    • Rasmus Villemoes's avatar
      lib/uuid.c: change prototype of uuid_guid_get_str() · 31ce367c
      Rasmus Villemoes authored and Tom Rini's avatar Tom Rini committed
      
      There's no reason to require an appropriately sized output parameter
      for the string, that's error-prone should the table ever grow an
      element with a longer string. We can just return the const char*
      pointer directly.
      
      Update the only caller accordingly, and get rid of pointless ifdeffery
      in the header so that the compiler always sees a declaration and can
      thus do type-checking, whether or not PARTITION_TYPE_GUID is enabled
      or not.
      
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      31ce367c
  7. Jan 15, 2021
  8. Sep 22, 2020
  9. Aug 14, 2020
  10. May 19, 2020
  11. May 18, 2020
  12. May 15, 2020
  13. Apr 30, 2020
    • Heinrich Schuchardt's avatar
      part: detect EFI system partition · 25801acc
      Heinrich Schuchardt authored
      
      Up to now for MBR and GPT partitions the info field 'bootable' was set to 1
      if either the partition was an EFI system partition or the bootable flag
      was set.
      
      Turn info field 'bootable' into a bit mask with separate bits for bootable
      and EFI system partition.
      
      This will allow us to identify the EFI system partition in the UEFI
      sub-system.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      25801acc
  14. Mar 18, 2020
    • André Przywara's avatar
      sunxi: Move common defconfig options to Kconfig · 48313fe5
      André Przywara authored and Jagan Teki's avatar Jagan Teki committed
      
      Some config symbols are found in *almost* every _defconfig file for
      Allwinner boards, because those options are actually a platform choice,
      and not a per-board decision.
      Some of these options are older, some have recently been added.
      
      Move those options to be set for all Allwinner boards in their
      respective Kconfig files.
      
      The rationales are as follows:
      - NR_DRAM_BANKS: All Allwinner SoC map DRAM at one contiguous region of
        address space only, starting at 1 GB. So it's always one bank.
      - SPL_{DOS,EFI}_PARTITION: The Allwinner SPL does only support raw MMC
        accesses, we don't care about filesystems or partitions in there, so
        there is no need to define those symbols at all.
      - USE_PREBOOT: We start USB early when a keyboard is configured, using the
        preboot env variable, so we need to set this variable.
      - SYS_RELOC_GD_ENV_ADDR: We don't specify any ENV_ADDR, so need this
        symbol to be set (according to 8d8ee47e).
      - SYS_USB_EVENT_POLL_VIA_INT_QUEUE: According to commit eab9433a,
        specifying this reduces the latency of the USB keyboard handling, so
        this was formerly enabled in config headers for all Allwinner boards.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Tested-by: Jagan Teki <jagan@amarulasolutions.com> # Amarula A64-Relic
      Reviewed-by: default avatarJagan Teki <jagan@amarulasolutions.com>
      48313fe5
  15. Jan 23, 2020
  16. Dec 02, 2019
  17. Oct 31, 2019
    • Heinrich Schuchardt's avatar
      disk: part_dos: correctly detect DOS PBR · 34856b0f
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      The signature 0x55 0xAA in bytes 510 and 511 of the first sector can either
      indicate a DOS partition table of the first sector of a FAT file system.
      
      The current code tries to check if the partition table is valid by looking
      at the boot indicator of the partition entries. But first of all it does
      not count from 0 to 3 but only from 0 to 2. And second it misses to
      increment the pointer for the partition entry.
      
      If it is a FAT file system can be discovered by looking for the text 'FAT'
      at offset 0x36 or 'FAT32' at offset 0x52. In a DOS PBR there are no
      partition entries, so those bytes are undefined. Don't require the byte at
      offset 0x1BE to differ from 0x00 and 0x80.
      
      With the patch the logic is changed as follows:
      
      If the partition table has either an invalid boot flag for any partition or
      has no partition at all, check if the first sector is a DOS PBR by looking
      at the FAT* signature.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      34856b0f
  18. Sep 19, 2019
  19. Aug 23, 2019
  20. Aug 11, 2019
  21. Jul 24, 2019
  22. Jul 18, 2019
  23. Jul 16, 2019
    • Heinrich Schuchardt's avatar
      disk: efi: avoid unaligned pointer error · 06e921b1
      Heinrich Schuchardt authored
      
      When building with GCC 9.1 an error occurs:
      
      disk/part_efi.c: In function ‘gpt_verify_partitions’:
      disk/part_efi.c:737:49: error: taking address of packed member of
      ‘struct _gpt_entry’ may result in an unaligned pointer value
      [-Werror=address-of-packed-member]
        737 |   gpt_convert_efi_name_to_char(efi_str, gpt_e[i].partition_name,
            |                                         ~~~~~~~~^~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors
      make[1]: *** [scripts/Makefile.build:279: disk/part_efi.o] Error 1
      make: *** [Makefile:1594: disk] Error 2
      
      Adjust gpt_convert_efi_name_to_char() to accept unaligned strings.
      
      Reported-by: default avatarRamon Fried <rfried.dev@gmail.com>
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      06e921b1
  24. Jul 06, 2019
  25. Jun 21, 2019
    • Robert Hancock's avatar
      disk: part: Don't skip partition init · 4edfabd9
      Robert Hancock authored and Tom Rini's avatar Tom Rini committed
      
      blk_get_device_by_str was skipping part_init when hw partition 0 was
      selected because it is the default. However, this caused issues when
      switching to a non-zero partition and then back to partition zero, as
      stale data from the wrong partition was returned.
      
      Remove this optimization and call part_init regardless of the selected
      partition.
      
      Signed-off-by: default avatarRobert Hancock <hancock@sedsystems.ca>
      4edfabd9
  26. Jun 14, 2019
  27. May 02, 2019
    • Eugeniu Rosca's avatar
      disk: efi: Fix memory leak on 'gpt verify' · 716f919d
      Eugeniu Rosca authored and Heinrich Schuchardt's avatar Heinrich Schuchardt committed
      
      Below is what happens on R-Car H3ULCB-KF using clean U-Boot
      v2019.04-00810-g6aebc0d11a10 and r8a7795_ulcb_defconfig:
      
       => ### interrupt autoboot
       => gpt verify mmc 1
       No partition list provided - only basic check
       Verify GPT: success!
       => ### keep calling 'gpt verify mmc 1'
       => ### on 58th call, we are out of memory:
       => gpt verify mmc 1
       alloc_read_gpt_entries: ERROR: Can't allocate 0X4000 bytes for GPT Entries
       GPT: Failed to allocate memory for PTE
       gpt_verify_headers: *** ERROR: Invalid Backup GPT ***
       Verify GPT: error!
      
      This is caused by calling is_gpt_valid() twice (hence allocating pte
      also twice via alloc_read_gpt_entries()) while freeing pte only _once_
      in the caller of gpt_verify_headers(). Fix that by freeing the pte
      allocated and populated for primary GPT _before_ allocating and
      populating the pte for backup GPT. The latter will be freed by the
      caller of gpt_verify_headers().
      
      With the fix applied, the reproduction scenario [1-2] has been run
      hundreds of times in a loop w/o running into OOM.
      
      [1] gpt verify mmc 1
      [2] gpt verify mmc 1 $partitions
      
      Fixes: cef68bf9 ("gpt: part: Definition and declaration of GPT verification functions")
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      716f919d
    • Eugeniu Rosca's avatar
      disk: efi: Fix memory leak on 'gpt guid' · 1cfe9694
      Eugeniu Rosca authored and Heinrich Schuchardt's avatar Heinrich Schuchardt committed
      
      Below is what happens on R-Car H3ULCB-KF using clean U-Boot
      v2019.04-00810-g6aebc0d11a10 and r8a7795_ulcb_defconfig:
      
       => ### interrupt autoboot
       => gpt guid mmc 1
       21200400-0804-0146-9dcc-a8c51255994f
       success!
       => ### keep calling 'gpt guid mmc 1'
       => ### on 59th call, we are out of memory:
       => gpt guid mmc 1
       alloc_read_gpt_entries: ERROR: Can't allocate 0X4000 bytes for GPT Entries
       GPT: Failed to allocate memory for PTE
       get_disk_guid: *** ERROR: Invalid GPT ***
       alloc_read_gpt_entries: ERROR: Can't allocate 0X4000 bytes for GPT Entries
       GPT: Failed to allocate memory for PTE
       get_disk_guid: *** ERROR: Invalid Backup GPT ***
       error!
      
      After some inspection, it looks like get_disk_guid(), added via v2017.09
      commit 73d6d18b ("GPT: add accessor function for disk GUID"),
      unlike other callers of is_gpt_valid(), doesn't free the memory pointed
      out by 'gpt_entry *gpt_pte'. The latter is allocated by is_gpt_valid()
      via alloc_read_gpt_entries().
      
      With the fix applied, the reproduction scenario has been run hundreds
      of times ('while true; do gpt guid mmc 1; done') w/o running into OOM.
      
      Fixes: 73d6d18b ("GPT: add accessor function for disk GUID")
      Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      1cfe9694
  28. Apr 26, 2019
  29. Jan 18, 2019
Loading