X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fdriver.h;h=3757442fcc8788206b4aa0c6f2074edab3ec1bad;hp=0e77132734bbf14d0589b8f6a623ed06ef7f3293;hb=bc8be110ff314cab0e09792a05b6871672c18302;hpb=24ebfffff54f5201f1503256df56717900e65e2d diff --git a/src/flash/nor/driver.h b/src/flash/nor/driver.h index 0e77132734..3757442fcc 100644 --- a/src/flash/nor/driver.h +++ b/src/flash/nor/driver.h @@ -3,6 +3,7 @@ * Copyright (C) 2007,2008 Øyvind Harboe * * Copyright (C) 2008 by Spencer Oliver * * Copyright (C) 2009 Zachary T Welch * + * Copyright (C) 2010 by Antonio Borneo * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -130,6 +131,20 @@ struct flash_driver int (*write)(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count); + /** + * Read data from the flash. Note CPU address will be + * "bank->base + offset", while the physical address is + * dependent upon current target MMU mappings. + * + * @param bank The bank to read. + * @param buffer The data bytes read. + * @param offset The offset into the chip to read. + * @param count The number of bytes to read. + * @returns ERROR_OK if successful; otherwise, an error code. + */ + int (*read)(struct flash_bank *bank, + uint8_t *buffer, uint32_t offset, uint32_t count); + /** * Probe to determine what kind of flash is present. * This is invoked by the "probe" script command.