OpenOCD
quark_x10xx.c
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  * Debugger for Intel Quark SoC X1000
19  * Intel Quark X10xx is the first product in the Quark family of SoCs.
20  * It is an IA-32 (Pentium x86 ISA) compatible SoC. The core CPU in the
21  * X10xx is codenamed Lakemont. Lakemont version 1 (LMT1) is used in X10xx.
22  * The CPU TAP (Lakemont TAP) is used for software debug and the CLTAP is
23  * used for SoC level operations.
24  * Useful docs are here: https://communities.intel.com/community/makers/documentation
25  * Intel Quark SoC X1000 OpenOCD/GDB/Eclipse App Note (web search for doc num 330015)
26  * Intel Quark SoC X1000 Debug Operations User Guide (web search for doc num 329866)
27  * Intel Quark SoC X1000 Datasheet (web search for doc num 329676)
28  *
29  * This file implements any Quark SoC specific features such as resetbreak (TODO)
30  */
31 
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35 
36 #include <helper/log.h>
37 
38 #include "target.h"
39 #include "target_type.h"
40 #include "lakemont.h"
41 #include "x86_32_common.h"
42 
43 static int quark_x10xx_target_create(struct target *t, Jim_Interp *interp)
44 {
45  struct x86_32_common *x86_32 = calloc(1, sizeof(*x86_32));
46 
47  if (!x86_32)
48  return ERROR_FAIL;
49 
51  lakemont_init_arch_info(t, x86_32);
52  x86_32->core_type = LMT1;
53 
54  return ERROR_OK;
55 }
56 
58  .name = "quark_x10xx",
59 
60  /* Quark X1000 SoC */
61  .target_create = quark_x10xx_target_create,
62 
63  /* lakemont probemode specific code */
64  .arch_state = lakemont_arch_state,
65  .assert_reset = lakemont_reset_assert,
66  .deassert_reset = lakemont_reset_deassert,
67  .halt = lakemont_halt,
68  .init_target = lakemont_init_target,
69  .poll = lakemont_poll,
70  .resume = lakemont_resume,
71  .step = lakemont_step,
72 
73  /* common x86 code */
74  .add_breakpoint = x86_32_common_add_breakpoint,
75  .add_watchpoint = x86_32_common_add_watchpoint,
76  .commands = x86_32_command_handlers,
77  .get_gdb_reg_list = x86_32_get_gdb_reg_list,
78  .mmu = x86_32_common_mmu,
79  .read_memory = x86_32_common_read_memory,
80  .read_phys_memory = x86_32_common_read_phys_mem,
81  .remove_breakpoint = x86_32_common_remove_breakpoint,
82  .remove_watchpoint = x86_32_common_remove_watchpoint,
83  .virt2phys = x86_32_common_virt2phys,
84  .write_memory = x86_32_common_write_memory,
85  .write_phys_memory = x86_32_common_write_phys_mem,
86 };
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
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_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
#define ERROR_FAIL
Definition: log.h:170
#define ERROR_OK
Definition: log.h:164
struct target_type quark_x10xx_target
Definition: quark_x10xx.c:57
static int quark_x10xx_target_create(struct target *t, Jim_Interp *interp)
Definition: quark_x10xx.c:43
This holds methods shared between all instances of a given target type.
Definition: target_type.h:26
const char * name
Name of this type of target.
Definition: target_type.h:31
Definition: target.h:116
enum x86_core_type core_type
const struct command_registration x86_32_command_handlers[]
int x86_32_common_add_watchpoint(struct target *t, struct watchpoint *wp)
int x86_32_common_read_memory(struct target *t, target_addr_t addr, uint32_t size, uint32_t count, uint8_t *buf)
int x86_32_common_init_arch_info(struct target *t, struct x86_32_common *x86_32)
Definition: x86_32_common.c:80
int x86_32_common_add_breakpoint(struct target *t, struct breakpoint *bp)
int x86_32_common_virt2phys(struct target *t, target_addr_t address, target_addr_t *physical)
int x86_32_common_write_memory(struct target *t, target_addr_t addr, uint32_t size, uint32_t count, const uint8_t *buf)
int x86_32_get_gdb_reg_list(struct target *t, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
Definition: x86_32_common.c:57
int x86_32_common_read_phys_mem(struct target *t, target_addr_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer)
int x86_32_common_remove_watchpoint(struct target *t, struct watchpoint *wp)
int x86_32_common_mmu(struct target *t, int *enabled)
Definition: x86_32_common.c:99
int x86_32_common_write_phys_mem(struct target *t, target_addr_t phys_address, uint32_t size, uint32_t count, const uint8_t *buffer)
int x86_32_common_remove_breakpoint(struct target *t, struct breakpoint *bp)
@ LMT1