Re: [PATCH 4/4] spl: spl_nand: Fix bad block handling in fitImage

2022-05-06 Thread Han Xu
On 22/04/27 07:50AM, Michael Trimarchi wrote:
> If the fitImage has some bad block in fit image area, the
> offset must be recalulcated. This should be done always.
> After implementing it in mxs now is possible to call the function
> even for that platform.
> 
> Cc: Fabio Estevam 
> Signed-off-by: Michael Trimarchi 

Acked-by: Han Xu 

> ---
> V1->V2:
>   - move out from RFC
> ---
>  common/spl/spl_nand.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> index fc61b447a5..82a10ffa63 100644
> --- a/common/spl/spl_nand.c
> +++ b/common/spl/spl_nand.c
> @@ -43,15 +43,12 @@ static ulong spl_nand_fit_read(struct spl_load_info 
> *load, ulong offs,
>  ulong size, void *dst)
>  {
>   int err;
> -#ifdef CONFIG_SYS_NAND_BLOCK_SIZE
>   ulong sector;
>  
>   sector = *(int *)load->priv;
> - offs = sector + nand_spl_adjust_offset(sector, offs - sector);
> -#else
>   offs *= load->bl_len;
>   size *= load->bl_len;
> -#endif
> + offs = sector + nand_spl_adjust_offset(sector, offs - sector);
>   err = nand_spl_load_image(offs, size, dst);
>   if (err)
>   return 0;
> -- 
> 2.25.1
> 


Re: [PATCH 4/4] spl: spl_nand: Fix bad block handling in fitImage

2022-04-28 Thread Tom Rini
On Wed, Apr 27, 2022 at 07:50:25AM +0200, Michael Trimarchi wrote:

> If the fitImage has some bad block in fit image area, the
> offset must be recalulcated. This should be done always.
> After implementing it in mxs now is possible to call the function
> even for that platform.
> 
> Cc: Fabio Estevam 
> Signed-off-by: Michael Trimarchi 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature


[PATCH 4/4] spl: spl_nand: Fix bad block handling in fitImage

2022-04-26 Thread Michael Trimarchi
If the fitImage has some bad block in fit image area, the
offset must be recalulcated. This should be done always.
After implementing it in mxs now is possible to call the function
even for that platform.

Cc: Fabio Estevam 
Signed-off-by: Michael Trimarchi 
---
V1->V2:
- move out from RFC
---
 common/spl/spl_nand.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index fc61b447a5..82a10ffa63 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -43,15 +43,12 @@ static ulong spl_nand_fit_read(struct spl_load_info *load, 
ulong offs,
   ulong size, void *dst)
 {
int err;
-#ifdef CONFIG_SYS_NAND_BLOCK_SIZE
ulong sector;
 
sector = *(int *)load->priv;
-   offs = sector + nand_spl_adjust_offset(sector, offs - sector);
-#else
offs *= load->bl_len;
size *= load->bl_len;
-#endif
+   offs = sector + nand_spl_adjust_offset(sector, offs - sector);
err = nand_spl_load_image(offs, size, dst);
if (err)
return 0;
-- 
2.25.1