All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolai Zhubr <n-a-zhubr@yandex.ru>
To: u-boot@lists.denx.de
Subject: [U-Boot] SPL variant of sunxi nand module
Date: Mon, 24 Dec 2018 00:47:51 +0300	[thread overview]
Message-ID: <5C200287.2040106@yandex.ru> (raw)
In-Reply-To: <5C1FF78A.6000009@yandex.ru>

Hi again,

The following commit (titled "use PIO instead of DMA") apparently broke 
actual reading of nand pages in SPL at least for A20:

http://git.denx.de/?p=u-boot.git;a=commit;h=6ddbb1e936c78cdef1e7395039fa7020c5c75326

Instead of reading page contents, non-dma (current) version just feeds 
zeroes here.
Tested on A20-olinuxino-micro with a Hynix 4GB nand chip.

It'd be nice to somehow fix it back eventually :)

Other than that, nand boot seems usable (with added necessary chip id).


Thank you,

Regards,
Nikolai

24.12.2018 0:00, I wrote:
> 23.12.2018 21:58, I wrote:
> [...]
>> Regarding the sunxi_nand_spl.c module, I can not find any mention if it
>> implies NAND_ECC_HW, NAND_ECC_HW_SYNDROME, or rather some other mode, or
>> if these modes are irrelevant in this case?
>
> So far I'm observing that sunxi_nand_spl module refuses to load erased
> nand pages (500000 in the example below), which is correct, but it
> "successfully" loads filled nand pages as totally zeroed out, which is
> supposedly incorrect. This is in contrast with sunxi_nand module, that
> loads filled pages correctly, at least in my simple tests.
>
> So while detection in sunxi_nand_spl seems fine, reading seems not.
>
> I think digging deeper without some additional advice is a bit beyond my
> capabilities, although most probably some very tiny bits are missing...
>
>
> Thank you,
>
> Regards,
> Nikolai
>
> U-Boot SPL 2019.01-rc2 (Dec 23 2018 - 23:23:57 +0300)
> CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
> DRAM: 1024 MiB
>  >>SPL: board_init_r()
> Trying to boot from NAND
> spl: nand - using hw ecc
> [zh]nand_spl_load_image(500000, 40)=-22
> [zh]Read dump of page 768 (nand offs 600000, page_size 8192):
> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
> [zh]Read dump of page 768 (nand offs 600000, page_size 8192):
> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
> =====================================================
> U-Boot 2019.01-rc2 (Dec 23 2018 - 22:30:35 +0300) Allwinner Technology
>
> CPU: Allwinner A20 (SUN7I)
> Model: Olimex A20-Olinuxino Micro
> I2C: ready
> DRAM: 1 GiB
> NAND: nand_base: device found, Manufacturer ID: 0xad, Chip ID: 0xd7
> nand_base: Hynix H27UBG8T2BTR-BC 32G 3.3V 8-bit
> nand_base: Hynix H27UBG8T2BTR-BC 32G 3.3V 8-bit
> nand_base: 4096 MiB, MLC, erase size: 2048 KiB, page size: 8192, OOB
> size: 640
> Using ECC step 1024, strength 40, mode 2
> 4096 MiB
> In: serial
> Out: serial
> Err: serial
> SCSI: SATA link 0 timeout.
> AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
> flags: ncq stag pm led clo only pmp pio slum part ccc apst
>
> Net: Can't get reset: -524
> eth0: ethernet at 1c50000
> Hit any key to stop autoboot: 0
> => nand read 0x45000000 0x400000 0x1000
>
> NAND read: device 0 offset 0x400000, size 0x1000
> Scanning device for bad blocks
> Bad eraseblock 0 at 0x0000001fe000
> Bad eraseblock 1 at 0x0000003fe000
> 4096 bytes read: OK
> => md.b 0x45000000 100
> 45000000: b8 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ................
> =====================================================
>
>
>>
>> Can not guess browsing through the code, it looks too different from
>> sunxi_nand.c to compare.
>>
>>
>> Thank you,
>>
>> Regards,
>> Nikolai
>>
>>
>>> On the other hand, normal U-boot variant reads correct data from nand,
>>> but I'm not yet sure if it uses correct parameters and specifically, if
>>> they match those of SPL version. Need to add yet more debugging output.
>>>
>>>
>>> Thank you,
>>>
>>> Regards,
>>> Nikolai
>>>
>>>> Michael
>>>>
>>>>>
>>>>> Now the detection routine in sunxi_nand_spl apparently comes up with a
>>>>> value of ecc_strength=4 instead... Why is that?
>>>>
>>>> n - 1 using an index, if the code that I have is aligned so
>>>>
>>>> Michael
>>>>
>>>>>
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Regards,
>>>>> Nikolai
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Regards,
>>>>>> Nikolai
>>>>>> _______________________________________________
>>>>>> U-Boot mailing list
>>>>>> U-Boot at lists.denx.de
>>>>>> https://lists.denx.de/listinfo/u-boot
>>>>>
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> https://lists.denx.de/listinfo/u-boot
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>>
>

  reply	other threads:[~2018-12-23 21:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-23 13:29 [U-Boot] SPL variant of sunxi nand module Nikolai Zhubr
2018-12-23 16:04 ` Nikolai Zhubr
2018-12-23 15:54   ` Michael Nazzareno Trimarchi
2018-12-23 18:11     ` Nikolai Zhubr
2018-12-23 18:58       ` Nikolai Zhubr
2018-12-23 21:00         ` Nikolai Zhubr
2018-12-23 21:47           ` Nikolai Zhubr [this message]
2018-12-29 20:08             ` Nikolai Zhubr

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=5C200287.2040106@yandex.ru \
    --to=n-a-zhubr@yandex.ru \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.