[U-Boot] [PATCH 1/3] mtd: rawnand: denali-spl: Add missing hardware init

Masahiro Yamada yamada.masahiro at socionext.com
Tue Nov 26 09:24:20 UTC 2019


On Tue, Nov 26, 2019 at 5:25 PM Marek Vasut <marex at denx.de> wrote:
>
> On 11/26/19 3:34 AM, Masahiro Yamada wrote:
> > On Thu, Nov 21, 2019 at 6:37 AM Marek Vasut 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().
> >
> > I'd like to know this in more detailed.
> >
> > I assume these registers are set up by the BootROM,
> > and SPL is supposed to read data in the same manner as the Boot ROM.
> >
> > In which situation does the data get corrupted?
>
> When I boot the board, these registers are not set up correctly. The
> bootrom reads the SPL fine, but the SPL cannot read U-Boot anymore,
> probably because the bootrom does something funny to the controller
> settings.

Interesting.
The boot ROM can load SPL from a NAND device,
but SPL cannot load U-Boot from it in the same manner.


How did you burn SPL, U-Boot proper, respectively?
Were they written in different ways?




>
> >> Signed-off-by: Marek Vasut <marex at denx.de>
> >> Cc: Masahiro Yamada <yamada.masahiro at 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);
> >
> > I guess you tested this for SOCFPGA.
> >
> > Please tell me the value of CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES.
> 2


-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list