You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

98 lines
3.2 KiB

  1. /*
  2. * Copyright(c) 2013-2016 Intel Corporation.
  3. *
  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)
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. * Contact Information:
  24. * Intel Corporation
  25. */
  26. /*
  27. * @file
  28. * Debugger for Intel Quark SoC X1000
  29. * Intel Quark X10xx is the first product in the Quark family of SoCs.
  30. * It is an IA-32 (Pentium x86 ISA) compatible SoC. The core CPU in the
  31. * X10xx is codenamed Lakemont. Lakemont version 1 (LMT1) is used in X10xx.
  32. * The CPU TAP (Lakemont TAP) is used for software debug and the CLTAP is
  33. * used for SoC level operations.
  34. * Useful docs are here: https://communities.intel.com/community/makers/documentation
  35. * Intel Quark SoC X1000 OpenOCD/GDB/Eclipse App Note (web search for doc num 330015)
  36. * Intel Quark SoC X1000 Debug Operations User Guide (web search for doc num 329866)
  37. * Intel Quark SoC X1000 Datasheet (web search for doc num 329676)
  38. *
  39. * This file implements any Quark SoC specific features such as resetbreak (TODO)
  40. */
  41. #ifdef HAVE_CONFIG_H
  42. #include "config.h"
  43. #endif
  44. #include <helper/log.h>
  45. #include "target.h"
  46. #include "target_type.h"
  47. #include "lakemont.h"
  48. #include "x86_32_common.h"
  49. static int quark_x10xx_target_create(struct target *t, Jim_Interp *interp)
  50. {
  51. struct x86_32_common *x86_32 = calloc(1, sizeof(*x86_32));
  52. if (!x86_32)
  53. return ERROR_FAIL;
  54. x86_32_common_init_arch_info(t, x86_32);
  55. lakemont_init_arch_info(t, x86_32);
  56. x86_32->core_type = LMT1;
  57. return ERROR_OK;
  58. }
  59. struct target_type quark_x10xx_target = {
  60. .name = "quark_x10xx",
  61. /* Quark X1000 SoC */
  62. .target_create = quark_x10xx_target_create,
  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. /* common x86 code */
  73. .add_breakpoint = x86_32_common_add_breakpoint,
  74. .add_watchpoint = x86_32_common_add_watchpoint,
  75. .commands = x86_32_command_handlers,
  76. .get_gdb_reg_list = x86_32_get_gdb_reg_list,
  77. .mmu = x86_32_common_mmu,
  78. .read_memory = x86_32_common_read_memory,
  79. .read_phys_memory = x86_32_common_read_phys_mem,
  80. .remove_breakpoint = x86_32_common_remove_breakpoint,
  81. .remove_watchpoint = x86_32_common_remove_watchpoint,
  82. .virt2phys = x86_32_common_virt2phys,
  83. .write_memory = x86_32_common_write_memory,
  84. .write_phys_memory = x86_32_common_write_phys_mem,
  85. };