Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Merged. It would be nice with some followup patches: - some comments on how this code can/should be refactored rather than copy pasted as new devices are added - a patch to get rid of the non-sensical .h files in drivers/nor/*.h and just put the private data into the .c file. -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Antonio Borneo wrote: Are you aware of any target, other than SPEAr, that provides memory mapping feature of SPI flash? I quickly searched, but failed. I haven't seen it on any ARM chips, but OTOH I'm somewhat new to ARM. On PC mainboards it is quite common, I'd even say the norm. http://stuge.se/pc2010.png is from a coreboot talk of mine. I have done fair bit of SPI flash work in the flashrom project, a spin-off from coreboot, but am not so active there now. SPI really needs a good data model in order to be programmed efficiently; flash in once place, bridges in another. //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Are you aware of any target, other than SPEAr, that provides memory mapping feature of SPI flash? I quickly searched, but failed. ST STR750 i believe - it is also called SMI interface. Cheers Spen ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On 16/11/2010 21:14, Igor Skochinsky wrote: Hello Antonio, Tuesday, November 16, 2010, 3:53:53 PM, you wrote: AB Are you aware of any target, other than SPEAr, that provides memory AB mapping feature of SPI flash? I quickly searched, but failed. NXP's LPC1800 (and, I think, LPC4000) have support for that. Not sure if the nxp part supports code execution from spi like the ST SMI does. Cheers Spen ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
The patch in attachment adds additional comments to previous commit. Best Regards, Antonio Borneo 0002-NOR-SPEARSMI-Add-comments-about-SPI.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On Tue, Nov 16, 2010 at 4:18 PM, Øyvind Harboe oyvind.har...@zylin.com wrote: ... It would be nice with some followup patches: ... - a patch to get rid of the non-sensical .h files in drivers/nor/*.h and just put the private data into the .c file. Hi, in attachment 3 patches to start addressing this rework. Please provide feedback, if any, before I go ahead. Best Regards, Antonio Borneo 0003-FLASH-NOR-Remove-useless-file-spearsmi.h.patch Description: Binary data 0004-FLASH-NOR-Remove-useless-file-at91sam3.h.patch Description: Binary data 0005-FLASH-NOR-Remove-useless-file-at91sam7.h.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On Tue, Nov 16, 2010 at 11:23 PM, Spencer Oliver s...@spen-soft.co.uk wrote: Are you aware of any target, other than SPEAr, that provides memory mapping feature of SPI flash? I quickly searched, but failed. ST STR750 i believe - it is also called SMI interface. Yes, seems they share same SMI HW block. Just for test purpose, I have slightly modified spearsmi driver to add support to STR750. The driver was already prepared for adding new devices, since I was expecting to support new members in SPEAr family. I have no way to test such patch on STR750. Just check it compiles. Does anybody have a STR750 board with external serial flash on SMI? It's possible that something need to be changed in the reset-init script to initialize the SMI, but I have no idea on what could be the proper settings. Anyway, let me know if you need help for this latter item. If it works, I need at least to remove the name SPEAr from driver name and code. Best Regards, Antonio Borneo 0001-STR750-Add-SMI-interface-support.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Merged. Thanks! -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Merged. Thanks! (Please post followup patches in new thread) -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On Sat, Nov 13, 2010 at 1:09 PM, Peter Stuge pe...@stuge.se wrote: Øyvind Harboe wrote: So basically if OpenOCD had some generic support for interfacing to SPI chips via the target CPU over JTAG, then you could build on that for your flash driver? That seems a completely separate feature to your patch. That's the point basically, there are parts of the patch which should be separated out, because they are not really specific to spearsmi. Your flash driver could be refactored once such support was added, possibly by factoring out some code from your flash driver. Refactor now, or then? Copypaste later is more likely what we'll see.. I haven't seen a proposed design and it seems some time off. -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Øyvind Harboe wrote: there are parts of the patch which should be separated out, because they are not really specific to spearsmi. .. Refactor now, or then? .. I haven't seen a proposed design and it seems some time off. Fair enough. Could we add some commentary to remind future code pilots of these circumstances? //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On Mon, Nov 15, 2010 at 4:07 PM, Peter Stuge pe...@stuge.se wrote: Øyvind Harboe wrote: there are parts of the patch which should be separated out, because they are not really specific to spearsmi. .. Refactor now, or then? .. I haven't seen a proposed design and it seems some time off. Fair enough. Could we add some commentary to remind future code pilots of these circumstances? That does seem in order. Would you care to formulate something? -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Antonio Borneo wrote: I'm not thrilled about having this information local in the spearsmi Like generic SPI and SPI-flash layers. The flash support shouldn't be SPEAr-specific in the least. Understand your comments. I agree that the table could be shared between SPEAr SMI and a generic SPI or SPI-flash framework. But I think this could be the only common part. AFAIK, SPI flash is not accessible in CPU memory space directly, but requires the driver to copy to RAM the flash content. This is stated also in OpenOCD documentation, chapter 12. But, SMI controller is not a generic SPI interface (some devices in SPEAr family also provide a separate SPI controller, keeping SMI for flash only). SMI is a dedicated HW accelerator that hides the SPI protocol and maps on-the-fly the content of the SPI flash in the CPU memory space. That is true.. But SPI is still SPI, and maybe some code can be shared. Likewise the flash chips in the table may be relevant elsewhere in the code, so would be better to have their information outside spearsmi, along with enough knowledge to determine if they can be used by spearsmi or not. The SMI has some limitation while choosing a flash device. The documentation reports the list of mandatory SPI commands codes that the flash have to support, since such values are hardcoded in the controller and cannot be changed. Does the SMI have a manual command mode? What you describe is common with SPI flash controllers, but there can also be a generic mode where software can specify one command at a time to execute on SPI? //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Øyvind Harboe wrote: So basically if OpenOCD had some generic support for interfacing to SPI chips via the target CPU over JTAG, then you could build on that for your flash driver? That seems a completely separate feature to your patch. That's the point basically, there are parts of the patch which should be separated out, because they are not really specific to spearsmi. Your flash driver could be refactored once such support was added, possibly by factoring out some code from your flash driver. Refactor now, or then? Copypaste later is more likely what we'll see.. //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
Any objections out there? Looks OK to me on the surface of it. You're the expert here. I'll let it cool off and if no feedback, I'll merge it. The driver structure follows the prototype of the other drivers in src/flash/nor/ The file .h that I'm adding is totally useless, since only provides a function prototype but is not included by the only user of that function. I'm thinking that it would make more sense to get rid of all the .h files where a simple fn prototype in drivers.c would do. Less clutter. But that's a separate issue to the patches and can be dealt with after this patch has gone in. -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
--- On Fri, 11/12/10, Peter Stuge pe...@stuge.se wrote: I'm not thrilled about having this information local in the spearsmi Like generic SPI and SPI-flash layers. The flash support shouldn't be SPEAr-specific in the least. ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [Patch] SPEAr serial NOR flash driver
On Sat, Nov 13, 2010 at 1:27 AM, David Brownell davi...@pacbell.net wrote: --- On Fri, 11/12/10, Peter Stuge pe...@stuge.se wrote: I'm not thrilled about having this information local in the spearsmi Like generic SPI and SPI-flash layers. The flash support shouldn't be SPEAr-specific in the least. Understand your comments. I agree that the table could be shared between SPEAr SMI and a generic SPI or SPI-flash framework. But I think this could be the only common part. AFAIK, SPI flash is not accessible in CPU memory space directly, but requires the driver to copy to RAM the flash content. This is stated also in OpenOCD documentation, chapter 12. But, SMI controller is not a generic SPI interface (some devices in SPEAr family also provide a separate SPI controller, keeping SMI for flash only). SMI is a dedicated HW accelerator that hides the SPI protocol and maps on-the-fly the content of the SPI flash in the CPU memory space. This makes SMI + SPI flash similar to a parallel NOR device, and also makes the driver fitting in the generic NOR framework of OpenOCD. I cannot use an explicit SPI framework, since SPI is hidden inside the SMI HW. The SMI has some limitation while choosing a flash device. The documentation reports the list of mandatory SPI commands codes that the flash have to support, since such values are hardcoded in the controller and cannot be changed. So, the table above does not lists all the possible SPI devices, but only a subset of flashes compatible with SMI accelerator. If some other target device has a SPI flash controller with similar characteristic, than would be interesting to compare them and look for common code. In the mean time, I think the table could either be in current file or in a separate one. Would not be difficult to review it later on. Best Regards Antonio Borneo ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development