public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 1/3] mtd: rawnand: denali-spl: Add missing hardware init
Date: Thu, 9 Jan 2020 14:18:47 +0100	[thread overview]
Message-ID: <791bbb46-67fc-eaef-3ecf-968325d7639a@denx.de> (raw)
In-Reply-To: <CAK7LNASL6YrBWZJqmkDX_6jyF1yMPqW0vgnUo4ePrndEPPGAcQ@mail.gmail.com>

On 1/9/20 12:29 PM, Masahiro Yamada wrote:
> On Thu, Jan 9, 2020 at 7:08 PM Marek Vasut <marex@denx.de> wrote:
>>
>> While the Denali NAND is initialized by the BootROM in SPL, there
>> are still a couple of settings which are missing. These can trigger
>> subtle corruption of the data read out of the NAND. Fill these
>> settings in just like they are filled in by the full Denali NAND
>> driver in denali_hw_init().
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>  drivers/mtd/nand/raw/denali_spl.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/denali_spl.c b/drivers/mtd/nand/raw/denali_spl.c
>> index dbaba3cab2..b8b29812aa 100644
>> --- a/drivers/mtd/nand/raw/denali_spl.c
>> +++ b/drivers/mtd/nand/raw/denali_spl.c
>> @@ -173,6 +173,13 @@ void nand_init(void)
>>         page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
>>         oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
>>         pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);
>> +
>> +       /* Do as denali_hw_init() does. */
>> +       writel(CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES,
>> +              denali_flash_reg + SPARE_AREA_SKIP_BYTES);
>> +       writel(0x0F, denali_flash_reg + RB_PIN_ENABLED);
>> +       writel(CHIP_EN_DONT_CARE__FLAG, denali_flash_reg + CHIP_ENABLE_DONT_CARE);
>> +       writel(0xffff, denali_flash_reg + SPARE_AREA_MARKER);
>>  }
>>
> 
> You need this because SOCFPGA SPL resets the nand controller, correct?
> 
> https://github.com/u-boot/u-boot/blob/v2020.01/arch/arm/mach-socfpga/spl_gen5.c#L89

Yes. The driver should init the hardware correctly and fully, which it
does not do without this patch.

  reply	other threads:[~2020-01-09 13:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 10:07 [PATCH 1/3] mtd: rawnand: denali-spl: Add missing hardware init Marek Vasut
2020-01-09 10:07 ` [PATCH 2/3] mtd: rawnand: denali: Allow operation without clock driver Marek Vasut
2020-01-09 11:02   ` Masahiro Yamada
2020-01-09 11:14     ` Marek Vasut
2020-01-09 12:04       ` Masahiro Yamada
2020-01-09 13:21         ` Marek Vasut
2020-01-09 10:07 ` [PATCH 3/3] mtd: rawnand: denali: Do not reset the block on SoCFPGA Marek Vasut
2020-01-09 11:04   ` Masahiro Yamada
2020-01-09 11:15     ` Marek Vasut
2020-01-09 12:11       ` Masahiro Yamada
2020-01-09 14:25         ` Marek Vasut
2020-01-09 15:01           ` Masahiro Yamada
2020-01-10  0:10             ` Marek Vasut
2020-01-09 11:29 ` [PATCH 1/3] mtd: rawnand: denali-spl: Add missing hardware init Masahiro Yamada
2020-01-09 13:18   ` Marek Vasut [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-01-10  0:14 Marek Vasut
2020-01-10  2:45 ` Masahiro Yamada
2020-01-10  3:52   ` Marek Vasut
2020-01-10  6:26     ` Masahiro Yamada
2020-01-13 11:05       ` Marek Vasut
2020-01-14  6:55         ` Masahiro Yamada
2020-01-21 18:54           ` Marek Vasut

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=791bbb46-67fc-eaef-3ecf-968325d7639a@denx.de \
    --to=marex@denx.de \
    --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