Message ID | 20210112183529.2011863-1-f4bug@amsat.org |
---|---|
Headers | show |
Series | hw/ssi: imx_spi: Fix various bugs in the imx_spi model | expand |
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
On 1/13/21 2:27 PM, Bin Meng 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. Arf, stupid mistake in patch 7 :) With this diff I can run your test: -- >8 -- --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -343,7 +343,7 @@ static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value, return; } s->regs[ECSPI_CONREG] = value; - if (value & ECSPI_CONREG_EN) { + if (!(value & ECSPI_CONREG_EN)) { /* Keep disabled */ return; } --- Regards, Phil.
Hi Ben, On 1/13/21 6:56 PM, Philippe Mathieu-Daudé wrote: > On 1/13/21 2:27 PM, Bin Meng wrote: >> Hi Philippe, >> >>>> 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. > > Arf, stupid mistake in patch 7 :) With this diff I can run your > test: > > -- >8 -- > --- a/hw/ssi/imx_spi.c > +++ b/hw/ssi/imx_spi.c > @@ -343,7 +343,7 @@ static void imx_spi_write(void *opaque, hwaddr > offset, uint64_t value, > return; > } > s->regs[ECSPI_CONREG] = value; > - if (value & ECSPI_CONREG_EN) { > + if (!(value & ECSPI_CONREG_EN)) { > /* Keep disabled */ > return; > } > --- Could you have a try at this? Do you prefer I resubmit the whole series? Thanks, Phil.