[U-Boot] QSPI "sf probe ...", "sf read ..." on Altera SoC FPGA
Eldor Rødseth
er at systemsoft.no
Mon Dec 19 16:07:22 CET 2016
Hi,
I observe a behavior with the QSPI functionality on newer uboot versions; e.g. 2016.11 rc1 and also latest from DENX mainline.
I was wondering whether anyone else has experienced similar issue(s) and can perhaps give hints as to what can cause this.
I will try to narrow down the issue to a couple of examples related to “sf probe …” and “sf read ..”.
I apologize for the long listing, but I am running with full DEBUG for additional details:
Example #1:
When issuing “sf probe” with no parameters; i.e. use defaults, the command fails and causes board reboot:
=> sf probe
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
spi_find_bus_and_cs: No bus 0
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
uclass_find_device_by_seq: 1 0
- 0 -1
- found
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
fdtdec_get_int_array: reg
get_prop_check_min_len: reg
fdtdec_get_uint: spi-max-frequency: 0x5f5e100 (100000000)
fdtdec_get_int: page-size: 0x100 (256)
fdtdec_get_int: block-size: 0x10 (16)
fdtdec_get_int: tshsl-ns: 0x32 (50)
fdtdec_get_int: tsd2d-ns: 0x32 (50)
fdtdec_get_int: tchsh-ns: 0x4 (4)
fdtdec_get_int: tslch-ns: 0x4 (4)
fdtdec_get_int: sram-size: 0x80 (128)
cadence_spi_ofdata_to_platdata: regbase=ff705000 ahbbase=ffa00000 max-frequency=100000000 page-size=256
fdtdec_get_int: spi-max-frequency: (not found)
spi_get_bus_and_cs: Binding new device 'spi_flash at 0:0', busnum=0, cs=0, driver=spi_flash_std
Bound device spi_flash at 0:0 to spi at ff705000
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
- -1 -1
- not found
spi_flash_std_probe: slave=7bf49e88, cs=0
cadence_qspi_apb_config_baudrate_div: ref_clk 400000000Hz sclk 1000000Hz Div 0xf
cadence_qspi_apb_config_baudrate_div: ref_clk 400000000Hz sclk 100000Hz Div 0xf
SF: Read data capture delay calibrated to 7 (0 - 15)
cadence_spi_set_speed: speed=100000
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
cadence_spi_xfer: len=5 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
SF: Got idcodes
00000000: 20 ba 22 10 44 .".D
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
fdtdec_get_addr_size_fixed: memory-map: (not found)
spi_flash_decode_fdt: Cannot decode address
SF: Detected MT25QL02 with page size 256 Bytes, erase size 64 KiB, total 256 MiB
cadence_qspi_apb_config_baudrate_div: ref_clk 400000000Hz sclk 1000000Hz Div 0xf
### ERROR ### Please RESET the board ###
--------------
Example #2:
When issuing “sf probe <w/params>”; the command apparently succeeds; i.e. correct flash type is detected.
However – look at Example #3 below.
=> sf probe 0 100000000 3 ß should be identical parameters as read from DTS in Example #1
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
spi_find_bus_and_cs: No bus 0
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
uclass_find_device_by_seq: 1 0
- 0 -1
- found
uclass_find_device_by_seq: 0 0
- 0 -1
- not found
fdtdec_get_int_array: reg
get_prop_check_min_len: reg
fdtdec_get_uint: spi-max-frequency: 0x5f5e100 (100000000)
fdtdec_get_int: page-size: 0x100 (256)
fdtdec_get_int: block-size: 0x10 (16)
fdtdec_get_int: tshsl-ns: 0x32 (50)
fdtdec_get_int: tsd2d-ns: 0x32 (50)
fdtdec_get_int: tchsh-ns: 0x4 (4)
fdtdec_get_int: tslch-ns: 0x4 (4)
fdtdec_get_int: sram-size: 0x80 (128)
cadence_spi_ofdata_to_platdata: regbase=ff705000 ahbbase=ffa00000 max-frequency=100000000 page-size=256
fdtdec_get_int: spi-max-frequency: (not found)
spi_get_bus_and_cs: Binding new device 'spi_flash at 0:0', busnum=0, cs=0, driver=spi_flash_std
Bound device spi_flash at 0:0 to spi at ff705000
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
- -1 -1
- not found
spi_flash_std_probe: slave=7bf49ec0, cs=0
cadence_qspi_apb_config_baudrate_div: ref_clk 400000000Hz sclk 1000000Hz Div 0xf
cadence_qspi_apb_config_baudrate_div: ref_clk 400000000Hz sclk 100000000Hz Div 0x1
SF: Read data capture delay calibrated to 3 (2 - 4)
cadence_spi_set_speed: speed=100000000
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
cadence_spi_xfer: len=5 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
SF: Got idcodes
00000000: 20 ba 22 10 44 .".D
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
cadence_spi_xfer: len=1 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
fdtdec_get_addr_size_fixed: memory-map: (not found)
spi_flash_decode_fdt: Cannot decode address
SF: Detected MT25QL02 with page size 256 Bytes, erase size 64 KiB, total 256 MiB
cadence_spi_set_speed: speed=100000000
spi_get_bus_and_cs: bus=7bf48348, slave=7bf49ec0
=>
------
Example #3:
After successful “sf probe” in Example #2, any “sf ……” access (except “sf erase ….”) causes core dump in uboot:
=> mtdparts
---mtdparts_init---
last_ids :
env_ids : <NULL>
last_parts:
env_parts : <NULL>
last_partition :
env_partition : <NULL>
mtdids variable not defined, using default
Initial value for argc=3
Final value for argc=3
Initial value for argc=3
Final value for argc=3
---parse_mtdids---
mtdids = nor0=ff705000.spi.0
+ id nor0 268435456 bytes ff705000.spi.0
---parse_mtdparts---
mtdparts = <NULL>
--- current_save ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "partition"
=> partition NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
===device_parse===
--- id_find_by_mtd_id: 'ff705000.spi.0' (len = 14)
entry: 'ff705000.spi.0' (len = 14)
dev type = 1 (nor), dev num = 0, mtd-id = ff705000.spi.0
parsing partitions 256k(spl),512k(u-boot),64k(env1),256k(dtb),8m(lba),32m(lbafs),8m(fpga),128k(script),-(UBI)
+ partition: name spl size 0x00040000 offset 0xffffffffffffffff mask flags 0
+ partition: name u-boot size 0x00080000 offset 0xffffffffffffffff mask flags 0
+ partition: name env1 size 0x00010000 offset 0xffffffffffffffff mask flags 0
+ partition: name dtb size 0x00040000 offset 0xffffffffffffffff mask flags 0
+ partition: name lba size 0x00800000 offset 0xffffffffffffffff mask flags 0
+ partition: name lbafs size 0x02000000 offset 0xffffffffffffffff mask flags 0
+ partition: name fpga size 0x00800000 offset 0xffffffffffffffff mask flags 0
+ partition: name script size 0x00020000 offset 0xffffffffffffffff mask flags 0
'-': remaining size assigned
+ partition: name UBI size 0xffffffffffffffff offset 0xffffffffffffffff mask flags 0
total partitions: 9
part_sort_add: list empty
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
--- index partitions ---
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevnum"
Initial value for argc=2
Final value for argc=2
hdelete: DELETE key "mtddevname"
=> mtddevnum NULL
=> mtddevname NULL
===
+ device: nor 0 ff705000.spi.0
--- current_save ---
Initial value for argc=3
Final value for argc=3
=> partition nor0,0
--- index partitions ---
Initial value for argc=3
Final value for argc=3
--- mtd_part_info: partition number 0 for device nor0 (ff705000.spi.0)
Initial value for argc=3
Final value for argc=3
=> mtddevnum 0,
=> mtddevname spl
mtdparts_init: current_mtd_dev = nor0, current_mtd_partnum = 0
---list_partitions---
device nor0 <ff705000.spi.0>, # parts = 9
#: name size offset mask_flags
0: spl 0x00040000 0x00000000 0
1: u-boot 0x00080000 0x00040000 0
2: env1 0x00010000 0x000c0000 0
3: dtb 0x00040000 0x000d0000 0
4: lba 0x00800000 0x00110000 0
5: lbafs 0x02000000 0x00910000 0
6: fpga 0x00800000 0x02910000 0
7: script 0x00020000 0x03110000 0
8: UBI 0x0ced0000 0x03130000 0
--- mtd_part_info: partition number 0 for device nor0 (ff705000.spi.0)
active partition: nor0,0 - (spl) 0x00040000 @ 0x00000000
defaults:
mtdids : nor0=ff705000.spi.0
mtdparts: mtdparts=ff705000.spi.0:256k(spl),512k(u-boot),64k(env1),256k(dtb),8m(lba),32m(lbafs),8m(fpga),128k(script),-(UBI)
=>
=> sf read 100 0 100
device 0 offset 0x0, size 0x100
cadence_spi_xfer: len=5 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
cadence_spi_xfer: len=256 [bytes]
cadence_qspi_apb_chipselect : chipselect 0 decode 0
data abort
pc : [<7ff706c8>] lr : [<7ff90021>]
reloc pc : [<01027708>] lr : [<01047061>]
sp : 7bf42c18 ip : 00000000 fp : 00000002
r10: 00000000 r9 : 7bf47ee8 r8 : 7bf483a0
r7 : 0000270f r6 : 00000100 r5 : 00000100 r4 : 7bf483a0
r3 : 00000008 r2 : 00000001 r1 : 00000100 r0 : ffa00000
Flags: nzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
-------
My QSPI is a “cadence,qspi” compatible device, and I am using the default DTS for socfpga_cyclone5_socdk.dts.
Regards,
Eldor Rodseth
More information about the U-Boot
mailing list