1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright(c) 2013-2016 Intel Corporation.
6 * Adrian Burns (adrian.burns@intel.com)
7 * Thomas Faust (thomas.faust@intel.com)
8 * Ivan De Cesaris (ivan.de.cesaris@intel.com)
9 * Julien Carreno (julien.carreno@intel.com)
10 * Jeffrey Maxwell (jeffrey.r.maxwell@intel.com)
12 * Contact Information:
18 * This is the interface to the probemode operations for Lakemont 1 (LMT1).
21 #ifndef OPENOCD_TARGET_LAKEMONT_H
22 #define OPENOCD_TARGET_LAKEMONT_H
24 #include <jtag/jtag.h>
25 #include <helper/types.h>
27 /* The Intel Quark SoC X1000 Core is codenamed lakemont */
31 /* lakemont tap instruction opcodes */
48 #define MAX_SCAN_SIZE PIR_SIZE
50 /* needed during lakemont probemode */
51 #define NOT_PMREG 0xfe
52 #define NOT_AVAIL_REG 0xff
53 #define PM_DSB ((uint32_t)0x00000000)
54 #define PM_DSL ((uint32_t)0xFFFFFFFF)
55 #define PM_DSAR ((uint32_t)0x004F9300)
56 #define PM_DR7 ((uint32_t)0x00000400)
57 #define DELAY_SUBMITPIR 0 /* for now 0 is working */
59 /* lakemont tapstatus bits */
60 #define TS_PRDY_BIT ((uint32_t)0x00000001)
61 #define TS_EN_PM_BIT ((uint32_t)0x00000002)
62 #define TS_PM_BIT ((uint32_t)0x00000004)
63 #define TS_PMCR_BIT ((uint32_t)0x00000008)
64 #define TS_SBP_BIT ((uint32_t)0x00000010)
66 struct lakemont_core_reg {
68 struct target *target;
69 struct x86_32_common *x86_32_common;
75 uint8_t out[MAX_SCAN_SIZE]; /* scanned out to the tap */
76 uint8_t in[MAX_SCAN_SIZE]; /* in to our capture buf */
77 struct scan_field field;
80 #define I(name) (((struct lakemont_core_reg *)x86_32->cache->reg_list[name].arch_info)->pm_idx)
82 int lakemont_init_target(struct command_context *cmd_ctx, struct target *t);
83 int lakemont_init_arch_info(struct target *t, struct x86_32_common *x86_32);
84 int lakemont_poll(struct target *t);
85 int lakemont_arch_state(struct target *t);
86 int lakemont_halt(struct target *t);
87 int lakemont_resume(struct target *t, int current, target_addr_t address,
88 int handle_breakpoints, int debug_execution);
89 int lakemont_step(struct target *t, int current,
90 target_addr_t address, int handle_breakpoints);
91 int lakemont_reset_assert(struct target *t);
92 int lakemont_reset_deassert(struct target *t);
93 int lakemont_update_after_probemode_entry(struct target *t);
95 #endif /* OPENOCD_TARGET_LAKEMONT_H */