DM SPI FLASH
Hi Simon,
I am hacking DTB and DM SPI FLASH support for i.MX 6SoloX. I have a question about sf probe. In original way, sf probe or sf probe 0:0 can detect qspi flashes on my platform. But after using DM, I should use sf probe 35536896:0 to probe flashes. 35536896 is the address of QSPI controller's reg base 0x021e4000 in hex format. Does I miss something in my driver? It seems dev->seq is not valid so should pass req_seq which is the address of qspi controller in dts file.
Any ideas?
The log using sf probe 0:0. Fail to probe flash
=> sf probe 0:0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not foundspi_find_bus_and_cs: No bus 0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not founduclass_find_device_by_seq: 1 0
- 35536896 35536896
- not found
Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)
The log using sf probe 35536896:0. Success to probe flash. => sf probe 35536896:0uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundspi_find_bus_and_cs: No bus 35536896uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not founduclass_find_device_by_seq: 1 35536896
- 35536896 -1
- founduclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 34603008
- -1 0
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundfdtdec_get_int_array: regget_prop_check_min_len: regfdtdec_get_int: spi-max-frequency: (not found) fsl_qspi_ofdata_to_platdata: reg_base=0x21e4000 amba_base=0x70000000 max-frequency=500000fdtdec_get_int: spi-max-frequency: (not found)spi_get_bus_and_cs: Binding new device '35536896:0', busnum=35536896, cs=0, driver=spi_flash_stdfdtdec_get_int: reg: (not found)
Bound device 35536896:0 to qspi at 021e4000fdtdec_get_int: reg: (not found)fdtdec_get_int: spi-max-frequency: (not found)fdtdec_get_bool: spi-cpolfdtdec_get_bool: spi-cphafdtdec_get_bool: spi-cs-highfdtdec_get_bool: spi-half-duplexuclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- not foundspi_flash_std_probe: slave=bfc5b208, cs=0fsl_qspi_set_speed: hz=100000fsl_qspi_set_mode: mode=0
SF: Got idcodes
00000000: 20 ba 19 10 00 ....
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
SF: Warning - Only lower 16MiB accessible, Full access #define CONFIG_SPI_FLASH_BARfsl_qspi_set_speed: hz=1000000fsl_qspi_set_mode: mode=3spi_get_bus_and_cs: bus=bfc53308, slave=bfc5b208
Thanks,
Peng.
Hi Peng,
Quoted 11 lines · Peng Fan
Hi Simon,
I am hacking DTB and DM SPI FLASH support for i.MX 6SoloX. I have a question about
sf probe. In original way,sf probeorsf probe 0:0can detect qspi flashes on my platform. But after using DM, I should usesf probe 35536896:0to probe flashes. 35536896 is the address of QSPI controller's reg base0x021e4000in hex format. Does I miss something in my driver? It seemsdev->seqis not valid so should passreq_seqwhich is the address of qspi controller in dts file.Any ideas?
You can use:
aliases {
spi0 = "/spi at xxxx";
}
to correct the sequence number.
It would be better if we had a way to indicate a bus where reg provides the sequence number, so we know when it doesn't. I haven't come up with a good idea on that yet.
Quoted 78 lines
The log using
sf probe 0:0. Fail to probe flash
=> sf probe 0:0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not foundspi_find_bus_and_cs: No bus 0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not founduclass_find_device_by_seq: 1 0
- 35536896 35536896
- not found
Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)The log using
sf probe 35536896:0. Success to probe flash.
=> sf probe 35536896:0uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundspi_find_bus_and_cs: No bus 35536896uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not founduclass_find_device_by_seq: 1 35536896
- 35536896 -1
- founduclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 34603008
- -1 0
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundfdtdec_get_int_array: regget_prop_check_min_len: regfdtdec_get_int: spi-max-frequency: (not found)fsl_qspi_ofdata_to_platdata: reg_base=0x21e4000 amba_base=0x70000000 max-frequency=500000fdtdec_get_int: spi-max-frequency: (not found)spi_get_bus_and_cs: Binding new device '35536896:0', busnum=35536896, cs=0, driver=spi_flash_stdfdtdec_get_int: reg: (not found)
Bound device 35536896:0 to qspi at021e4000fdtdec_get_int: reg: (not found)fdtdec_get_int: spi-max-frequency: (not found)fdtdec_get_bool: spi-cpolfdtdec_get_bool: spi-cphafdtdec_get_bool: spi-cs-highfdtdec_get_bool: spi-half-duplexuclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- not foundspi_flash_std_probe: slave=bfc5b208, cs=0fsl_qspi_set_speed: hz=100000fsl_qspi_set_mode: mode=0
SF: Got idcodes
Quoted 8 lines
00000000: 20 ba 19 10 00 ....
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
SF: Warning - Only lower 16MiB accessible, Full access #defineCONFIG_SPI_FLASH_BARfsl_qspi_set_speed: hz=1000000fsl_qspi_set_mode: mode=3spi_get_bus_and_cs: bus=bfc53308, slave=bfc5b208
Regards,
Simon
A message that is not in the archive (sent off-list or not yet received): BN1PR0301MB0673D78DC3D1681E9423234182460@BN1PR0301MB0673.namprd03.prod.outlook.com
Quoted 6 lines · Peng.Fan at freescale.com
Hi, Simon,
It works for me using aliases. This aliases node reassigns
req_seqnumber to dev, so it works.Another question, spi device driver can not get cs value?
sf probe 0:0. Bus is 0, and cs is 0. I want to use cs value to configure qspi controller, but i did not find way to do this.0:0is a new created device whose parent is spi controller device. But spi driver works at bus level. I am not sure whether this is correct, just want one way to get cs to configure qspi controller.
Yes, dm-spi not quite well this run-time cs change as of now. We discussed the same while implementing, may be you can add cs attribute number for
that particular bus or add support in dm-spi itself to support runtime configurable using
sf probe [[bus:]cs]]
Quoted 28 lines
Thanks,
Peng.-----Original Message-----
From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
Sent: Wednesday, January 07, 2015 1:33 PM
To: Fan Peng-B51431
Cc: Jagan Teki; u-Boot Mailing List
Subject: Re: [Question] DM SPI FLASHHi Peng,
Quoted 11 lines · Peng Fan
Hi Simon,
I am hacking DTB and DM SPI FLASH support for i.MX 6SoloX. I have a question about
sf probe. In original way,sf probeorsf probe 0:0can detect qspi flashes on my platform. But after using DM, I should usesf probe 35536896:0to probe flashes. 35536896 is the address of QSPI controller's reg base0x021e4000in hex format. Does I miss something in my driver? It seemsdev->seqis not valid so should passreq_seqwhich is the address of qspi controller in dts file.Any ideas?
You can use:
Quoted 93 lines
aliases { spi0 = "/spi at xxxx"; }to correct the sequence number.
It would be better if we had a way to indicate a bus where reg provides the sequence number, so we know when it doesn't. I haven't come up with a good idea on that yet.
Quoted 85 lines
The log using
sf probe 0:0. Fail to probe flash => sf probe 0:0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not foundspi_find_bus_and_cs: No bus 0uclass_find_device_by_seq: 0 0
- 35536896 35536896
- not founduclass_find_device_by_seq: 1 0
- 35536896 35536896
- not found
Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)The log using
sf probe 35536896:0. Success to probe flash. => sf probe 35536896:0uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundspi_find_bus_and_cs: No bus 35536896uclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not founduclass_find_device_by_seq: 1 35536896
- 35536896 -1
- founduclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 34603008
- -1 0
- 33554432 -1
- 33554432 -1
- 34373632 -1
- -1 -1
- 34603008 -1
- 35651584 -1
- 35913728 -1
- -1 -1
- not founduclass_find_device_by_seq: 0 35536896
- 35536896 -1
- not foundfdtdec_get_int_array: regget_prop_check_min_len: regfdtdec_get_int: spi-max-frequency: (not found)fsl_qspi_ofdata_to_platdata: reg_base=0x21e4000 amba_base=0x70000000 max-frequency=500000fdtdec_get_int: spi-max-frequency: (not found)spi_get_bus_and_cs: Binding new device '35536896:0', busnum=35536896, cs=0, driver=spi_flash_stdfdtdec_get_int: reg: (not found)
Bound device 35536896:0 to qspi at021e4000fdtdec_get_int: reg: (not found)fdtdec_get_int: spi-max-frequency: (not found)fdtdec_get_bool: spi-cpolfdtdec_get_bool: spi-cphafdtdec_get_bool: spi-cs-highfdtdec_get_bool: spi-half-duplexuclass_find_device_by_seq: 0 -1uclass_find_device_by_seq: 0 0
- -1 -1
- not foundspi_flash_std_probe: slave=bfc5b208, cs=0fsl_qspi_set_speed: hz=100000fsl_qspi_set_mode: mode=0
SF: Got idcodes
00000000: 20 ba 19 10 00 ....
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
SF: Warning - Only lower 16MiB accessible, Full access #defineCONFIG_SPI_FLASH_BARfsl_qspi_set_speed: hz=1000000fsl_qspi_set_mode: mode=3spi_get_bus_and_cs: bus=bfc53308, slave=bfc5b208
thanks!
Signature · 1 line
Jagan.
Quoted 21 lines · On Tue, 6 Jan 2015 22:33:02 -0700 Simon Glass <[email protected]> wrote:
Hi Peng,
Quoted 11 lines · Peng Fan
Hi Simon,
I am hacking DTB and DM SPI FLASH support for i.MX 6SoloX. I have a question about
sf probe. In original way,sf probeorsf probe 0:0can detect qspi flashes on my platform. But after using DM, I should usesf probe 35536896:0to probe flashes. 35536896 is the address of QSPI controller's reg base0x021e4000in hex format. Does I miss something in my driver? It seemsdev->seqis not valid so should passreq_seqwhich is the address of qspi controller in dts file.Any ideas?
You can use:
aliases { spi0 = "/spi at xxxx"; }
Quoted 5 lines
to correct the sequence number.
It would be better if we had a way to indicate a bus where reg provides the sequence number, so we know when it doesn't. I haven't come up with a good idea on that yet.
My device tree source is growing its aliases node...
arch/arm/dts/uniphier-ph1-pro4-ref.dts
aliases {
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
serial3 = &uart3;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
i2c5 = &i2c5;
i2c6 = &i2c6;
};Best Regards
Masahiro Yamada
Hi,
Quoted 39 lines · Masahiro Yamada
Quoted 21 lines · On Tue, 6 Jan 2015 22:33:02 -0700 Simon Glass <[email protected]> wrote:
Hi Peng,
Quoted 11 lines · Peng Fan
Hi Simon,
I am hacking DTB and DM SPI FLASH support for i.MX 6SoloX. I have a question about
sf probe. In original way,sf probeorsf probe 0:0can detect qspi flashes on my platform. But after using DM, I should usesf probe 35536896:0to probe flashes. 35536896 is the address of QSPI controller's reg base0x021e4000in hex format. Does I miss something in my driver? It seemsdev->seqis not valid so should passreq_seqwhich is the address of qspi controller in dts file.Any ideas?
You can use:
aliases { spi0 = "/spi at xxxx"; }Quoted 5 lines
to correct the sequence number.
It would be better if we had a way to indicate a bus where reg provides the sequence number, so we know when it doesn't. I haven't come up with a good idea on that yet.
My device tree source is growing its aliases node...
arch/arm/dts/uniphier-ph1-pro4-ref.dts
Quoted 13 lines
aliases {
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
serial3 = &uart3;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
i2c5 = &i2c5;
i2c6 = &i2c6;
};This is good. It makes it very clear in one place which port is which.
But I am going to propose dropping the 'reg' support for sequence numbers in driver model. With I2C and SPI doing there own thing, we don't use it. And it just creates problems - e.g. if reg is actually an address we end up with a very strange sequence number on various devices.
Regards,
Simon