]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/dsp5680xx_flash.c
flash: Constify write buffer
[openocd] / src / flash / nor / dsp5680xx_flash.c
index eb2f3e1b3782478f7523c1355ab3bb12fae235c8..693ff487edd71c024fb14e4ac1a8358fbc84c968 100644 (file)
@@ -20,7 +20,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
  ***************************************************************************/
 
 /**
 #include <target/algorithm.h>
 #include <target/dsp5680xx.h>
 
-struct dsp5680xx_flash_bank {
-       struct working_area *write_algorithm;
-};
-
 static int dsp5680xx_build_sector_list(struct flash_bank *bank)
 {
        uint32_t offset = HFM_FLASH_BASE_ADDR;
@@ -71,13 +67,8 @@ static int dsp5680xx_build_sector_list(struct flash_bank *bank)
 /* flash bank dsp5680xx 0 0 0 0 <target#> */
 FLASH_BANK_COMMAND_HANDLER(dsp5680xx_flash_bank_command)
 {
-       struct dsp5680xx_flash_bank *nbank;
-
-       nbank = malloc(sizeof(struct dsp5680xx_flash_bank));
-
        bank->base = HFM_FLASH_BASE_ADDR;
        bank->size = HFM_SIZE_BYTES; /* top 4k not accessible */
-       bank->driver_priv = nbank;
        bank->num_sectors = HFM_SECTOR_COUNT;
        dsp5680xx_build_sector_list(bank);
 
@@ -165,7 +156,7 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set, int first,
  *
  * @return
  */
-static int dsp5680xx_flash_write(struct flash_bank *bank, uint8_t * buffer,
+static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t* buffer,
                                 uint32_t offset, uint32_t count)
 {
        int retval;
@@ -202,14 +193,6 @@ static int dsp5680xx_probe(struct flash_bank *bank)
        return ERROR_OK;
 }
 
-static int dsp5680xx_flash_info(struct flash_bank *bank, char *buf,
-               int buf_size)
-{
-       snprintf(buf, buf_size,
-               "\ndsp5680xx flash driver info:\n - See comments in code.");
-       return ERROR_OK;
-}
-
 /**
  * The flash module (FM) on the dsp5680xx supports both individual sector
  * and mass erase of the flash memory.
@@ -286,5 +269,4 @@ struct flash_driver dsp5680xx_flash = {
        .auto_probe = dsp5680xx_probe,
        .erase_check = dsp5680xx_flash_erase_check,
        .protect_check = dsp5680xx_flash_protect_check,
-       .info = dsp5680xx_flash_info
 };