[U-Boot] [BUG] divide by 0 in spi flash probe

Hi,
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
When I run saveenv (env is in SPI) I don't get the divide by 0.
I'll do some more digging tomorrow but just thought I'd get this email off now in case it rings any bells for anyone.
Thanks, Chris

Hi Chris,
(added Tom to Cc)
On 29.08.2016 07:49, Chris Packham wrote:
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
When I run saveenv (env is in SPI) I don't get the divide by 0.
I'll do some more digging tomorrow but just thought I'd get this email off now in case it rings any bells for anyone.
I've also stumbled over this issue last week. You (and everyone else) need this patch:
https://patchwork.ozlabs.org/patch/659979/
Jagan or Tom, please make sure that this patch gets added really soon. Its really annoying. As updating the image in SPI nor does not work without it.
Thanks, Stefan

On Mon, Aug 29, 2016 at 5:55 PM, Stefan Roese sr@denx.de wrote:
Hi Chris,
(added Tom to Cc)
On 29.08.2016 07:49, Chris Packham wrote:
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
When I run saveenv (env is in SPI) I don't get the divide by 0.
I'll do some more digging tomorrow but just thought I'd get this email off now in case it rings any bells for anyone.
I've also stumbled over this issue last week. You (and everyone else) need this patch:
https://patchwork.ozlabs.org/patch/659979/
Jagan or Tom, please make sure that this patch gets added really soon. Its really annoying. As updating the image in SPI nor does not work without it.
Thanks Stefan and Vignesh for pointing me at the fix. It works on my board.

On Mon, Aug 29, 2016 at 1:34 PM, Chris Packham judge.packham@gmail.com wrote:
On Mon, Aug 29, 2016 at 5:55 PM, Stefan Roese sr@denx.de wrote:
Hi Chris,
(added Tom to Cc)
On 29.08.2016 07:49, Chris Packham wrote:
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
Did you find this for first 'sf probe' it self?
When I run saveenv (env is in SPI) I don't get the divide by 0.
I'll do some more digging tomorrow but just thought I'd get this email off now in case it rings any bells for anyone.
I've also stumbled over this issue last week. You (and everyone else) need this patch:
https://patchwork.ozlabs.org/patch/659979/
Jagan or Tom, please make sure that this patch gets added really soon. Its really annoying. As updating the image in SPI nor does not work without it.
Thanks Stefan and Vignesh for pointing me at the fix. It works on my board.
Just wondered why would this worked with the second time unbound fix.

On Tue, Aug 30, 2016 at 12:52 AM, Jagan Teki jagannadh.teki@gmail.com wrote:
On Mon, Aug 29, 2016 at 1:34 PM, Chris Packham judge.packham@gmail.com wrote:
On Mon, Aug 29, 2016 at 5:55 PM, Stefan Roese sr@denx.de wrote:
Hi Chris,
(added Tom to Cc)
On 29.08.2016 07:49, Chris Packham wrote:
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
Did you find this for first 'sf probe' it self?
First "sf probe" command but internally a probe has already occurred because the environment is in SPI.
When I run saveenv (env is in SPI) I don't get the divide by 0.
I'll do some more digging tomorrow but just thought I'd get this email off now in case it rings any bells for anyone.
I've also stumbled over this issue last week. You (and everyone else) need this patch:
https://patchwork.ozlabs.org/patch/659979/
Jagan or Tom, please make sure that this patch gets added really soon. Its really annoying. As updating the image in SPI nor does not work without it.
Thanks Stefan and Vignesh for pointing me at the fix. It works on my board.
Just wondered why would this worked with the second time unbound fix.
-- Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.

On Monday 29 August 2016 11:19 AM, Chris Packham wrote:
Hi,
I'm updating support for a board which uses the Armada-385 from u-boot v2016.05 to use the latest master (v2016.09-rc2 plus a bit).
When I run "sf probe" I get a divide by 0 in mvebu_spi_set_speed because hz has made it through as 0.
There is a bug when sf probe is called second time. This bug is fixed by: https://patchwork.ozlabs.org/patch/659979/
Could you try if this patch helps?
participants (4)
-
Chris Packham
-
Jagan Teki
-
Stefan Roese
-
Vignesh R