LatticeMico32 target
v3 cover LatticeMico32 target
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots of CODING_STYLE fixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead of qemu_register_reset()
- add missing include guards
- merged lm32_pic_cpu.c into boards file
- removed buggy qemu_irq_lower() in reset functions
- converted hw_error to error_report()
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing ones
PATCH v3 1/17 LatticeMico32 target support
This patch adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
--- Makefile.target | 2 + arch_init.c | 2 + arch_init.h | 13 ++-- cpu-exec.c | 13 +++- elf.h | 1 + poison.h | 1 + target-lm32/cpu.h | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++++ target-lm32/exec.h | 50 +++++++++++ 8 files changed, 319 insertions(+), 7 deletions(-) create mode 100644 target-lm32/cpu.h create mode 100644 target-lm32/exec.h
Makefile.target +2 -0
@@ -247,6 +247,8 @@ obj-ppc-y += xilinx_timer.o obj-ppc-y += xilinx_uartlite.o obj-ppc-y += xilinx_ethlite.o +# LM32 peripherals + obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o obj-mips-y += vga.o i8259.o
arch_init.c +2 -0
@@ -64,6 +64,8 @@ const char arch_config_name[] = CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".con#define QEMU_ARCH QEMU_ARCH_I386#elif defined(TARGET_M68K )#define QEMU_ARCH QEMU_ARCH_M68K +#elif defined(TARGET_LM32 ) +#define QEMU_ARCH QEMU_ARCH_LM32#elif defined(TARGET_MICROBLAZE )#define QEMU_ARCH QEMU_ARCH_MICROBLAZE#elif defined(TARGET_MIPS )
arch_init.h +7 -6
@@ -10,12 +10,13 @@ enum {QEMU_ARCH_CRIS =4 ,QEMU_ARCH_I386 =8 ,QEMU_ARCH_M68K =16 , -QEMU_ARCH_MICROBLAZE =32 , -QEMU_ARCH_MIPS =64 , -QEMU_ARCH_PPC =128 , -QEMU_ARCH_S390X =256 , -QEMU_ARCH_SH4 =512 , - QEMU_ARCH_SPARC = 1024, +QEMU_ARCH_LM32 =32 , +QEMU_ARCH_MICROBLAZE =64 , +QEMU_ARCH_MIPS =128 , +QEMU_ARCH_PPC =256 , +QEMU_ARCH_S390X =512 , +QEMU_ARCH_SH4 =1024 , + QEMU_ARCH_SPARC = 2048, };extern const uint32_t arch_type;
cpu-exec.c +12 -1
@@ -239,6 +239,7 @@ int cpu_exec(CPUState *env1)#elif defined(TARGET_ALPHA )#elif defined(TARGET_ARM )#elif defined(TARGET_PPC ) +#elif defined(TARGET_LM32 )#elif defined(TARGET_MICROBLAZE )#elif defined(TARGET_MIPS )#elif defined(TARGET_SH4 )
@@ -292,6 +293,8 @@ int cpu_exec(CPUState *env1) env->old_exception =-1 ;#elif defined(TARGET_PPC )do_interrupt (env); +#elif defined(TARGET_LM32 ) +do_interrupt (env);#elif defined(TARGET_MICROBLAZE )do_interrupt (env);#elif defined(TARGET_MIPS )
@@ -332,7 +335,7 @@ int cpu_exec(CPUState *env1) }#if defined(TARGET_ARM ) || defined(TARGET_SPARC ) || defined(TARGET_MIPS ) || \ defined(TARGET_PPC ) || defined(TARGET_ALPHA ) || defined(TARGET_CRIS ) || \ - defined(TARGET_MICROBLAZE ) + defined(TARGET_MICROBLAZE ) || defined(TARGET_LM32 )if (interrupt_request &CPU_INTERRUPT_HALT ) { env->interrupt_request &= ~CPU_INTERRUPT_HALT ; env->halted =1 ;
@@ -412,6 +415,13 @@ int cpu_exec(CPUState *env1) env->interrupt_request &= ~CPU_INTERRUPT_HARD ; next_tb =0 ; } +#elif defined(TARGET_LM32 ) +if ((interrupt_request &CPU_INTERRUPT_HARD ) + && (env->ie &IE_IE )) { + env->exception_index =EXCP_IRQ ; +do_interrupt (env); + next_tb =0 ; + }#elif defined(TARGET_MICROBLAZE )if ((interrupt_request &CPU_INTERRUPT_HARD ) && (env->sregs[SR_MSR] & MSR_IE)
@@ -624,6 +634,7 @@ int cpu_exec(CPUState *env1)/* XXX: Save/restore host fpu exception state?. */ #elif defined(TARGET_SPARC )#elif defined(TARGET_PPC ) +#elif defined(TARGET_LM32 )#elif defined(TARGET_M68K )cpu_m68k_flush_flags (env, env->cc_op); env->cc_op =CC_OP_FLAGS ;
elf.h +1 -0
@@ -104,6 +104,7 @@ typedef int64_t Elf64_Sxword;#define EM_H8_300H 47/* Hitachi H8/300H */ #define EM_H8S 48/* Hitachi H8S */ +#define EM_LATTICEMICO32 138/* LatticeMico32 */ /* * This is an interim value that we will use until the committee comes
poison.h +1 -0
@@ -10,6 +10,7 @@#pragma GCC poison TARGET_ALPHA#pragma GCC poison TARGET_ARM#pragma GCC poison TARGET_CRIS +#pragma GCC poison TARGET_LM32#pragma GCC poison TARGET_M68K#pragma GCC poison TARGET_MIPS#pragma GCC poison TARGET_MIPS64
target-lm32/cpu.h new file +244 -0
244 lines not on this page · raw message
target-lm32/exec.h new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v3 2/17 lm32: translation routines
In reply to Michael WalleThis patch adds the main translation routine. All opcodes of the LatticeMico32 processor are supported and translated to TCG ops.
--- target-lm32/helper.c | 259 +++++++++ target-lm32/lm32-decode.h | 78 +++ target-lm32/translate.c | 1317 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1654 insertions(+), 0 deletions(-) create mode 100644 target-lm32/helper.c create mode 100644 target-lm32/lm32-decode.h create mode 100644 target-lm32/translate.c
target-lm32/helper.c new file +259 -0
@@ -0,0 +1,259 @@ +/* +* LatticeMico32 helper routines. +* +* Copyright (c) 2010 Michael Walle <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/>. +*/ + +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#include "config.h" +#include "cpu.h" +#include "exec-all.h" +#include "host-utils.h" + +int cpu_lm32_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu) +{ +int prot; + + address &=TARGET_PAGE_MASK ; + prot =PAGE_BITS ; +if (env->flags &LM32_FLAG_IGNORE_MSB ) { +tlb_set_page (env, address, address &0x7fffffff , prot, mmu_idx, +TARGET_PAGE_SIZE ); + }else { +tlb_set_page (env, address, address, prot, mmu_idx,TARGET_PAGE_SIZE ); + } + +return 0 ; +} + +target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +{ +return addr &TARGET_PAGE_MASK ; +} + +void do_interrupt (CPUState *env) +{ +qemu_log_mask (CPU_LOG_INT , +"exception at pc=%x type=%x\n" , env->pc, env->exception_index); + +switch (env->exception_index) { +case EXCP_INSN_BUS_ERROR : +case EXCP_DATA_BUS_ERROR : +case EXCP_DIVIDE_BY_ZERO : +case EXCP_IRQ : +case EXCP_SYSTEMCALL : +/* non-debug exceptions */ + env->regs[R_EA ] = env->pc; + env->ie |= (env->ie &IE_IE ) ?IE_EIE :0 ; + env->ie &= ~IE_IE ; +if (env->dc &DC_RE ) { + env->pc = env->deba + (env->exception_index *32 ); + }else { + env->pc = env->eba + (env->exception_index *32 ); + } +log_cpu_state_mask (CPU_LOG_INT , env,0 ); +break ; +case EXCP_BREAKPOINT : +case EXCP_WATCHPOINT : +/* debug exceptions */ + env->regs[R_BA ] = env->pc; + env->ie |= (env->ie &IE_IE ) ?IE_BIE :0 ; + env->ie &= ~IE_IE ; +if (env->dc &DC_RE ) { + env->pc = env->deba + (env->exception_index *32 ); + }else { + env->pc = env->eba + (env->exception_index *32 ); + } +log_cpu_state_mask (CPU_LOG_INT , env,0 ); +break ; +default : +cpu_abort (env,"unhandled exception type=%d\n" , + env->exception_index); +break ; + } +} + +typedef struct { +const char *name; +uint32_t revision; +uint8_t num_interrupts; +uint8_t num_breakpoints; +uint8_t num_watchpoints; +uint32_t features; +}LM32Def ; + +static const LM32Def lm32_defs[] = { + { + .name ="lm32-basic" , + .revision =3 , + .num_interrupts =32 , + .num_breakpoints =4 , + .num_watchpoints =4 , + .features = (LM32_FEATURE_SHIFT + |LM32_FEATURE_SIGN_EXTEND + |LM32_FEATURE_CYCLE_COUNT ), + }, + { + .name ="lm32-standard" , + .revision =3 , + .num_interrupts =32 , + .num_breakpoints =4 , + .num_watchpoints =4 , + .features = (LM32_FEATURE_MULTIPLY + |LM32_FEATURE_DIVIDE + |LM32_FEATURE_SHIFT + |LM32_FEATURE_SIGN_EXTEND + |LM32_FEATURE_I_CACHE + |LM32_FEATURE_CYCLE_COUNT ), + }, + { + .name ="lm32-full" , + .revision =3 , + .num_interrupts =32 , + .num_breakpoints =4 , + .num_watchpoints =4 , + .features = (LM32_FEATURE_MULTIPLY + |LM32_FEATURE_DIVIDE + |LM32_FEATURE_SHIFT + |LM32_FEATURE_SIGN_EXTEND + |LM32_FEATURE_I_CACHE + |LM32_FEATURE_D_CACHE + |LM32_FEATURE_CYCLE_COUNT ), + } +}; + +void cpu_lm32_list (FILE *f,fprintf_function cpu_fprintf) +{ +int i; + +cpu_fprintf (f,"Available CPUs:\n" ); +for (i =0 ; i <ARRAY_SIZE (lm32_defs); i++) { +cpu_fprintf (f," %s\n" , lm32_defs[i].name); + } +} + +static const LM32Def *cpu_lm32_find_by_name (const char *name) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lm32_defs); i++) { +if (strcasecmp (name, lm32_defs[i].name) ==0 ) { +return &lm32_defs[i]; + } + } + +return NULL ; +} + +static uint32_t cfg_by_def (const LM32Def *def) +{ +uint32_t cfg =0 ; + +if (def->features &LM32_FEATURE_MULTIPLY ) { + cfg |=CFG_M ; + } + +if (def->features &LM32_FEATURE_DIVIDE ) { + cfg |=CFG_D ; + } + +if (def->features &LM32_FEATURE_SHIFT ) { + cfg |=CFG_S ; + } + +if (def->features &LM32_FEATURE_SIGN_EXTEND ) { + cfg |=CFG_X ; + } + +if (def->features &LM32_FEATURE_I_CACHE ) { + cfg |=CFG_IC ; + } + +if (def->features &LM32_FEATURE_D_CACHE ) { + cfg |=CFG_DC ; + } + +if (def->features &LM32_FEATURE_CYCLE_COUNT ) { + cfg |=CFG_CC ; + } + + cfg |= (def->num_interrupts <<CFG_INT_SHIFT ); + cfg |= (def->num_breakpoints <<CFG_BP_SHIFT ); + cfg |= (def->num_watchpoints <<CFG_WP_SHIFT ); + cfg |= (def->revision <<CFG_REV_SHIFT ); + +return cfg; +} + +CPUState *cpu_lm32_init (const char *cpu_model) +{ +CPUState *env; +const LM32Def *def; +static int tcg_initialized; + + def =cpu_lm32_find_by_name (cpu_model); +if (!def) { +return NULL ; + } + + env =qemu_mallocz (sizeof (CPUState)); + + env->features = def->features; + env->num_bps = def->num_breakpoints; + env->num_wps = def->num_watchpoints; + env->cfg =cfg_by_def (def); + env->flags =0 ; + +cpu_exec_init (env); +cpu_reset (env); + +if (!tcg_initialized) { + tcg_initialized =1 ; +lm32_translate_init (); + } + +return env; +} + +/* Some soc ignores the MSB on the address bus. Thus creating a shadow memory +* area. As a general rule, 0x00000000-0x7fffffff is cached, whereas +* 0x80000000-0xffffffff is not cached and used to access IO devices. */ +void cpu_lm32_set_phys_msb_ignore (CPUState *env,int value) +{ +if (value) { + env->flags |=LM32_FLAG_IGNORE_MSB ; + }else { + env->flags &= ~LM32_FLAG_IGNORE_MSB ; + } +} + +void cpu_reset (CPUState *env) +{ +if (qemu_loglevel_mask (CPU_LOG_RESET )) { +qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index); +log_cpu_state (env,0 ); + } + +tlb_flush (env,1 ); + +/* reset cpu state */ +memset (env,0 , offsetof(CPULM32State , breakpoints)); +} +
target-lm32/lm32-decode.h new file +78 -0
78 lines not on this page · raw message
target-lm32/translate.c new file +1317 -0
1,317 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v3 3/17 lm32: translation code helper
In reply to Michael WalleThis patch adds translation helper functions.
--- target-lm32/helper.h | 14 ++++++ target-lm32/op_helper.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 target-lm32/helper.h create mode 100644 target-lm32/op_helper.c
target-lm32/helper.h new file +14 -0
@@ -0,0 +1,14 @@ +#include "def-helper.h" + +DEF_HELPER_1(raise_exception, void, i32) +DEF_HELPER_0(hlt, void) +DEF_HELPER_1(wcsr_im, void, i32) +DEF_HELPER_1(wcsr_ip, void, i32) +DEF_HELPER_1(wcsr_jtx, void, i32) +DEF_HELPER_1(wcsr_jrx, void, i32) +DEF_HELPER_0(rcsr_im, i32) +DEF_HELPER_0(rcsr_ip, i32) +DEF_HELPER_0(rcsr_jtx, i32) +DEF_HELPER_0(rcsr_jrx, i32) + +#include "def-helper.h"
target-lm32/op_helper.c new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v3 4/17 lm32: machine state loading/saving
In reply to Michael WalleThis patch adds support for saving and loading the processor state.
--- target-lm32/machine.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 target-lm32/machine.c
target-lm32/machine.c new file +33 -0
@@ -0,0 +1,33 @@ +#include "hw/hw.h" +#include "hw/boards.h" + +static const VMStateDescription vmstate_cpu = { + .name ="cpu" , + .version_id =CPU_SAVE_VERSION , + .minimum_version_id =1 , + .minimum_version_id_old =1 , + .fields = (VMStateField []) { +VMSTATE_UINT32_ARRAY (regs, CPUState,32 ), +VMSTATE_UINT32 (pc, CPUState), +VMSTATE_UINT32 (ie, CPUState), +VMSTATE_UINT32 (icc, CPUState), +VMSTATE_UINT32 (dcc, CPUState), +VMSTATE_UINT32 (cc, CPUState), +VMSTATE_UINT32 (eba, CPUState), +VMSTATE_UINT32 (dc, CPUState), +VMSTATE_UINT32 (deba, CPUState), +VMSTATE_UINT32_ARRAY (bp, CPUState,4 ), +VMSTATE_UINT32_ARRAY (wp, CPUState,4 ), +VMSTATE_END_OF_LIST () + } +}; + +void cpu_save (QEMUFile *f,void *opaque) +{ +vmstate_save_state (f, &vmstate_cpu, opaque); +} + +int cpu_load (QEMUFile *f,void *opaque,int version_id) +{ +return vmstate_load_state (f, &vmstate_cpu, opaque, version_id); +}
Signature · 1 line
1.7.2.3
PATCH v3 5/17 lm32: gdbstub support
In reply to Michael WalleThis patch adds lm32 support to the gdbstub.
--- gdbstub.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 0 deletions(-)
gdbstub.c +76 -0
@@ -1462,6 +1462,80 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)return r; } +#elif defined (TARGET_LM32 ) + +#include "hw/lm32_pic.h" +#define NUM_CORE_REGS (32 + 7) + +static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +{ +if (n <32 ) { +GET_REG32 (env->regs[n]); + }else { +switch (n) { +case 32 : +GET_REG32 (env->pc); +break ; +/* FIXME: put in right exception ID */ +case 33 : +GET_REG32 (0 ); +break ; +case 34 : +GET_REG32 (env->eba); +break ; +case 35 : +GET_REG32 (env->deba); +break ; +case 36 : +GET_REG32 (env->ie); +break ; +case 37 : +GET_REG32 (lm32_pic_get_im (env->pic_state)); +break ; +case 38 : +GET_REG32 (lm32_pic_get_ip (env->pic_state)); +break ; + } + } +return 0 ; +} + +static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +{ +uint32_t tmp; + +if (n >NUM_CORE_REGS ) { +return 0 ; + } + + tmp =ldl_p (mem_buf); + +if (n <32 ) { + env->regs[n] = tmp; + }else { +switch (n) { +case 32 : + env->pc = tmp; +break ; +case 34 : + env->eba = tmp; +break ; +case 35 : + env->deba = tmp; +break ; +case 36 : + env->ie = tmp; +break ; +case 37 : +lm32_pic_set_im (env->pic_state, tmp); +break ; +case 38 : +lm32_pic_set_ip (env->pic_state, tmp); +break ; + } + } +return 4 ; +}#else #define NUM_CORE_REGS 0
@@ -1737,6 +1811,8 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)#elif defined (TARGET_S390X )cpu_synchronize_state (s->c_cpu); s->c_cpu->psw.addr = pc; +#elif defined (TARGET_LM32 ) + s->c_cpu->pc = pc;#endif }
Signature · 1 line
1.7.2.3
PATCH v3 6/17 lm32: interrupt controller model
In reply to Michael WalleThis patch adds the interrupt controller of the lm32. Because the PIC is accessed through special control registers and opcodes, there are callbacks from the lm32 translation code to this model.
--- Makefile.target | 1 + hw/lm32_pic.c | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/lm32_pic.h | 11 +++ trace-events | 9 +++ 4 files changed, 211 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_pic.c create mode 100644 hw/lm32_pic.h
Makefile.target +1 -0
@@ -248,6 +248,7 @@ obj-ppc-y += xilinx_uartlite.o obj-ppc-y += xilinx_ethlite.o # LM32 peripherals +obj-lm32-y += lm32_pic.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o
hw/lm32_pic.c new file +190 -0
190 lines not on this page · raw message
hw/lm32_pic.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef QEMU_HW_LM32_PIC_H +#define QEMU_HW_LM32_PIC_H + +#include "qemu-common.h" + +uint32_t lm32_pic_get_ip (DeviceState *d); +uint32_t lm32_pic_get_im (DeviceState *d); +void lm32_pic_set_ip (DeviceState *d,uint32_t ip); +void lm32_pic_set_im (DeviceState *d,uint32_t im); + +#endif /* QEMU_HW_LM32_PIC_H */
trace-events +9 -0
@@ -254,3 +254,12 @@ disable spice_vmc_write(ssize_t out, int len) "spice wrottn %lu of requested %zd disable spice_vmc_read(int bytes, int len) "spice read %lu of requested %zd" disable spice_vmc_register_interface(void *scd) "spice vmc registered interface %p" disable spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p" + +# hw/lm32_pic.c +disable lm32_pic_raise_irq(void) "Raise CPU interrupt" +disable lm32_pic_lower_irq(void) "Lower CPU interrupt" +disable lm32_pic_interrupt(int irq, int level) "Set IRQ%d %d" +disable lm32_pic_set_im(uint32_t im) "im 0x%08x" +disable lm32_pic_set_ip(uint32_t ip) "ip 0x%08x" +disable lm32_pic_get_im(uint32_t im) "im 0x%08x" +disable lm32_pic_get_ip(uint32_t ip) "ip 0x%08x"
Signature · 1 line
1.7.2.3
PATCH v3 7/17 lm32: juart model
In reply to Michael WalleThis patch adds the JTAG UART model. It is accessed through special control registers and opcodes. Therefore the translation uses callbacks to this model.
--- Makefile.target | 1 + hw/lm32_juart.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/lm32_juart.h | 11 ++++ trace-events | 6 ++ 4 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_juart.c create mode 100644 hw/lm32_juart.h
Makefile.target +1 -0
@@ -249,6 +249,7 @@ obj-ppc-y += xilinx_ethlite.o # LM32 peripherals obj-lm32-y += lm32_pic.o +obj-lm32-y += lm32_juart.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o
hw/lm32_juart.c new file +150 -0
150 lines not on this page · raw message
hw/lm32_juart.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef QEMU_HW_LM32_JUART_H +#define QEMU_HW_LM32_JUART_H + +#include "qemu-common.h" + +uint32_t lm32_juart_get_jtx (DeviceState *d); +uint32_t lm32_juart_get_jrx (DeviceState *d); +void lm32_juart_set_jtx (DeviceState *d,uint32_t jtx); +void lm32_juart_set_jrx (DeviceState *d,uint32_t jrx); + +#endif /* QEMU_HW_LM32_JUART_H */
trace-events +6 -0
@@ -263,3 +263,9 @@ disable lm32_pic_set_im(uint32_t im) "im 0x%08x" disable lm32_pic_set_ip(uint32_t ip) "ip 0x%08x" disable lm32_pic_get_im(uint32_t im) "im 0x%08x" disable lm32_pic_get_ip(uint32_t ip) "ip 0x%08x" + +# hw/lm32_juart.c +disable lm32_juart_get_jtx(uint32_t value) "jtx 0x%08x" +disable lm32_juart_set_jtx(uint32_t value) "jtx 0x%08x" +disable lm32_juart_get_jrx(uint32_t value) "jrx 0x%08x" +disable lm32_juart_set_jrx(uint32_t value) "jrx 0x%08x"
Signature · 1 line
1.7.2.3
PATCH v3 8/17 lm32: pic and juart helper functions
In reply to Michael WalleThis patch adds init functions for the PIC and JTAG UART commonly used in the board initialization.
--- hw/lm32.h | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) create mode 100644 hw/lm32.h
hw/lm32.h new file +25 -0
@@ -0,0 +1,25 @@ + +#include "qemu-common.h" + +static inline DeviceState *lm32_pic_init (qemu_irq cpu_irq) +{ +DeviceState *dev; +SysBusDevice *d; + + dev =qdev_create (NULL ,"lm32-pic" ); +qdev_init_nofail (dev); + d =sysbus_from_qdev (dev); +sysbus_connect_irq (d,0 , cpu_irq); + +return dev; +} + +static inline DeviceState *lm32_juart_init (void ) +{ +DeviceState *dev; + + dev =qdev_create (NULL ,"lm32-juart" ); +qdev_init_nofail (dev); + +return dev; +}
Signature · 1 line
1.7.2.3
PATCH v3 9/17 lm32: timer model
In reply to Michael WalleThis patch adds support for the LatticeMico32 system timer.
--- Makefile.target | 1 + hw/lm32_timer.c | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ trace-events | 6 ++ 3 files changed, 229 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_timer.c
Makefile.target +1 -0
@@ -250,6 +250,7 @@ obj-ppc-y += xilinx_ethlite.o # LM32 peripherals obj-lm32-y += lm32_pic.o obj-lm32-y += lm32_juart.o +obj-lm32-y += lm32_timer.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o
hw/lm32_timer.c new file +222 -0
222 lines not on this page · raw message
trace-events +6 -0
@@ -269,3 +269,9 @@ disable lm32_juart_get_jtx(uint32_t value) "jtx 0x%08x" disable lm32_juart_set_jtx(uint32_t value) "jtx 0x%08x" disable lm32_juart_get_jrx(uint32_t value) "jrx 0x%08x" disable lm32_juart_set_jrx(uint32_t value) "jrx 0x%08x" + +# hw/lm32_timer.c +disable lm32_timer_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +disable lm32_timer_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +disable lm32_timer_hit(void) "timer hit" +disable lm32_timer_irq_state(int level) "irq state %d"
Signature · 1 line
1.7.2.3
PATCH v3 10/17 lm32: uart model
In reply to Michael WalleThis patch add support for the LatticeMico32 UART.
--- Makefile.target | 1 + hw/lm32_uart.c | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ trace-events | 5 + 3 files changed, 294 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_uart.c
Makefile.target +1 -0
@@ -251,6 +251,7 @@ obj-ppc-y += xilinx_ethlite.o obj-lm32-y += lm32_pic.o obj-lm32-y += lm32_juart.o obj-lm32-y += lm32_timer.o +obj-lm32-y += lm32_uart.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o
hw/lm32_uart.c new file +288 -0
288 lines not on this page · raw message
trace-events +5 -0
@@ -275,3 +275,8 @@ disable lm32_timer_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x valu disable lm32_timer_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" disable lm32_timer_hit(void) "timer hit" disable lm32_timer_irq_state(int level) "irq state %d" + +# hw/lm32_uart.c +disable lm32_uart_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +disable lm32_uart_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" +disable lm32_uart_irq_state(int level) "irq state %d"
Signature · 1 line
1.7.2.3
PATCH v3 11/17 lm32: system control model
In reply to Michael WalleThis patch add support for a system control block. It is supposed to act as helper for the emulated program. E.g. shutting down the VM or printing test results. This model is intended for testing purposes only and doesn't fit to any real hardware. Therefore, it is not added to any board by default. Instead a user has to add it explicitly with the '-device' commandline parameter.
--- Makefile.target | 1 + hw/lm32_sys.c | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ trace-events | 3 + 3 files changed, 165 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_sys.c
Makefile.target +1 -0
@@ -252,6 +252,7 @@ obj-lm32-y += lm32_pic.o obj-lm32-y += lm32_juart.o obj-lm32-y += lm32_timer.o obj-lm32-y += lm32_uart.o +obj-lm32-y += lm32_sys.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o
hw/lm32_sys.c new file +161 -0
161 lines not on this page · raw message
trace-events +3 -0
@@ -280,3 +280,6 @@ disable lm32_timer_irq_state(int level) "irq state %d" disable lm32_uart_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" disable lm32_uart_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" disable lm32_uart_irq_state(int level) "irq state %d" + +# hw/lm32_sys.c +disable lm32_sys_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
Signature · 1 line
1.7.2.3
PATCH v3 12/17 lm32: support for creating device tree
In reply to Michael WalleThis patch adds helper functions to create a ROM, which contains a hardware description of a board. This is used in Theobromas LM32 Linux port.
--- hw/lm32_hwsetup.h | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 178 insertions(+), 0 deletions(-) create mode 100644 hw/lm32_hwsetup.h
hw/lm32_hwsetup.h new file +178 -0
@@ -0,0 +1,178 @@ +/* +* LatticeMico32 hwsetup helper functions. +* +* Copyright (c) 2010 Michael Walle <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/>. +*/ + +/* +* These are helper functions for creating the hardware description blob used +* in the Theobroma's uClinux port. +*/ + +#ifndef QEMU_HW_LM32_HWSETUP_H +#define QEMU_HW_LM32_HWSETUP_H + +#include "qemu-common.h" +#include "loader.h" + +typedef struct { +void *data; +void *ptr; +}HWSetup ; + +enum hwsetup_tag { +HWSETUP_TAG_EOL =0 , +HWSETUP_TAG_CPU =1 , +HWSETUP_TAG_ASRAM =2 , +HWSETUP_TAG_FLASH =3 , +HWSETUP_TAG_SDRAM =4 , +HWSETUP_TAG_OCM =5 , +HWSETUP_TAG_DDR_SDRAM =6 , +HWSETUP_TAG_DDR2_SDRAM =7 , +HWSETUP_TAG_TIMER =8 , +HWSETUP_TAG_UART =9 , +HWSETUP_TAG_GPIO =10 , +HWSETUP_TAG_TRISPEEDMAC =11 , +HWSETUP_TAG_I2CM =12 , +HWSETUP_TAG_LEDS =13 , +HWSETUP_TAG_7SEG =14 , +HWSETUP_TAG_SPI_S =15 , +HWSETUP_TAG_SPI_M =16 , +}; + +static inline HWSetup *hwsetup_init (void ) +{ +HWSetup *hw; + + hw =qemu_malloc (sizeof (HWSetup)); + hw->data =qemu_mallocz (TARGET_PAGE_SIZE ); + hw->ptr = hw->data; + +return hw; +} + +static inline void hwsetup_free (HWSetup *hw) +{ +qemu_free (hw->data); +qemu_free (hw); +} + +static inline void hwsetup_create_rom (HWSetup *hw, +target_phys_addr_t base) +{ +rom_add_blob ("hwsetup" , hw->data,TARGET_PAGE_SIZE , base); +} + +static inline void hwsetup_add_u8 (HWSetup *hw,uint8_t u) +{ +stb_p (hw->ptr, u); + hw->ptr +=1 ; +} + +static inline void hwsetup_add_u32 (HWSetup *hw,uint32_t u) +{ +stl_p (hw->ptr, u); + hw->ptr +=4 ; +} + +static inline void hwsetup_add_tag (HWSetup *hw,enum hwsetup_tag t) +{ +stl_p (hw->ptr, t); + hw->ptr +=4 ; +} + +static inline void hwsetup_add_str (HWSetup *hw,const char *str) +{ +strncpy (hw->ptr, str,31 );/* make sure last byte is zero */ + hw->ptr +=32 ; +} + +static inline void hwsetup_add_trailer (HWSetup *hw) +{ +hwsetup_add_u32 (hw,8 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_EOL ); +} + +static inline void hwsetup_add_cpu (HWSetup *hw, +const char *name,uint32_t frequency) +{ +hwsetup_add_u32 (hw,44 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_CPU ); +hwsetup_add_str (hw, name); +hwsetup_add_u32 (hw, frequency); +} + +static inline void hwsetup_add_flash (HWSetup *hw, +const char *name,uint32_t base,uint32_t size) +{ +hwsetup_add_u32 (hw,52 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_FLASH ); +hwsetup_add_str (hw, name); +hwsetup_add_u32 (hw, base); +hwsetup_add_u32 (hw, size); +hwsetup_add_u8 (hw,8 );/* read latency */ +hwsetup_add_u8 (hw,8 );/* write latency */ +hwsetup_add_u8 (hw,25 );/* address width */ +hwsetup_add_u8 (hw,32 );/* data width */ +} + +static inline void hwsetup_add_ddr_sdram (HWSetup *hw, +const char *name,uint32_t base,uint32_t size) +{ +hwsetup_add_u32 (hw,48 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_DDR_SDRAM ); +hwsetup_add_str (hw, name); +hwsetup_add_u32 (hw, base); +hwsetup_add_u32 (hw, size); +} + +static inline void hwsetup_add_timer (HWSetup *hw, +const char *name,uint32_t base,uint32_t irq) +{ +hwsetup_add_u32 (hw,56 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_TIMER ); +hwsetup_add_str (hw, name); +hwsetup_add_u32 (hw, base); +hwsetup_add_u8 (hw,1 );/* wr_tickcount */ +hwsetup_add_u8 (hw,1 );/* rd_tickcount */ +hwsetup_add_u8 (hw,1 );/* start_stop_control */ +hwsetup_add_u8 (hw,32 );/* counter_width */ +hwsetup_add_u32 (hw,20 );/* reload_ticks */ +hwsetup_add_u8 (hw, irq); +hwsetup_add_u8 (hw,0 );/* padding */ +hwsetup_add_u8 (hw,0 );/* padding */ +hwsetup_add_u8 (hw,0 );/* padding */ +} + +static inline void hwsetup_add_uart (HWSetup *hw, +const char *name,uint32_t base,uint32_t irq) +{ +hwsetup_add_u32 (hw,56 );/* size */ +hwsetup_add_tag (hw,HWSETUP_TAG_UART ); +hwsetup_add_str (hw, name); +hwsetup_add_u32 (hw, base); +hwsetup_add_u32 (hw,115200 );/* baudrate */ +hwsetup_add_u8 (hw,8 );/* databits */ +hwsetup_add_u8 (hw,1 );/* stopbits */ +hwsetup_add_u8 (hw,1 );/* use_interrupt */ +hwsetup_add_u8 (hw,1 );/* block_on_transmit */ +hwsetup_add_u8 (hw,1 );/* block_on_receive */ +hwsetup_add_u8 (hw,4 );/* rx_buffer_size */ +hwsetup_add_u8 (hw,4 );/* tx_buffer_size */ +hwsetup_add_u8 (hw, irq); +} + +#endif /* QEMU_HW_LM32_HWSETUP_H */
Signature · 1 line
1.7.2.3
PATCH v3 13/17 lm32: EVR32 and uclinux BSP
In reply to Michael WalleThis patch adds support for the following two BSPs:
- LM32 EVR32 BSP (as used by RTEMS)
- uclinux BSP by Theobroma Systems
--- Makefile.target | 3 + default-configs/lm32-softmmu.mak | 4 + hw/lm32_boards.c | 305 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 312 insertions(+), 0 deletions(-) create mode 100644 default-configs/lm32-softmmu.mak create mode 100644 hw/lm32_boards.c
Makefile.target +3 -0
@@ -247,6 +247,9 @@ obj-ppc-y += xilinx_timer.o obj-ppc-y += xilinx_uartlite.o obj-ppc-y += xilinx_ethlite.o +# LM32 boards +obj-lm32-y += lm32_boards.o + # LM32 peripherals obj-lm32-y += lm32_pic.o obj-lm32-y += lm32_juart.o
default-configs/lm32-softmmu.mak new file +4 -0
@@ -0,0 +1,4 @@ +# Default configuration for lm32-softmmu + +CONFIG_PTIMER=y +CONFIG_PFLASH_CFI02=y
hw/lm32_boards.c new file +305 -0
305 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v3 14/17 lm32: todo and documentation
In reply to Michael WalleThis patch adds general target documentation and a todo list.
--- target-lm32/README | 46 ++++++++++++++++++++++++++++++++++++++++++++++ target-lm32/TODO | 3 +++ 2 files changed, 49 insertions(+), 0 deletions(-) create mode 100644 target-lm32/README create mode 100644 target-lm32/TODO
target-lm32/README new file +46 -0
@@ -0,0 +1,46 @@ +LatticeMico32 target +-------------------- + +General +------- +All opcodes including the JUART CSRs are supported. + + +JTAG UART +--------- +JTAG UART is routed to a serial console device. For the current boards it +is the second one. Ie to enable it in the qemu virtual console window use +the following command line parameters: + -serial vc -serial vc +This will make serial0 (the lm32_uart) and serial1 (the JTAG UART) +available as virtual consoles. + + +Programmatically terminate the emulator +---------------------------------------- +Originally neither the LatticeMico32 nor its peripherals support a +mechanism to shut down the machine. Emulation aware programs can write to a +to a special register within the system control block to shut down the +virtual machine. For more details see hw/lm32_sys.c. The lm32-evr is the +first BSP which instantiate this model. A (32 bit) write to 0xfff0000 +causes a vm shutdown. + + +Special instructions +-------------------- +The translation recognizes one special instruction to halt the cpu: + and r0, r0, r0 +On real hardware this instruction is a nop. It is not used by GCC and +should (hopefully) not be used within hand-crafted assembly. +Insert this instruction in your idle loop to reduce the cpu load on the +host. + + +Ignoring the MSB of the address bus +----------------------------------- +Some SoC ignores the MSB on the address bus. Thus creating a shadow memory +area. As a general rule, 0x00000000-0x7fffffff is cached, whereas +0x80000000-0xffffffff is not cached and used to access IO devices. This +behaviour can be enabled with: + cpu_lm32_set_phys_msb_ignore(env, 1); +
target-lm32/TODO new file +3 -0
@@ -0,0 +1,3 @@ +* disassembler (lm32-dis.c) +* linux-user emulation +* native bp/wp emulation (?)
Signature · 1 line
1.7.2.3
PATCH v3 15/17 lm32: opcode testsuite
In reply to Michael WalleThis patch creates tests/lm32 directory and adds tests for every LatticeMico32 opcode.
--- tests/Makefile | 4 ++ tests/lm32/Makefile | 102 +++++++++++++++++++++++++++++++++++++++++++++ tests/lm32/crt.S | 84 +++++++++++++++++++++++++++++++++++++ tests/lm32/linker.ld | 55 ++++++++++++++++++++++++ tests/lm32/macros.inc | 79 ++++++++++++++++++++++++++++++++++ tests/lm32/test_add.S | 75 +++++++++++++++++++++++++++++++++ tests/lm32/test_addi.S | 56 ++++++++++++++++++++++++ tests/lm32/test_and.S | 45 ++++++++++++++++++++ tests/lm32/test_andhi.S | 35 +++++++++++++++ tests/lm32/test_andi.S | 35 +++++++++++++++ tests/lm32/test_b.S | 13 ++++++ tests/lm32/test_be.S | 48 +++++++++++++++++++++ tests/lm32/test_bg.S | 78 ++++++++++++++++++++++++++++++++++ tests/lm32/test_bge.S | 78 ++++++++++++++++++++++++++++++++++ tests/lm32/test_bgeu.S | 78 ++++++++++++++++++++++++++++++++++ tests/lm32/test_bgu.S | 78 ++++++++++++++++++++++++++++++++++ tests/lm32/test_bi.S | 23 ++++++++++ tests/lm32/test_bne.S | 48 +++++++++++++++++++++ tests/lm32/test_break.S | 20 +++++++++ tests/lm32/test_bret.S | 38 +++++++++++++++++ tests/lm32/test_call.S | 16 +++++++ tests/lm32/test_calli.S | 15 +++++++ tests/lm32/test_cmpe.S | 40 +++++++++++++++++ tests/lm32/test_cmpei.S | 35 +++++++++++++++ tests/lm32/test_cmpg.S | 64 ++++++++++++++++++++++++++++ tests/lm32/test_cmpge.S | 64 ++++++++++++++++++++++++++++ tests/lm32/test_cmpgei.S | 55 ++++++++++++++++++++++++ tests/lm32/test_cmpgeu.S | 64 ++++++++++++++++++++++++++++ tests/lm32/test_cmpgeui.S | 55 ++++++++++++++++++++++++ tests/lm32/test_cmpgi.S | 55 ++++++++++++++++++++++++ tests/lm32/test_cmpgu.S | 64 ++++++++++++++++++++++++++++ tests/lm32/test_cmpgui.S | 55 ++++++++++++++++++++++++ tests/lm32/test_cmpne.S | 40 +++++++++++++++++ tests/lm32/test_cmpnei.S | 35 +++++++++++++++ tests/lm32/test_divu.S | 29 +++++++++++++ tests/lm32/test_eret.S | 38 +++++++++++++++++ tests/lm32/test_lb.S | 45 ++++++++++++++++++++ tests/lm32/test_lbu.S | 45 ++++++++++++++++++++ tests/lm32/test_lh.S | 45 ++++++++++++++++++++ tests/lm32/test_lhu.S | 45 ++++++++++++++++++++ tests/lm32/test_lw.S | 30 +++++++++++++ tests/lm32/test_modu.S | 35 +++++++++++++++ tests/lm32/test_mul.S | 70 +++++++++++++++++++++++++++++++ tests/lm32/test_muli.S | 45 ++++++++++++++++++++ tests/lm32/test_nor.S | 51 ++++++++++++++++++++++ tests/lm32/test_nori.S | 35 +++++++++++++++ tests/lm32/test_or.S | 51 ++++++++++++++++++++++ tests/lm32/test_orhi.S | 35 +++++++++++++++ tests/lm32/test_ori.S | 35 +++++++++++++++ tests/lm32/test_ret.S | 14 ++++++ tests/lm32/test_sb.S | 30 +++++++++++++ tests/lm32/test_scall.S | 20 +++++++++ tests/lm32/test_sextb.S | 20 +++++++++ tests/lm32/test_sexth.S | 20 +++++++++ tests/lm32/test_sh.S | 30 +++++++++++++ tests/lm32/test_sl.S | 45 ++++++++++++++++++++ tests/lm32/test_sli.S | 30 +++++++++++++ tests/lm32/test_sr.S | 57 +++++++++++++++++++++++++ tests/lm32/test_sri.S | 40 +++++++++++++++++ tests/lm32/test_sru.S | 57 +++++++++++++++++++++++++ tests/lm32/test_srui.S | 40 +++++++++++++++++ tests/lm32/test_sub.S | 75 +++++++++++++++++++++++++++++++++ tests/lm32/test_sw.S | 35 +++++++++++++++ tests/lm32/test_xnor.S | 51 ++++++++++++++++++++++ tests/lm32/test_xnori.S | 35 +++++++++++++++ tests/lm32/test_xor.S | 51 ++++++++++++++++++++++ tests/lm32/test_xori.S | 35 +++++++++++++++ 67 files changed, 3048 insertions(+), 0 deletions(-) create mode 100644 tests/lm32/Makefile create mode 100644 tests/lm32/crt.S create mode 100644 tests/lm32/linker.ld create mode 100644 tests/lm32/macros.inc create mode 100644 tests/lm32/test_add.S create mode 100644 tests/lm32/test_addi.S create mode 100644 tests/lm32/test_and.S create mode 100644 tests/lm32/test_andhi.S create mode 100644 tests/lm32/test_andi.S create mode 100644 tests/lm32/test_b.S create mode 100644 tests/lm32/test_be.S create mode 100644 tests/lm32/test_bg.S create mode 100644 tests/lm32/test_bge.S create mode 100644 tests/lm32/test_bgeu.S create mode 100644 tests/lm32/test_bgu.S create mode 100644 tests/lm32/test_bi.S create mode 100644 tests/lm32/test_bne.S create mode 100644 tests/lm32/test_break.S create mode 100644 tests/lm32/test_bret.S create mode 100644 tests/lm32/test_call.S create mode 100644 tests/lm32/test_calli.S create mode 100644 tests/lm32/test_cmpe.S create mode 100644 tests/lm32/test_cmpei.S create mode 100644 tests/lm32/test_cmpg.S create mode 100644 tests/lm32/test_cmpge.S create mode 100644 tests/lm32/test_cmpgei.S create mode 100644 tests/lm32/test_cmpgeu.S create mode 100644 tests/lm32/test_cmpgeui.S create mode 100644 tests/lm32/test_cmpgi.S create mode 100644 tests/lm32/test_cmpgu.S create mode 100644 tests/lm32/test_cmpgui.S create mode 100644 tests/lm32/test_cmpne.S create mode 100644 tests/lm32/test_cmpnei.S create mode 100644 tests/lm32/test_divu.S create mode 100644 tests/lm32/test_eret.S create mode 100644 tests/lm32/test_lb.S create mode 100644 tests/lm32/test_lbu.S create mode 100644 tests/lm32/test_lh.S create mode 100644 tests/lm32/test_lhu.S create mode 100644 tests/lm32/test_lw.S create mode 100644 tests/lm32/test_modu.S create mode 100644 tests/lm32/test_mul.S create mode 100644 tests/lm32/test_muli.S create mode 100644 tests/lm32/test_nor.S create mode 100644 tests/lm32/test_nori.S create mode 100644 tests/lm32/test_or.S create mode 100644 tests/lm32/test_orhi.S create mode 100644 tests/lm32/test_ori.S create mode 100644 tests/lm32/test_ret.S create mode 100644 tests/lm32/test_sb.S create mode 100644 tests/lm32/test_scall.S create mode 100644 tests/lm32/test_sextb.S create mode 100644 tests/lm32/test_sexth.S create mode 100644 tests/lm32/test_sh.S create mode 100644 tests/lm32/test_sl.S create mode 100644 tests/lm32/test_sli.S create mode 100644 tests/lm32/test_sr.S create mode 100644 tests/lm32/test_sri.S create mode 100644 tests/lm32/test_sru.S create mode 100644 tests/lm32/test_srui.S create mode 100644 tests/lm32/test_sub.S create mode 100644 tests/lm32/test_sw.S create mode 100644 tests/lm32/test_xnor.S create mode 100644 tests/lm32/test_xnori.S create mode 100644 tests/lm32/test_xor.S create mode 100644 tests/lm32/test_xori.S
tests/Makefile +4 -0
@@ -142,6 +142,10 @@ hello-mipsel: hello-mips.c test-cris: $(MAKE) -C cris check +# testsuite for the LM32 port. +test-lm32: + $(MAKE) -C lm32 check + clean: rm -f *~ *.o test-i386.out test-i386.ref \ test-x86_64.log test-x86_64.ref qruncom $(TESTS)
tests/lm32/Makefile new file +102 -0
102 lines not on this page · raw message
tests/lm32/crt.S new file +84 -0
84 lines not on this page · raw message
tests/lm32/linker.ld new file +55 -0
55 lines not on this page · raw message
tests/lm32/macros.inc new file +79 -0
79 lines not on this page · raw message
tests/lm32/test_add.S new file +75 -0
75 lines not on this page · raw message
tests/lm32/test_addi.S new file +56 -0
56 lines not on this page · raw message
tests/lm32/test_and.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_andhi.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name ANDHI_1 +mvi r1, 0 +andhi r3, r1, 0 +check_r3 0 + +test_name ANDHI_2 +mvi r1, 1 +andhi r3, r1, 1 +check_r3 0 + +test_name ANDHI_3 +load r1 0x000f0000 +andhi r3, r1, 1 +check_r3 0x00010000 + +test_name ANDHI_4 +load r1 0xffffffff +andhi r3, r1, 0xffff +check_r3 0xffff0000 + +test_name ANDHI_5 +load r1 0xffffffff +andhi r3, r1, 0 +check_r3 0 + +test_name ANDHI_6 +load r3 0x55aaffff +andhi r3, r3, 0xaaaa +check_r3 0x00aa0000 + +end
tests/lm32/test_andi.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name ANDI_1 +mvi r1, 0 +andi r3, r1, 0 +check_r3 0 + +test_name ANDI_2 +mvi r1, 1 +andi r3, r1, 1 +check_r3 1 + +test_name ANDI_3 +load r1 0x000f0000 +andi r3, r1, 1 +check_r3 0 + +test_name ANDI_4 +load r1 0xffffffff +andi r3, r1, 0xffff +check_r3 0xffff + +test_name ANDI_5 +load r1 0xffffffff +andi r3, r1, 0 +check_r3 0 + +test_name ANDI_6 +load r3 0xffff55aa +andi r3, r3, 0xaaaa +check_r3 0x000000aa + +end
tests/lm32/test_b.S new file +13 -0
@@ -0,0 +1,13 @@ +.include "macros.inc" + +start + +test_name B_1 +load r1 jump +b r1 +tc_fail +end + +jump: +tc_pass +end
tests/lm32/test_be.S new file +48 -0
48 lines not on this page · raw message
tests/lm32/test_bg.S new file +78 -0
78 lines not on this page · raw message
tests/lm32/test_bge.S new file +78 -0
78 lines not on this page · raw message
tests/lm32/test_bgeu.S new file +78 -0
78 lines not on this page · raw message
tests/lm32/test_bgu.S new file +78 -0
78 lines not on this page · raw message
tests/lm32/test_bi.S new file +23 -0
@@ -0,0 +1,23 @@ +.include "macros.inc" + +start + +test_name BI_1 +bi jump +tc_fail +end + +jump_back: +tc_pass +end + +jump: +tc_pass + +test_name BI_2 +bi jump_back +tc_fail + +end + +
tests/lm32/test_bne.S new file +48 -0
48 lines not on this page · raw message
tests/lm32/test_break.S new file +20 -0
@@ -0,0 +1,20 @@ +.include "macros.inc" + +start + +test_name BREAK_1 +mvi r1, 1 +wcsr IE, r1 +insn: +break +check_excp 1 + +test_name BREAK_2 +mv r3, ba +check_r3 insn + +test_name BREAK_3 +rcsr r3, IE +check_r3 4 + +end
tests/lm32/test_bret.S new file +38 -0
@@ -0,0 +1,38 @@ +.include "macros.inc" + +start + +test_name BRET_1 +mvi r1, 4 +wcsr IE, r1 +load ba mark +bret +tc_fail +bi 1f + +mark: +tc_pass + +1: +test_name BRET_2 +rcsr r3, IE +check_r3 5 + +test_name BRET_3 +mvi r1, 0 +wcsr IE, r1 +load ba mark2 +bret +tc_fail +bi 1f + +mark2: +tc_pass + +1: +test_name BRET_4 +rcsr r3, IE +check_r3 0 + +end +
tests/lm32/test_call.S new file +16 -0
@@ -0,0 +1,16 @@ +.include "macros.inc" + +start + +test_name CALL_1 +load r1 mark +call r1 +return: + +tc_fail +end + +mark: +mv r3, ra +check_r3 return +end
tests/lm32/test_calli.S new file +15 -0
@@ -0,0 +1,15 @@ +.include "macros.inc" + +start + +test_name CALLI_1 +calli mark +return: + +tc_fail +end + +mark: +mv r3, ra +check_r3 return +end
tests/lm32/test_cmpe.S new file +40 -0
@@ -0,0 +1,40 @@ +.include "macros.inc" + +start + +test_name CMPE_1 +mvi r1, 0 +mvi r2, 0 +cmpe r3, r1, r2 +check_r3 1 + +test_name CMPE_2 +mvi r1, 0 +mvi r2, 1 +cmpe r3, r1, r2 +check_r3 0 + +test_name CMPE_3 +mvi r1, 1 +mvi r2, 0 +cmpe r3, r1, r2 +check_r3 0 + +test_name CMPE_4 +mvi r3, 0 +mvi r2, 1 +cmpe r3, r3, r2 +check_r3 0 + +test_name CMPE_5 +mvi r3, 0 +mvi r2, 0 +cmpe r3, r3, r2 +check_r3 1 + +test_name CMPE_6 +mvi r3, 0 +cmpe r3, r3, r3 +check_r3 1 + +end
tests/lm32/test_cmpei.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name CMPEI_1 +mvi r1, 0 +cmpei r3, r1, 0 +check_r3 1 + +test_name CMPEI_2 +mvi r1, 0 +cmpei r3, r1, 1 +check_r3 0 + +test_name CMPEI_3 +mvi r1, 1 +cmpei r3, r1, 0 +check_r3 0 + +test_name CMPEI_4 +load r1 0xffffffff +cmpei r3, r1, -1 +check_r3 1 + +test_name CMPEI_5 +mvi r3, 0 +cmpei r3, r3, 0 +check_r3 1 + +test_name CMPEI_6 +mvi r3, 0 +cmpei r3, r3, 1 +check_r3 0 + +end
tests/lm32/test_cmpg.S new file +64 -0
64 lines not on this page · raw message
tests/lm32/test_cmpge.S new file +64 -0
64 lines not on this page · raw message
tests/lm32/test_cmpgei.S new file +55 -0
55 lines not on this page · raw message
tests/lm32/test_cmpgeu.S new file +64 -0
64 lines not on this page · raw message
tests/lm32/test_cmpgeui.S new file +55 -0
55 lines not on this page · raw message
tests/lm32/test_cmpgi.S new file +55 -0
55 lines not on this page · raw message
tests/lm32/test_cmpgu.S new file +64 -0
64 lines not on this page · raw message
tests/lm32/test_cmpgui.S new file +55 -0
55 lines not on this page · raw message
tests/lm32/test_cmpne.S new file +40 -0
@@ -0,0 +1,40 @@ +.include "macros.inc" + +start + +test_name CMPNE_1 +mvi r1, 0 +mvi r2, 0 +cmpne r3, r1, r2 +check_r3 0 + +test_name CMPNE_2 +mvi r1, 0 +mvi r2, 1 +cmpne r3, r1, r2 +check_r3 1 + +test_name CMPNE_3 +mvi r1, 1 +mvi r2, 0 +cmpne r3, r1, r2 +check_r3 1 + +test_name CMPNE_4 +mvi r3, 0 +mvi r2, 1 +cmpne r3, r3, r2 +check_r3 1 + +test_name CMPNE_5 +mvi r3, 0 +mvi r2, 0 +cmpne r3, r3, r2 +check_r3 0 + +test_name CMPNE_6 +mvi r3, 0 +cmpne r3, r3, r3 +check_r3 0 + +end
tests/lm32/test_cmpnei.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name CMPNEI_1 +mvi r1, 0 +cmpnei r3, r1, 0 +check_r3 0 + +test_name CMPNEI_2 +mvi r1, 0 +cmpnei r3, r1, 1 +check_r3 1 + +test_name CMPNEI_3 +mvi r1, 1 +cmpnei r3, r1, 0 +check_r3 1 + +test_name CMPNEI_4 +load r1 0xffffffff +cmpnei r3, r1, -1 +check_r3 0 + +test_name CMPNEI_5 +mvi r3, 0 +cmpnei r3, r3, 0 +check_r3 0 + +test_name CMPNEI_6 +mvi r3, 0 +cmpnei r3, r3, 1 +check_r3 1 + +end
tests/lm32/test_divu.S new file +29 -0
@@ -0,0 +1,29 @@ +.include "macros.inc" + +start + +test_name DIVU_1 +mvi r1, 0 +mvi r2, 1 +divu r3, r1, r2 +check_r3 0 + +test_name DIVU_2 +mvi r1, 1 +mvi r2, 1 +divu r3, r1, r2 +check_r3 1 + +test_name DIVU_3 +mvi r1, 0 +mvi r2, 0 +divu r3, r1, r2 +check_excp 16 + +test_name DIVU_4 +load r1 0xabcdef12 +load r2 0x12345 +divu r3, r1, r2 +check_r3 0x9700 + +end
tests/lm32/test_eret.S new file +38 -0
@@ -0,0 +1,38 @@ +.include "macros.inc" + +start + +test_name ERET_1 +mvi r1, 2 +wcsr IE, r1 +load ea mark +eret +tc_fail +bi 1f + +mark: +tc_pass + +1: +test_name ERET_2 +rcsr r3, IE +check_r3 3 + +test_name ERET_3 +mvi r1, 0 +wcsr IE, r1 +load ea mark2 +eret +tc_fail +bi 1f + +mark2: +tc_pass + +1: +test_name ERET_4 +rcsr r3, IE +check_r3 0 + +end +
tests/lm32/test_lb.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_lbu.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_lh.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_lhu.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_lw.S new file +30 -0
@@ -0,0 +1,30 @@ +.include "macros.inc" + +start + +test_name LW_1 +load r1 data +lw r3, (r1+0) +check_r3 0x7e7f7071 + +test_name LW_2 +lw r3, (r1+4) +check_r3 0x72737475 + +test_name LW_3 +lw r3, (r1+-4) +check_r3 0x7a7b7c7d + +test_name LW_4 +load r3 data +lw r3, (r3+0) +check_r3 0x7e7f7071 + +end + +.data + .align 4 + .byte 0x7a, 0x7b, 0x7c, 0x7d +data: + .byte 0x7e, 0x7f, 0x70, 0x71 + .byte 0x72, 0x73, 0x74, 0x75
tests/lm32/test_modu.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name MODU_1 +mvi r1, 0 +mvi r2, 1 +modu r3, r1, r2 +check_r3 0 + +test_name MODU_2 +mvi r1, 1 +mvi r2, 1 +modu r3, r1, r2 +check_r3 0 + +test_name MODU_3 +mvi r1, 3 +mvi r2, 2 +modu r3, r1, r2 +check_r3 1 + +test_name MODU_4 +mvi r1, 0 +mvi r2, 0 +modu r3, r1, r2 +check_excp 16 + +test_name MODU_5 +load r1 0xabcdef12 +load r2 0x12345 +modu r3, r1, r2 +check_r3 0x3c12 + +end
tests/lm32/test_mul.S new file +70 -0
70 lines not on this page · raw message
tests/lm32/test_muli.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_nor.S new file +51 -0
51 lines not on this page · raw message
tests/lm32/test_nori.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name NORI_1 +mvi r1, 0 +nori r3, r1, 0 +check_r3 0xffffffff + +test_name NORI_2 +mvi r1, 0 +nori r3, r1, 1 +check_r3 0xfffffffe + +test_name NORI_3 +mvi r1, 1 +nori r3, r1, 1 +check_r3 0xfffffffe + +test_name NORI_4 +mvi r1, 1 +nori r3, r1, 0 +check_r3 0xfffffffe + +test_name NORI_5 +load r1 0xaa55aa55 +nori r3, r1, 0x55aa +check_r3 0x55aa0000 + +test_name NORI_6 +load r3 0xaa55aa55 +nori r3, r3, 0x55aa +check_r3 0x55aa0000 + +end
tests/lm32/test_or.S new file +51 -0
51 lines not on this page · raw message
tests/lm32/test_orhi.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name ORHI_1 +mvi r1, 0 +orhi r3, r1, 0 +check_r3 0 + +test_name ORHI_2 +mvi r1, 0 +orhi r3, r1, 1 +check_r3 0x00010000 + +test_name ORHI_3 +load r1 0x00010000 +orhi r3, r1, 1 +check_r3 0x00010000 + +test_name ORHI_4 +mvi r1, 1 +orhi r3, r1, 0 +check_r3 1 + +test_name ORHI_5 +load r1 0xaa55aa55 +orhi r3, r1, 0x55aa +check_r3 0xffffaa55 + +test_name ORHI_6 +load r3 0xaa55aa55 +orhi r3, r3, 0x55aa +check_r3 0xffffaa55 + +end
tests/lm32/test_ori.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name ORI_1 +mvi r1, 0 +ori r3, r1, 0 +check_r3 0 + +test_name ORI_2 +mvi r1, 0 +ori r3, r1, 1 +check_r3 1 + +test_name ORI_3 +mvi r1, 1 +ori r3, r1, 1 +check_r3 1 + +test_name ORI_4 +mvi r1, 1 +ori r3, r1, 0 +check_r3 1 + +test_name ORI_5 +load r1 0xaa55aa55 +ori r3, r1, 0x55aa +check_r3 0xaa55ffff + +test_name ORI_6 +load r3 0xaa55aa55 +ori r3, r3, 0x55aa +check_r3 0xaa55ffff + +end
tests/lm32/test_ret.S new file +14 -0
@@ -0,0 +1,14 @@ +.include "macros.inc" + +start + +test_name RET_1 +load ra mark +ret + +tc_fail +end + +mark: +tc_pass +end
tests/lm32/test_sb.S new file +30 -0
@@ -0,0 +1,30 @@ +.include "macros.inc" + +start + +test_name SB_1 +load r1 data +load r2 0xf0f1f2aa +sb (r1+0), r2 +check_mem data 0xaa000000 + +test_name SB_2 +load r2 0xf0f1f2bb +sb (r1+1), r2 +check_mem data 0xaabb0000 + +test_name SB_3 +load r2 0xf0f1f2cc +sb (r1+-1), r2 +check_mem data0 0x000000cc + +end + +.data + .align 4 +data0: + .byte 0, 0, 0, 0 +data: + .byte 0, 0, 0, 0 +data1: + .byte 0, 0, 0, 0
tests/lm32/test_scall.S new file +20 -0
@@ -0,0 +1,20 @@ +.include "macros.inc" + +start + +test_name SCALL_1 +mvi r1, 1 +wcsr IE, r1 +insn: +scall +check_excp 64 + +test_name SCALL_2 +mv r3, ea +check_r3 insn + +test_name SCALL_3 +rcsr r3, IE +check_r3 2 + +end
tests/lm32/test_sextb.S new file +20 -0
@@ -0,0 +1,20 @@ +.include "macros.inc" + +start + +test_name SEXTB_1 +mvi r1, 0 +sextb r3, r1 +check_r3 0 + +test_name SEXTB_2 +mvi r1, 0x7f +sextb r3, r1 +check_r3 0x0000007f + +test_name SEXTB_3 +mvi r1, 0x80 +sextb r3, r1 +check_r3 0xffffff80 + +end
tests/lm32/test_sexth.S new file +20 -0
@@ -0,0 +1,20 @@ +.include "macros.inc" + +start + +test_name SEXTH_1 +mvi r1, 0 +sexth r3, r1 +check_r3 0 + +test_name SEXTH_2 +load r1 0x7fff +sexth r3, r1 +check_r3 0x00007fff + +test_name SEXTH_3 +load r1 0x8000 +sexth r3, r1 +check_r3 0xffff8000 + +end
tests/lm32/test_sh.S new file +30 -0
@@ -0,0 +1,30 @@ +.include "macros.inc" + +start + +test_name SH_1 +load r1 data +load r2 0xf0f1aaaa +sh (r1+0), r2 +check_mem data 0xaaaa0000 + +test_name SH_2 +load r2 0xf0f1bbbb +sh (r1+2), r2 +check_mem data 0xaaaabbbb + +test_name SH_3 +load r2 0xf0f1cccc +sh (r1+-2), r2 +check_mem data0 0x0000cccc + +end + +.data + .align 4 +data0: + .byte 0, 0, 0, 0 +data: + .byte 0, 0, 0, 0 +data1: + .byte 0, 0, 0, 0
tests/lm32/test_sl.S new file +45 -0
45 lines not on this page · raw message
tests/lm32/test_sli.S new file +30 -0
@@ -0,0 +1,30 @@ +.include "macros.inc" + +start + +test_name SLI_1 +mvi r1, 1 +sli r3, r1, 0 +check_r3 1 + +test_name SLI_2 +mvi r1, 0 +sli r3, r1, 1 +check_r3 0 + +test_name SLI_3 +mvi r1, 1 +sli r3, r1, 31 +check_r3 0x80000000 + +test_name SLI_4 +mvi r1, 16 +sli r3, r1, 31 +check_r3 0 + +test_name SLI_7 +mvi r3, 2 +sli r3, r3, 2 +check_r3 8 + +end
tests/lm32/test_sr.S new file +57 -0
57 lines not on this page · raw message
tests/lm32/test_sri.S new file +40 -0
@@ -0,0 +1,40 @@ +.include "macros.inc" + +start + +test_name SRI_1 +mvi r1, 1 +sri r3, r1, 0 +check_r3 1 + +test_name SRI_2 +mvi r1, 0 +sri r3, r1, 1 +check_r3 0 + +test_name SRI_3 +load r1 0x40000000 +sri r3, r1, 30 +check_r3 1 + +test_name SRI_4 +load r1 0x40000000 +sri r3, r1, 31 +check_r3 0 + +test_name SRI_5 +mvi r3, 2 +sri r3, r3, 2 +check_r3 0 + +test_name SRI_6 +mvi r1, 0xfffffff0 +sri r3, r1, 2 +check_r3 0xfffffffc + +test_name SRI_7 +mvi r1, 0xfffffff0 +sri r3, r1, 4 +check_r3 0xffffffff + +end
tests/lm32/test_sru.S new file +57 -0
57 lines not on this page · raw message
tests/lm32/test_srui.S new file +40 -0
@@ -0,0 +1,40 @@ +.include "macros.inc" + +start + +test_name SRUI_1 +mvi r1, 1 +srui r3, r1, 0 +check_r3 1 + +test_name SRUI_2 +mvi r1, 0 +srui r3, r1, 1 +check_r3 0 + +test_name SRUI_3 +load r1 0x40000000 +srui r3, r1, 30 +check_r3 1 + +test_name SRUI_4 +load r1 0x40000000 +srui r3, r1, 31 +check_r3 0 + +test_name SRUI_5 +mvi r3, 2 +srui r3, r3, 2 +check_r3 0 + +test_name SRUI_6 +mvi r1, 0xfffffff0 +srui r3, r1, 2 +check_r3 0x3ffffffc + +test_name SRUI_7 +mvi r1, 0xfffffff0 +srui r3, r1, 4 +check_r3 0x0fffffff + +end
tests/lm32/test_sub.S new file +75 -0
75 lines not on this page · raw message
tests/lm32/test_sw.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name SW_1 +load r1 data +load r2 0xaabbccdd +sw (r1+0), r2 +check_mem data 0xaabbccdd + +test_name SW_2 +load r2 0x00112233 +sw (r1+4), r2 +check_mem data1 0x00112233 + +test_name SW_3 +load r2 0x44556677 +sw (r1+-4), r2 +check_mem data0 0x44556677 + +test_name SW_4 +sw (r1+0), r1 +lw r3, (r1+0) +check_r3 data + +end + +.data + .align 4 +data0: + .byte 0, 0, 0, 0 +data: + .byte 0, 0, 0, 0 +data1: + .byte 0, 0, 0, 0
tests/lm32/test_xnor.S new file +51 -0
51 lines not on this page · raw message
tests/lm32/test_xnori.S new file +35 -0
@@ -0,0 +1,35 @@ +.include "macros.inc" + +start + +test_name XNORI_1 +mvi r1, 0 +xnori r3, r1, 0 +check_r3 0xffffffff + +test_name XNORI_2 +mvi r1, 0 +xnori r3, r1, 1 +check_r3 0xfffffffe + +test_name XNORI_3 +mvi r1, 1 +xnori r3, r1, 1 +check_r3 0xffffffff + +test_name XNORI_4 +mvi r1, 1 +xnori r3, r1, 0 +check_r3 0xfffffffe + +test_name XNORI_5 +load r1 0xaa55aa55 +xnori r3, r1, 0x5555 +check_r3 0x55aa00ff + +test_name XNORI_6 +load r3 0xaa55aa55 +xnori r3, r3, 0x5555 +check_r3 0x55aa00ff + +end
tests/lm32/test_xor.S new file +51 -0
32 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.2.3
Part of the diff is not shown here. View the raw message.
PATCH v3 16/17 Add lm32 target to configure
In reply to Michael Walle--- configure | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
configure +7 -3
@@ -280,7 +280,7 @@ else fi case "$cpu" in - alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64) + alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64) cpu="$cpu" ;; i386|i486|i586|i686|i86pc|BePC)
@@ -982,6 +982,7 @@ i386-softmmu \ x86_64-softmmu \ arm-softmmu \ cris-softmmu \ +lm32-softmmu \ m68k-softmmu \ microblaze-softmmu \ mips-softmmu \
@@ -2501,7 +2502,7 @@ echo "docdir=$docdir" >> $config_host_mak echo "confdir=$confdir" >> $config_host_mak case "$cpu" in - i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) + i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) ARCH=$cpu ;; armv4b|armv4l)
@@ -2848,7 +2849,7 @@ target_arch2=`echo $target | cut -d '-' -f 1` target_bigendian="no" case "$target_arch2" in - armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus) + armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus) target_bigendian=yes ;; esac
@@ -2936,6 +2937,9 @@ case "$target_arch2" in target_nptl="yes" target_phys_bits=32 ;; + lm32) + target_phys_bits=32 + ;; m68k) bflt="yes" gdb_xml_files="cf-core.xml cf-fp.xml"
Signature · 1 line
1.7.2.3
PATCH v3 17/17 MAINTAINERS: add LatticeMico32 maintainer
In reply to Michael WalleAdd me as the lm32-target and machines maintainer.
--- MAINTAINERS | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
MAINTAINERS +12 -0
@@ -70,6 +70,11 @@ M: Edgar E. Iglesias <[email protected]> S: Maintained F: target-cris/ +LM32 +M: Michael Walle <[email protected]> +S: Maintained +F: target-lm32/ + M68K M: Paul Brook <[email protected]> S: Maintained
@@ -202,6 +207,13 @@ M: Edgar E. Iglesias <[email protected]> S: Maintained F: hw/etraxfs.c +LM32 Machines +------------- +EVR32 and uclinux BSP +M: Michael Walle <[email protected]> +S: Maintained +F: hw/lm32_boards.c + M68K Machines ------------- an5206
Signature · 1 line
1.7.2.3
Am Donnerstag 17 Februar 2011, 23:45:01 schrieb Michael Walle:
Quoted 12 lines
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots ofCODING_STYLEfixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead ofqemu_register_reset()
- add missing include guards
- mergedlm32_pic_cpu.cinto boards file
- removed buggyqemu_irq_lower()in reset functions
- convertedhw_errortoerror_report()
Quoted 5 lines
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing ones
Any comments/reviews on this patchset?
I've changed the opcode decoding to use a lookup table instead of the for- loop. If you don't mind, i would submit a patch after the above is merged. Or, alternatively, if there is another patchset version, i'll integrate it into that ;)
Signature · 1 line
Michael
Quoted 19 lines · Michael Walle
Am Donnerstag 17 Februar 2011, 23:45:01 schrieb Michael Walle:
Quoted 12 lines
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots ofCODING_STYLEfixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead ofqemu_register_reset()
- add missing include guards
- mergedlm32_pic_cpu.cinto boards file
- removed buggyqemu_irq_lower()in reset functions
- convertedhw_errortoerror_report()Quoted 5 lines
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing ones
Quoted 6 lines
Any comments/reviews on this patchset?
I've changed the opcode decoding to use a lookup table instead of the for- loop. If you don't mind, i would submit a patch after the above is merged. Or, alternatively, if there is another patchset version, i'll integrate it into that ;)
Hi, lets do v3 first.
Do you have a public tree to pull from?
Blue, did v3 address all the comments you had?
Cheers
Quoted 27 lines · Edgar E. Iglesias
Quoted 19 lines · Michael Walle
Am Donnerstag 17 Februar 2011, 23:45:01 schrieb Michael Walle:
Quoted 12 lines
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots ofCODING_STYLEfixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead ofqemu_register_reset()
- add missing include guards
- mergedlm32_pic_cpu.cinto boards file
- removed buggyqemu_irq_lower()in reset functions
- convertedhw_errortoerror_report()Quoted 5 lines
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing onesQuoted 6 lines
Any comments/reviews on this patchset?
I've changed the opcode decoding to use a lookup table instead of the for- loop. If you don't mind, i would submit a patch after the above is merged. Or, alternatively, if there is another patchset version, i'll integrate it into that ;)
Quoted 5 lines
Hi, lets do v3 first.
Do you have a public tree to pull from?
Blue, did v3 address all the comments you had?
Yes, it looks OK.
Am Dienstag 01 März 2011, 22:31:58 schrieb Edgar E. Iglesias:
Quoted 22 lines · Michael Walle
Quoted 21 lines
Am Donnerstag 17 Februar 2011, 23:45:01 schrieb Michael Walle:
Quoted 12 lines
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots ofCODING_STYLEfixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead ofqemu_register_reset()
- add missing include guards
- mergedlm32_pic_cpu.cinto boards file
- removed buggyqemu_irq_lower()in reset functions
- convertedhw_errortoerror_report()Quoted 5 lines
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing onesAny comments/reviews on this patchset?
Quoted 8 lines
Quoted 4 lines
I've changed the opcode decoding to use a lookup table instead of the for- loop. If you don't mind, i would submit a patch after the above is merged. Or, alternatively, if there is another patchset version, i'll integrate it into that ;)
Hi, lets do v3 first.
Do you have a public tree to pull from?
My git repository is at:
http://git.serverraum.org/git/mw/qemu-lm32.git/
There i create a tag 'for-upstream-v3' which contains the patchset rebased on the latest official HEAD.
HTH, Michael
Quoted 28 lines · Michael Walle
Am Dienstag 01 März 2011, 22:31:58 schrieb Edgar E. Iglesias:
Quoted 27 lines · Michael Walle
Quoted 25 lines
Am Donnerstag 17 Februar 2011, 23:45:01 schrieb Michael Walle:
Quoted 12 lines
This patchset adds support for the LatticeMico32 softcore processor by Lattice Semiconductor.
Changes since v2:
- lots ofCODING_STYLEfixes
- reworked pic and juart model, CPUState is not passed anymore
- use qdev reset field instead ofqemu_register_reset()
- add missing include guards
- mergedlm32_pic_cpu.cinto boards file
- removed buggyqemu_irq_lower()in reset functions
- convertedhw_errortoerror_report()Quoted 5 lines
Changes since v1:
- removed variables which are no longer in use
- replaced some tcg ops with specialized ones
- kill VM in case of an unknown opcode
- fixed tracepoints format strings to match existing onesAny comments/reviews on this patchset?
I've changed the opcode decoding to use a lookup table instead of the for- loop. If you don't mind, i would submit a patch after the above is merged. Or, alternatively, if there is another patchset version, i'll integrate it into that ;)
Quoted 8 lines
Quoted 3 lines
Hi, lets do v3 first.
Do you have a public tree to pull from?
My git repository is at:
http://git.serverraum.org/git/mw/qemu-lm32.git/There i create a tag 'for-upstream-v3' which contains the patchset rebased on the latest official HEAD.
Thanks, I've applied v3.
Got a conflict on patch nr 16 though. Would be good if you could double check upstreams configure to verify I resolved it correctly...
Cheers
Am Montag 07 März 2011, 14:20:09 schrieb Edgar E. Iglesias:
Quoted 2 lines
Got a conflict on patch nr 16 though. Would be good if you could double check upstreams configure to verify I resolved it correctly...
It's OK, thanks.
Signature · 1 line
Michael