From: Hannes Schmelzer <hannes@schmelzer.or.at>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] cmd/sf: probe flash with speed of last known flash or speed from devicetree
Date: Thu, 25 Aug 2016 11:32:52 +0200 [thread overview]
Message-ID: <57BEBB44.4070400@schmelzer.or.at> (raw)
In-Reply-To: <1cf2c49d-1a55-e7f6-235f-88ce2d153353@ti.com>
On 08/25/2016 10:39 AM, Vignesh R wrote:
>
> On Wednesday 24 August 2016 07:40 PM, Hannes Schmelzer wrote:
>> On 08/24/2016 02:21 PM, Hannes Schmelzer wrote:
>>> On 08/24/2016 01:12 PM, Vignesh R wrote:
>>>> On Wednesday 24 August 2016 04:21 PM, Hannes Schmelzer wrote:
>>>>> On 08/24/2016 12:35 PM, Vignesh R wrote:
> [...]
>
>>>> AFAIU, saveenv() uses CONFIG_ENV_SPI_MAX_HZ only when
>>>> CONFIG_DM_SPI_FLASH is not defined. Could please explain how
>>>> CONFIG_ENV_SPI_MAX_HZ takes precedence over spi-max-frequency during sf
>>>> probe?
>>> Thanks the discussion, I think we coming closer to the problem.
>>> Your'e right saveenv() behaves as you described, but not so
>>> env_relocate_spec().
>>>
>>> There the flash is probed like this:
>>> env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
>>> CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
>>>
>>> and thats the point where some existing dt node becomes modified with
>>> those values. Thats probably wrong doing so.
>>>
>>> I think there should be same logic applied as in saveen().
>> Tested again, and confirming this behaviour.
> Yeah, I think relocate_spec() was not updated during dm conversion.
looks like, should i submit some patch?
>
>>> Just for testing i fixed the probe there.
>>> Now i'm a bit confused about that the function
>>> spi_find_chip_select(bus, cs, &dev) in spi-uclass doesn't find child
>>> devices on the spi node.
>>> Instead there a new flash binding is created.
>>> spi_get_bus_and_cs: Binding new device 'spi_flash at 0:0', busnum=0,
>>> cs=0, driver=spi_flash_std
>> Debugged into DM and found out that my devicetree didn't represent a
>> valid flash-child.
>> I've now modified it to:
>>
>> => fdt print spi0
>> spi at e000d000 {
>> clock-names = "ref_clk", "pclk";
>> clocks = <0x00000001 0x0000000a 0x00000001 0x0000002b>;
>> compatible = "xlnx,zynq-qspi-1.0";
>> status = "okay";
>> interrupt-parent = <0x00000003>;
>> interrupts = <0x00000000 0x00000013 0x00000004>;
>> reg = <0xe000d000 0x00001000>;
>> #address-cells = <0x00000001>;
>> #size-cells = <0x00000000>;
>> u-boot,dm-pre-reloc;
>> spi-max-frequency = <0x05f5e100>;
>> spiflash at 0 {
>> u-boot,dm-pre-reloc;
>> compatible = "spidev", "spi-flash";
> Shouldn't this be: compatible = "spansion,S25FL256S_64K", "spi-flash";
> as per doc/device-tree-bindings/mtd/spi/spi-flash.txt
yes you're right ... i will fix this.
next prev parent reply other threads:[~2016-08-25 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 10:05 [U-Boot] [PATCH v1] cmd/sf: probe flash with speed of last known flash or speed from devicetree Hannes Schmelzer
2016-08-24 10:35 ` Vignesh R
2016-08-24 10:51 ` Hannes Schmelzer
2016-08-24 11:12 ` Vignesh R
2016-08-24 12:21 ` Hannes Schmelzer
2016-08-24 14:10 ` Hannes Schmelzer
2016-08-25 8:39 ` Vignesh R
2016-08-25 9:32 ` Hannes Schmelzer [this message]
2016-08-25 10:10 ` Vignesh R
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=57BEBB44.4070400@schmelzer.or.at \
--to=hannes@schmelzer.or.at \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox