Skip to content
Snippets Groups Projects
  1. Sep 22, 2020
  2. Aug 14, 2020
  3. May 19, 2020
  4. May 18, 2020
  5. May 15, 2020
  6. 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
  7. 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
  8. Jan 23, 2020
  9. Dec 02, 2019
  10. 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
  11. Sep 19, 2019
  12. Aug 23, 2019
  13. Aug 11, 2019
  14. Jul 24, 2019
  15. Jul 18, 2019
  16. 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
  17. Jul 06, 2019
  18. 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
  19. Jun 14, 2019
  20. 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
  21. Apr 26, 2019
  22. Jan 18, 2019
  23. Nov 14, 2018
  24. Oct 09, 2018
  25. Sep 11, 2018
  26. Aug 10, 2018
  27. Jun 14, 2018
    • Heinrich Schuchardt's avatar
      efi_loader: avoid initializer element is not constant · 44ab2d32
      Heinrich Schuchardt authored
      
      When building with -pedantic the current definition of EFI_GUID() causes
      an error 'initializer element is not constant'.
      
      Currently EFI_GUID() is used both as an anonymous constant and as an
      intializer. A conversion to efi_guid_t is not allowable when using
      EFI_GUID() as an initializer. But it is needed when using it as an
      anonymous constant.
      
      We should not use EFI_GUID() for anything but an initializer. So let's
      introduce a variable where needed and remove the conversion.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      44ab2d32
  28. Jun 05, 2018
    • Sam Protsenko's avatar
      disk: efi: Correct backing up the MBR boot code · 955575c8
      Sam Protsenko authored and Tom Rini's avatar Tom Rini committed
      
      In commit e163a931 ("cmd: gpt: backup boot code before writing MBR")
      there was added the procedure for storing old boot code when doing "gpt
      write". But instead of storing just backup code, the whole MBR was
      stored, and only specific fields were replaced further, keeping
      everything else intact. That's obviously not what we want.
      
      Fix the code to actually store only old boot code and zero out
      everything else. This fixes next testing case:
      
          => mmc write $loadaddr 0x0 0x7b
          => gpt write mmc 1 $partitions
      
      In case when $loadaddr address and further memory contains 0xff, the
      board was bricked (ROM-code probably didn't like partition entries that
      were clobbered with 0xff). With this patch applied, commands above don't
      brick the board.
      
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      Cc: Alejandro Hernandez <ajhernandez@ti.com>
      Tested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      955575c8
  29. May 07, 2018
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      83d290c5
  30. Apr 28, 2018
    • Alex Kiernan's avatar
      spl: disk: usb: Add dependencies to sprintf/strto* · ab9e12f6
      Alex Kiernan authored and Tom Rini's avatar Tom Rini committed
      
      If SPL serial support is disabled nothing brings in sprintf, snprintf
      or simple_strtoul:
      
        env/built-in.o: In function `regex_callback':
        env/attr.c:128: undefined reference to `sprintf'
        disk/built-in.o: In function `blk_get_device_by_str':
        disk/part.c:386: undefined reference to `simple_strtoul'
        disk/part.c:395: undefined reference to `simple_strtoul'
        disk/built-in.o: In function `blk_get_device_part_str':
        disk/part.c:522: undefined reference to `simple_strtoul'
        disk/built-in.o: In function `part_set_generic_name':
        disk/part.c:704: undefined reference to `sprintf'
        drivers/built-in.o: In function `init_peripheral_ep':
        drivers/usb/musb-new/musb_gadget.c:1826: undefined reference to `sprintf'
        drivers/built-in.o: In function `musb_core_init':
        drivers/usb/musb-new/musb_core.c:1451: undefined reference to `snprintf'
      
      Add those dependencies here.
      
      Signed-off-by: default avatarAlex Kiernan <alex.kiernan@gmail.com>
      ab9e12f6
  31. Apr 27, 2018
  32. Apr 16, 2018
    • Alexander Graf's avatar
      part: Disable CONFIG_SPL_ISO_PARTITION by default · 4f67b93f
      Alexander Graf authored and Tom Rini's avatar Tom Rini committed
      
      We enabled CONFIG_ISO_PARTITION by default for distro boot, so that U-Boot
      could load distro images that usually get shipped as iso images. These images
      usually come with a board agnostic boot environment.
      
      However, there is very little point in having ISO support enabled (for anyone
      really) in SPL, as the whole idea of SPL is to load U-Boot proper which again
      is board specific. So the fact that we enable ISO support in U-Boot proper does
      not mean at all that we want ISO support in U-Boot SPL.
      
      Hence, let's remove the Kconfig dependency. Along the way, let's also clean up
      all those default configs that disabled SPL ISO support.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      4f67b93f
  33. Mar 14, 2018
  34. Feb 09, 2018
Loading