Skip to content

Commit

Permalink
target-xtensa: refactor standard core configuration
Browse files Browse the repository at this point in the history
Coalesce all standard configuration sections into single
DEFAULT_SECTIONS macro for all cores. This allows to add new features in
a single place: overlay_tool.h

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed Feb 24, 2014
1 parent 2c09eee commit 676056d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
8 changes: 1 addition & 7 deletions target-xtensa/core-dc232b.c
Expand Up @@ -35,21 +35,15 @@

static const XtensaConfig dc232b = {
.name = "dc232b",
.options = XTENSA_OPTIONS,
.gdb_regmap = {
.num_regs = 120,
.num_core_regs = 52,
.reg = {
#include "core-dc232b/gdb-config.c"
}
},
.nareg = XCHAL_NUM_AREGS,
.ndepc = 1,
EXCEPTIONS_SECTION,
INTERRUPTS_SECTION,
TLB_SECTION,
DEBUG_SECTION,
.clock_freq_khz = 10000,
DEFAULT_SECTIONS
};

REGISTER_CORE(dc232b)
8 changes: 1 addition & 7 deletions target-xtensa/core-dc233c.c
Expand Up @@ -36,21 +36,15 @@

static const XtensaConfig dc233c = {
.name = "dc233c",
.options = XTENSA_OPTIONS,
.gdb_regmap = {
.num_regs = 121,
.num_core_regs = 52,
.reg = {
#include "core-dc233c/gdb-config.c"
}
},
.nareg = XCHAL_NUM_AREGS,
.ndepc = 1,
EXCEPTIONS_SECTION,
INTERRUPTS_SECTION,
TLB_SECTION,
DEBUG_SECTION,
.clock_freq_khz = 10000,
DEFAULT_SECTIONS
};

REGISTER_CORE(dc233c)
8 changes: 1 addition & 7 deletions target-xtensa/core-fsf.c
Expand Up @@ -35,15 +35,9 @@

static const XtensaConfig fsf = {
.name = "fsf",
.options = XTENSA_OPTIONS,
/* GDB for this core is not supported currently */
.nareg = XCHAL_NUM_AREGS,
.ndepc = 1,
EXCEPTIONS_SECTION,
INTERRUPTS_SECTION,
TLB_SECTION,
DEBUG_SECTION,
.clock_freq_khz = 10000,
DEFAULT_SECTIONS
};

REGISTER_CORE(fsf)
10 changes: 10 additions & 0 deletions target-xtensa/overlay_tool.h
Expand Up @@ -319,6 +319,16 @@
.nibreak = XCHAL_NUM_IBREAK, \
.ndbreak = XCHAL_NUM_DBREAK

#define DEFAULT_SECTIONS \
.options = XTENSA_OPTIONS, \
.nareg = XCHAL_NUM_AREGS, \
.ndepc = (XCHAL_XEA_VERSION >= 2), \
EXCEPTIONS_SECTION, \
INTERRUPTS_SECTION, \
TLB_SECTION, \
DEBUG_SECTION


#if XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI + 1 <= 2
#define XCHAL_INTLEVEL2_VECTOR_VADDR 0
#endif
Expand Down

0 comments on commit 676056d

Please sign in to comment.