public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
@ 2013-03-25 16:13 Javier Martinez Canillas
  2013-04-03  9:25 ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Javier Martinez Canillas @ 2013-03-25 16:13 UTC (permalink / raw)
  To: u-boot

since commit "c1173bd0: sf command: allow default bus and chip selects"
the chip-select and bus arguments for the sf probe command are optional.

Even when passing the chip-select to sf probe says to be optional, it
makes "sf erase" and "sf write" to fail on a mx6qsabrelite board. e.g:

MX6QSABRELITE U-Boot > sf probe 1
MX6QSABRELITE U-Boot > sf erase 0 0x40000
SPI flash erase failed
MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
SPI flash write failed

But just using "sf probe" works well. So, update the mx6qsabrelite
README so the commands will work on current U-Boot.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 board/freescale/mx6qsabrelite/README |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/README b/board/freescale/mx6qsabrelite/README
index 6f2f534..324b116 100644
--- a/board/freescale/mx6qsabrelite/README
+++ b/board/freescale/mx6qsabrelite/README
@@ -40,7 +40,7 @@ enter the following commands:
 
  MX6Q SABRELITE U-Boot > mmc dev 0
  MX6Q SABRELITE U-Boot > mmc read 0x10800000 0 200
- MX6Q SABRELITE U-Boot > sf probe 1
+ MX6Q SABRELITE U-Boot > sf probe
  MX6Q SABRELITE U-Boot > sf erase 0 0x40000
  MX6Q SABRELITE U-Boot > sf write 0x10800000 0 0x40000
 
-- 
1.7.7.6

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-03-25 16:13 [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command Javier Martinez Canillas
@ 2013-04-03  9:25 ` Stefano Babic
  2013-04-03  9:50   ` Javier Martinez Canillas
  2013-04-03 14:06   ` Eric Nelson
  0 siblings, 2 replies; 8+ messages in thread
From: Stefano Babic @ 2013-04-03  9:25 UTC (permalink / raw)
  To: u-boot

On 25/03/2013 17:13, Javier Martinez Canillas wrote:
> since commit "c1173bd0: sf command: allow default bus and chip selects"
> the chip-select and bus arguments for the sf probe command are optional.
> 

Hi Javier,

> Even when passing the chip-select to sf probe says to be optional, it
> makes "sf erase" and "sf write" to fail on a mx6qsabrelite board. e.g:
> 
> MX6QSABRELITE U-Boot > sf probe 1
> MX6QSABRELITE U-Boot > sf erase 0 0x40000
> SPI flash erase failed
> MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
> SPI flash write failed

Well, the real reason is that the passed chipselect is wrong. Checking
in the configuration file, I see that the value to be passed should be
0x7300. I suppose (I am not testing) that "sf probe 0x7300" make sf
erase and sw write working.

> 
> But just using "sf probe" works well. So, update the mx6qsabrelite
> README so the commands will work on current U-Boot.

I agree with the patch, but the description is wrong. Can you rewrite it
simply stating that the chipselect "1" is wrong and that it is not
strictly required (but again, is not forbidden) to pass it to sf probe ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03  9:25 ` Stefano Babic
@ 2013-04-03  9:50   ` Javier Martinez Canillas
  2013-04-03 10:13     ` Stefano Babic
  2013-04-03 14:06   ` Eric Nelson
  1 sibling, 1 reply; 8+ messages in thread
From: Javier Martinez Canillas @ 2013-04-03  9:50 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 3, 2013 at 11:25 AM, Stefano Babic <sbabic@denx.de> wrote:
> On 25/03/2013 17:13, Javier Martinez Canillas wrote:
>> since commit "c1173bd0: sf command: allow default bus and chip selects"
>> the chip-select and bus arguments for the sf probe command are optional.
>>
>
> Hi Javier,
>

Hi Stefano, thanks a lot for your feedback.

>> Even when passing the chip-select to sf probe says to be optional, it
>> makes "sf erase" and "sf write" to fail on a mx6qsabrelite board. e.g:
>>
>> MX6QSABRELITE U-Boot > sf probe 1
>> MX6QSABRELITE U-Boot > sf erase 0 0x40000
>> SPI flash erase failed
>> MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
>> SPI flash write failed
>
> Well, the real reason is that the passed chipselect is wrong. Checking
> in the configuration file, I see that the value to be passed should be
> 0x7300. I suppose (I am not testing) that "sf probe 0x7300" make sf
> erase and sw write working.
>

Just for curiosity, in which configuration file did you see that? When
I had the issue I looked at
include/configs/{mx6qsabrelite,mx6_common}.h and
board/freescale/mx6qsabrelite/mx6qsabrelite.c but I didn't find what
chip-select was supposed to be used.

>>
>> But just using "sf probe" works well. So, update the mx6qsabrelite
>> README so the commands will work on current U-Boot.
>
> I agree with the patch, but the description is wrong. Can you rewrite it
> simply stating that the chipselect "1" is wrong and that it is not
> strictly required (but again, is not forbidden) to pass it to sf probe ?
>

I'll send a v2 of the patch with this description:

    i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command

    board/freescale/mx6qsabrelite/README explain a procedure to
    update the SPI-NOR on the SabreLite board without Freescale
    manufacturing tool but following this procedure leads to both
    "sf erase" and "sf write" failing on a mx6qsabrelite board:

    MX6QSABRELITE U-Boot > sf probe 1
    MX6QSABRELITE U-Boot > sf erase 0 0x40000
    SPI flash erase failed
    MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
    SPI flash write failed

    This is because the chip-select 1 is wrong and according the
    correct value is 0x7300.

    Since commit c1173bd0 ("sf command: allow default bus and chip selects"),
    the chip-select and bus arguments for the sf probe command are optional
    so let's just remove it and use "sf probe" instead.

> Best regards,
> Stefano Babic
>
> --

Thanks a lot and best regards,
Javier

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03  9:50   ` Javier Martinez Canillas
@ 2013-04-03 10:13     ` Stefano Babic
  2013-04-03 14:11       ` Eric Nelson
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2013-04-03 10:13 UTC (permalink / raw)
  To: u-boot

On 03/04/2013 11:50, Javier Martinez Canillas wrote:
> Just for curiosity, in which configuration file did you see that? When
> I had the issue I looked at
> include/configs/{mx6qsabrelite,mx6_common}.h and
> board/freescale/mx6qsabrelite/mx6qsabrelite.c but I didn't find what
> chip-select was supposed to be used.

include/configs/mx6qsabrelite.h:

#define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))

It should be 0x7300

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03  9:25 ` Stefano Babic
  2013-04-03  9:50   ` Javier Martinez Canillas
@ 2013-04-03 14:06   ` Eric Nelson
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Nelson @ 2013-04-03 14:06 UTC (permalink / raw)
  To: u-boot

On 04/03/2013 02:25 AM, Stefano Babic wrote:
> On 25/03/2013 17:13, Javier Martinez Canillas wrote:
>> since commit "c1173bd0: sf command: allow default bus and chip selects"
>> the chip-select and bus arguments for the sf probe command are optional.
>>
>
> Hi Javier,
>
>> Even when passing the chip-select to sf probe says to be optional, it
>> makes "sf erase" and "sf write" to fail on a mx6qsabrelite board. e.g:
>>
>> MX6QSABRELITE U-Boot > sf probe 1
>> MX6QSABRELITE U-Boot > sf erase 0 0x40000
>> SPI flash erase failed
>> MX6QSABRELITE U-Boot > sf write 0x10800000 0 0x40000
>> SPI flash write failed
>
> Well, the real reason is that the passed chipselect is wrong. Checking
> in the configuration file, I see that the value to be passed should be
> 0x7300. I suppose (I am not testing) that "sf probe 0x7300" make sf
> erase and sw write working.
>
It's 0x5300 as listed in commit c1173bd0.

And the SABRE Lite README definitely needs updates.

Regards,


Eric

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03 10:13     ` Stefano Babic
@ 2013-04-03 14:11       ` Eric Nelson
  2013-04-03 14:49         ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Nelson @ 2013-04-03 14:11 UTC (permalink / raw)
  To: u-boot

On 04/03/2013 03:13 AM, Stefano Babic wrote:
> On 03/04/2013 11:50, Javier Martinez Canillas wrote:
>> Just for curiosity, in which configuration file did you see that? When
>> I had the issue I looked at
>> include/configs/{mx6qsabrelite,mx6_common}.h and
>> board/freescale/mx6qsabrelite/mx6qsabrelite.c but I didn't find what
>> chip-select was supposed to be used.
>
> include/configs/mx6qsabrelite.h:
>
> #define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))
>
> It should be 0x7300
>
0x5300?

	(((3-1)*32)+19)<<8

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03 14:11       ` Eric Nelson
@ 2013-04-03 14:49         ` Stefano Babic
  2013-04-03 14:54           ` Eric Nelson
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2013-04-03 14:49 UTC (permalink / raw)
  To: u-boot

On 03/04/2013 16:11, Eric Nelson wrote:
> On 04/03/2013 03:13 AM, Stefano Babic wrote:
>> On 03/04/2013 11:50, Javier Martinez Canillas wrote:
>>> Just for curiosity, in which configuration file did you see that? When
>>> I had the issue I looked at
>>> include/configs/{mx6qsabrelite,mx6_common}.h and
>>> board/freescale/mx6qsabrelite/mx6qsabrelite.c but I didn't find what
>>> chip-select was supposed to be used.
>>
>> include/configs/mx6qsabrelite.h:
>>
>> #define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))
>>
>> It should be 0x7300
>>
> 0x5300?
> 
>     (((3-1)*32)+19)<<8
> 

Right, forget to subtract 1.

Regards,
Stefano


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command
  2013-04-03 14:49         ` Stefano Babic
@ 2013-04-03 14:54           ` Eric Nelson
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Nelson @ 2013-04-03 14:54 UTC (permalink / raw)
  To: u-boot

On 04/03/2013 07:49 AM, Stefano Babic wrote:
> On 03/04/2013 16:11, Eric Nelson wrote:
>> On 04/03/2013 03:13 AM, Stefano Babic wrote:
>>> On 03/04/2013 11:50, Javier Martinez Canillas wrote:
>>>> Just for curiosity, in which configuration file did you see that? When
>>>> I had the issue I looked at
>>>> include/configs/{mx6qsabrelite,mx6_common}.h and
>>>> board/freescale/mx6qsabrelite/mx6qsabrelite.c but I didn't find what
>>>> chip-select was supposed to be used.
>>>
>>> include/configs/mx6qsabrelite.h:
>>>
>>> #define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))
>>>
>>> It should be 0x7300
>>>
>> 0x5300?
>>
>>      (((3-1)*32)+19)<<8
>>
>
> Right, forget to subtract 1.
>

I only remember this because I typed it in **many** times
before adding the default ;)

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

end of thread, other threads:[~2013-04-03 14:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 16:13 [U-Boot] [PATCH 1/1] i.MX6: mx6qsabrelite: README: don't pass chip-select to sf probe command Javier Martinez Canillas
2013-04-03  9:25 ` Stefano Babic
2013-04-03  9:50   ` Javier Martinez Canillas
2013-04-03 10:13     ` Stefano Babic
2013-04-03 14:11       ` Eric Nelson
2013-04-03 14:49         ` Stefano Babic
2013-04-03 14:54           ` Eric Nelson
2013-04-03 14:06   ` Eric Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox