* [Qemu-devel] [PATCH 0/2] target-xtensa: refactor core configuration, add HW config ID
@ 2014-02-15 17:30 Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 1/2] target-xtensa: refactor standard core configuration Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 2/2] target-xtensa: provide HW confg ID registers Max Filippov
0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2014-02-15 17:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov
Hello,
this series collapses standard core configuration statements into a single
macro and adds support for two new special registers.
Max Filippov (2):
target-xtensa: refactor standard core configuration
target-xtensa: provide HW confg ID registers
target-xtensa/core-dc232b.c | 8 +-------
target-xtensa/core-dc233c.c | 8 +-------
target-xtensa/core-fsf.c | 8 +-------
target-xtensa/cpu.c | 2 ++
target-xtensa/cpu.h | 4 ++++
target-xtensa/overlay_tool.h | 17 +++++++++++++++++
target-xtensa/translate.c | 9 +++++++--
7 files changed, 33 insertions(+), 23 deletions(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 1/2] target-xtensa: refactor standard core configuration
2014-02-15 17:30 [Qemu-devel] [PATCH 0/2] target-xtensa: refactor core configuration, add HW config ID Max Filippov
@ 2014-02-15 17:30 ` Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 2/2] target-xtensa: provide HW confg ID registers Max Filippov
1 sibling, 0 replies; 3+ messages in thread
From: Max Filippov @ 2014-02-15 17:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov
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>
---
target-xtensa/core-dc232b.c | 8 +-------
target-xtensa/core-dc233c.c | 8 +-------
target-xtensa/core-fsf.c | 8 +-------
target-xtensa/overlay_tool.h | 10 ++++++++++
4 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/target-xtensa/core-dc232b.c b/target-xtensa/core-dc232b.c
index 0bfcf24..c51e11e 100644
--- a/target-xtensa/core-dc232b.c
+++ b/target-xtensa/core-dc232b.c
@@ -35,7 +35,6 @@
static const XtensaConfig dc232b = {
.name = "dc232b",
- .options = XTENSA_OPTIONS,
.gdb_regmap = {
.num_regs = 120,
.num_core_regs = 52,
@@ -43,13 +42,8 @@ static const XtensaConfig dc232b = {
#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)
diff --git a/target-xtensa/core-dc233c.c b/target-xtensa/core-dc233c.c
index 738d543..42dd64f 100644
--- a/target-xtensa/core-dc233c.c
+++ b/target-xtensa/core-dc233c.c
@@ -36,7 +36,6 @@
static const XtensaConfig dc233c = {
.name = "dc233c",
- .options = XTENSA_OPTIONS,
.gdb_regmap = {
.num_regs = 121,
.num_core_regs = 52,
@@ -44,13 +43,8 @@ static const XtensaConfig dc233c = {
#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)
diff --git a/target-xtensa/core-fsf.c b/target-xtensa/core-fsf.c
index d4660ed..6859bee 100644
--- a/target-xtensa/core-fsf.c
+++ b/target-xtensa/core-fsf.c
@@ -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)
diff --git a/target-xtensa/overlay_tool.h b/target-xtensa/overlay_tool.h
index 2b4443d..25b7970 100644
--- a/target-xtensa/overlay_tool.h
+++ b/target-xtensa/overlay_tool.h
@@ -320,6 +320,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
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-xtensa: provide HW confg ID registers
2014-02-15 17:30 [Qemu-devel] [PATCH 0/2] target-xtensa: refactor core configuration, add HW config ID Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 1/2] target-xtensa: refactor standard core configuration Max Filippov
@ 2014-02-15 17:30 ` Max Filippov
1 sibling, 0 replies; 3+ messages in thread
From: Max Filippov @ 2014-02-15 17:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
target-xtensa/cpu.c | 2 ++
target-xtensa/cpu.h | 4 ++++
target-xtensa/overlay_tool.h | 9 ++++++++-
target-xtensa/translate.c | 9 +++++++--
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c
index 66a0c8a..16f01de 100644
--- a/target-xtensa/cpu.c
+++ b/target-xtensa/cpu.c
@@ -59,6 +59,8 @@ static void xtensa_cpu_reset(CPUState *s)
env->sregs[CACHEATTR] = 0x22222222;
env->sregs[ATOMCTL] = xtensa_option_enabled(env->config,
XTENSA_OPTION_ATOMCTL) ? 0x28 : 0x15;
+ env->sregs[CONFIGID0] = env->config->configid[0];
+ env->sregs[CONFIGID1] = env->config->configid[1];
env->pending_irq_level = 0;
reset_mmu(env);
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index afdb340..9c5a55b 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -135,9 +135,11 @@ enum {
IBREAKA = 128,
DBREAKA = 144,
DBREAKC = 160,
+ CONFIGID0 = 176,
EPC1 = 177,
DEPC = 192,
EPS2 = 194,
+ CONFIGID1 = 208,
EXCSAVE1 = 209,
CPENABLE = 224,
INTSET = 226,
@@ -322,6 +324,8 @@ typedef struct XtensaConfig {
unsigned nibreak;
unsigned ndbreak;
+ uint32_t configid[2];
+
uint32_t clock_freq_khz;
xtensa_tlb itlb;
diff --git a/target-xtensa/overlay_tool.h b/target-xtensa/overlay_tool.h
index 25b7970..5a1353e 100644
--- a/target-xtensa/overlay_tool.h
+++ b/target-xtensa/overlay_tool.h
@@ -320,6 +320,12 @@
.nibreak = XCHAL_NUM_IBREAK, \
.ndbreak = XCHAL_NUM_DBREAK
+#define CONFIG_SECTION \
+ .configid = { \
+ XCHAL_HW_CONFIGID0, \
+ XCHAL_HW_CONFIGID1, \
+ }
+
#define DEFAULT_SECTIONS \
.options = XTENSA_OPTIONS, \
.nareg = XCHAL_NUM_AREGS, \
@@ -327,7 +333,8 @@
EXCEPTIONS_SECTION, \
INTERRUPTS_SECTION, \
TLB_SECTION, \
- DEBUG_SECTION
+ DEBUG_SECTION, \
+ CONFIG_SECTION
#if XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI + 1 <= 2
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 6061968..22c0735 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -98,12 +98,15 @@ typedef struct XtensaReg {
#define XTENSA_REG(regname, opt) XTENSA_REG_ACCESS(regname, opt, SR_RWX)
-#define XTENSA_REG_BITS(regname, opt) { \
+#define XTENSA_REG_BITS_ACCESS(regname, opt, acc) { \
.name = (regname), \
.opt_bits = (opt), \
- .access = SR_RWX, \
+ .access = (acc), \
}
+#define XTENSA_REG_BITS(regname, opt) \
+ XTENSA_REG_BITS_ACCESS(regname, opt, SR_RWX)
+
static const XtensaReg sregnames[256] = {
[LBEG] = XTENSA_REG("LBEG", XTENSA_OPTION_LOOP),
[LEND] = XTENSA_REG("LEND", XTENSA_OPTION_LOOP),
@@ -134,6 +137,7 @@ static const XtensaReg sregnames[256] = {
[DBREAKA + 1] = XTENSA_REG("DBREAKA1", XTENSA_OPTION_DEBUG),
[DBREAKC] = XTENSA_REG("DBREAKC0", XTENSA_OPTION_DEBUG),
[DBREAKC + 1] = XTENSA_REG("DBREAKC1", XTENSA_OPTION_DEBUG),
+ [CONFIGID0] = XTENSA_REG_BITS_ACCESS("CONFIGID0", XTENSA_OPTION_ALL, SR_R),
[EPC1] = XTENSA_REG("EPC1", XTENSA_OPTION_EXCEPTION),
[EPC1 + 1] = XTENSA_REG("EPC2", XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
[EPC1 + 2] = XTENSA_REG("EPC3", XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
@@ -148,6 +152,7 @@ static const XtensaReg sregnames[256] = {
[EPS2 + 3] = XTENSA_REG("EPS5", XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
[EPS2 + 4] = XTENSA_REG("EPS6", XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
[EPS2 + 5] = XTENSA_REG("EPS7", XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
+ [CONFIGID1] = XTENSA_REG_BITS_ACCESS("CONFIGID1", XTENSA_OPTION_ALL, SR_R),
[EXCSAVE1] = XTENSA_REG("EXCSAVE1", XTENSA_OPTION_EXCEPTION),
[EXCSAVE1 + 1] = XTENSA_REG("EXCSAVE2",
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT),
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-15 17:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-15 17:30 [Qemu-devel] [PATCH 0/2] target-xtensa: refactor core configuration, add HW config ID Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 1/2] target-xtensa: refactor standard core configuration Max Filippov
2014-02-15 17:30 ` [Qemu-devel] [PATCH 2/2] target-xtensa: provide HW confg ID registers Max Filippov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).