OpenOCD
lakemont.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /*
4  * Copyright(c) 2013-2016 Intel Corporation.
5  *
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)
11  *
12  * Contact Information:
13  * Intel Corporation
14  */
15 
16 /*
17  * @file
18  * This is the interface to the probemode operations for Lakemont 1 (LMT1).
19  */
20 
21 #ifndef OPENOCD_TARGET_LAKEMONT_H
22 #define OPENOCD_TARGET_LAKEMONT_H
23 
24 #include <jtag/jtag.h>
25 #include <helper/types.h>
26 
27 /* The Intel Quark SoC X1000 Core is codenamed lakemont */
28 
29 #define LMT_IRLEN 8
30 
31 /* lakemont tap instruction opcodes */
32 #define IDCODE 2
33 #define SUBMITPIR 3
34 #define PROBEMODE 4
35 #define WRPIR 6
36 #define RDWRPDR 8
37 #define TAPSTATUS 11
38 #define BYPASS 255
39 #define NOT_NULL 2
40 
41 /* DR sizes */
42 #define ID_SIZE 32
43 #define PM_SIZE 1
44 #define PIR_SIZE 64
45 #define PDR_SIZE 32
46 #define TS_SIZE 32
47 #define BP_SIZE 1
48 #define MAX_SCAN_SIZE PIR_SIZE
49 
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 */
58 
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)
65 
67  uint32_t num;
68  struct target *target;
70  uint64_t op;
71  uint8_t pm_idx;
72 };
73 
74 struct scan_blk {
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;
78 };
79 
80 #define I(name) (((struct lakemont_core_reg *)x86_32->cache->reg_list[name].arch_info)->pm_idx)
81 
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);
94 
95 #endif /* OPENOCD_TARGET_LAKEMONT_H */
The JTAG interface can be implemented with a software or hardware fifo.
int lakemont_reset_deassert(struct target *t)
Definition: lakemont.c:1208
int lakemont_init_target(struct command_context *cmd_ctx, struct target *t)
Definition: lakemont.c:825
int lakemont_arch_state(struct target *t)
Definition: lakemont.c:966
int lakemont_init_arch_info(struct target *t, struct x86_32_common *x86_32)
Definition: lakemont.c:833
#define MAX_SCAN_SIZE
Definition: lakemont.h:48
int lakemont_poll(struct target *t)
Definition: lakemont.c:847
int lakemont_step(struct target *t, int current, target_addr_t address, int handle_breakpoints)
Definition: lakemont.c:1032
int lakemont_update_after_probemode_entry(struct target *t)
Definition: lakemont.c:569
int lakemont_reset_assert(struct target *t)
Definition: lakemont.c:1164
int lakemont_resume(struct target *t, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: lakemont.c:991
int lakemont_halt(struct target *t)
Definition: lakemont.c:978
uint64_t op
Definition: lakemont.h:70
uint32_t num
Definition: lakemont.h:67
struct x86_32_common * x86_32_common
Definition: lakemont.h:69
struct target * target
Definition: lakemont.h:68
uint8_t pm_idx
Definition: lakemont.h:71
struct scan_field field
Definition: lakemont.h:77
uint8_t in[MAX_SCAN_SIZE]
Definition: lakemont.h:76
uint8_t out[MAX_SCAN_SIZE]
Definition: lakemont.h:75
This structure defines a single scan field in the scan.
Definition: jtag.h:87
Definition: target.h:116
uint64_t target_addr_t
Definition: types.h:335