All of lore.kernel.org
 help / color / mirror / Atom feed
* [u-boot-fslc] QSPI driver
@ 2016-02-08 17:17 Esponde, Joel
  2016-02-17 13:45 ` Esponde, Joel
  0 siblings, 1 reply; 7+ messages in thread
From: Esponde, Joel @ 2016-02-08 17:17 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

Hi all,

I am working on a project where all embedded linux components will fit in one QSPI NOR flash (u-boot/kernel/rootfs). The board is currently the iMX6ULEVK.

As I would like to boot a kernel that is in a UBIFS partition, I cannot use u-boot-imx version because mtd is not yet compatible with QSPI NOR flash unlike u-boot-fslc. The latter embeds that compatibility since 2015/07.
It had been added through that commit:
https://github.com/Freescale/u-boot-fslc/commit/9fe6d8716e090f3b2dd3f4604acfced124b8a2fc

Unfortunately, it looks like the qspi driver of u-boot-fslc is not compatible with iMX6UL. It is not able to probe the NOR flash (sf probe).
I had to replace the fsl-qspi driver with the one available in u-boot-imx and it worked then.
As both fsl-qspi.c files are very different, I do not know how to add the support of QSPI to iMX6UL in u-boot-fslc project.
I saw that even the latest sources do not manage that hardware compatibility.

Does anybody have an idea of how to solve this iMX6UL compatibility issue the right way?

Joël




[-- Attachment #2: Type: text/html, Size: 4368 bytes --]

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

* Re: [u-boot-fslc] QSPI driver
  2016-02-08 17:17 [u-boot-fslc] QSPI driver Esponde, Joel
@ 2016-02-17 13:45 ` Esponde, Joel
  2016-02-17 15:08   ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Esponde, Joel @ 2016-02-17 13:45 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]

Hi,

As I would like to keep this issue alive, I am trying to raise it again.

QSPI driver of u-boot-fslc seems to be broken for IMX6UL counter to u-boot-imx one.
Could that issue be solved simply by replacing the QSPI driver by the one in u-boot-imx repo?
It works at least for iMX6UL EVK board.

Joël


De : meta-freescale-bounces@yoctoproject.org [mailto:meta-freescale-bounces@yoctoproject.org] De la part de Esponde, Joel
Envoyé : lundi 8 février 2016 18:17
À : meta-freescale@yoctoproject.org
Objet : [meta-freescale] [u-boot-fslc] QSPI driver

Hi all,

I am working on a project where all embedded linux components will fit in one QSPI NOR flash (u-boot/kernel/rootfs). The board is currently the iMX6ULEVK.

As I would like to boot a kernel that is in a UBIFS partition, I cannot use u-boot-imx version because mtd is not yet compatible with QSPI NOR flash unlike u-boot-fslc. The latter embeds that compatibility since 2015/07.
It had been added through that commit:
https://github.com/Freescale/u-boot-fslc/commit/9fe6d8716e090f3b2dd3f4604acfced124b8a2fc

Unfortunately, it looks like the qspi driver of u-boot-fslc is not compatible with iMX6UL. It is not able to probe the NOR flash (sf probe).
I had to replace the fsl-qspi driver with the one available in u-boot-imx and it worked then.
As both fsl-qspi.c files are very different, I do not know how to add the support of QSPI to iMX6UL in u-boot-fslc project.
I saw that even the latest sources do not manage that hardware compatibility.

Does anybody have an idea of how to solve this iMX6UL compatibility issue the right way?

Joël




[-- Attachment #2: Type: text/html, Size: 6547 bytes --]

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

* Re: [u-boot-fslc] QSPI driver
  2016-02-17 13:45 ` Esponde, Joel
@ 2016-02-17 15:08   ` Fabio Estevam
  2016-02-17 17:26     ` Esponde, Joel
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2016-02-17 15:08 UTC (permalink / raw)
  To: Esponde, Joel; +Cc: meta-freescale

On Wed, Feb 17, 2016 at 11:45 AM, Esponde, Joel
<Joel.Esponde@honeywell.com> wrote:

> QSPI driver of u-boot-fslc seems to be broken for IMX6UL counter to
> u-boot-imx one.
>
> Could that issue be solved simply by replacing the QSPI driver by the one in
> u-boot-imx repo?
>
> It works at least for iMX6UL EVK board.

Have you tested U-boot 2016.01?

If it fails with this version, the please report it at the U-boot mailing list.


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

* Re: [u-boot-fslc] QSPI driver
  2016-02-17 15:08   ` Fabio Estevam
@ 2016-02-17 17:26     ` Esponde, Joel
  2016-02-17 19:15       ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Esponde, Joel @ 2016-02-17 17:26 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: meta-freescale

Hi,

Thanks Fabio for your reply!
I am using the 2015.10 version because it's the last one tagged, I guess it is the latest stable release.

BTW, in the QSPI driver of u-boot-imx there is this piece of code:
	/* Write data to the QUADSPI_TBDR buffer registers. */
	static void fsl_qspi_write_data(struct fsl_qspi *q, int len, u8* txbuf)
	{
		...

	#if defined(CONFIG_MX7D) || defined(CONFIG_MX6UL)
		u32 t3;
		/* iMX7D and MX6UL TXFIFO must be at least 16 bytes*/
		t3 = t1 + ((t2 + 3) >> 2);
		for (; t3 < 4; t3++)
			writel(0, q->iobase + QUADSPI_TBDR);
	#endif

	}
So it looks like the latest Freescale CPUs have a QSPI peripheral a bit different of the previous ones.

The closest function in u-boot-fslc driver seems to be qspi_op_write:
https://github.com/Freescale/u-boot-fslc/blob/2016.01%2Bfslc/drivers/spi/fsl_qspi.c#L565
And I do not see any special code for MX6UL and MX7D in that function.
The code of that function is very close if not equal between 2015.10 and 2016.01.

If you think I still need to make a test to confirm that issue despite my explanations, I will try to do it.

When you are talking about the u-boot mailing list, are you talking about the mainline mailing list?
http://lists.denx.de/mailman/listinfo/u-boot
If so, I still have difficulties to understand how the imx, fslc and mainline 'projects' are interconnected/linked.
If you had any explanations to provide about that, I would greatly appreciate.

Joël


-----Message d'origine-----
De : Fabio Estevam [mailto:festevam@gmail.com] 
Envoyé : mercredi 17 février 2016 16:09
À : Esponde, Joel
Cc : meta-freescale@yoctoproject.org
Objet : Re: [meta-freescale] [u-boot-fslc] QSPI driver

On Wed, Feb 17, 2016 at 11:45 AM, Esponde, Joel <Joel.Esponde@honeywell.com> wrote:

> QSPI driver of u-boot-fslc seems to be broken for IMX6UL counter to 
> u-boot-imx one.
>
> Could that issue be solved simply by replacing the QSPI driver by the 
> one in u-boot-imx repo?
>
> It works at least for iMX6UL EVK board.

Have you tested U-boot 2016.01?

If it fails with this version, the please report it at the U-boot mailing list.

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

* Re: [u-boot-fslc] QSPI driver
  2016-02-17 17:26     ` Esponde, Joel
@ 2016-02-17 19:15       ` Fabio Estevam
  2016-02-17 21:39         ` Esponde, Joel
  2016-02-22 18:46         ` Fabio Estevam
  0 siblings, 2 replies; 7+ messages in thread
From: Fabio Estevam @ 2016-02-17 19:15 UTC (permalink / raw)
  To: Esponde, Joel; +Cc: meta-freescale

On Wed, Feb 17, 2016 at 3:26 PM, Esponde, Joel
<Joel.Esponde@honeywell.com> wrote:
> Hi,
>
> Thanks Fabio for your reply!
> I am using the 2015.10 version because it's the last one tagged, I guess it is the latest stable release.
>
> BTW, in the QSPI driver of u-boot-imx there is this piece of code:
>         /* Write data to the QUADSPI_TBDR buffer registers. */
>         static void fsl_qspi_write_data(struct fsl_qspi *q, int len, u8* txbuf)
>         {
>                 ...
>
>         #if defined(CONFIG_MX7D) || defined(CONFIG_MX6UL)
>                 u32 t3;
>                 /* iMX7D and MX6UL TXFIFO must be at least 16 bytes*/
>                 t3 = t1 + ((t2 + 3) >> 2);
>                 for (; t3 < 4; t3++)
>                         writel(0, q->iobase + QUADSPI_TBDR);
>         #endif
>
>         }
> So it looks like the latest Freescale CPUs have a QSPI peripheral a bit different of the previous ones.
>
> The closest function in u-boot-fslc driver seems to be qspi_op_write:
> https://github.com/Freescale/u-boot-fslc/blob/2016.01%2Bfslc/drivers/spi/fsl_qspi.c#L565
> And I do not see any special code for MX6UL and MX7D in that function.
> The code of that function is very close if not equal between 2015.10 and 2016.01.
>
> If you think I still need to make a test to confirm that issue despite my explanations, I will try to do it.

Just tested with mainline U-boot with this change:

--- a/include/configs/mx6ul_14x14_evk.h
+++ b/include/configs/mx6ul_14x14_evk.h
@@ -195,6 +195,7 @@
 #define CONFIG_CMD_CACHE
 #endif

+#define CONFIG_FSL_QSPI
 #ifdef CONFIG_FSL_QSPI
 #define CONFIG_CMD_SF
 #define CONFIG_SPI_FLASH

Then I can see the SPI being probed correctly:

U-Boot SPL 2016.03-rc1-00144-gd6bf29b-dirty (Feb 17 2016 - 17:11:44)
Trying to boot from MMC


U-Boot 2016.03-rc1-00144-gd6bf29b-dirty (Feb 17 2016 - 17:11:44 -0200)

CPU:   Freescale i.MX6UL rev1.0 792 MHz (running at 396 MHz)
CPU:   Commercial temperature grade (0C to 95C)Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Video: MXSFB: 'videomode' variable not set!
In:    serial
Out:   serial
Err:   serial
Net:   FEC1
Warning: FEC1 MAC addresses don't match:
Address in SROM is         00:04:9f:03:c3:d2
Address in environment is  00:04:9f:03:c3:d1

Hit any key to stop autoboot:  0
=> sf probe
SF: Detected N25Q256 with page size 256 Bytes, erase size 64 KiB, total 32 MiB


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

* Re: [u-boot-fslc] QSPI driver
  2016-02-17 19:15       ` Fabio Estevam
@ 2016-02-17 21:39         ` Esponde, Joel
  2016-02-22 18:46         ` Fabio Estevam
  1 sibling, 0 replies; 7+ messages in thread
From: Esponde, Joel @ 2016-02-17 21:39 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: meta-freescale

> -----Message d'origine-----
> De : Fabio Estevam [mailto:festevam@gmail.com]
> Envoyé : mercredi 17 février 2016 20:16
> À : Esponde, Joel
> Cc : meta-freescale@yoctoproject.org
> Objet : Re: [meta-freescale] [u-boot-fslc] QSPI driver
> 
> 
> Just tested with mainline U-boot with this change:
> 
> --- a/include/configs/mx6ul_14x14_evk.h
> +++ b/include/configs/mx6ul_14x14_evk.h
> @@ -195,6 +195,7 @@
>  #define CONFIG_CMD_CACHE
>  #endif
> 
> +#define CONFIG_FSL_QSPI
>  #ifdef CONFIG_FSL_QSPI
>  #define CONFIG_CMD_SF
>  #define CONFIG_SPI_FLASH
> 
> Then I can see the SPI being probed correctly:
> 
> U-Boot SPL 2016.03-rc1-00144-gd6bf29b-dirty (Feb 17 2016 - 17:11:44) Trying
> to boot from MMC
> 
> 
> U-Boot 2016.03-rc1-00144-gd6bf29b-dirty (Feb 17 2016 - 17:11:44 -0200)
> 
> CPU:   Freescale i.MX6UL rev1.0 792 MHz (running at 396 MHz)
> CPU:   Commercial temperature grade (0C to 95C)Reset cause: POR
> Board: MX6UL 14x14 EVK
> I2C:   ready
> DRAM:  512 MiB
> MMC:   FSL_SDHC: 0, FSL_SDHC: 1
> Video: MXSFB: 'videomode' variable not set!
> In:    serial
> Out:   serial
> Err:   serial
> Net:   FEC1
> Warning: FEC1 MAC addresses don't match:
> Address in SROM is         00:04:9f:03:c3:d2
> Address in environment is  00:04:9f:03:c3:d1
> 
> Hit any key to stop autoboot:  0
> => sf probe
> SF: Detected N25Q256 with page size 256 Bytes, erase size 64 KiB, total 32
> MiB

Ok thanks a lot Fabio!

So I will try tomorrow to build the latest mainline u-boot and load it in my evaluation board.

I found a recent commit that could explain the issue and its resolution:
http://git.denx.de/?p=u-boot.git;a=patch;h=c6d3d812fefabd0807fca485fef89e0c32ed4190
I checked my code and I already had this new define... I do not see which difference with u-boot-fslc could have made it work...


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

* Re: [u-boot-fslc] QSPI driver
  2016-02-17 19:15       ` Fabio Estevam
  2016-02-17 21:39         ` Esponde, Joel
@ 2016-02-22 18:46         ` Fabio Estevam
  1 sibling, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2016-02-22 18:46 UTC (permalink / raw)
  To: Esponde, Joel; +Cc: meta-freescale

On Wed, Feb 17, 2016 at 5:15 PM, Fabio Estevam <festevam@gmail.com> wrote:

> Just tested with mainline U-boot with this change:

This patch has been applied into u-boot-imx tree:
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=e9e18353c0c5b8c9d48a143f81d6e8f69eb20d3b;hp=3964311473e00f4d22034cefe56d96bb625e6ba4


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

end of thread, other threads:[~2016-02-22 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 17:17 [u-boot-fslc] QSPI driver Esponde, Joel
2016-02-17 13:45 ` Esponde, Joel
2016-02-17 15:08   ` Fabio Estevam
2016-02-17 17:26     ` Esponde, Joel
2016-02-17 19:15       ` Fabio Estevam
2016-02-17 21:39         ` Esponde, Joel
2016-02-22 18:46         ` Fabio Estevam

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.