All of lore.kernel.org
 help / color / mirror / Atom feed
* Help needed with uboot for CHIP
       [not found] <CAJAzxbWTO2hbqLt1j5mUbBqjwUXJ2h1+UjK1pgAEavJ=svNV9g@mail.gmail.com>
@ 2021-03-10 18:39 ` Alexandre GRIVEAUX
  2021-03-10 18:58   ` Gunjan Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre GRIVEAUX @ 2021-03-10 18:39 UTC (permalink / raw)
  To: u-boot

Le 10/03/2021 ? 18:32, Gunjan Gupta a ?crit?:
> Hi Alexandre,
>
> I saw your patch 
> <https://lists.denx.de/pipermail/u-boot/2021-January/438538.html> on 
> the U-boot mailing list. I am trying to get the latest U-boot working 
> on the CHIP with Hynix NAND and need your help with the same.
>
> I am using almost the same configuration as yours. I have also added 
> the nfc block in the dts file from the CHIP's original dts file. I am 
> able to boot the resultant U-boot from fel and also use env stored on 
> the NAND.
>
> When I write it on the nand and boot from it, spl fails to load and 
> jump to U-boot stored on the nand. I have tried a lot of things but 
> have not succeeded?in solving this yet.
>
> Did you also face this?problem?
>
> Please find attached my config file for your reference.
>
> Thanks & Regards
> Gunjan Gupta

Hello Gunjan,


Thanks for reporting the problem, you seem to use differents 
"CONFIG_MTDPARTS_DEFAULT"

Have you tried with the default defconfig ?

What NFC block do you have added on dts file ?


Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
  2021-03-10 18:39 ` Help needed with uboot for CHIP Alexandre GRIVEAUX
@ 2021-03-10 18:58   ` Gunjan Gupta
  2021-03-17 19:50     ` Alexandre GRIVEAUX
  0 siblings, 1 reply; 7+ messages in thread
From: Gunjan Gupta @ 2021-03-10 18:58 UTC (permalink / raw)
  To: u-boot

PFA my dts file. I have added the nfc section there as without that U-Boot
was giving a message about nfc being disabled in the dts.

Regarding trying the default config, I can't really do that as that doesn't
support booting from NAND and I want to be able to boot from NAND. Also I
don't think having different MTDPARTS value should create an issue, as I
didn't notice that being used in the SPL code. Please feel free to correct
me if I am wrong. Even if it was being used, I am flashing U-Boot to the
uboot partition and that is the same location that gets populated in
the CONFIG_SYS_NAND_U_BOOT_OFFS variable of the .config file.









On Thu, Mar 11, 2021 at 12:09 AM Alexandre GRIVEAUX <agriveaux@deutnet.info>
wrote:

> Le 10/03/2021 ? 18:32, Gunjan Gupta a ?crit :
> > Hi Alexandre,
> >
> > I saw your patch
> > <https://lists.denx.de/pipermail/u-boot/2021-January/438538.html> on
> > the U-boot mailing list. I am trying to get the latest U-boot working
> > on the CHIP with Hynix NAND and need your help with the same.
> >
> > I am using almost the same configuration as yours. I have also added
> > the nfc block in the dts file from the CHIP's original dts file. I am
> > able to boot the resultant U-boot from fel and also use env stored on
> > the NAND.
> >
> > When I write it on the nand and boot from it, spl fails to load and
> > jump to U-boot stored on the nand. I have tried a lot of things but
> > have not succeeded in solving this yet.
> >
> > Did you also face this problem?
> >
> > Please find attached my config file for your reference.
> >
> > Thanks & Regards
> > Gunjan Gupta
>
> Hello Gunjan,
>
>
> Thanks for reporting the problem, you seem to use differents
> "CONFIG_MTDPARTS_DEFAULT"
>
> Have you tried with the default defconfig ?
>
> What NFC block do you have added on dts file ?
>
>
> Thanks.
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sun5i-r8-chip.dts
Type: audio/vnd.dts
Size: 8155 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210311/06917a42/attachment.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
  2021-03-10 18:58   ` Gunjan Gupta
@ 2021-03-17 19:50     ` Alexandre GRIVEAUX
       [not found]       ` <CAJAzxbXEOjSEAew3NTo+EDU7Sw7n9xTGMjtXwxjFMDTEYLGQjA@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre GRIVEAUX @ 2021-03-17 19:50 UTC (permalink / raw)
  To: u-boot

Hello,

Le 10/03/2021 ? 19:58, Gunjan Gupta a ?crit?:
> PFA my dts file. I have added the nfc section there as without that U-Boot
> was giving a message about nfc being disabled in the dts.
>
> Regarding trying the default config, I can't really do that as that doesn't
> support booting from NAND and I want to be able to boot from NAND. Also I
> don't think having different MTDPARTS value should create an issue, as I
> didn't notice that being used in the SPL code. Please feel free to correct
> me if I am wrong. Even if it was being used, I am flashing U-Boot to the
> uboot partition and that is the same location that gets populated in
> the CONFIG_SYS_NAND_U_BOOT_OFFS variable of the .config file.
>
>
>
>
I've tried with a CHIP, same problem, the SPL work main u-boot not.

I don't think it's a defconfig limitation, sadly i don't know how this 
can be corrected.


Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
       [not found]       ` <CAJAzxbXEOjSEAew3NTo+EDU7Sw7n9xTGMjtXwxjFMDTEYLGQjA@mail.gmail.com>
@ 2021-03-21 14:34         ` Gunjan Gupta
  2021-03-22 18:28           ` Maxime Ripard
  0 siblings, 1 reply; 7+ messages in thread
From: Gunjan Gupta @ 2021-03-21 14:34 UTC (permalink / raw)
  To: u-boot

I figured out the why SPL was not loading U-Boot from NAND.

Apparently the logic to use PIO instead of DMA that was introduced in
6ddbb1e936c78cdef1e7395039fa7020c5c75326
<https://github.com/u-boot/u-boot/commit/6ddbb1e936c78cdef1e7395039fa7020c5c75326>
may
be was not as generic as it was supposed to be. I tried adding hexdump in
nand_read_page and found that on CHIP the logic was not reading and real
data. Instead all of the bytes were set to 0s.

I have created a patch to provide an option to use the older version of
nand_read_page function that was present just before the above mentioned
commit.

With the attached patches and some config changes the Upstream U-Boot works
fine on CHIP. I have tested the attached patches on CHIP with 8GB Hynix
nand along with the following extra configurations.

CONFIG_MTD=y
CONFIG_CMD_MTD=y
CONFIG_CMD_MTDPARTS=y
CONFIG_MTDIDS_DEFAULT="nand0=sunxi-nand.0"
CONFIG_MTDPARTS_DEFAULT="mtdparts=sunxi-nand.0:4m(spl),4m(spl-backup),4m(uboot),4m(env),-(yaffs2)"
CONFIG_MTD_RAW_NAND=y
CONFIG_SYS_NAND_BLOCK_SIZE=0x400000
CONFIG_SYS_NAND_PAGE_SIZE=0x4000
CONFIG_SYS_NAND_OOBSIZE=0x680
CONFIG_ENV_IS_IN_NAND=y
CONFIG_ENV_SIZE=0x400000
CONFIG_ENV_OFFSET=0xc00000
CONFIG_FASTBOOT_FLASH_NAND=y
CONFIG_YAFFS2=y

@Andre will it be possible to get the attached patches merged into the
U-Boot?

Thanks & Regards
Gunjan Gupta

On Thu, Mar 18, 2021 at 1:25 AM Gunjan Gupta <viraniac@gmail.com> wrote:

> Its not really like uboot is not working. Just spl fails to load it from
> nand. I tried replacing the 2021.01 spl with the original spl of chip's
> firmware(based on uboot 2016.01) and it loaded the 2021.01 u-boot
> correctly.
>
> On Thu, Mar 18, 2021, 1:20 AM Alexandre GRIVEAUX <agriveaux@deutnet.info>
> wrote:
>
>> Hello,
>> Le 10/03/2021 ? 19:58, Gunjan Gupta a ?crit :
>>
>> PFA my dts file. I have added the nfc section there as without that U-Boot
>> was giving a message about nfc being disabled in the dts.
>>
>> Regarding trying the default config, I can't really do that as that doesn't
>> support booting from NAND and I want to be able to boot from NAND. Also I
>> don't think having different MTDPARTS value should create an issue, as I
>> didn't notice that being used in the SPL code. Please feel free to correct
>> me if I am wrong. Even if it was being used, I am flashing U-Boot to the
>> uboot partition and that is the same location that gets populated in
>> the CONFIG_SYS_NAND_U_BOOT_OFFS variable of the .config file.
>>
>>
>>
>>
>>
>> I've tried with a CHIP, same problem, the SPL work main u-boot not.
>>
>> I don't think it's a defconfig limitation, sadly i don't know how this
>> can be corrected.
>>
>>
>> Thanks.
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-The-generic-PIO-based-nand_read_page-function-was-no.patch
Type: text/x-patch
Size: 5713 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210321/f9a873a3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Enable-NFC-in-sun5i-r8-chip.dts.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210321/f9a873a3/attachment-0001.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
  2021-03-21 14:34         ` Gunjan Gupta
@ 2021-03-22 18:28           ` Maxime Ripard
  2021-03-22 18:31             ` Gunjan Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Maxime Ripard @ 2021-03-22 18:28 UTC (permalink / raw)
  To: u-boot

Hi,

On Sun, Mar 21, 2021 at 08:04:08PM +0530, Gunjan Gupta wrote:
> I figured out the why SPL was not loading U-Boot from NAND.
> 
> Apparently the logic to use PIO instead of DMA that was introduced in
> 6ddbb1e936c78cdef1e7395039fa7020c5c75326
> <https://github.com/u-boot/u-boot/commit/6ddbb1e936c78cdef1e7395039fa7020c5c75326>
> may
> be was not as generic as it was supposed to be. I tried adding hexdump in
> nand_read_page and found that on CHIP the logic was not reading and real
> data. Instead all of the bytes were set to 0s.
> 
> I have created a patch to provide an option to use the older version of
> nand_read_page function that was present just before the above mentioned
> commit.
> 
> With the attached patches and some config changes the Upstream U-Boot works
> fine on CHIP. I have tested the attached patches on CHIP with 8GB Hynix
> nand along with the following extra configurations.

An MLC NAND without proper support will work fine until it won't. I
would strongly discourage you to use it.

> CONFIG_MTD=y
> CONFIG_CMD_MTD=y
> CONFIG_CMD_MTDPARTS=y
> CONFIG_MTDIDS_DEFAULT="nand0=sunxi-nand.0"
> CONFIG_MTDPARTS_DEFAULT="mtdparts=sunxi-nand.0:4m(spl),4m(spl-backup),4m(uboot),4m(env),-(yaffs2)"
> CONFIG_MTD_RAW_NAND=y
> CONFIG_SYS_NAND_BLOCK_SIZE=0x400000
> CONFIG_SYS_NAND_PAGE_SIZE=0x4000
> CONFIG_SYS_NAND_OOBSIZE=0x680
> CONFIG_ENV_IS_IN_NAND=y
> CONFIG_ENV_SIZE=0x400000
> CONFIG_ENV_OFFSET=0xc00000
> CONFIG_FASTBOOT_FLASH_NAND=y
> CONFIG_YAFFS2=y
> 
> @Andre will it be possible to get the attached patches merged into the
> U-Boot?

And we definitely shouldn't make it easy

Maxime

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
  2021-03-22 18:28           ` Maxime Ripard
@ 2021-03-22 18:31             ` Gunjan Gupta
  2021-03-23 11:30               ` Maxime Ripard
  0 siblings, 1 reply; 7+ messages in thread
From: Gunjan Gupta @ 2021-03-22 18:31 UTC (permalink / raw)
  To: u-boot

Ok...

What about supporting SLC. I dont have a Chip pro, but are you sure that
the current logic works for that too?

Thanks & Regards
Gunjan Gupta

On Mon, Mar 22, 2021, 11:58 PM Maxime Ripard <maxime@cerno.tech> wrote:

> Hi,
>
> On Sun, Mar 21, 2021 at 08:04:08PM +0530, Gunjan Gupta wrote:
> > I figured out the why SPL was not loading U-Boot from NAND.
> >
> > Apparently the logic to use PIO instead of DMA that was introduced in
> > 6ddbb1e936c78cdef1e7395039fa7020c5c75326
> > <
> https://github.com/u-boot/u-boot/commit/6ddbb1e936c78cdef1e7395039fa7020c5c75326
> >
> > may
> > be was not as generic as it was supposed to be. I tried adding hexdump in
> > nand_read_page and found that on CHIP the logic was not reading and real
> > data. Instead all of the bytes were set to 0s.
> >
> > I have created a patch to provide an option to use the older version of
> > nand_read_page function that was present just before the above mentioned
> > commit.
> >
> > With the attached patches and some config changes the Upstream U-Boot
> works
> > fine on CHIP. I have tested the attached patches on CHIP with 8GB Hynix
> > nand along with the following extra configurations.
>
> An MLC NAND without proper support will work fine until it won't. I
> would strongly discourage you to use it.
>
> > CONFIG_MTD=y
> > CONFIG_CMD_MTD=y
> > CONFIG_CMD_MTDPARTS=y
> > CONFIG_MTDIDS_DEFAULT="nand0=sunxi-nand.0"
> >
> CONFIG_MTDPARTS_DEFAULT="mtdparts=sunxi-nand.0:4m(spl),4m(spl-backup),4m(uboot),4m(env),-(yaffs2)"
> > CONFIG_MTD_RAW_NAND=y
> > CONFIG_SYS_NAND_BLOCK_SIZE=0x400000
> > CONFIG_SYS_NAND_PAGE_SIZE=0x4000
> > CONFIG_SYS_NAND_OOBSIZE=0x680
> > CONFIG_ENV_IS_IN_NAND=y
> > CONFIG_ENV_SIZE=0x400000
> > CONFIG_ENV_OFFSET=0xc00000
> > CONFIG_FASTBOOT_FLASH_NAND=y
> > CONFIG_YAFFS2=y
> >
> > @Andre will it be possible to get the attached patches merged into the
> > U-Boot?
>
> And we definitely shouldn't make it easy
>
> Maxime
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Help needed with uboot for CHIP
  2021-03-22 18:31             ` Gunjan Gupta
@ 2021-03-23 11:30               ` Maxime Ripard
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2021-03-23 11:30 UTC (permalink / raw)
  To: u-boot

On Tue, Mar 23, 2021 at 12:01:36AM +0530, Gunjan Gupta wrote:
> Ok...
> 
> What about supporting SLC. I dont have a Chip pro, but are you sure that
> the current logic works for that too?

The CHIP Pro has support for the NAND enabled, and if there's an issue
then it should be fixed indeed.

Maxime

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-23 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAJAzxbWTO2hbqLt1j5mUbBqjwUXJ2h1+UjK1pgAEavJ=svNV9g@mail.gmail.com>
2021-03-10 18:39 ` Help needed with uboot for CHIP Alexandre GRIVEAUX
2021-03-10 18:58   ` Gunjan Gupta
2021-03-17 19:50     ` Alexandre GRIVEAUX
     [not found]       ` <CAJAzxbXEOjSEAew3NTo+EDU7Sw7n9xTGMjtXwxjFMDTEYLGQjA@mail.gmail.com>
2021-03-21 14:34         ` Gunjan Gupta
2021-03-22 18:28           ` Maxime Ripard
2021-03-22 18:31             ` Gunjan Gupta
2021-03-23 11:30               ` Maxime Ripard

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.