Hi, Am 13.04.21 um 01:53 schrieb VR: > Great this gives me a good starting point to explore the code to create a > patch. Let me see what I > can put together. > > I'll let Olesksij comment on this comment: "DMA seems to be broken in many > ways. Don't trust it". I > am assuming that there was a good reason to disable DMA. So I think I agree > with you that maybe > -broken-ejtag-dma OR -force-dma is a good option and have DMA be disabled by > default.
Here is the log of discussion related to this patch: http://openocd.zylin.com/#/c/1936/ Before trying to re enable the DMA, did you tried to use different address for the CFI flash? The DMA address is different to the CPU address. > Thanks > Vivek > On Monday, April 12, 2021, 7:33:19 PM EDT, Antonio Borneo > <borneo.anto...@gmail.com> wrote: > > > On Tue, Apr 13, 2021 at 12:41 AM VR via OpenOCD-devel > <openocd-devel@lists.sourceforge.net > <mailto:openocd-devel@lists.sourceforge.net>> wrote: >> >> Hello, >> >> I am working with a Broadcom BCM5352 (MIPS) target (its a WRT54GL router) >> and was unable to get > OpenOCD to detect flash memory. >> >> It turns out the fix was to undo this commit: > https://sourceforge.net/p/openocd/code/ci/d2ddb53f7d3c6c5c3be1f6b41a796033599b1880 > <https://sourceforge.net/p/openocd/code/ci/d2ddb53f7d3c6c5c3be1f6b41a796033599b1880 > >--> > (mips_ejtag.c: disable DMA for all platforms: DMA seems to be broken in many > ways. Don't trust it) >> >> There is a comment in the source (mips32_dmaacc.c) which even mentions >> "BCM5352 doesn't appear to > support PRACC accesses". So I got things to work for my purposes by editing > the code. >> >> But... MY QUESTION --> I was wondering if it would be possible to allow DMA >> access via > command/switch instead of disabling it altogether for MIPS devices. Hope > someone can comment on > this. I am willing to work on this to get it implemented. > > Hi, > > could it be a flag during 'target create' command? e.g. -force-nodma > or -broken-ejtag-dma? > Then revert the patch you mention and put in mips_m4k_read_memory() > and mips_m4k_write_memory() a test based on both the flag and > EJTAG_IMP_NODMA. > You will also need to decide which config in tcl/target/ need the > flag. Maybe the solution is to disable DMA for all the targets and > enable it only where it works. This will be consistent with the > current code. > > In case you decide to add such a flag, you can check how it is > implemented for other targets, e.g. in cortex_m_target_create(). > > Regards, > Antonio > > >> >> Thanks! >> Regards >> Vivek -- Regards, Oleksij