Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Cortex handling unification #1664

Merged
merged 22 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca76c14
cortexar: Renamed cortexr.c ready to unify the Cortex-A and Cortex-R …
dragonmux Oct 9, 2023
635818f
cortexar: Implemented handling for i-cache flushing VMSA parts for re…
dragonmux Oct 11, 2023
d843faf
cortexar: Renamed the private structure as it's common to both -A and…
dragonmux Oct 14, 2023
62f01d6
cortexar: Renamed all the common macros
dragonmux Oct 14, 2023
db6025f
cortexar: Renamed all the register and instruction access machinary a…
dragonmux Oct 14, 2023
42e577b
cortexar: Renamed the memory access machinary
dragonmux Oct 14, 2023
2232692
cortexar: Renamed the halt/resume machinary
dragonmux Oct 14, 2023
1c050ef
cortexar: Renamed the breakwatch machinary
dragonmux Oct 14, 2023
dc637fa
cortexar: Renamed the target XML description machinary
dragonmux Oct 14, 2023
3150b2b
cortexar: Renamed the target attach/detach functions
dragonmux Oct 14, 2023
a815ce5
cortexar: Refactored the Cortex-R probe routine to allow for a common…
dragonmux Oct 14, 2023
8fe11e8
cortexar: Built a replacement Cortex-A probe routine and dropped the …
dragonmux Oct 14, 2023
2133d2c
cortexar: Implemented address translation so breakpoints and watchpoi…
dragonmux Oct 14, 2023
2db5422
cortexar: Ported over the OS lock unlock logic from the ALTracer
dragonmux Oct 15, 2023
958da46
cortexar: Improved the register documentation and CPSR definitions
dragonmux Oct 15, 2023
e93dee1
cortex: Moved and renamed CORTEXM_TOPT_INHIBIT_NRST to CORTEX_TOPT_IN…
dragonmux Oct 15, 2023
3cce642
cortexar: Implemented basic reset support for both core types
dragonmux Oct 15, 2023
bf7b66b
cortexm: Cleaned up and documented cortexm_reset() some more
dragonmux Oct 15, 2023
a26b7da
cortexar: Implemented insurances that the core is powered up and unlo…
dragonmux Oct 15, 2023
974fc8d
cortexm: Fixed the target parameter for cortexm_{at,de}tach(), and va…
dragonmux Oct 15, 2023
4322304
cortexm: Fixed all target nomenclature in one big pass
dragonmux Oct 15, 2023
54566b0
cortexa: Removed the old Cortex-A implementation now it has been supe…
dragonmux Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROBE_HOST ?= native
PLATFORM_DIR = platforms/$(PROBE_HOST)
VPATH += $(PLATFORM_DIR) target
ENABLE_DEBUG ?= 0
ENABLE_CORTEXR ?= 0
ENABLE_CORTEXAR ?= 0

SYS = $(shell $(CC) -dumpmachine)

Expand Down Expand Up @@ -31,7 +31,6 @@ SRC = \
at32f43x.c \
command.c \
cortex.c \
cortexa.c \
cortexm.c \
crc32.c \
efm32.c \
Expand Down Expand Up @@ -90,9 +89,9 @@ ifeq (,$(filter all_platforms,$(MAKECMDGOALS)))
include $(PLATFORM_DIR)/Makefile.inc
endif

ifeq ($(ENABLE_CORTEXR), 1)
CFLAGS += -DENABLE_CORTEXR
SRC += cortexr.c
ifeq ($(ENABLE_CORTEXAR), 1)
CFLAGS += -DENABLE_CORTEXAR
SRC += cortexar.c
endif

ifneq ($(PC_HOSTED),1)
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/hosted/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SYS := $(shell $(CC) -dumpmachine)
CFLAGS += -DENABLE_DEBUG -DPLATFORM_HAS_DEBUG
CFLAGS +=-I ./target

ENABLE_CORTEXR := 1
ENABLE_CORTEXAR := 1

# Clang requires some special handling here: -gnu means MinGW
# while -msvc means Clang/CL. We don't currently support the latter
Expand Down
4 changes: 2 additions & 2 deletions src/target/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ In summary, the following applies:
* JTAG physical reset is referred to by 'nTRST'
* Software reset as in the case of JTAG-PDI is referred to by 'SRST' if shortened.

The upshot of this is that to inhibit physical reset in the ARM ADIv5/Cortex-M code, set
`CORTEXM_TOPT_INHIBIT_NRST`, which refers to inhibiting the ADIv5 spec 'SRST'.
The upshot of this is that to inhibit physical reset in the ARM ADIv5/Cortex code, set
`CORTEX_TOPT_INHIBIT_NRST`, which refers to inhibiting the ADIv5 spec 'SRST'.

## Multiple-inclusion guarding

Expand Down
2 changes: 2 additions & 0 deletions src/target/cortex.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
#define CORTEXM_GENERAL_REG_COUNT 20U
#define CORTEXAR_GENERAL_REG_COUNT 17U

#define CORTEX_TOPT_INHIBIT_NRST (1U << 0U)

adiv5_access_port_s *cortex_ap(target_s *target);

#endif /* TARGET_CORTEX_H */
Loading