public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Cc: u-boot@lists.denx.de, sjg@chromium.org
Subject: Re: [PATCH 4/5] image: Drop if/elseif hash selection in calculate_hash()
Date: Mon, 30 Aug 2021 12:01:46 -0400	[thread overview]
Message-ID: <20210830160146.GA14609@bill-the-cat> (raw)
In-Reply-To: <20210824005320.3647668-5-mr.nuke.me@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2252 bytes --]

On Mon, Aug 23, 2021 at 07:53:19PM -0500, Alexandru Gagniuc wrote:

> calculate_hash() would try to select the appropriate hashing function
> by a if/elseif contruct. But that is exactly why hash_lookup_algo()
> exists, so use it instead.
> 
> This does mean that we now have to 'select HASH' to make sure we get
> the hash_lookup_algo() symbol. However, the change makes sense because
> even basic FITs will have to deal with "hash" nodes.
> 
> My only concern is that the 'select SPL_HASH' might cause some
> platform to grow above its SPL size allowance
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Two problems.  The easy to fix problem is that we need:
commit 7dbac59f6655e928d11708948f34e779b03bb3d2
Author: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Date:   Mon Aug 23 19:53:19 2021 -0500

    image: Drop if/elseif hash selection in calculate_hash()
    
    calculate_hash() would try to select the appropriate hashing function
    by a if/elseif contruct. But that is exactly why hash_lookup_algo()
    exists, so use it instead.
    
    This does mean that we now have to 'select HASH' to make sure we get
    the hash_lookup_algo() symbol. However, the change makes sense because
    even basic FITs will have to deal with "hash" nodes.
    
    My only concern is that the 'select SPL_HASH' might cause some
    platform to grow above its SPL size allowance
    
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
    [trini: Add SPL_CRYPTO to FSL_CAAM if ARM && SPL]
    Signed-off-by: Tom Rini <trini@konsulko.com>

diff --git a/drivers/crypto/fsl/Kconfig b/drivers/crypto/fsl/Kconfig
index 1f5dfb94bb81..f91753aa0f3d 100644
--- a/drivers/crypto/fsl/Kconfig
+++ b/drivers/crypto/fsl/Kconfig
@@ -1,6 +1,7 @@
 config FSL_CAAM
 	bool "Freescale Crypto Driver Support"
 	select SHA_HW_ACCEL
+	select SPL_CRYPTO if (ARM && SPL)
 	imply CMD_HASH
 	help
 	  Enables the Freescale's Cryptographic Accelerator and Assurance

to fix a handful of platforms.  The harder to fix problem is that
changing how the algorithm is selected seems to break mkimage on for
example xilinx_zynqmp_virt.  Please fix and resubmit, and run it all
past CI as well.  Thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-08-30 16:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  0:53 [PATCH 0/5] Fix FIT hash algos in SPL (Fixes v2021.10-rc2) Alexandru Gagniuc
2021-08-24  0:53 ` [PATCH 1/5] common: Remove unused CONFIG_FIT_SHAxxx selectors Alexandru Gagniuc
2021-08-24  0:53 ` [PATCH 2/5] lib: Drop SHA512_ALGO in lieu of SHA512 Alexandru Gagniuc
2021-08-24  0:53 ` [PATCH 3/5] common/spl: Drop SPL_HASH_SUPPORT in favor of SPL_HASH Alexandru Gagniuc
2021-08-30 13:58   ` Tom Rini
2021-08-30 16:02   ` Tom Rini
2021-08-30 16:19   ` Tom Rini
2021-08-24  0:53 ` [PATCH 4/5] image: Drop if/elseif hash selection in calculate_hash() Alexandru Gagniuc
2021-08-30 16:01   ` Tom Rini [this message]
2021-08-24  0:53 ` [PATCH 5/5] image: Drop IMAGE_ENABLE_{MD5, CRC32} #defines Alexandru Gagniuc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210830160146.GA14609@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox