[PATCH 02/16] ata: ahci: replace magic numbers with named constants

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 21 +++-- drivers/ata/ahci.h | 12 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ad9e2f950f..c64c856f94 100644 --- a/drivers/ata/ahci.c +++

[PATCH 03/16] ata: ahci: fix missing whitespace in ahci_add_host()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index c64c856f94..5aab81fcef 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -596,7 +596,7 @@ int ahci_add_host(struct

[PATCH 04/16] ata: ahci: simplify fis structure creation

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 5aab81fcef..026f83046c 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -192,14 +192,12 @@

[PATCH 01/16] ata: ahci: use abstract read/write functions uniformly

2022-05-04 Thread Denis Orlov
Currently those are used in some routines side by side with underlying functions with no apparent reason for it. Make their usage uniform, this cleans up code a bit and allows to remove unneeded variables. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 18 +++--- 1 file

[PATCH 16/16] ata: ahci: allocate memory in one call in ahci_init_port()

2022-05-04 Thread Denis Orlov
Memory allocated with dma_alloc_coherent() is aligned by page size. Calling it multiple times leads to unnecessary fragmentation and overhead considering that we are actually able to allocate all the memory that we need at once by issuing only one call. Signed-off-by: Denis Orlov ---

[PATCH 15/16] ata: ahci: register only implemented ports

2022-05-04 Thread Denis Orlov
The value from the "ports implemented" register should be kept in mind when registering ports or detecting devices on them. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci.c

[PATCH 14/16] ata: ahci: remove redundant cast in ahci_io()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2d5adcfca9..f9056ff418 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -171,7 +171,7 @@ static int ahci_io(struct

[PATCH 13/16] ata: ahci: add missing capability in ahci_print_info()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 23085ebe09..2d5adcfca9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -532,6 +532,7 @@ void ahci_print_info(struct ahci_device *ahci)

[PATCH 08/16] ata: ahci: properly fill scatter/gather table

2022-05-04 Thread Denis Orlov
We are supposed to populate a table, but instead we were just overwriting the same entry over and over in a loop. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index f7eb35c09d..2d7b527755 100644 ---

[PATCH 10/16] ata: ahci: map buffers properly

2022-05-04 Thread Denis Orlov
Using dma_sync_single_for_*() does not make sense in there - we are given a cpu side address of a buffer and need to actually map it for the device. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-)

[PATCH 12/16] ata: ahci: make rx_fis field in ahci_port of type void*

2022-05-04 Thread Denis Orlov
It is supposed to represent a pointer so make it actually be one. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 5 ++--- drivers/ata/ahci.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index d423da3a48..23085ebe09 100644

[PATCH 11/16] ata: ahci: use 64-bit addressing if available

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ff9093c7b7..d423da3a48 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -117,8 +117,10 @@ static

[PATCH 05/16] ata: ahci: do not ignore dma handles

2022-05-04 Thread Denis Orlov
They represent addresses from the device side and should be used instead of cpu side ones when populating device registers than hold addresses. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 21 - drivers/ata/ahci.h | 3 +++ 2 files changed, 15 insertions(+), 9

[PATCH 06/16] ata: ahci: adjust debug messages in ahci_init_port()

2022-05-04 Thread Denis Orlov
The output was a bit misleading, not displaying physical addresses while for some reason using "dma" to specify a variable in one case. Make it print both types of addresses. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 07/16] ata: ahci: correct named constants values and names

2022-05-04 Thread Denis Orlov
This gives more clear names to some of the macros that designate the sizes of various memory structures and fixes a mistake in one of them. The command table item was regarded as taking 32 bytes in size while it is actually supposed to only take 16 bytes according to the spec. This also changes a

[PATCH 09/16] ata: ahci: use named constants for capabilities bits

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 51 +++--- drivers/ata/ahci.h | 30 +++ 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2d7b527755..1d8099c2ee 100644

[PATCH 1/8] rsatoc: fix compiler warnings

2022-05-04 Thread Sascha Hauer
Fixes: scripts/rsatoc.c:189:5: warning: no previous prototype for ‘rsa_get_params’ [-Wmissing-prototypes] Signed-off-by: Sascha Hauer --- scripts/rsatoc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c index f2d91b8e0d..722c5dba19

[PATCH 3/8] crypto: simplify $(srctree)/ handling and remove config_filename macro

2022-05-04 Thread Sascha Hauer
The config_filename macro has been dropped from mainline in b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"). Adopt the mechanism it has been replaced with for barebox. Signed-off-by: Sascha Hauer --- crypto/Makefile| 12 ---

[PATCH 5/8] rsa: Add iterator for rsa keys

2022-05-04 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- crypto/rsa.c | 9 + include/rsa.h | 4 2 files changed, 13 insertions(+) diff --git a/crypto/rsa.c b/crypto/rsa.c index 4e2d463b54..2eeb9984b1 100644 --- a/crypto/rsa.c +++ b/crypto/rsa.c @@ -446,6 +446,15 @@ void rsa_key_free(struct rsa_public_key

[PATCH 7/8] rsa: Turn error messages into debug messages

2022-05-04 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- crypto/rsa.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/rsa.c b/crypto/rsa.c index 6d23ecb11c..e97e5192ab 100644 --- a/crypto/rsa.c +++ b/crypto/rsa.c @@ -342,27 +342,27 @@ int rsa_verify(const struct rsa_public_key *key,

[PATCH 6/8] rsa: Add pr_fmt and use pr_debug

2022-05-04 Thread Sascha Hauer
Add pr_fmt to print more context and use pr_debug consistently. Signed-off-by: Sascha Hauer --- crypto/rsa.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/crypto/rsa.c b/crypto/rsa.c index 2eeb9984b1..6d23ecb11c 100644 --- a/crypto/rsa.c +++

[PATCH 4/8] rsa: Collect keys on list

2022-05-04 Thread Sascha Hauer
Currently there is no way to iterate over all available RSA keys. This patch collects all keys on a list so we can add an iterator in the next step. Signed-off-by: Sascha Hauer --- common/image-fit.c | 25 ++-- crypto/rsa.c | 97 ++

[PATCH 8/8] fit: try other keys as fallback

2022-05-04 Thread Sascha Hauer
So far the rsa key and the image signature must have a matching key-name-hint. Relax that by trying other available keys when the key-name-hints don't match or when the matching key can't verify the signature. Signed-off-by: Sascha Hauer --- common/image-fit.c | 36