Enabling test/py/tests/test_spi.py more?
Hey,
Can you please confirm that this test currently functions on your platforms? And then can we please enable it in
https://source.denx.de/u-boot/u-boot-test-hooks as both a functional example, and testing of the SPI framework?
I'm asking in part because I've attempted to enable it on two TI K3 platforms (am62x_evm_a53 and am64x_evm_a53) and the write twice test fails there and while I can repeat the failure on the command line, I can't make the same concept fail at the CLI (including 0xff'ing out memory before reading back to the same location). I've also tried enabling it for sifive_unleashed via QEMU but that in turn seems to fail differently, and possibly because we're destroying all of the SPI contents and need to expand the test to include a region to ignore? I'm not entirely sure, I'm still debugging that one.
Thanks!
Signature · 1 line
Tom
Quoted 7 lines · Tom Rini
Hey,
Can you please confirm that this test currently functions on your platforms? And then can we please enable it in
https://source.denx.de/u-boot/u-boot-test-hooks as both a functional example, and testing of the SPI framework?
Quoted 9 lines
I'm asking in part because I've attempted to enable it on two TI K3 platforms (
am62x_evm_a53andam64x_evm_a53) and the write twice test fails there and while I can repeat the failure on the command line, I can't make the same concept fail at the CLI (including 0xff'ing out memory before reading back to the same location). I've also tried enabling it forsifive_unleashedvia QEMU but that in turn seems to fail differently, and possibly because we're destroying all of the SPI contents and need to expand the test to include a region to ignore? I'm not entirely sure, I'm still debugging that one.
As an easy'ish for-example, if you rename py/travis-ci/u_boot_boardenv_evb-ast2500_qemu.py to py/travis-ci/u_boot_boardenv_evb_ast2500_qemu.py and add:
env__spi_device_test = {
'bus': 0,
'chip_select': 0,
'mode': 0,
'part_name': 'mx25l25635e',
'timeout': 10000,
'iteration': 5,
}So that the test will run, it fails with:
AssertionError: assert 'f753d4e0' in 'crc32 for 822000c8 ... 83212327 ==> bf3e333c' ------------------------------------ Captured stdout call ------------------------------------- => sf probe 0:0 0 0
SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB => => crc32 0x82200000 0x10
crc32 for 82200000 ... 8220000f ==> ecbb4b55
=> => sf erase 0x0 0x10000
SF: 65536 bytes @ 0x0 Erased: OK
=> => sf write 0x82200000 0x0 0x10
device 0 offset 0x0, size 0x10
SF: 16 bytes @ 0x0 Written: OK
=> => sf read 0x82200054 0x0 0x10
device 0 offset 0x0, size 0x10
SF: 16 bytes @ 0x0 Read: OK
=> => crc32 0x82200054 0x10
crc32 for 82200054 ... 82200063 ==> ecbb4b55
=> => crc32 0x82200000 0x1012260
crc32 for 82200000 ... 8321225f ==> f753d4e0
=> => sf erase 0x0 0x1020000
SF: 16908288 bytes @ 0x0 Erased: OK
=> => sf write 0x82200000 0x0 0x1012260
device 0 offset 0x0, size 0x1012260
SF: 16851552 bytes @ 0x0 Written: OK
=> => sf read 0x822000c8 0x0 0x1012260
device 0 offset 0x0, size 0x1012260
SF: 16851552 bytes @ 0x0 Read: OK
=> => crc32 0x822000c8 0x1012260
crc32 for 822000c8 ... 83212327 ==> bf3e333c
=>
And that is also how the TI K3 platforms fail. However, evb-ast2600 is fine, with:
env__spi_device_test = {
'bus': 0,
'chip_select': 0,
'mode': 0,
'part_name': 'mx25u51245g',
'timeout': 10000,
'iteration': 5,
}And note that evb-ast2600 is a 64MB flash while evb-ast2500 is a 32MB flash.
Signature · 1 line
Tom
Hi Tom,
Quoted 8 lines · Tom Rini
Quoted 7 lines · Tom Rini
Hey,
Can you please confirm that this test currently functions on your platforms? And then can we please enable it in
https://source.denx.de/u-boot/u-boot-test-hooks as both a functional example, and testing of the SPI framework?
Yes, this test works fine on our boards and it can be enabled it in u-boot-test-hooks as well.
Quoted 9 lines
Quoted 9 lines
I'm asking in part because I've attempted to enable it on two TI K3 platforms (
am62x_evm_a53andam64x_evm_a53) and the write twice test fails there and while I can repeat the failure on the command line, I can't make the same concept fail at the CLI (including 0xff'ing out memory before reading back to the same location). I've also tried enabling it forsifive_unleashedvia QEMU but that in turn seems to fail differently, and possibly because we're destroying all of the SPI contents and need to expand the test to include a region to ignore? I'm not entirely sure, I'm still debugging that one.
You mean to say some regions in SPI are protected and test should ignore it?
Quoted 36 lines
As an easy'ish for-example, if you rename
py/travis-ci/u_boot_boardenv_evb-ast2500_qemu.pytopy/travis-ci/u_boot_boardenv_evb_ast2500_qemu.pyand add:env__spi_device_test = { 'bus': 0, 'chip_select': 0, 'mode': 0, 'part_name': 'mx25l25635e', 'timeout': 10000, 'iteration': 5, }So that the test will run, it fails with:
AssertionError: assert 'f753d4e0' in 'crc32 for822000c8... 83212327 ==>bf3e333c' ------------------------------------ Captured stdout call ------------------------------------- => sf probe 0:0 0 0
SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB => => crc320x822000000x10
crc32 for 82200000 ...8220000f==>ecbb4b55
=> => sf erase0x00x10000
SF: 65536 bytes @0x0Erased: OK
=> => sf write0x822000000x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Written: OK
=> => sf read0x822000540x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Read: OK
=> => crc320x822000540x10
crc32 for 82200054 ... 82200063 ==>ecbb4b55
=> => crc320x822000000x1012260
crc32 for 82200000 ...8321225f==>f753d4e0
=> => sf erase0x00x1020000
SF: 16908288 bytes @0x0Erased: OK
=> => sf write0x822000000x00x1012260
Quoted 8 lines
device 0 offset
0x0, size0x1012260
SF: 16851552 bytes @0x0Written: OK => => sf read0x822000c80x00x1012260device 0 offset0x0, size0x1012260
SF: 16851552 bytes @0x0Read: OK
=> => crc320x822000c80x1012260crc32 for822000c8... 83212327 ==>bf3e333c=>
I haven't tried with mx25l25635e part but on other macronix part (mx66u1g45g) - it was working on ZynqMP. Need to figure out if it is a flash specific issue or any thing else?
Regards,
Love Kumar
Quoted 15 lines
And that is also how the TI K3 platforms fail. However, evb-ast2600 is fine, with:
env__spi_device_test = { 'bus': 0, 'chip_select': 0, 'mode': 0, 'part_name': 'mx25u51245g', 'timeout': 10000, 'iteration': 5, }And note that evb-ast2600 is a 64MB flash while evb-ast2500 is a 32MB flash.
Quoted 6 lines · Love Kumar
Hi Tom,
Quoted 3 lines · Tom Rini
Quoted 2 lines · Tom Rini
Hey,
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Can you please confirm that this test currently functions on your platforms? And then can we please enable it in
https://source.denx.de/u-boot/u-boot-test-hooks as both a functional example, and testing of the SPI framework?Yes, this test works fine on our boards and it can be enabled it in u-boot-test-hooks as well.
OK, please send a patch enabling it in u-boot-test-hooks.
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
I'm asking in part because I've attempted to enable it on two TI K3 platforms (
am62x_evm_a53andam64x_evm_a53) and the write twice test fails there and while I can repeat the failure on the command line, I can't make the same concept fail at the CLI (including 0xff'ing out memory before reading back to the same location). I've also tried enabling it forsifive_unleashedvia QEMU but that in turn seems to fail differently, and possibly because we're destroying all of the SPI contents and need to expand the test to include a region to ignore? I'm not entirely sure, I'm still debugging that one.You mean to say some regions in SPI are protected and test should ignore it?
I was unclear, sorry. In the case of sifive_unleashed-spi-nor_qemu, which is in CI and u-boot-test-hooks, if I enable the test here then the test will overwrite U-Boot in the (simulated) SPI flash. Can the test be configured to know it only has a certain region of space available to use?
Quoted 45 lines
Quoted 36 lines
As an easy'ish for-example, if you rename
py/travis-ci/u_boot_boardenv_evb-ast2500_qemu.pytopy/travis-ci/u_boot_boardenv_evb_ast2500_qemu.pyand add:env__spi_device_test = { 'bus': 0, 'chip_select': 0, 'mode': 0, 'part_name': 'mx25l25635e', 'timeout': 10000, 'iteration': 5, }So that the test will run, it fails with:
AssertionError: assert 'f753d4e0' in 'crc32 for822000c8... 83212327 ==>bf3e333c' ------------------------------------ Captured stdout call ------------------------------------- => sf probe 0:0 0 0
SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB => => crc320x822000000x10
crc32 for 82200000 ...8220000f==>ecbb4b55
=> => sf erase0x00x10000
SF: 65536 bytes @0x0Erased: OK
=> => sf write0x822000000x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Written: OK
=> => sf read0x822000540x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Read: OK
=> => crc320x822000540x10
crc32 for 82200054 ... 82200063 ==>ecbb4b55
=> => crc320x822000000x1012260
crc32 for 82200000 ...8321225f==>f753d4e0
=> => sf erase0x00x1020000
SF: 16908288 bytes @0x0Erased: OK
=> => sf write0x822000000x00x1012260Quoted 8 lines
device 0 offset
0x0, size0x1012260
SF: 16851552 bytes @0x0Written: OK => => sf read0x822000c80x00x1012260device 0 offset0x0, size0x1012260
SF: 16851552 bytes @0x0Read: OK
=> => crc320x822000c80x1012260crc32 for822000c8... 83212327 ==>bf3e333c=>
Quoted 3 lines
I haven't tried with mx25l25635e part but on other macronix part (mx66u1g45g) - it was working on ZynqMP. Need to figure out if it is a flash specific issue or any thing else?
Again, sorry for being unclear. I don't know where exactly the problem is, but I see this same problem on multiple flash chips. The above is easy to replicate in that it's in QEMU. The same problem also happens on my TI K3 platforms with s28hs512t for example.
Signature · 1 line
Tom
Quoted 80 lines · Tom Rini
Quoted 6 lines · Love Kumar
Hi Tom,
Quoted 3 lines · Tom Rini
Quoted 2 lines · Tom Rini
Hey,
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Can you please confirm that this test currently functions on your platforms? And then can we please enable it in
https://source.denx.de/u-boot/u-boot-test-hooks as both a functional example, and testing of the SPI framework?Yes, this test works fine on our boards and it can be enabled it in u-boot-test-hooks as well.
OK, please send a patch enabling it in u-boot-test-hooks.
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
I'm asking in part because I've attempted to enable it on two TI K3 platforms (
am62x_evm_a53andam64x_evm_a53) and the write twice test fails there and while I can repeat the failure on the command line, I can't make the same concept fail at the CLI (including 0xff'ing out memory before reading back to the same location). I've also tried enabling it forsifive_unleashedvia QEMU but that in turn seems to fail differently, and possibly because we're destroying all of the SPI contents and need to expand the test to include a region to ignore? I'm not entirely sure, I'm still debugging that one.You mean to say some regions in SPI are protected and test should ignore it?
I was unclear, sorry. In the case of sifive_unleashed-spi-nor_qemu, which is in CI and u-boot-test-hooks, if I enable the test here then the test will overwrite U-Boot in the (simulated) SPI flash. Can the test be configured to know it only has a certain region of space available to use?
Quoted 45 lines
Quoted 44 lines
As an easy'ish for-example, if you rename
py/travis-ci/u_boot_boardenv_evb-ast2500_qemu.pytopy/travis-ci/u_boot_boardenv_evb_ast2500_qemu.pyand add:env__spi_device_test = { 'bus': 0, 'chip_select': 0, 'mode': 0, 'part_name': 'mx25l25635e', 'timeout': 10000, 'iteration': 5, }So that the test will run, it fails with:
AssertionError: assert 'f753d4e0' in 'crc32 for822000c8... 83212327 ==>bf3e333c' ------------------------------------ Captured stdout call ------------------------------------- => sf probe 0:0 0 0
SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB => => crc320x822000000x10
crc32 for 82200000 ...8220000f==>ecbb4b55
=> => sf erase0x00x10000
SF: 65536 bytes @0x0Erased: OK
=> => sf write0x822000000x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Written: OK
=> => sf read0x822000540x00x10
device 0 offset0x0, size0x10
SF: 16 bytes @0x0Read: OK
=> => crc320x822000540x10
crc32 for 82200054 ... 82200063 ==>ecbb4b55
=> => crc320x822000000x1012260
crc32 for 82200000 ...8321225f==>f753d4e0
=> => sf erase0x00x1020000
SF: 16908288 bytes @0x0Erased: OK
=> => sf write0x822000000x00x1012260
device 0 offset0x0, size0x1012260
SF: 16851552 bytes @0x0Written: OK
=> => sf read0x822000c80x00x1012260
device 0 offset0x0, size0x1012260
SF: 16851552 bytes @0x0Read: OK
=> => crc320x822000c80x1012260
crc32 for822000c8... 83212327 ==>bf3e333c
=>
Quoted 8 lines
Quoted 3 lines
I haven't tried with mx25l25635e part but on other macronix part (mx66u1g45g) - it was working on ZynqMP. Need to figure out if it is a flash specific issue or any thing else?
Again, sorry for being unclear. I don't know where exactly the problem is, but I see this same problem on multiple flash chips. The above is easy to replicate in that it's in QEMU. The same problem also happens on my TI K3 platforms with s28hs512t for example.
Have you had a chance to look in to this more? Thanks!
Signature · 1 line
Tom