2 * Copyright(c) 2013 Intel Corporation.
4 * Adrian Burns (adrian.burns@intel.com)
5 * Thomas Faust (thomas.faust@intel.com)
6 * Ivan De Cesaris (ivan.de.cesaris@intel.com)
7 * Julien Carreno (julien.carreno@intel.com)
8 * Jeffrey Maxwell (jeffrey.r.maxwell@intel.com)
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * Contact Information:
29 * This is the interface to the probemode operations for Lakemont 1 (LMT1).
34 #include <jtag/jtag.h>
36 /* The Intel Quark SoC X1000 Core is codenamed lakemont */
40 /* lakemont tap instruction opcodes */
57 #define MAX_SCAN_SIZE PIR_SIZE
59 /* needed during lakemont probemode */
60 #define NOT_PMREG 0xfe
61 #define NOT_AVAIL_REG 0xff
62 #define PM_DSB 0x00000000
63 #define PM_DSL 0xFFFFFFFF
64 #define PM_DSAR 0x004F9300
65 #define PM_DR7 0x00000400
66 #define DELAY_SUBMITPIR 0 /* for now 0 is working */
68 /* lakemont tapstatus bits */
69 #define TS_PRDY_BIT 0x00000001
70 #define TS_EN_PM_BIT 0x00000002
71 #define TS_PM_BIT 0x00000004
72 #define TS_PMCR_BIT 0x00000008
73 #define TS_SBP_BIT 0x00000010
75 struct lakemont_core_reg {
77 struct target *target;
78 struct x86_32_common *x86_32_common;
84 uint8_t out[MAX_SCAN_SIZE]; /* scanned out to the tap */
85 uint8_t in[MAX_SCAN_SIZE]; /* in to our capture buf */
86 struct scan_field field;
89 #define I(name) (((struct lakemont_core_reg *)x86_32->cache->reg_list[name].arch_info)->pm_idx)
91 int lakemont_init_target(struct command_context *cmd_ctx, struct target *t);
92 int lakemont_init_arch_info(struct target *t, struct x86_32_common *x86_32);
93 int lakemont_poll(struct target *t);
94 int lakemont_arch_state(struct target *t);
95 int lakemont_halt(struct target *t);
96 int lakemont_resume(struct target *t, int current, uint32_t address,
97 int handle_breakpoints, int debug_execution);
98 int lakemont_step(struct target *t, int current,
99 uint32_t address, int handle_breakpoints);
100 int lakemont_reset_assert(struct target *t);
101 int lakemont_reset_deassert(struct target *t);
103 #endif /* LAKEMONT_H */