aboutsummaryrefslogtreecommitdiff
path: root/src/pld/lattice_bit.h
diff options
context:
space:
mode:
authorDaniel Anselmi <danselmi@gmx.ch>2022-12-12 09:49:51 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2023-04-30 14:53:25 +0000
commitd35faaa35cd5d56fa946d194d7cf780127a3f8c8 (patch)
treedffcb19ad0922a7ad78012bf74fb5cfa3e95bad5 /src/pld/lattice_bit.h
parent8670ad4caa705c460972badbd0fc28aa98c41866 (diff)
downloadriscv-openocd-d35faaa35cd5d56fa946d194d7cf780127a3f8c8.zip
riscv-openocd-d35faaa35cd5d56fa946d194d7cf780127a3f8c8.tar.gz
riscv-openocd-d35faaa35cd5d56fa946d194d7cf780127a3f8c8.tar.bz2
pld: add support for lattice ecp2 and ecp3 devices
Change-Id: I29c227c37be464f7ecc97a30d9cf3da1442e2b7f Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7396 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Diffstat (limited to 'src/pld/lattice_bit.h')
-rw-r--r--src/pld/lattice_bit.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/pld/lattice_bit.h b/src/pld/lattice_bit.h
new file mode 100644
index 0000000..33f1b34
--- /dev/null
+++ b/src/pld/lattice_bit.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/***************************************************************************
+ * Copyright (C) 2022 by Daniel Anselmi *
+ * danselmi@gmx.ch *
+ ***************************************************************************/
+
+#ifndef OPENOCD_PLD_LATTICE_BIT_H
+#define OPENOCD_PLD_LATTICE_BIT_H
+
+#include "helper/types.h"
+#include "raw_bit.h"
+
+
+struct lattice_bit_file {
+ struct raw_bit_file raw_bit;
+ size_t offset;
+ uint32_t idcode;
+ const char *part; /* reuses memory in raw_bit_file */
+ bool has_id;
+};
+
+enum lattice_family_e {
+ LATTICE_ECP2,
+ LATTICE_ECP3,
+ LATTICE_ECP5,
+ LATTICE_CERTUS,
+ LATTICE_UNKNOWN,
+};
+
+int lattice_read_file(struct lattice_bit_file *bit_file, const char *filename, enum lattice_family_e family);
+
+#endif /* OPENOCD_PLD_LATTICE_BIT_H */