X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fdsp5680xx.h;h=842796bc7f7fdf0be33209e996dbd8e2aed411e9;hb=d537cce7ef49bf2f4bc81cf016f784a9adf2537a;hp=71405d4ef44b0f4bb637857ebe572e28737832a1;hpb=3d0e2547fe4a0ea50d31beec8b4be1cc7cf51cda;p=openocd.git
diff --git a/src/target/dsp5680xx.h b/src/target/dsp5680xx.h
index 71405d4ef4..842796bc7f 100644
--- a/src/target/dsp5680xx.h
+++ b/src/target/dsp5680xx.h
@@ -16,12 +16,11 @@
* GNU General Public License for more details. *
* *
* 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. *
+ * along with this program. If not, see . *
***************************************************************************/
-#ifndef DSP5680XX_H
-#define DSP5680XX_H
+
+#ifndef OPENOCD_TARGET_DSP5680XX_H
+#define OPENOCD_TARGET_DSP5680XX_H
#include
@@ -29,12 +28,11 @@
* @file dsp5680xx.h
* @author Rodrigo Rosa
* @date Thu Jun 9 18:54:38 2011
- *
+ *
* @brief Basic support for the 5680xx DSP from Freescale.
* The chip has two taps in the JTAG chain, the Master tap and the Core tap.
* In this code the Master tap is only used to unlock the flash memory by executing a JTAG instruction.
- *
- *
+ *
*/
#define S_FILE_DATA_OFFSET 0x200000
@@ -127,7 +125,7 @@
*/
/** ----------------------------------------------------------------
- * Register Select Encoding (eonce_rev.1.0_0208081.pdf@14)
+ * Register Select Encoding (eonce_rev.1.0_0208081.pdf:14)
* ----------------------------------------------------------------
*/
#define DSP5680XX_ONCE_NOREG 0x00 /* No register selected */
@@ -153,10 +151,10 @@
* ----------------------------------------------------------------
*/
-#define FLUSH_COUNT_READ_WRITE 8192 // This value works, higher values (and lower...) may work as well.
+#define FLUSH_COUNT_READ_WRITE 8192 /* This value works, higher values (and lower...) may work as well. */
#define FLUSH_COUNT_FLASH 8192
/** ----------------------------------------------------------------
- * HFM (flash module) Commands (ref:MC56F801xRM.pdf@159)
+ * HFM (flash module) Commands (ref:MC56F801xRM.pdf:159)
* ----------------------------------------------------------------
*/
#define HFM_ERASE_VERIFY 0x05
@@ -170,7 +168,7 @@
*/
/** ----------------------------------------------------------------
- * Flashing (ref:MC56F801xRM.pdf@159)
+ * Flashing (ref:MC56F801xRM.pdf:159)
* ----------------------------------------------------------------
*/
#define HFM_BASE_ADDR 0x0F400 /** In x: mem. (write to S_FILE_DATA_OFFSET+HFM_BASE_ADDR
@@ -194,14 +192,14 @@
#define HFM_EXEC_COMPLETE 0x40
-/* User status register (USTAT) masks (MC56F80XXRM.pdf@6.7.5) */
+/* User status register (USTAT) masks (MC56F80XXRM.pdf:6.7.5) */
#define HFM_USTAT_MASK_BLANK 0x4
#define HFM_USTAT_MASK_PVIOL_ACCER 0x30
/**
* The value used on for the FM clock is important to prevent flashing errors and to prevent deterioration of the FM.
* This value was calculated using a spreadsheet tool available on the Freescale website under FAQ 25464.
- *
+ *
*/
#define HFM_CLK_DEFAULT 0x27
/* 0x27 according to freescale cfg, but 0x40 according to freescale spreadsheet... */
@@ -223,7 +221,7 @@
*/
/** ----------------------------------------------------------------
- * Register Memory Map (eonce_rev.1.0_0208081.pdf@16)
+ * Register Memory Map (eonce_rev.1.0_0208081.pdf:16)
* ----------------------------------------------------------------
*/
#define MC568013_EONCE_OBASE_ADDR 0xFF
@@ -299,73 +297,86 @@ static inline struct dsp5680xx_common *target_to_dsp5680xx(struct target
return target->arch_info;
}
-/**
+/**
* Writes to flash memory.
- * Does not check if flash is erased, it's up to the user to erase the flash before running this function.
- * The flashing algorithm runs from RAM, reading from a register to which this function writes to. The algorithm is open loop, there is no control to verify that the FM read the register before writing the next data. A closed loop approach was much slower, and the current implementation does not fail, and if it did the crc check would detect it, allowing to flash again.
- *
- * @param target
- * @param buffer
+ * Does not check if flash is erased, it's up to the user to erase the flash before running
+ * this function.
+ * The flashing algorithm runs from RAM, reading from a register to which this function
+ * writes to. The algorithm is open loop, there is no control to verify that the FM read
+ * the register before writing the next data. A closed loop approach was much slower,
+ * and the current implementation does not fail, and if it did the crc check would detect it,
+ * allowing to flash again.
+ *
+ * @param target
+ * @param buffer
* @param address Word addressing.
- * @param count In bytes.
- * @param verify_flash Execute a CRC check after flashing.
- *
- * @return
- */
-int dsp5680xx_f_wr(struct target *target, uint8_t * buffer, uint32_t address,
- uint32_t count, int is_flash_lock);
-
-/**
- * The FM has the funcionality of checking if the flash array is erased. This function executes it. It does not support individual sector analysis.
- *
- * @param target
- * @param erased
- * @param sector This parameter is ignored because the FM does not support checking if individual sectors are erased.
- *
- * @return
+ * @param count In bytes.
+ * @param is_flash_lock
+ *
+ * @return
+ */
+int dsp5680xx_f_wr(struct target *target, const uint8_t * buffer, uint32_t address,
+ uint32_t count, int is_flash_lock);
+
+/**
+ * The FM has the functionality of checking if the flash array is erased. This function
+ * executes it. It does not support individual sector analysis.
+ *
+ * @param target
+ * @param erased
+ * @param sector This parameter is ignored because the FM does not support checking if
+ * individual sectors are erased.
+ *
+ * @return
*/
int dsp5680xx_f_erase_check(struct target *target, uint8_t * erased,
- uint32_t sector);
+ uint32_t sector);
-/**
- * Erases either a sector or the complete flash array. If either the range first-last covers the complete array or if @first == 0 and @last == 0 then a mass erase command is executed on the FM. If not, then individual sectors are erased.
- *
- * @param target
- * @param first
- * @param last
- *
- * @return
+/**
+ * Erases either a sector or the complete flash array. If either the range first-last covers
+ * the complete array or if first == 0 and last == 0 then a mass erase command is executed
+ * on the FM. If not, then individual sectors are erased.
+ *
+ * @param target
+ * @param first
+ * @param last
+ *
+ * @return
*/
int dsp5680xx_f_erase(struct target *target, int first, int last);
-/**
- * Reads the memory mapped protection register. A 1 implies the sector is protected, a 0 implies the sector is not protected.
- *
- * @param target
+/**
+ * Reads the memory mapped protection register. A 1 implies the sector is protected,
+ * a 0 implies the sector is not protected.
+ *
+ * @param target
* @param protected Data read from the protection register.
- *
- * @return
+ *
+ * @return
*/
int dsp5680xx_f_protect_check(struct target *target, uint16_t * protected);
-/**
- * Writes the flash security words with a specific value. The chip's security will be enabled after the first reset following the execution of this function.
- *
- * @param target
- *
- * @return
+/**
+ * Writes the flash security words with a specific value. The chip's security will be
+ * enabled after the first reset following the execution of this function.
+ *
+ * @param target
+ *
+ * @return
*/
int dsp5680xx_f_lock(struct target *target);
-/**
+/**
* Executes a mass erase command. The must be done from the Master tap.
- * It is up to the user to select the master tap (jtag tapenable dsp5680xx.chp) before running this function.
- * The flash array will be unsecured (and erased) after the first reset following the execution of this function.
- *
- * @param target
- *
- * @return
+ * It is up to the user to select the master tap (jtag tapenable dsp5680xx.chp)
+ * before running this function.
+ * The flash array will be unsecured (and erased) after the first reset following
+ * the execution of this function.
+ *
+ * @param target
+ *
+ * @return
*/
int dsp5680xx_f_unlock(struct target *target);
-#endif /* dsp5680xx.h */
+#endif /* OPENOCD_TARGET_DSP5680XX_H */