[U-Boot] [PATCH 3/3] mtd: rawnand: denali: Do not reset the block on SoCFPGA

Marek Vasut marex at denx.de
Tue Nov 26 08:17:27 UTC 2019


On 11/26/19 3:47 AM, Masahiro Yamada wrote:
> On Thu, Nov 21, 2019 at 6:38 AM Marek Vasut wrote:
>>
>> Legacy kernel versions for SoCFPGA may not implement proper reset
>> handling.
> 
> What is "legacy kernel versions" ?

Anything older than 5.x , which got proper reset handling, finally.

>> Apply the same approach as SoCFPGA reset driver, check
>> environment variable "socfpga_legacy_reset_compat", and if it is
>> set, do not reset the IP before booting Linux. This way, even the
>> older kernel versions can be booted by up to date U-Boot.
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Cc: Masahiro Yamada <yamada.masahiro at socionext.com>
>> ---
>>  drivers/mtd/nand/raw/denali_dt.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c
>> index 2c9e249ab6..d35f2a3543 100644
>> --- a/drivers/mtd/nand/raw/denali_dt.c
>> +++ b/drivers/mtd/nand/raw/denali_dt.c
>> @@ -148,6 +148,18 @@ static int denali_dt_remove(struct udevice *dev)
>>  {
>>         struct denali_nand_info *denali = dev_get_priv(dev);
>>
>> +#if CONFIG_IS_ENABLED(ARCH_SOCFPGA)
>> +       /*
>> +        * Legacy kernel versions do not implement proper reset handling on
>> +        * SoCFPGA. To let those older kernel versions work, reuse the same
>> +        * approach as the SoCFPGA reset driver does -- check environment
>> +        * variable socfpga_legacy_reset_compat and avoid resetting the IP
>> +        * before booting the kernel if it is set to 1.
>> +        */
>> +       if (env_get_ulong("socfpga_legacy_reset_compat", 10, 0))
>> +               return 0;
>> +#endif
>> +
> 
> 
> How about removing denali_dt_remove() entirely ?

Fine by me.

> Not only SOCFPGA, but also my boards are broken.

How come ?

> I am really annoyed since the following commit:
> 
> 
> 
> 
> commit ed784ac3822b7d7019679a41a17907296e2dadbe
> Author:     Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> AuthorDate: Fri Mar 1 20:12:34 2019 +0100
> Commit:     Marek Vasut <marex at denx.de>
> CommitDate: Wed Apr 17 22:20:16 2019 +0200
> 
>     mtd: rawnand: denali: add reset handling
> 
>     This adds reset handling to the devicetree-enabled Denali NAND driver.
> 
>     For backwards compatibility, only a warning is printed when failing to
>     get reset handles.
> 
>     Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> 
> 
> 
>>         return reset_release_bulk(&denali->resets);
>>  }

CCing Simon.


More information about the U-Boot mailing list