1. 17 7月, 2021 3 次提交
  2. 11 6月, 2021 1 次提交
  3. 23 4月, 2021 1 次提交
  4. 15 4月, 2021 3 次提交
  5. 27 3月, 2021 1 次提交
  6. 18 3月, 2021 1 次提交
  7. 18 2月, 2021 1 次提交
    • A
      image: Do not #if guard board_fit_image_post_process() prototype · 9e304239
      Alexandru Gagniuc 提交于
      There's no point in guarding function prototypes with #ifdefs. If a
      function is not defined, the linker will notice. Having the prototype
      does not affect code size.
      
      What the #if guard takes away is the ability to use IS_ENABLED:
      
      	if (CONFIG_IS ENABLED(FIT_IMAGE_POST_PROCESS))
      		board_fit_image_post_process(...)
      
      When the prototype is guarded, the above form cannot be used. This
      leads to the proliferation of #ifdefs, and unreadable code. The
      opportunity cost of the #if guard outweighs any benefits. Remove it.
      
      Since the original version of this patch, an empty definition was
      added by commit f14e6eec ("image: cleanup pre-processor usage").
      The empty definition can cause silent failures, when an implementation
      of board_fit_image_post_process() is expected because the linker will
      not catch the missing function. Thus this patch removes this empty
      inline declaration.
      
      Fixes: f14e6eec ("image: cleanup pre-processor usage")
      Signed-off-by: NAlexandru Gagniuc <mr.nuke.me@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      9e304239
  8. 16 2月, 2021 1 次提交
  9. 12 1月, 2021 1 次提交
  10. 05 1月, 2021 1 次提交
  11. 30 10月, 2020 1 次提交
  12. 22 10月, 2020 2 次提交
  13. 13 10月, 2020 1 次提交
    • P
      fit: cipher: aes: allow to store the IV in the FIT image · a6982a6f
      Philippe Reynes 提交于
      Binaries may be encrypted in a FIT image with AES. This
      algo needs a key and an IV (Initialization Vector). The
      IV is provided in a file (pointer by iv-name-hint in the
      ITS file) when building the ITB file.
      
      This commits adds provide an alternative way to manage
      the IV. If the property iv-name-hint is not provided in
      the ITS file, the tool mkimage will generate an random
      IV and store it in the FIT image.
      Signed-off-by: NPhilippe Reynes <philippe.reynes@softathome.com>
      a6982a6f
  14. 17 7月, 2020 1 次提交
    • M
      treewide: convert bd_t to struct bd_info by coccinelle · b75d8dc5
      Masahiro 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: NMasahiro Yamada <masahiroy@kernel.org>
      b75d8dc5
  15. 08 7月, 2020 1 次提交
  16. 13 6月, 2020 1 次提交
  17. 19 5月, 2020 1 次提交
    • S
      command: Remove the cmd_tbl_t typedef · 09140113
      Simon Glass 提交于
      We should not use typedefs in U-Boot. They cannot be used as forward
      declarations which means that header files must include the full header to
      access them.
      
      Drop the typedef and rename the struct to remove the _s suffix which is
      now not useful.
      
      This requires quite a few header-file additions.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      09140113
  18. 18 4月, 2020 1 次提交
  19. 01 4月, 2020 2 次提交
  20. 12 3月, 2020 3 次提交
    • A
      include: image.h: add key info to image_sign_info · a8fc3df8
      AKASHI Takahiro 提交于
      For FIT verification, all the properties of a public key come from
      "control fdt" pointed to by fdt_blob. In UEFI secure boot, on the other
      hand, a public key is located and retrieved from dedicated signature
      database stored as UEFI variables.
      
      Added two fields may hold values of a public key if fdt_blob is NULL, and
      will be used in rsa_verify_with_pkey() to verify a signature in UEFI
      sub-system.
      Signed-off-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      a8fc3df8
    • A
      lib: rsa: decouple rsa from FIT image verification · b983cc2d
      AKASHI Takahiro 提交于
      Introduce new configuration, CONFIG_RSA_VERIFY which will decouple building
      RSA functions from FIT verification and allow for adding a RSA-based
      signature verification for other file formats, in particular PE file
      for UEFI secure boot.
      Signed-off-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      b983cc2d
    • E
      image.h: isolate android_image_* functions from tooling · d08b16ed
      Eugeniu Rosca 提交于
      On Feb. 16, 2020, Tom reported [1] build failure of U-Boot in-tree
      tooling after applying https://patchwork.ozlabs.org/cover/1229663/
      ("[v6,0/7] rsa: extend rsa_verify() for UEFI secure boot").
      
      Later on, Heinrich stressed the urgency of the issue in
      https://patchwork.ozlabs.org/patch/1250858/#2379069:
      
       >>>>>>>>>
       We should finalize the topic as it stops EFI patches from being merged
       >>>>>>>>>
      
      On the surface, the problem is caused by U-Boot commits [2-3], which
      employed 'u32' in 'include/image.h', while historically U-Boot tooling
      stayed agnostic on the {u,s}{8,16,32} types.
      
      Thanks to Tom, Yamada-san and Heinrich, the following solutions have
      been put head-to-head ('+' pros, '-' cons):
      
       A. Use an equivalent fixed-size type, i.e. s/u32/uint32_t/ in both
          android function prototypes (image.h) and definitions (c file):
          + quick and low-line-count
          - creates a 'soup' of fixed-sized types in the Android C file
          - will confuse contributors
          - is going against Linux kernel best practices [4]
      
       B. Guard Android functions by '!defined(USE_HOSTCC)' in image.h:
          + quick and low-line-count
          + reflects the reality (no android function is used by tooling)
          + zero impact on other subsystems
          - ifdeffery may look annoying (pre-existing problem of image.h)
      
       C. Make {u8,u16,u32} available in U-Boot tooling:
          + quick and low-line-count
          + [Yamada-san][5]:
            * forbidding u32 for tools is questionable to me
            * Linux kernel and Barebox use {u8,u16,u32} for the tools space
          - breaks U-Boot tradition?
          - has larger impact than [A] and [B]
          - adds type complexity/inconsistency in the tooling space
      
       D. [Yamada-san] Refactor the headers to minimize the code shared
          between U-Boot space and tooling space:
          + probably the long-term solution
          - high effort
          - can be seen/done as an incremental update on top of [B]
      
      Looking at the above, [B] looks like the natural way to go forward.
      
      [1] https://patchwork.ozlabs.org/patch/1238245/#2363052
      [2] commit 7f253150 ("image: android: Add routine to get dtbo params")
      [3] commit c3bfad82 ("image: android: Add functions for handling dtb field")
      [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6176fa4728fb6d
          ("checkpatch: add --strict warning for c99 fixed size typedefs : int<size>_t")
      [5] https://patchwork.ozlabs.org/patch/1238245/#2363340
      
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
      Cc: Sam Protsenko <joe.skb7@gmail.com>
      Cc: Lokesh Vutla <lokeshvutla@ti.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
      Reported-by: NTom Rini <trini@konsulko.com>
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Tested-by: NHeinrich Schuchardt <xpyron.glpk@gmx.de>
      d08b16ed
  21. 04 2月, 2020 2 次提交
    • S
      image: android: Add routine to get dtbo params · 7f253150
      Sam Protsenko 提交于
      Android Boot Image v1 adds "Recovery DTB" field in image header and
      associate payload in boot image itself [1]. Payload should be in
      Android DTB/DTBO format [2]. That "Recovery DTB" area should be only
      populated for non-A/B devices, and only in recovery image.
      
      Add function to get an address and size of that payload. That function
      can be further used e.g. in 'abootimg' command to provide the user a way
      to get the address of recovery dtbo from U-Boot shell, which can be
      further parsed using 'adtimg' command.
      
      [1] https://source.android.com/devices/bootloader/boot-image-header
      [2] https://source.android.com/devices/architecture/dto/partitionsSigned-off-by: NSam Protsenko <joe.skb7@gmail.com>
      Signed-off-by: NLokesh Vutla <lokeshvutla@ti.com>
      7f253150
    • S
      image: android: Add functions for handling dtb field · c3bfad82
      Sam Protsenko 提交于
      Android Boot Image v2 adds "DTB" payload (and corresponding field in the
      image header). Provide functions for its handling:
      
        - android_image_get_dtb_by_index(): Obtain DTB blob from "DTB" part of
          boot image, by blob's index
        - android_image_print_dtb_contents(): Iterate over all DTB blobs in
          "DTB" part of boot image and print those blobs info
      
      "DTB" payload might be in one of the following formats:
        1. concatenated DTB blobs
        2. Android DTBO format
      
      The latter requires "android-image-dt.c" functionality, so this commit
      selects that file for building for CONFIG_ANDROID_BOOT_IMAGE option.
      
      Right now this new functionality isn't used, but it can be used further.
      As it's required to apply some specific dtbo blob(s) from "dtbo"
      partition, we can't automate this process inside of "bootm" command. But
      we can do next:
        - come up with some new command like "abootimg" to extract dtb blob
          from boot image (using functions from this patch)
        - extract desired dtbo blobs from "dtbo" partition using "adtimg"
          command
        - merge dtbo blobs into dtb blob using "fdt apply" command
        - pass resulting dtb blob into bootm command in order to boot the
          Android kernel with Android ramdisk from boot image
      Signed-off-by: NSam Protsenko <joe.skb7@gmail.com>
      Signed-off-by: NLokesh Vutla <lokeshvutla@ti.com>
      c3bfad82
  22. 25 1月, 2020 2 次提交
  23. 18 1月, 2020 2 次提交
  24. 17 1月, 2020 2 次提交
  25. 08 1月, 2020 1 次提交
    • C
      image: Add IH_OS_EFI for EFI chain-load boot · a031b03f
      Cristian Ciocaltea 提交于
      Add a new OS type to be used for chain-loading an EFI compatible
      firmware or boot loader like GRUB2, possibly in a verified boot
      scenario.
      
      Bellow is sample ITS file that generates a FIT image supporting
      secure boot. Please note the presence of 'os = "efi";' line, which
      identifies the currently introduced OS type:
      
      / {
          #address-cells = <1>;
      
          images {
              efi-grub {
                  description = "GRUB EFI";
                  data = /incbin/("bootarm.efi");
                  type = "kernel_noload";
                  arch = "arm";
                  os = "efi";
                  compression = "none";
                  load = <0x0>;
                  entry = <0x0>;
                  hash-1 {
                      algo = "sha256";
                  };
              };
          };
      
          configurations {
              default = "config-grub";
              config-grub {
                  kernel = "efi-grub";
                  signature-1 {
                      algo = "sha256,rsa2048";
                      sign-images = "kernel";
                  };
              };
          };
      };
      Signed-off-by: NCristian Ciocaltea <cristian.ciocaltea@gmail.com>
      Reviewed-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
      a031b03f
  26. 29 10月, 2019 1 次提交
  27. 27 8月, 2019 1 次提交
  28. 26 8月, 2019 1 次提交
    • L
      spl: support booting via RISC-V OpenSBI · 5e30e45c
      Lukas Auer 提交于
      RISC-V OpenSBI is an open-source implementation of the RISC-V Supervisor
      Binary Interface (SBI) specification. It is required by Linux and U-Boot
      running in supervisor mode. This patch adds support for booting via the
      OpenSBI FW_DYNAMIC firmware. It supports OpenSBI version 0.4 and higher.
      
      In this configuration, U-Boot SPL starts in machine mode. After loading
      OpenSBI and U-Boot proper, it will start OpenSBI. All necessary
      parameters are generated by U-Boot SPL and are passed to OpenSBI. U-Boot
      proper is started in supervisor mode by OpenSBI. Support for OpenSBI is
      enabled with CONFIG_SPL_OPENSBI. An additional configuration entry,
      CONFIG_SPL_OPENSBI_LOAD_ADDR, is used to specify the load address of the
      OpenSBI firmware binary. It is not used directly in U-Boot and instead
      is intended to make the value available to scripts such as FIT
      configuration generators.
      
      The header file include/opensbi.h is based on header files from the
      OpenSBI project. They are recent, as of commit bae54f764570 ("firmware:
      Add fw_dynamic firmware").
      Signed-off-by: NLukas Auer <lukas.auer@aisec.fraunhofer.de>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      Tested-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NAnup Patel <anup.patel@wdc.com>
      5e30e45c