include/hw/ssi/imx_spi.h | 5 +- hw/ssi/imx_spi.c | 147 +++++++++++++++++++++++---------------- hw/ssi/trace-events | 7 ++ 3 files changed, 97 insertions(+), 62 deletions(-)
Hi, As it is sometimes harder for me to express myself in plain English, I found it easier to write the patches I was thinking about. I know this doesn't scale. So this is how I understand the ecSPI reset works, after looking at the IMX6DQRM.pdf datasheet. This is a respin of Ben's v5 series [*]. Tagged RFC because I have not tested it :) Sometimes changing device reset to better match hardware gives trouble when using '-kernel ...' because there is no bootloader setting the device in the state Linux expects it. Copy of Ben's v5 cover: This series fixes a bunch of bugs in current implementation of the imx spi controller, including the following issues: - chip select signal was not lower down when spi controller is disabled - remove imx_spi_update_irq() in imx_spi_reset() - round up the tx burst length to be multiple of 8 - transfer incorrect data when the burst length is larger than 32 bit - spi controller tx and rx fifo endianness is incorrect [*] https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg02333.html Diff with Ben's v5: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respective= ly 001/11:[----] [--] 'hw/ssi: imx_spi: Use a macro for number of chip selects s= upported' 002/11:[down] 'hw/ssi: imx_spi: Remove pointless variable initialization' 003/11:[down] 'hw/ssi: imx_spi: Convert some debug printf()s to trace events' 004/11:[down] 'hw/ssi: imx_spi: Reduce 'change_mask' variable scope' 005/11:[down] 'hw/ssi: imx_spi: Rework imx_spi_reset() to keep CONREG registe= r value' 006/11:[down] 'hw/ssi: imx_spi: Rework imx_spi_read() to handle block disable= d' 007/11:[down] 'hw/ssi: imx_spi: Rework imx_spi_write() to handle block disabl= ed' 008/11:[0004] [FC] 'hw/ssi: imx_spi: Disable chip selects when controller is = disabled' 009/11:[----] [--] 'hw/ssi: imx_spi: Round up the burst length to be multiple= of 8' 010/11:[----] [--] 'hw/ssi: imx_spi: Correct the burst length > 32 bit transf= er logic' 011/11:[----] [--] 'hw/ssi: imx_spi: Correct tx and rx fifo endianness' Bin Meng (4): hw/ssi: imx_spi: Use a macro for number of chip selects supported hw/ssi: imx_spi: Round up the burst length to be multiple of 8 hw/ssi: imx_spi: Correct the burst length > 32 bit transfer logic hw/ssi: imx_spi: Correct tx and rx fifo endianness Philippe Mathieu-Daud=C3=A9 (6): hw/ssi: imx_spi: Remove pointless variable initialization hw/ssi: imx_spi: Convert some debug printf()s to trace events hw/ssi: imx_spi: Reduce 'change_mask' variable scope hw/ssi: imx_spi: Rework imx_spi_reset() to keep CONREG register value hw/ssi: imx_spi: Rework imx_spi_read() to handle block disabled hw/ssi: imx_spi: Rework imx_spi_write() to handle block disabled Xuzhou Cheng (1): hw/ssi: imx_spi: Disable chip selects when controller is disabled include/hw/ssi/imx_spi.h | 5 +- hw/ssi/imx_spi.c | 147 +++++++++++++++++++++++---------------- hw/ssi/trace-events | 7 ++ 3 files changed, 97 insertions(+), 62 deletions(-) --=20 2.26.2
Hi Philippe, On Wed, Jan 13, 2021 at 2:35 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > Hi, > > As it is sometimes harder for me to express myself in plain > English, I found it easier to write the patches I was thinking > about. I know this doesn't scale. > > So this is how I understand the ecSPI reset works, after > looking at the IMX6DQRM.pdf datasheet. > > This is a respin of Ben's v5 series [*]. > Tagged RFC because I have not tested it :) Unfortunately this series breaks SPI flash testing under both U-Boot and VxWorks 7. > Sometimes changing device reset to better match hardware gives > trouble when using '-kernel ...' because there is no bootloader > setting the device in the state Linux expects it. > Given most of the new changes in this RFC series are clean-ups, I suggest we apply the v5 series unless there is anything seriously wrong in v5, IOW, don't fix it unless it's broken. Thoughts? Regards, Bin
Hi Ben, On 1/13/21 4:29 AM, Bin Meng wrote: > On Wed, Jan 13, 2021 at 2:35 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: >> >> Hi, >> >> As it is sometimes harder for me to express myself in plain >> English, I found it easier to write the patches I was thinking >> about. I know this doesn't scale. >> >> So this is how I understand the ecSPI reset works, after >> looking at the IMX6DQRM.pdf datasheet. >> >> This is a respin of Ben's v5 series [*]. >> Tagged RFC because I have not tested it :) > > Unfortunately this series breaks SPI flash testing under both U-Boot > and VxWorks 7. Thanks for testing :) Can you provide the binary tested and the command line used? At least one, so I can have a look. >> Sometimes changing device reset to better match hardware gives >> trouble when using '-kernel ...' because there is no bootloader >> setting the device in the state Linux expects it. >> > > Given most of the new changes in this RFC series are clean-ups, I > suggest we apply the v5 series unless there is anything seriously > wrong in v5, IOW, don't fix it unless it's broken. > > Thoughts? Up to the maintainer :) The IMX6DQRM datasheet is available here: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-6DQ-Reference-Manual-IMX6DQRM-R2-Part-1/ta-p/1115983 https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-6DQ-Reference-Manual-IMX6DQRM-R2-Part-2/ta-p/1118510 Regards, Phil.
Hi Philippe, On Wed, Jan 13, 2021 at 3:53 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > Hi Ben, > > On 1/13/21 4:29 AM, Bin Meng wrote: > > On Wed, Jan 13, 2021 at 2:35 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > >> > >> Hi, > >> > >> As it is sometimes harder for me to express myself in plain > >> English, I found it easier to write the patches I was thinking > >> about. I know this doesn't scale. > >> > >> So this is how I understand the ecSPI reset works, after > >> looking at the IMX6DQRM.pdf datasheet. > >> > >> This is a respin of Ben's v5 series [*]. > >> Tagged RFC because I have not tested it :) > > > > Unfortunately this series breaks SPI flash testing under both U-Boot > > and VxWorks 7. > > Thanks for testing :) Can you provide the binary tested and the command > line used? At least one, so I can have a look. Sure, will send you offline. > > >> Sometimes changing device reset to better match hardware gives > >> trouble when using '-kernel ...' because there is no bootloader > >> setting the device in the state Linux expects it. > >> > > > > Given most of the new changes in this RFC series are clean-ups, I > > suggest we apply the v5 series unless there is anything seriously > > wrong in v5, IOW, don't fix it unless it's broken. > > > > Thoughts? > > Up to the maintainer :) > > The IMX6DQRM datasheet is available here: > https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-6DQ-Reference-Manual-IMX6DQRM-R2-Part-1/ta-p/1115983 > https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-6DQ-Reference-Manual-IMX6DQRM-R2-Part-2/ta-p/1118510 Regards, Bin
Hi Philippe, On Wed, Jan 13, 2021 at 9:27 PM Bin Meng <bmeng.cn@gmail.com> wrote: > > Hi Philippe, > > On Wed, Jan 13, 2021 at 3:53 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > > > Hi Ben, > > > > On 1/13/21 4:29 AM, Bin Meng wrote: > > > On Wed, Jan 13, 2021 at 2:35 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > >> > > >> Hi, > > >> > > >> As it is sometimes harder for me to express myself in plain > > >> English, I found it easier to write the patches I was thinking > > >> about. I know this doesn't scale. > > >> > > >> So this is how I understand the ecSPI reset works, after > > >> looking at the IMX6DQRM.pdf datasheet. > > >> > > >> This is a respin of Ben's v5 series [*]. > > >> Tagged RFC because I have not tested it :) > > > > > > Unfortunately this series breaks SPI flash testing under both U-Boot > > > and VxWorks 7. > > > > Thanks for testing :) Can you provide the binary tested and the command > > line used? At least one, so I can have a look. > > Sure, will send you offline. Please use attached u-boot image to test. You will also need the following additional QEMU patches: http://patchwork.ozlabs.org/project/qemu-devel/patch/1606704602-59435-1-git-send-email-bmeng.cn@gmail.com/ http://patchwork.ozlabs.org/project/qemu-devel/list/?series=221754 $ qemu-system-arm -display none -serial null -serial stdio -M sabrelite -m 1G -kernel u-boot => sf probe SF: Detected sst25vf016b with page size 256 Bytes, erase size 4 KiB, total 2 MiB => sf test 1ff000 1000 SPI flash test: 0 erase: 0 ticks, 4096000 KiB/s 32768.000 Mbps 1 check: 2 ticks, 2000 KiB/s 16.000 Mbps 2 write: 187 ticks, 21 KiB/s 0.168 Mbps 3 read: 2 ticks, 2000 KiB/s 16.000 Mbps Test passed 0 erase: 0 ticks, 4096000 KiB/s 32768.000 Mbps 1 check: 2 ticks, 2000 KiB/s 16.000 Mbps 2 write: 187 ticks, 21 KiB/s 0.168 Mbps 3 read: 2 ticks, 2000 KiB/s 16.000 Mbps Regards, Bin ELF ( �4 Xc 4 ( � �=b =b �a �Շ�Շ� � Q�td � ���������������` �� � �����@���ᆳ� � � � � � � � � � � � � � � �(�� ��� �O����Р� �i�����H�M����P � ��H ��4P���� �� �� � � � � � � � � � � � � ��� ��� �O����Р� �i�����H�M���� � ��H ��4P���� �� ��� � � � � � � � � � � � � ���� ��� �O����Р� �i�����H�M����!� ��H ��4P���� �� ��� � � � � � � � � � � � � �H�� ��� �O����Р� �i�����H�M����p!� ��H ��4P���� �� ��� � � � � � � � � � � � � ��� ��� �O����Р� �i�����H�M�����!� ��H ��4P���� �� ��� � � � � � � � � � � � � ��� ��� �O����Р� �i�����H�M����0"� ��H ��4P���� �� ��� � � � � � � � � � � � � �h�� ��� �O����Р� �i�����H�M����"� ��H ��4P���� �� �� � � � � 1� � �� �� �)�� ���� ��� �, � �����/����� ��������� �� �� ���� ���0� ��0�0�@ ��0�0���0�0���0�0���0�P���!:��0�@�"�� �� �� �� Р���v � ��� pGHpG � � HpG � HpG � HpG � HpG �-��M Jh +9� )9��� ��� ��H� ������FO� &Ph�h� ���B�H����E�E��E����O�0B�RB��E��E�i dD`�� �6D��H��H�� � � � � HpG � HpG ��F !F�h a ��� a�8 D�B �pG�; �?��7� %F�� � ����#h�#`�0� ��� �F � � 9�B �X�� 1�[��FpBpAM�2����?xBxA��+�"h2 D"�`�K`���L !��T� ##`� ��-��E!LFch �i�FFDb�%� $ F�����3�B+`�� $,`�� hh� F+FAF����8�%�+h�B$� #+`$h��dh4�B�O� �:FAF F������B(���� � -���+`��� ,�� -���� ���� FFF�H�� )�� *��h(F ���3h�B��)F8F������+� +����� 1F3�K ,��0hZ�B2`�(F��8�"�8FD��2� F��H��H�� � � ��FFaF���FF� �H�� (�� +�� "��h�ȱ�Ch;`���#�� ##hh�B"`� -�� � 1�K ,��(F���� F��H��H�� � � � ����L!hfh�B(� !3i(�!`� � 1�[ -��hD79D!�[R3a����dh(F"i�: ���`a�� ��-��M $F&K�F_h���� 8�P4 -��c �� � ���D�D�D���O0�B`�G� ��#��#"D�����AFFXF����2F F ������������W� K2^h"D"��2a(F:� �t�pa(F�����H�� �� �K ![hi��P 0pG� HpG � HpG ���4�����F �B�3� �pG0����j� L�;:�� ۲T�#0�� Ћ��F�L"�W�B�:Dk�3L�D�?C@۲T�#0�B�� ���V�[h@ŲT�%P��%�T� ��%�T� �� ŲT�%P�� �� ����C�����C�HK0dK�aK�a��콨 �������-��MFF3M4K�B�3K`����M ���<�� ���Q �\�,K�B�43�B �*K�B�;�B�+y+�$KhZ�00D��J�0�C!�?"�? ���FI #HE��5��FO� �������FO� _F�E��B����O� <L�\O�>� �L� O� ��� x�E��B��I HE�o��� �l�<��Ȇ� �D ��ք� � �%s: Unknown relocation type %llx %s: Relocation at %p is out of range (%lx) @ �@ �IBI SYSTP H � � ! � � D a s U - B o o t RUNTSERVP P ��������)����a�%����������� �0w,a�Q ��m��jp5�c飕d�2�����y�����җ+L� �|�~-����d�� �jHq���A��}�����mQ���DžӃV�l��kdz�b���e�O\�lcc=�� �� n;^iL�A`�rqg���<G�K�� �k� ����5l��B�ɻ�@����l�2u\�E� ��Y=ѫ�0�&: �Q�Q��aп���!#ijV���������(�_���$���|o/LhX�a�=-f��A�vq�� Ҙ*��q���俟3Ը��x4� �� ��� j-=m�ld�\c��Qkkbal�0e�N b��l{����W���ٰeP�긾�|�����bI-��|ӌeL��Xa�M�Q�:t ���0��A��Jו�=m�Ѥ����j�iC��n4F�g�и`�s-D�3_L ��| �<qP�A'�� �%�hW��o �f���a���^���)"�а����=�Y� �.;\���l�� ���������ұt9G��wҝ&���sc�;d�>jm �Zjz��� �'� ��}D��ң�h���i]Wb��ge�q6l�knv���+ӉZz��J�go߹��ホC��Վ�`���~�ѡ���8R��O�g��gW����?K6�H�+ �L ��J6`zA��`�U�g��n1y�iF��a��f���o%6�hR�w�G��"/&U�;��(���Z�+j�\����1�е���,��[��d�&�c윣ju �m� �?6�grW �J��z��+�{8���Ғ �����|!����ӆB������hn�����[&���w�owG��Z�pj��;f\��e�i�b���kaE�lx� ��� �T�N³9a&g��`�MGiI�wn>JjѮ�Z��f�@�;�7S���Ş��ϲG���0º�0��S���$6к���)W�T�g�#.zf��Ja�h]�+o*7������Z��-�� _��00�;��0� ��� ��0��� Q� ��@�o��0� � ���C �A�_o���v����e�����b�����^���Y�����@T�������� S����� ����@�N��o���/��N-������N���/�_��00�;��0� ��� ��0��� Q� ��@�o��0� � ���C �A�_o���v����e�����b�����V���Y�����@T�������� S����� ����@�N��o���/��N-������N���/�� ����/� #�?��?��O���o�pG������@ �ż������@ ���)����� #�?�?�?��O���o��8�F F ��0�?"�3�@SB#@�Bؿ�O�)F F��8@ ��>?D������� #�?�?�?��O���o��p�F F �u�0�o)F F �o�@�#�6��#F�Bؿ�O�)F F��p@ ���6?3D��pG�F ���� � ���$����� �����z����� � �����r���z���n� ���� ��П������M���� ��� P-�6 � ����� t �� �� Р�J5 � Р� ���J5 � ��p; �L �� �� Р�T������P �� ���<