: add alpha es40 system emulation
cover : add alpha es40 system emulation
this patch series adds alpha system emulation for the es40. The work is not yet complete (don't expect to boot an OS) but enough to get the firmware prompt.
The only processor supported is the alpha 21264 but the infrastructure is here to support other processors or pal emulation.
The system emulated is the ES40
http://www.compaq.com/alphaserver/archive/es40/index.html
It is a mid-range system that is quite well documented, supports all alpha OSes (AFAIK) and its firmware is available.
The emulation uses the original firmware. See comment at the head of hw/es40.c for building the rom image.
This work is a first step and I plan to continue this work. That's the reason why I left some (deactivated) debug code and placed a few aborts. Also it is not yet built by default.
Only the last patch adds full cpu emulation. The previous ones fix bugs, clen up, add new devices and es40 machine or add new features.
Comments are welcome,
Tristan.
PATCH 1/24 Add support for multi-level phys map.
As Alpha physical addresses are 44 bits, l1_phys_map can't be anymore 2 levels. Use a more generic multi-level approach and explain why we don't need to extend l1_map.
--- exec.c | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 38 insertions(+), 12 deletions(-)
exec.c +38 -12
@@ -150,14 +150,17 @@ typedef struct PhysPageDesc { } PhysPageDesc;#define L2_BITS 10 -#if defined(CONFIG_USER_ONLY ) && defined(TARGET_VIRT_ADDR_SPACE_BITS ) -/* XXX: this is a temporary hack for alpha target. -* In the future, this is to be replaced by a multi-level table -* to actually be able to handle the complete 64 bits address space. -*/ -#define L1_BITS (TARGET_VIRT_ADDR_SPACE_BITS - L2_BITS - TARGET_PAGE_BITS) + +#if TARGET_PHYS_ADDR_SPACE_BITS > (32 +32 -L2_BITS -TARGET_PAGE_BITS ) +# define MULTILEVEL_PHYS_MAP +# define L1_BITS_ ((TARGET_PHYS_ADDR_SPACE_BITS - TARGET_PAGE_BITS) % L2_BITS) +# if L1_BITS_ <4 /* avoid ridiculous small l1 */ +# define L1_BITS (L1_BITS_ + L2_BITS) +# else +# define L1_BITS L1_BITS_ +# endif #else -#define L1_BITS (32 - L2_BITS - TARGET_PAGE_BITS) +# define L1_BITS (32 - L2_BITS - TARGET_PAGE_BITS)#endif #define L1_SIZE (1 << L1_BITS)
@@ -168,7 +171,9 @@ unsigned long qemu_host_page_bits;unsigned long qemu_host_page_size;unsigned long qemu_host_page_mask; -/* XXX: for system emulation, it could just be an array */ +/* XXX: for system emulation, it could just be an array. As this is currently +a two level map this limits the size of RAM memory that can contains +target code. In practice this is large enough (>= 4GB) */ static PageDesc *l1_map[L1_SIZE ];static PhysPageDesc **l1_phys_map;
@@ -342,12 +347,31 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)void **lp, **p;PhysPageDesc *pd; +#ifdef MULTILEVEL_PHYS_MAP + int i; +#define L1_SHIFT (TARGET_PHYS_ADDR_SPACE_BITS - TARGET_PAGE_BITS - L1_BITS) + + /* Level 1. */ + p = (void **)l1_phys_map; + lp = p + ((index >> L1_SHIFT) & (L1_SIZE - 1)); + + /* Level 2..n-1 */ + for (i = (L1_SHIFT / L2_BITS) - 1; i > 0; i--) { + p = *lp; + if (!p) { + /* allocate if not found */ + if (!alloc) + return NULL; + p = qemu_vmalloc(sizeof(void *) * L2_SIZE); + memset(p, 0, sizeof(void *) * L2_SIZE); + *lp = p; + } + lp = p + ((index >> (i * L2_BITS)) & (L2_SIZE - 1)); + } +#else p = (void **)l1_phys_map; -#if TARGET_PHYS_ADDR_SPACE_BITS >32 -#if TARGET_PHYS_ADDR_SPACE_BITS > (32 +L1_BITS ) -#error unsupported TARGET_PHYS_ADDR_SPACE_BITS -#endif +#if TARGET_PHYS_ADDR_SPACE_BITS > 32 lp = p + ((index >> (L1_BITS + L2_BITS)) & (L1_SIZE - 1)); p = *lp; if (!p) {
@@ -360,6 +384,8 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc) }#endif lp = p + ((index >>L2_BITS ) & (L1_SIZE -1 )); +#endif + pd = *lp;if (!pd) {int i;
Signature · 1 line
1.6.2
PATCH 2/24 Fix cpu_physical_memory_rw when operating on IO blocks.
In some cases, addr was destroyed and the next access was wrong. This occured while making 64bits IO accesses.
--- exec.c | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-)
exec.c +15 -11
@@ -357,16 +357,16 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)/* Level 2..n-1 */ for (i = (L1_SHIFT /L2_BITS ) -1 ; i >0 ; i--) { - p = *lp; -if (!p) { -/* allocate if not found */ -if (!alloc) -return NULL ; - p =qemu_vmalloc (sizeof (void *) *L2_SIZE ); -memset (p,0 ,sizeof (void *) *L2_SIZE ); - *lp = p; - } - lp = p + ((index >> (i *L2_BITS )) & (L2_SIZE -1 )); + p = *lp; +if (!p) { +/* allocate if not found */ +if (!alloc) +return NULL ; + p =qemu_vmalloc (sizeof (void *) *L2_SIZE ); +memset (p,0 ,sizeof (void *) *L2_SIZE ); + *lp = p; + } + lp = p + ((index >> (i *L2_BITS )) & (L2_SIZE -1 )); }#else p = (void **)l1_phys_map;
@@ -2987,6 +2987,7 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,target_phys_addr_t page;unsigned long pd;PhysPageDesc *p; +unsigned long addr1;while (len >0 ) { page = addr &TARGET_PAGE_MASK ;
@@ -3006,6 +3007,8 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, io_index = (pd >>IO_MEM_SHIFT ) & (IO_MEM_NB_ENTRIES -1 );if (p) addr1 = (addr & ~TARGET_PAGE_MASK ) + p->region_offset; +else + addr1 = addr;/* XXX: could force cpu_single_env to NULL to avoid potential bugs */ if (l >=4 && ((addr1 &3 ) ==0 )) {
@@ -3025,7 +3028,6 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, l =1 ; } }else { -unsigned long addr1; addr1 = (pd &TARGET_PAGE_MASK ) + (addr & ~TARGET_PAGE_MASK );/* RAM case */ ptr = phys_ram_base + addr1;
@@ -3046,6 +3048,8 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, io_index = (pd >>IO_MEM_SHIFT ) & (IO_MEM_NB_ENTRIES -1 );if (p) addr1 = (addr & ~TARGET_PAGE_MASK ) + p->region_offset; +else + addr1 = addr;if (l >=4 && ((addr1 &3 ) ==0 )) {/* 32 bit read access */ val = io_mem_read[io_index][2 ](io_mem_opaque[io_index], addr1);
Signature · 1 line
1.6.2
PATCH 3/24 Fix bug: palcode is at least 6 bits.
--- target-alpha/translate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-alpha/translate.c +1 -1
@@ -692,7 +692,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)if (ctx->mem_idx &1 ) goto invalid_opc;else -gen_excp (ctx,EXCP_CALL_PALP + ((palcode &0x1F ) <<6 ),0 ); +gen_excp (ctx,EXCP_CALL_PALP + ((palcode &0x3F ) <<6 ),0 );#endif }else {/* Invalid PAL call */
Signature · 1 line
1.6.2
PATCH 4/24 Fix bug: do not mask address LSBs for ldwu.
--- target-alpha/translate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-alpha/translate.c +1 -1
@@ -753,7 +753,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)/* LDWU */ if (!(ctx->amask &AMASK_BWX )) goto invalid_opc; -gen_load_mem (ctx, &tcg_gen_qemu_ld16u, ra, rb, disp16,0 ,1 ); +gen_load_mem (ctx, &tcg_gen_qemu_ld16u, ra, rb, disp16,0 ,0 );break ;case 0x0D :/* STW */
Signature · 1 line
1.6.2
PATCH 5/24 bug fix: avoid nop to override next instruction
While searching PC, always store the pc of a new instruction. Instructions that didn't generate tcg code (such as nop) prevented the next one to be referenced.
--- target-alpha/translate.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
target-alpha/translate.c +3 -3
@@ -2380,10 +2380,10 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, lj++;while (lj < j) gen_opc_instr_start[lj++] =0 ; - gen_opc_pc[lj] = ctx.pc; - gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; } + gen_opc_pc[lj] = ctx.pc; + gen_opc_instr_start[lj] =1 ; + gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
Signature · 1 line
1.6.2
PATCH 6/24 Be slightly more verbose for unassigned_mem_read*
This was found useful while adding new devices.
--- exec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
exec.c +3 -3
@@ -2436,7 +2436,7 @@ void qemu_ram_free(ram_addr_t addr)static uint32_t unassigned_mem_readb (void *opaque,target_phys_addr_t addr) {#ifdef DEBUG_UNASSIGNED -printf ("Unassigned mem read " TARGET_FMT_plx"\n" , addr); +printf ("Unassigned mem readb " TARGET_FMT_plx"\n" , addr);#endif #if defined(TARGET_SPARC )do_unassigned_access (addr,0 ,0 ,0 ,1 );
@@ -2447,7 +2447,7 @@ static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr)static uint32_t unassigned_mem_readw (void *opaque,target_phys_addr_t addr) {#ifdef DEBUG_UNASSIGNED -printf ("Unassigned mem read " TARGET_FMT_plx"\n" , addr); +printf ("Unassigned mem readw " TARGET_FMT_plx"\n" , addr);#endif #if defined(TARGET_SPARC )do_unassigned_access (addr,0 ,0 ,0 ,2 );
@@ -2458,7 +2458,7 @@ static uint32_t unassigned_mem_readw(void *opaque, target_phys_addr_t addr)static uint32_t unassigned_mem_readl (void *opaque,target_phys_addr_t addr) {#ifdef DEBUG_UNASSIGNED -printf ("Unassigned mem read " TARGET_FMT_plx"\n" , addr); +printf ("Unassigned mem readl " TARGET_FMT_plx"\n" , addr);#endif #if defined(TARGET_SPARC )do_unassigned_access (addr,0 ,0 ,0 ,4 );
Signature · 1 line
1.6.2
PATCH 7/24 Increase Alpha physical address size to 44 bits.
Remove unused target virt addr.
--- exec.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
exec.c +1 -2
@@ -71,8 +71,7 @@#elif defined(TARGET_SPARC )#define TARGET_PHYS_ADDR_SPACE_BITS 36#elif defined(TARGET_ALPHA ) -#define TARGET_PHYS_ADDR_SPACE_BITS 42 -#define TARGET_VIRT_ADDR_SPACE_BITS 42 +#define TARGET_PHYS_ADDR_SPACE_BITS 44#elif defined(TARGET_PPC64 )#define TARGET_PHYS_ADDR_SPACE_BITS 42#elif defined(TARGET_X86_64 ) && !defined(USE_KQEMU )
Signature · 1 line
1.6.2
PATCH 8/24 Allow 5 mmu indexes.
This is necessary for alpha because it has 4 protection levels and pal mode.
--- exec.c | 30 +++++++++++++++++++++++++----- softmmu_exec.h | 29 ++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 10 deletions(-)
exec.c +25 -5
@@ -1759,12 +1759,18 @@ void tlb_flush(CPUState *env, int flush_global) env->tlb_table[2 ][i].addr_read =-1 ; env->tlb_table[2 ][i].addr_write =-1 ; env->tlb_table[2 ][i].addr_code =-1 ; -#if (NB_MMU_MODES ==4 ) +#endif +#if (NB_MMU_MODES >=4 ) env->tlb_table[3 ][i].addr_read =-1 ; env->tlb_table[3 ][i].addr_write =-1 ; env->tlb_table[3 ][i].addr_code =-1 ;#endif +#if (NB_MMU_MODES >=5 ) + env->tlb_table[4 ][i].addr_read =-1 ; + env->tlb_table[4 ][i].addr_write =-1 ; + env->tlb_table[4 ][i].addr_code =-1 ;#endif + }memset (env->tb_jmp_cache,0 ,TB_JMP_CACHE_SIZE *sizeof (void *));
@@ -1808,9 +1814,12 @@ void tlb_flush_page(CPUState *env, target_ulong addr)tlb_flush_entry (&env->tlb_table[1 ][i], addr);#if (NB_MMU_MODES >=3 )tlb_flush_entry (&env->tlb_table[2 ][i], addr); -#if (NB_MMU_MODES ==4 ) +#endif +#if (NB_MMU_MODES >=4 )tlb_flush_entry (&env->tlb_table[3 ][i], addr);#endif +#if (NB_MMU_MODES >=5 ) +tlb_flush_entry (&env->tlb_table[4 ][i], addr);#endif tlb_flush_jmp_cache (env, addr);
@@ -1894,10 +1903,14 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,#if (NB_MMU_MODES >=3 )for (i =0 ; i <CPU_TLB_SIZE ; i++)tlb_reset_dirty_range (&env->tlb_table[2 ][i], start1, length); -#if (NB_MMU_MODES ==4 ) +#endif +#if (NB_MMU_MODES >=4 )for (i =0 ; i <CPU_TLB_SIZE ; i++)tlb_reset_dirty_range (&env->tlb_table[3 ][i], start1, length);#endif +#if (NB_MMU_MODES >=5 ) +for (i =0 ; i <CPU_TLB_SIZE ; i++) +tlb_reset_dirty_range (&env->tlb_table[4 ][i], start1, length);#endif } }
@@ -1943,10 +1956,14 @@ void cpu_tlb_update_dirty(CPUState *env)#if (NB_MMU_MODES >=3 )for (i =0 ; i <CPU_TLB_SIZE ; i++)tlb_update_dirty (&env->tlb_table[2 ][i]); -#if (NB_MMU_MODES ==4 ) +#endif +#if (NB_MMU_MODES >=4 )for (i =0 ; i <CPU_TLB_SIZE ; i++)tlb_update_dirty (&env->tlb_table[3 ][i]);#endif +#if (NB_MMU_MODES >=5 ) +for (i =0 ; i <CPU_TLB_SIZE ; i++) +tlb_update_dirty (&env->tlb_table[4 ][i]);#endif }
@@ -1968,9 +1985,12 @@ static inline void tlb_set_dirty(CPUState *env, target_ulong vaddr)tlb_set_dirty1 (&env->tlb_table[1 ][i], vaddr);#if (NB_MMU_MODES >=3 )tlb_set_dirty1 (&env->tlb_table[2 ][i], vaddr); -#if (NB_MMU_MODES ==4 ) +#endif +#if (NB_MMU_MODES >=4 )tlb_set_dirty1 (&env->tlb_table[3 ][i], vaddr);#endif +#if (NB_MMU_MODES >=5 ) +tlb_set_dirty1 (&env->tlb_table[4 ][i], vaddr);#endif }
softmmu_exec.h +24 -5
@@ -60,6 +60,7 @@#include "softmmu_header.h" #undef ACCESS_TYPE#undef MEMSUFFIX +#endif /* (NB_MMU_MODES >= 3) */ #if (NB_MMU_MODES >=4 )
@@ -78,12 +79,30 @@#include "softmmu_header.h" #undef ACCESS_TYPE#undef MEMSUFFIX +#endif /* (NB_MMU_MODES >= 4) */ -#if (NB_MMU_MODES >4 ) -#error "NB_MMU_MODES > 4 is not supported for now" -#endif /* (NB_MMU_MODES > 4) */ -#endif /* (NB_MMU_MODES == 4) */ -#endif /* (NB_MMU_MODES >= 3) */ +#if (NB_MMU_MODES >=5 ) + +#define ACCESS_TYPE 4 +#define MEMSUFFIX MMU_MODE4_SUFFIX +#define DATA_SIZE 1 +#include "softmmu_header.h" + +#define DATA_SIZE 2 +#include "softmmu_header.h" + +#define DATA_SIZE 4 +#include "softmmu_header.h" + +#define DATA_SIZE 8 +#include "softmmu_header.h" +#undef ACCESS_TYPE +#undef MEMSUFFIX +#endif /* (NB_MMU_MODES >= 4) */ + +#if (NB_MMU_MODES >5 ) +#error "NB_MMU_MODES > 5 is not supported for now" +#endif /* (NB_MMU_MODES > 5) */ /* these access are slower, they must be as rare as possible */ #define ACCESS_TYPE (NB_MMU_MODES)
Signature · 1 line
1.6.2
PATCH 9/24 Split cpu_mmu_index into cpu_mmu_index_data and cpu_mmu_index_code.
This is required by alpha system emulation as PAL mode disable instruction mmu but not data mmu.
This might also be required for other cpus that have a split I/D mmu enable.
--- exec-all.h | 2 +- softmmu_header.h | 4 ++-- target-alpha/cpu.h | 13 +++++++++++-- target-alpha/op_helper.c | 4 ++-- target-arm/cpu.h | 3 ++- target-cris/cpu.h | 3 ++- target-cris/translate.c | 6 +++--- target-i386/cpu.h | 3 ++- target-m68k/cpu.h | 3 ++- target-mips/cpu.h | 3 ++- target-ppc/cpu.h | 3 ++- target-sh4/cpu.h | 3 ++- target-sparc/cpu.h | 3 ++- target-sparc/translate.c | 2 +- 14 files changed, 36 insertions(+), 19 deletions(-)
exec-all.h +1 -1
@@ -318,7 +318,7 @@ static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr)int mmu_idx, page_index, pd; page_index = (addr >>TARGET_PAGE_BITS ) & (CPU_TLB_SIZE -1 ); - mmu_idx =cpu_mmu_index (env1); + mmu_idx =cpu_mmu_index_code (env1);if (unlikely (env1->tlb_table[mmu_idx][page_index].addr_code != (addr &TARGET_PAGE_MASK ))) {ldub_code (addr);
softmmu_header.h +2 -2
@@ -46,12 +46,12 @@#elif ACCESS_TYPE == (NB_MMU_MODES ) -#define CPU_MMU_INDEX (cpu_mmu_index(env)) +#define CPU_MMU_INDEX (cpu_mmu_index_data(env))#define MMUSUFFIX _mmu#elif ACCESS_TYPE == (NB_MMU_MODES +1 ) -#define CPU_MMU_INDEX (cpu_mmu_index(env)) +#define CPU_MMU_INDEX (cpu_mmu_index_code(env))#define MMUSUFFIX _cmmu#else
target-alpha/cpu.h +11 -2
@@ -297,16 +297,25 @@ struct CPUAlphaState {#define cpu_exec cpu_alpha_exec#define cpu_gen_code cpu_alpha_gen_code#define cpu_signal_handler cpu_alpha_signal_handler +#define cpu_list alpha_cpu_list/* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _executive#define MMU_MODE2_SUFFIX _supervisor#define MMU_MODE3_SUFFIX _user +#define MMU_MODE4_SUFFIX _pal +#define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3 -static inline int cpu_mmu_index (CPUState *env) +#define MMU_PAL_IDX 4 +static inline int cpu_mmu_index_data (CPUState *env) { -return (env->ps >>3 ) &3 ; +return env->mmu_data_index; +} + +static inline int cpu_mmu_index_code (CPUState *env) +{ +return env->mmu_code_index; }#if defined(CONFIG_USER_ONLY )
target-alpha/op_helper.c +2 -2
@@ -1049,7 +1049,7 @@ uint64_t helper_ld_virt_to_phys (uint64_t virtaddr)int index, mmu_idx;void *retaddr; - mmu_idx =cpu_mmu_index (env); + mmu_idx =cpu_mmu_index_data (env); index = (virtaddr >>TARGET_PAGE_BITS ) & (CPU_TLB_SIZE -1 ); redo: tlb_addr = env->tlb_table[mmu_idx][index].addr_read;
@@ -1071,7 +1071,7 @@ uint64_t helper_st_virt_to_phys (uint64_t virtaddr)int index, mmu_idx;void *retaddr; - mmu_idx =cpu_mmu_index (env); + mmu_idx =cpu_mmu_index_data (env); index = (virtaddr >>TARGET_PAGE_BITS ) & (CPU_TLB_SIZE -1 ); redo: tlb_addr = env->tlb_table[mmu_idx][index].addr_write;
target-arm/cpu.h +2 -1
@@ -412,7 +412,8 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return (env->uncached_cpsr &CPSR_M ) ==ARM_CPU_MODE_USR ?1 :0 ; }
target-cris/cpu.h +2 -1
@@ -212,7 +212,8 @@ enum {#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return !!(env->pregs[PR_CCS ] &U_FLAG ); }
target-cris/translate.c +3 -3
@@ -1104,7 +1104,7 @@ static inline void cris_prepare_jmp (DisasContext *dc, unsigned int type)static void gen_load64 (DisasContext *dc,TCGv_i64 dst,TCGv addr) { -int mem_index =cpu_mmu_index (dc->env); +int mem_index =cpu_mmu_index_data (dc->env);/* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */
@@ -1117,7 +1117,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr)static void gen_load (DisasContext *dc,TCGv dst,TCGv addr,unsigned int size,int sign) { -int mem_index =cpu_mmu_index (dc->env); +int mem_index =cpu_mmu_index_data (dc->env);/* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */
@@ -1147,7 +1147,7 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,static void gen_store (DisasContext *dc,TCGv addr,TCGv val,unsigned int size) { -int mem_index =cpu_mmu_index (dc->env); +int mem_index =cpu_mmu_index_data (dc->env);/* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */
target-i386/cpu.h +2 -1
@@ -842,7 +842,8 @@ static inline int cpu_get_time_fast(void)#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return (env->hflags &HF_CPL_MASK ) ==3 ?1 :0 ; }
target-m68k/cpu.h +2 -1
@@ -218,7 +218,8 @@ void register_m68k_insns (CPUM68KState *env);#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return (env->sr &SR_S ) ==0 ?1 :0 ; }
target-mips/cpu.h +2 -1
@@ -489,7 +489,8 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,#define MMU_MODE1_SUFFIX _super#define MMU_MODE2_SUFFIX _user#define MMU_USER_IDX 2 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return env->hflags &MIPS_HFLAG_KSU ; }
target-ppc/cpu.h +2 -1
@@ -810,7 +810,8 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val);#define MMU_MODE1_SUFFIX _kernel#define MMU_MODE2_SUFFIX _hypv#define MMU_USER_IDX 0 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return env->mmu_idx; }
target-sh4/cpu.h +2 -1
@@ -181,7 +181,8 @@ void cpu_load_tlb(CPUSH4State * env);#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) {return (env->sr &SR_MD ) ==0 ?1 :0 ; }
target-sparc/cpu.h +2 -1
@@ -456,7 +456,8 @@ int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);#define MMU_KERNEL_IDX 1#define MMU_HYPV_IDX 2 -static inline int cpu_mmu_index (CPUState *env1) +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env1) {#if defined(CONFIG_USER_ONLY )return MMU_USER_IDX ;
target-sparc/translate.c +1 -1
@@ -4789,7 +4789,7 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb, dc->pc = pc_start; last_pc = dc->pc; dc->npc = (target_ulong ) tb->cs_base; - dc->mem_idx =cpu_mmu_index (env); + dc->mem_idx =cpu_mmu_index_code (env); dc->def = env->def;if ((dc->def->features &CPU_FEATURE_FLOAT )) dc->fpu_enabled =cpu_fpu_enabled (env);
Signature · 1 line
1.6.2
PATCH 10/24 Add square wave output support.
This is necessary for es40 as the sqw output is directly connected to the core chipset.
--- hw/mc146818rtc.c | 40 ++++++++++++++++++++++++++++++---------- hw/pc.h | 1 + 2 files changed, 31 insertions(+), 10 deletions(-)
hw/mc146818rtc.c +30 -10
@@ -50,11 +50,12 @@#define REG_A_UIP 0x80 -#define REG_B_SET 0x80 -#define REG_B_PIE 0x40 -#define REG_B_AIE 0x20 -#define REG_B_UIE 0x10 -#define REG_B_DM 0x04 +#define REG_B_SET 0x80 +#define REG_B_PIE 0x40 +#define REG_B_AIE 0x20 +#define REG_B_UIE 0x10 +#define REG_B_SQWE 0x08 +#define REG_B_DM 0x04struct RTCState {uint8_t cmos_data[128 ];
@@ -62,6 +63,7 @@ struct RTCState {struct tm current_tm;int base_year;qemu_irq irq; +qemu_irq sqw_irq;int it_shift;/* periodic timer */ QEMUTimer *periodic_timer;
@@ -95,20 +97,25 @@ static void rtc_timer_update(RTCState *s, int64_t current_time) {int period_code, period;int64_t cur_clock, next_irq_clock; +int enable_pie; period_code = s->cmos_data[RTC_REG_A ] &0x0f ;#if definedTARGET_I386 || definedTARGET_X86_64 /* disable periodic timer if hpet is in legacy mode, since interrupts are * disabled anyway. */ -if (period_code !=0 && (s->cmos_data[RTC_REG_B ] ®_B_PIE ) && !hpet_in_legacy_mode ()) { + enable_pie =hpet_in_legacy_mode ();#else -if (period_code !=0 && (s->cmos_data[RTC_REG_B ] ®_B_PIE )) { + enable_pie =1 ;#endif +if (period_code !=0 + && (((s->cmos_data[RTC_REG_B ] ®_B_PIE ) && enable_pie) + || ((s->cmos_data[RTC_REG_B ] ®_B_SQWE ) && s->sqw_irq))) {if (period_code <=2 ) period_code +=7 ;/* period in 32 Khz cycles */ period =1 << (period_code -1 ); +//period *= 2; #ifdef TARGET_I386 if (period != s->period) s->irq_coalesced = (s->irq_coalesced * s->period) / period;
@@ -138,8 +145,15 @@ static void rtc_periodic_timer(void *opaque) return; }#endif - s->cmos_data[RTC_REG_C ] |=0xc0 ; -rtc_irq_raise (s->irq); +if (s->cmos_data[RTC_REG_B ] ®_B_PIE ) { + s->cmos_data[RTC_REG_C ] |=0xc0 ; +rtc_irq_raise (s->irq); + } +if (s->cmos_data[RTC_REG_B ] ®_B_SQWE ) { +/* Not square wave at all but we don't want 2048Hz interrupts! +Must be seen as a pulse. */ +qemu_irq_raise (s->sqw_irq); + } }static void cmos_ioport_write (void *opaque,uint32_t addr,uint32_t data)
@@ -527,13 +541,14 @@ static int rtc_load_td(QEMUFile *f, void *opaque, int version_id) }#endif -RTCState *rtc_init (int base,qemu_irq irq,int base_year) +RTCState *rtc_init_sqw (int base,qemu_irq irq,qemu_irq sqw_irq,int base_year) {RTCState *s; s =qemu_mallocz (sizeof (RTCState)); s->irq = irq; + s->sqw_irq = sqw_irq; s->cmos_data[RTC_REG_A ] =0x26 ; s->cmos_data[RTC_REG_B ] =0x02 ; s->cmos_data[RTC_REG_C ] =0x00 ;
@@ -563,6 +578,11 @@ RTCState *rtc_init(int base, qemu_irq irq, int base_year)return s; } +RTCState *rtc_init (int base,qemu_irq irq,int base_year) +{ +return rtc_init_sqw (base, irq,NULL , base_year); +} +/* Memory mapped interface */ static uint32_t cmos_mm_readb (void *opaque,target_phys_addr_t addr) {
hw/pc.h +1 -0
@@ -87,6 +87,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,typedef struct RTCState RTCState ;RTCState *rtc_init (int base,qemu_irq irq,int base_year); +RTCState *rtc_init_sqw (int base,qemu_irq irq,qemu_irq sqw_irq,int base_year);RTCState *rtc_mm_init (target_phys_addr_t base,int it_shift,qemu_irq irq,int base_year);void rtc_set_memory (RTCState *s,int addr,int val);
Signature · 1 line
1.6.2
PATCH 11/24 Add ali1543 super IO pci device.
This is a very partial implementation just enough for es40 firmware.
--- hw/ali1543.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/pci.h | 8 ++++ 2 files changed, 135 insertions(+), 0 deletions(-) create mode 100644 hw/ali1543.c
hw/ali1543.c new file +127 -0
@@ -0,0 +1,127 @@ +/* +* QEMU Ali 1543c emulation +* +* Copyright (c) 2009 AdaCore +* +* Written by Tristan Gingold. +* +* This work is licensed under the GNU GPL license version 2 or later. +* +*/ +#include <time.h> +#include <sys/time.h> +#include "hw.h" +#include "net.h" +#include "sysemu.h" +#include "devices.h" +#include "boards.h" +#include "pc.h" +#include "isa.h" +#include "qemu-char.h" +#include "pci.h" + +struct ali1543_t { +PCIDevice pci; + +qemu_irq *irq;/* Upstream handler. */ +PITState *pit; +qemu_irq *i8259; + +/* Configuration. */ +enum cfg_state {CFG_SNOOP ,CFG_51 ,CFG_EN } cfg_state; +unsigned char cfg_index; +}; + +static void ali_cfg_write (void *opaque,uint32_t addr,uint32_t val) +{ +ali1543_t *ali = opaque; + +if ((addr &1 ) ==0 ) { +switch (ali->cfg_state) { +case CFG_SNOOP : +if (val ==0x51 ) + ali->cfg_state =CFG_51 ; +else +qemu_log ("ali1543-cfg: write %02x to cfg_port\n" , val); +break ; +case CFG_51 : +if (val ==0x23 ) + ali->cfg_state =CFG_EN ; +else { +qemu_log ("ali1543-cfg: write %02x to cfg_port (51)\n" , val); + ali->cfg_state =CFG_SNOOP ; + } +break ; +case CFG_EN : + ali->cfg_index = val; +break ; + } + } +else { +qemu_log ("ali1543-cfg: write %02x to cfg reg %02x (addr=%x)\n" , + val, ali->cfg_index, addr); + } +} + +static uint32_t ali_cfg_read (void *opaque,uint32_t addr) +{ +ali1543_t *ali = opaque; + +if ((addr &1 ) ==0 ) { +if (ali->cfg_state !=CFG_EN ) { +qemu_log ("ali1543-cfg: read fromcfg_port\n" ); +return 0 ; + } +else +return ali->cfg_index; + } +else { +qemu_log ("ali1543-cfg: read from reg %02x\n" , ali->cfg_index); +return 0 ; + } +} + +ali1543_t *ali1543_init (PCIBus *bus,int devfn,qemu_irq irq) +{ +ali1543_t *ali; +uint8_t *pci_conf; + + ali = (ali1543_t *)pci_register_device (bus,"Ali1543" ,sizeof (ali1543_t), + devfn,NULL ,NULL ); + + pci_conf = ali->pci.config; + +pci_config_set_vendor_id (pci_conf,PCI_VENDOR_ID_ALI ); +pci_config_set_device_id (pci_conf,PCI_DEVICE_ID_ALI1543 ); + pci_conf[0x08 ] =0xc3 ;// Revision +pci_config_set_class (pci_conf,PCI_CLASS_BRIDGE_ISA ); + pci_conf[0x2c ] =0 ;// Subsystem + pci_conf[0x2d ] =0 ; + pci_conf[0x2e ] =0 ; + pci_conf[0x2f ] =0 ; + +register_ioport_read (0x370 ,2 ,1 , ali_cfg_read, ali); +register_ioport_write (0x370 ,2 ,1 , ali_cfg_write, ali); + + ali->i8259 =i8259_init (irq); + +/* serial_init already handles NULL CharDriverState but this code adds +a more useful label. */ +if (serial_hds[0 ] ==NULL ) + serial_hds[0 ] =qemu_chr_open ("com1" ,"nul" ,NULL ); +if (serial_hds[1 ] ==NULL ) + serial_hds[1 ] =qemu_chr_open ("com2" ,"nul" ,NULL ); + +serial_init (0x3f8 , ali->i8259[4 ],115200 , serial_hds[0 ]); +serial_init (0x2f8 , ali->i8259[3 ],115200 , serial_hds[1 ]); + ali->pit =pit_init (0x40 , ali->i8259[0 ]); +pcspk_init (ali->pit); +DMA_init (0 ); + +return ali; +} + +qemu_irq ali1543_get_irq (ali1543_t *c,int n) +{ +return c->i8259[n]; +}
hw/pci.h +8 -0
@@ -83,6 +83,9 @@ extern target_phys_addr_t pci_mem_base;#define PCI_VENDOR_ID_CMD 0x1095#define PCI_DEVICE_ID_CMD_646 0x0646 +#define PCI_VENDOR_ID_ALI 0x10b9 +#define PCI_DEVICE_ID_ALI1543 0x1533 +#define PCI_VENDOR_ID_REALTEK 0x10ec#define PCI_DEVICE_ID_REALTEK_RTL8029 0x8029#define PCI_DEVICE_ID_REALTEK_8139 0x8139
@@ -314,4 +317,9 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,PCIBus *sh_pci_register_bus (pci_set_irq_fn set_irq,pci_map_irq_fn map_irq,qemu_irq *pic,int devfn_min,int nirq); +/* ali1543.c */ +typedef struct ali1543_t ali1543_t ; +ali1543_t *ali1543_init (PCIBus *bus,int devfn,qemu_irq irq); +qemu_irq ali1543_get_irq (ali1543_t *c,int n); +#endif
Signature · 1 line
1.6.2
PATCH 12/24 Add 21272 chipset (memory and pci controller for alpha)
--- hw/21272.c | 698 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/pci.h | 8 + 2 files changed, 706 insertions(+), 0 deletions(-) create mode 100644 hw/21272.c
hw/21272.c new file +698 -0
@@ -0,0 +1,698 @@ +/* +* Qemu 21272 (Tsunami/Typhoon) chipset emulation. +* +* Copyright (c) 2009 AdaCore +* +* Written by Tristan Gingold. +* +* This work is licensed under the GNU GPL license version 2 or later. +*/ +#include "hw.h" +#include "devices.h" +#include "pci.h" + +//#define DEBUG_CCHIP +//#define DEBUG_PCHIP +//#define DEBUG_PCICFG + +typedef struct pchip_t pchip_t ; +struct pchip_t { +/* IntAck handler. */ +int (*iack_handler)(void *); +void *iack_handler_param; + +PCIBus *pci; + +/* Pchip id. */ +int num; + +/* Used to reconstruct 64bits accesses. Low long word first. */ +uint32_t data; + +uint32_t wsba[3 ]; +uint64_t wsba3; +uint32_t wsm[3 ]; +uint32_t wsm3; +uint64_t tba[3 ]; +uint64_t tba3; +uint32_t perrmask; +/* pctl */ +unsigned char ptevrfy; +unsigned char mwin; +unsigned char hole; +unsigned char chaindis; +}; + +struct typhoon_t { +qemu_irq *irqs; +qemu_irq *intim_irq; +CPUState *cpu[4 ]; + +/* Used to reconstruct 64bits accesses. Low long word first. */ +uint32_t data; + +unsigned char misc_rev; +unsigned char misc_abw; +unsigned char misc_abt; + +int b_irq[4 ]; + +uint64_t dim[4 ]; +uint64_t dir[4 ]; +uint64_t drir; +uint64_t aar[4 ]; +pchip_t pchip[2 ]; +}; + +static void illegal_write (void *opaque, +target_phys_addr_t addr,uint32_t value) +{ +qemu_log ("illegal_write at addr=" TARGET_FMT_lx"\n" , addr); +} + +static uint32_t illegal_read (void *opaque,target_phys_addr_t addr) +{ +qemu_log ("illegal_read at addr=" TARGET_FMT_lx"\n" , addr); +return 0 ; +} + + +static uint32_t typhoon_cchip_readl (void *opaque,target_phys_addr_t addr) +{ +typhoon_t *s = opaque; +uint64_t val; +int reg; + +/* Handle 64-bits accesses; */ +if (addr &0x04 ) +return s->data; + + reg = addr >>6 ; +switch (reg) { +case 0x02 :/* MISC */ + val = ((uint64_t )s->misc_rev <<32 ) + | ((uint64_t )s->misc_abt <<20 ) + | ((uint64_t )s->misc_abw <<16 ) + | ((s->b_irq[0 ] &4 ) <<2 ) + | ((s->b_irq[1 ] &4 ) <<3 ) + | ((s->b_irq[2 ] &4 ) <<4 ) + | ((s->b_irq[3 ] &4 ) <<5 ); +break ; +case 0x04 : +case 0x05 : +case 0x06 : +case 0x07 : + val = s->aar[reg -4 ]; +break ; +case 0x08 : +case 0x09 : +case 0x18 : +case 0x19 : + val = s->dim[(reg &1 ) | ((reg &0x10 ) >>3 )]; +break ; +case 0x0a : +case 0x0b : +case 0x1a : +case 0x1b : + val = s->dir[(reg &1 ) | ((reg &0x10 ) >>3 )]; +break ; +default : +qemu_log ("21272: unhandled cchip read reg=%x\n" , reg); + val =0 ; +break ; + } + +#ifdef DEBUG_CCHIP +fprintf (stderr,"typhoon cchip read reg=%x, val=%016" PRIx64"\n" , reg, val); +#endif + s->data = val >>32 ; +return (uint32_t )val; +} + +static void typhoon_cchip_writel (void *opaque, +target_phys_addr_t addr,uint32_t value) +{ +typhoon_t *s = opaque; +int reg; +uint64_t val; + +#if 0 +fprintf (stderr,"typhoon write addr=" TARGET_FMT_lx", val=%08x\n" , + addr, value); +#endif + +/* Handle 64-bits accesses. LSB first. */ +if (!(addr &0x04 )) { + s->data = value; +return ; + } +else + val = ((uint64_t )value <<32 ) | s->data; + + reg = addr >>6 ; + +#ifdef DEBUG_CCHIP +fprintf (stderr,"typhoon cchip write reg=%x, val=%016" PRIx64"\n" , reg, val); +#endif + +switch (reg) { +case 0x02 :/* MISC */ +if (val & (1 <<24 )) { +/* ACL: arbitration clear. */ + s->misc_abt =0 ; + s->misc_abw =0 ; + } +if ((val & (0xf <<16 )) && s->misc_abw ==0 ) { +/* ABW: arbitration won. */ + s->misc_abw = (val >>16 ) &0x0f ; + } +if ((val & (0x0f <<20 )) && s->misc_abt ==0 ) { +/* ABT: arbitration try. */ + s->misc_abt = (val >>20 ) &0x0f ; + } +if (val & (1ULL <<28 )) { +/* NXM - not handled. */ + } +if (val & (0x0fULL <<40 )) { +/* DEVUP - not handled. */ + } +if (val & (0x0f <<4 )) { +int i; +for (i =0 ; i <4 && s->cpu[i]; i++) +if ((val & (0x10 << i))) { + s->b_irq[i] &= ~(1 <<2 ); +cpu_alpha_update_irq (s->cpu[i], s->b_irq[i]); + } + } +if (val & ~((0xfULL <<40 ) | (0xffULL <<32 ) | (1 <<28 ) | (1ULL <<24 ) + | (0xf <<16 ) | (0x0f <<20 ) | (0x0f <<4 ))) { +qemu_log ("21272: unhandled value %016" PRIx64" written in MISC\n" , + val); + } +break ; +case 0x08 : +case 0x09 : +case 0x18 : +case 0x19 : + s->dim[(reg &1 ) | ((reg &0x10 ) >>3 )] = val; +break ; +default : +qemu_log ("21272: unhandled cchip write reg %x (%016" PRIx64")\n" , + reg, val); +break ; + } +} + +static CPUReadMemoryFunc *typhoon_cchip_read[] = { + &illegal_read, + &illegal_read, + &typhoon_cchip_readl, +}; + +static CPUWriteMemoryFunc *typhoon_cchip_write[] = { + &illegal_write, + &illegal_write, + &typhoon_cchip_writel, +}; + +static uint32_t typhoon_pchip_readl (void *opaque,target_phys_addr_t addr) +{ +pchip_t *s = opaque; +uint64_t val; +int reg; + +/* Handle 64-bits accesses; */ +if (addr &0x04 ) +return s->data; + + reg = addr >>6 ; +switch (reg) { +case 0 : +case 1 : +case 2 : + val = s->wsba[reg]; +break ; +case 3 : + val = s->wsba3; +break ; +case 0x0c :/* pctl */ + val = (((uint64_t )(s->num &3 )) <<46 ) + | (((uint64_t )s->ptevrfy) <<44 ) + | (1ULL <<40 )/* PCLKX */ + | (s->mwin <<6 ) + | (s->hole <<5 ) + | (s->chaindis <<3 ); +break ; +case 0x0f :/* PERROR */ + val =0 ;/* Not emulated. */ +break ; +case 0x10 :/* PERRMASK */ + val = s->perrmask; +break ; +case 0x20 :/* WO. */ + val =0 ; +break ; +default : +qemu_log ("21272: unhandled pchip read reg=%x\n" , reg); + val =0 ; +break ; + } + +#ifdef DEBUG_PCHIP +fprintf (stderr,"typhoon pchip%d read reg=%x, val=%016" PRIx64"\n" , + s->num, reg, val); +#endif + s->data = val >>32 ; +return (uint32_t )val; +} + +static void typhoon_pchip_writel (void *opaque, +target_phys_addr_t addr,uint32_t value) +{ +pchip_t *s = opaque; +int reg; +uint64_t val; + +/* Handle 64-bits accesses. LSB first. */ +if (!(addr &0x04 )) { + s->data = value; +return ; + } +else + val = ((uint64_t )value <<32 ) | s->data; + + reg = addr >>6 ; + +#ifdef DEBUG_PCHIP +fprintf (stderr,"typhoon pchip%d write reg=%x, val=%016" PRIx64"\n" , + s->num, reg, val); +#endif + +switch (reg) { +case 0 : +case 1 : +case 2 : + s->wsba[reg] = val &0xfff00003 ; +if (val &1 ) +qemu_log ("21272: enabling wsba!\n" );/* Not yet emulated */ +break ; +case 3 : + s->wsba3 = val &0xffffff80fff00003ULL ; +if (val &1 ) +qemu_log ("21272: enabling wsba3!\n" );/* Not yet emulated */ +break ; +case 0x4 : +case 0x5 : +case 0x6 : + s->wsm[reg -4 ] = val &0xfff00000 ; +break ; +case 0x7 : + s->wsm3 = val &0xfff00000 ; +break ; +case 0x8 : +case 0x9 : +case 0xa : + s->tba[reg -0x8 ] = val &0x7fffffc00 ; +break ; +case 0xb : + s->tba3 = val &0x7fffffc00 ; +break ; +case 0x0c :/* pctl */ + s->ptevrfy = (val >>44 ) &1 ; + s->mwin = (val >>6 ) &1 ; + s->hole = (val >>5 ) &1 ; + s->chaindis = (val >>3 ) &1 ; +if (val & ((1ULL <<43 ) | (1ULL <<42 ) | (3ULL <<36 ) | (0x0fULL <<32 ) + | (0x0f <<20 ) | (1 <<19 ) | (0x3f <<8 ) + | (1 <<2 ) | (1 <<1 ))) +qemu_log ("21272: pchip pctl: unhandled value %016" PRIx64"\n" , + val); +break ; +case 0x0f :/* PERROR */ +break ;/* Not emulated. */ +case 0x10 :/* PERRMASK */ + s->perrmask = val &0xfff ; +break ; +case 0x20 :/* SPRST */ +/* Software pci-reset. FIXME: disable bus? */ +break ; +default : +qemu_log ("21272: unhandled pchip write reg=%x (%016" PRIx64")\n" , + reg, val); +break ; + } +} + +static CPUReadMemoryFunc *typhoon_pchip_read[] = { + &illegal_read, + &illegal_read, + &typhoon_pchip_readl, +}; + +static CPUWriteMemoryFunc *typhoon_pchip_write[] = { + &illegal_write, + &illegal_write, + &typhoon_pchip_writel, +}; + + +static void pchip_pci_io_writeb (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +cpu_outb (NULL , addr, value); +} + +static uint32_t pchip_pci_io_readb (void *opaque,target_phys_addr_t addr) +{ +return cpu_inb (NULL , addr); +} + +static void pchip_pci_io_writew (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +#ifdef TARGET_WORDS_BIGENDIAN + value =bswap16 (value); +#endif +cpu_outw (NULL , addr, value); +} + +static uint32_t pchip_pci_io_readw (void *opaque,target_phys_addr_t addr) +{ +uint32_t ret; + + ret =cpu_inw (NULL , addr); +#ifdef TARGET_WORDS_BIGENDIAN + ret =bswap16 (ret); +#endif +return ret; +} + +static void pchip_pci_io_writel (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +#ifdef TARGET_WORDS_BIGENDIAN + value =bswap32 (value); +#endif +cpu_outl (NULL , addr, value); +} + +static uint32_t pchip_pci_io_readl (void *opaque,target_phys_addr_t addr) +{ +uint32_t ret; + + ret =cpu_inl (NULL , addr); +#ifdef TARGET_WORDS_BIGENDIAN + ret =bswap32 (ret); +#endif +return ret; +} + +static CPUWriteMemoryFunc *pchip_pci_io_write[] = { + &pchip_pci_io_writeb, + &pchip_pci_io_writew, + &pchip_pci_io_writel, +}; + +static CPUReadMemoryFunc *pchip_pci_io_read[] = { + &pchip_pci_io_readb, + &pchip_pci_io_readw, + &pchip_pci_io_readl, +}; + +static void pchip_pci_cfg_writex (void *opaque,target_phys_addr_t addr, +uint32_t value,int sz) +{ +uint32_t a = addr &0xffffffU ; +pchip_t *s = opaque; + +#ifdef DEBUG_PCICFG +fprintf (stderr,"pci_cfg write: addr=%06x, sz=%d %u:%u:%02x, val=%08x\n" , + a, sz, + (a >>11 ) &0x1f , (a >>8 ) &0x7 , a &0xff , value); +#endif + +pci_data_write (s->pci, a, value,1 << sz); +} + +static void pchip_pci_cfg_writel (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +#ifdef TARGET_WORDS_BIGENDIAN + value =bswap32 (value); +#endif +pchip_pci_cfg_writex (opaque, addr, value,2 ); +} + +static void pchip_pci_cfg_writew (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +#ifdef TARGET_WORDS_BIGENDIAN + value =bswap16 (value); +#endif +pchip_pci_cfg_writex (opaque, addr, value,1 ); +} + +static void pchip_pci_cfg_writeb (void *opaque,target_phys_addr_t addr, +uint32_t value) +{ +pchip_pci_cfg_writex (opaque, addr, value,0 ); +} + +static uint32_t pchip_pci_cfg_readx (void *opaque,target_phys_addr_t addr, +int sz) +{ +uint32_t a = addr &0xffffffU ; +pchip_t *s = opaque; +uint32_t val; + + val =pci_data_read (s->pci, a,1 << sz); + +#ifdef DEBUG_PCICFG +fprintf (stderr,"pci_cfg read: addr=%06x, sz=%d %u:%u:%02x, val=%08x\n" , + a, sz, + (a >>11 ) &0x1f , (a >>8 ) &0x7 , a &0xff , + val); +#endif + +return val; +} + +static uint32_t pchip_pci_cfg_readb (void *opaque,target_phys_addr_t addr) +{ +return pchip_pci_cfg_readx (opaque, addr,0 ); +} + +static uint32_t pchip_pci_cfg_readw (void *opaque,target_phys_addr_t addr) +{ +return pchip_pci_cfg_readx (opaque, addr,1 ); +} + +static uint32_t pchip_pci_cfg_readl (void *opaque,target_phys_addr_t addr) +{ +return pchip_pci_cfg_readx (opaque, addr,2 ); +} + +static CPUWriteMemoryFunc *pchip_pci_cfg_write[] = { + &pchip_pci_cfg_writeb, + &pchip_pci_cfg_writew, + &pchip_pci_cfg_writel, +}; + +static CPUReadMemoryFunc *pchip_pci_cfg_read[] = { + &pchip_pci_cfg_readb, + &pchip_pci_cfg_readw, + &pchip_pci_cfg_readl, +}; + +static void pchip_pci_iack_writex (void *opaque, +target_phys_addr_t addr,uint32_t value) +{ +qemu_log ("21272: pci iack addr=%08x, val=%08x\n" , (uint32_t )addr, value); +} + +static uint32_t pchip_pci_iack_readx (void *opaque,target_phys_addr_t addr) +{ +pchip_t *s = opaque; +uint32_t res; + +/* Ideally we should have a PCIBus interface. */ + res = (*s->iack_handler)(s->iack_handler_param); +//fprintf(stderr, "21272 iack: addr=%016"PRIx64", res=%d\n", addr, res); +return res; +} + +static CPUWriteMemoryFunc *pchip_pci_iack_write[] = { + &pchip_pci_iack_writex, + &pchip_pci_iack_writex, + &pchip_pci_iack_writex, +}; + +static CPUReadMemoryFunc *pchip_pci_iack_read[] = { + &pchip_pci_iack_readx, + &pchip_pci_iack_readx, + &pchip_pci_iack_readx, +}; + +static void typhoon_reset (void *opaque) +{ +typhoon_t *s = opaque; + + s->misc_rev =8 ; + s->misc_abw =0 ; +} + +static void cchip_set_irq (void *opaque,int irq,int level) +{ +typhoon_t *s = opaque; +uint64_t mask; +int i; + +#if 0 +qemu_log ("cchip_set_irq: irq=%d level=%d\n" , irq, level); +#endif + mask =1ULL << irq; +if (level) + s->drir |= mask; +else + s->drir &= ~mask; + +for (i =0 ; i <4 && s->cpu[i]; i++) { +int old = s->b_irq[i]; + s->dir[i] = s->drir & s->dim[i]; +if (s->dir[i] >>58 ) + s->b_irq[i] |= (1 <<0 ); +else + s->b_irq[i] &= ~(1 <<0 ); + +if (s->dir[i] <<8 ) + s->b_irq[i] |= (1 <<1 ); +else + s->b_irq[i] &= ~(1 <<1 ); + +#if 0 +qemu_log ("cchip_set_irq: cpu[%d]: drir=%016" PRIx64" dim=%016" PRIx64" " +" dir=%016" PRIx64" birq=%02x\n" , + i, s->drir, s->dim[i], s->dir[i], s->b_irq[i]); +#endif +if (s->b_irq[i] != old) +cpu_alpha_update_irq (s->cpu[i], s->b_irq[i]); + } +} + +static void intim_set_irq (void *opaque,int irq,int level) +{ +int i; +typhoon_t *s = opaque; +unsigned char old; + +#if 0 + { +static int cnt; + cnt++; +if ((cnt %1024 ) ==1023 ) +fprintf (stderr,"Clock!\n" ); + } +#endif + +if (0 && (s->b_irq[0 ] &0x04 )) +fprintf (stderr,"!!Interrupt missed\n" ); + +for (i =0 ; i <4 && s->cpu[i]; i++) { + old = s->b_irq[i]; +if (!(old & (1 <<2 ))) { + s->b_irq[i] |= (1 <<2 ); +cpu_alpha_update_irq (s->cpu[i], s->b_irq[i]); + } + } +} + + +static int typhoon_map_irq (PCIDevice *pci_dev,int irq_num) +{ +return irq_num; +} + +static void typhoon_set_irq (qemu_irq *pic,int irq_num,int level) +{ +/* Never called (yet). */ +fprintf (stderr,"typhoon_set_irq: irq_num=%d, level=%d\n" , irq_num, level); +exit (4 ); +} + +typhoon_t *typhoon_21272_init (uint64_t *arr,qemu_irq **irqs, +qemu_irq *intim_irq,void *cpu0) +{ +typhoon_t *s; +int cchip; +int pchip; +int pci_io; +int pci_cfg; +int pci_iack; +int i; + + s =qemu_mallocz (sizeof (typhoon_t)); + cchip =cpu_register_io_memory (0 , typhoon_cchip_read, + typhoon_cchip_write, s); + +/* Cchip registers. */ +cpu_register_physical_memory (0x801a0000000ULL ,0x0002000 , cchip); + +/* Pchip0/1 registers. */ + pchip =cpu_register_io_memory (0 , typhoon_pchip_read, + typhoon_pchip_write, &s->pchip[0 ]); +cpu_register_physical_memory (0x80180000000ULL ,0x0002000 , pchip); + +/* Pchip1 registers. */ + pchip =cpu_register_io_memory (0 , typhoon_pchip_read, + typhoon_pchip_write, &s->pchip[1 ]); +cpu_register_physical_memory (0x80380000000ULL ,0x0002000 , pchip); + +/* Pchip0 PCI I/O */ + pci_io =cpu_register_io_memory (0 , pchip_pci_io_read, + pchip_pci_io_write, &s->pchip[0 ]); +cpu_register_physical_memory (0x801fc000000ULL ,0x0010000 , pci_io); + +/* Pchip0 PCI cfg */ + pci_cfg =cpu_register_io_memory (0 , pchip_pci_cfg_read, + pchip_pci_cfg_write, &s->pchip[0 ]); +cpu_register_physical_memory (0x801fe000000ULL ,0x0010000 , pci_cfg); + +/* Pchip0 PCI IntAck */ + pci_iack =cpu_register_io_memory (0 , pchip_pci_iack_read, + pchip_pci_iack_write, &s->pchip[0 ]); +cpu_register_physical_memory (0x801f8000000ULL ,0x002000 , pci_iack); + + s->pchip[0 ].pci =pci_register_bus (typhoon_set_irq, + typhoon_map_irq, +NULL ,0 ,64 ); + +typhoon_reset (s); + +/* Configure cchip array address. */ +for (i =0 ; i <4 ; i++) + s->aar[i] = arr[i]; + + s->cpu[0 ] = cpu0; + s->irqs =qemu_allocate_irqs (cchip_set_irq, s,64 ); + *irqs = s->irqs; + + s->intim_irq =qemu_allocate_irqs (intim_set_irq, s,1 ); + *intim_irq = s->intim_irq[0 ]; + +qemu_register_reset (&typhoon_reset, s); + +return s; +} + +void typhoon_set_iack_handler (typhoon_t *c,int num, +int (*handler)(void *),void *param) +{ + c->pchip[num].iack_handler = handler; + c->pchip[num].iack_handler_param = param; +} + +PCIBus *typhoon_get_pci_bus (typhoon_t *c,int num) +{ +return c->pchip[num].pci; +} +
hw/pci.h +8 -0
@@ -317,6 +317,14 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,PCIBus *sh_pci_register_bus (pci_set_irq_fn set_irq,pci_map_irq_fn map_irq,qemu_irq *pic,int devfn_min,int nirq); +/* 21272.c */ +typedef struct typhoon_t typhoon_t ; +typhoon_t *typhoon_21272_init (uint64_t *arr,qemu_irq **irqs, +qemu_irq *intim_irq,void *cpu0); +void typhoon_set_iack_handler (typhoon_t *c,int num, +int (*handler)(void *),void *param); +PCIBus *typhoon_get_pci_bus (typhoon_t *c,int num); +/* ali1543.c */ typedef struct ali1543_t ali1543_t ;ali1543_t *ali1543_init (PCIBus *bus,int devfn,qemu_irq irq);
Signature · 1 line
1.6.2
PATCH 13/24 Add target-alpha/machine.c with es40 machine emulation.
The machine emulation is not yet complete, in particular vm save and load is not yet implemented.
--- Makefile.target | 4 + hw/boards.h | 4 + hw/es40.c | 922 ++++++++++++++++++++++++++++++++++++++++++++++++ target-alpha/machine.c | 22 ++ 4 files changed, 952 insertions(+), 0 deletions(-) create mode 100644 hw/es40.c create mode 100644 target-alpha/machine.c
Makefile.target +4 -0
@@ -683,6 +683,10 @@ ifeq ($(TARGET_BASE_ARCH), m68k) OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o OBJS+= m68k-semi.o dummy_m68k.o endif +ifeq ($(TARGET_BASE_ARCH), alpha) +OBJS+= es40.o 21272.o serial.o i8259.o mc146818rtc.o i8254.o pcspk.o dma.o +OBJS+= ali1543.o +endif ifdef CONFIG_GDBSTUB OBJS+=gdbstub.o gdbstub-xml.o endif
hw/boards.h +4 -0
@@ -128,4 +128,8 @@ extern QEMUMachine musicpal_machine;/* tosa.c */ extern QEMUMachine tosapda_machine; +/* es40.c */ +extern QEMUMachine es40_machine; +extern QEMUMachine es40_rombuild_machine; +#endif
hw/es40.c new file +922 -0
922 lines not on this page · raw message
target-alpha/machine.c new file +22 -0
@@ -0,0 +1,22 @@ +#include "hw/hw.h" +#include "hw/boards.h" +#include "qemu-timer.h" + +#include "exec-all.h" + +void register_machines (void ) +{ +qemu_register_machine (&es40_machine); +qemu_register_machine (&es40_rombuild_machine); +} + +void cpu_save (QEMUFile *f,void *opaque) +{ +/* FIXME: todo */ +abort (); +} + +int cpu_load (QEMUFile *f,void *opaque,int version_id) +{ +return -EINVAL ; +}
Signature · 1 line
1.6.2
PATCH 14/24 Move softmmu_helper.h from exec.h to op_helper.c on alpha.
There is no real needs to inline these functions everywhere and this simplify debugging.
--- target-alpha/exec.h | 4 ---- target-alpha/op_helper.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
target-alpha/exec.h +0 -4
@@ -36,10 +36,6 @@ register struct CPUAlphaState *env asm(AREG0);#include "cpu.h" #include "exec-all.h" -#if !defined(CONFIG_USER_ONLY ) -#include "softmmu_exec.h" -#endif /* !defined(CONFIG_USER_ONLY) */ - static always_inline void env_to_regs(void) { }
target-alpha/op_helper.c +4 -0
@@ -23,6 +23,10 @@#include "softfloat.h" #include "helper.h" +#if !defined(CONFIG_USER_ONLY ) +#include "softmmu_exec.h" +#endif /* !defined(CONFIG_USER_ONLY) */ +void helper_tb_flush (void ) {tlb_flush (env,1 );
Signature · 1 line
1.6.2
PATCH 15/24 Document which IPR are used by 21264.
Add defines for IPR bits.
--- target-alpha/cpu.h | 96 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 65 insertions(+), 31 deletions(-)
target-alpha/cpu.h +65 -31
@@ -144,51 +144,85 @@ enum {/* XXX: TOFIX: most of those registers are implementation dependant */ enum {/* Ebox IPRs */ -IPR_CC =0xC0 , -IPR_CC_CTL =0xC1 , -IPR_VA =0xC2 , -IPR_VA_CTL =0xC4 , -IPR_VA_FORM =0xC3 , +IPR_CC =0xC0 ,/* 21264 */ +IPR_CC_CTL =0xC1 ,/* 21264 */ +#define IPR_CC_CTL_ENA_SHIFT 32 +#define IPR_CC_CTL_COUNTER_MASK 0xfffffff0UL +IPR_VA =0xC2 ,/* 21264 */ +IPR_VA_CTL =0xC4 ,/* 21264 */ +#define IPR_VA_CTL_VA_48_SHIFT 1 +#define IPR_VA_CTL_VPTB_SHIFT 30 +IPR_VA_FORM =0xC3 ,/* 21264 */ /* Ibox IPRs */ -IPR_ITB_TAG =0x00 , -IPR_ITB_PTE =0x01 , -IPT_ITB_IAP =0x02 , -IPT_ITB_IA =0x03 , -IPT_ITB_IS =0x04 , +IPR_ITB_TAG =0x00 ,/* 21264 */ +IPR_ITB_PTE =0x01 ,/* 21264 */ +IPR_ITB_IAP =0x02 , +IPR_ITB_IA =0x03 ,/* 21264 */ +IPR_ITB_IS =0x04 ,IPR_PMPC =0x05 , -IPR_EXC_ADDR =0x06 , -IPR_IVA_FORM =0x07 , -IPR_CM =0x09 , -IPR_IER =0x0A , -IPR_SIRR =0x0C , -IPR_ISUM =0x0D , -IPR_HW_INT_CLR =0x0E , +IPR_EXC_ADDR =0x06 ,/* 21264 */ +IPR_IVA_FORM =0x07 ,/* 21264 */ +IPR_CM =0x09 ,/* 21264 */ +#define IPR_CM_SHIFT 3 +#define IPR_CM_MASK (3ULL << IPR_CM_SHIFT) /* 21264 */ +IPR_IER =0x0A ,/* 21264 */ +#define IPR_IER_MASK 0x0000007fffffe000ULL + IPR_IER_CM = 0x0B, /* 21264: = CM | IER */ +IPR_SIRR =0x0C ,/* 21264 */ +#define IPR_SIRR_SHIFT 14 +#define IPR_SIRR_MASK 0x7fff +IPR_ISUM =0x0D ,/* 21264 */ +IPR_HW_INT_CLR =0x0E ,/* 21264 */ IPR_EXC_SUM =0x0F ,IPR_PAL_BASE =0x10 ,IPR_I_CTL =0x11 , -IPR_I_STAT =0x16 , -IPR_IC_FLUSH =0x13 , -IPR_IC_FLUSH_ASM =0x12 , +#define IPR_I_CTL_CHIP_ID_SHIFT 24 /* 21264 */ +#define IPR_I_CTL_BIST_FAIL (1 << 23) /* 21264 */ +#define IPR_I_CTL_IC_EN_SHIFT 2 /* 21264 */ +#define IPR_I_CTL_SDE1_SHIFT 7 /* 21264 */ +#define IPR_I_CTL_HWE_SHIFT 12 /* 21264 */ +#define IPR_I_CTL_VA_48_SHIFT 15 /* 21264 */ +#define IPR_I_CTL_SPE_SHIFT 3 /* 21264 */ +#define IPR_I_CTL_CALL_PAL_R23_SHIFT 20 /* 21264 */ +IPR_I_STAT =0x16 ,/* 21264 */ +IPR_IC_FLUSH =0x13 ,/* 21264 */ +IPR_IC_FLUSH_ASM =0x12 ,/* 21264 */ IPR_CLR_MAP =0x15 ,IPR_SLEEP =0x17 ,IPR_PCTX =0x40 , -IPR_PCTR_CTL =0x14 , +IPR_PCTX_ASN =0x01 ,/* field */ +#define IPR_PCTX_ASN_SHIFT 39 + IPR_PCTX_ASTER = 0x02, /* field */ +#define IPR_PCTX_ASTER_SHIFT 5 + IPR_PCTX_ASTRR = 0x04, /* field */ +#define IPR_PCTX_ASTRR_SHIFT 9 + IPR_PCTX_PPCE = 0x08, /* field */ +#define IPR_PCTX_PPCE_SHIFT 1 + IPR_PCTX_FPE = 0x10, /* field */ +#define IPR_PCTX_FPE_SHIFT 2 + IPR_PCTX_ALL = 0x5f, /* all fields */ +IPR_PCTR_CTL =0x14 ,/* 21264 */ /* Mbox IPRs */ -IPR_DTB_TAG0 =0x20 , -IPR_DTB_TAG1 =0xA0 , -IPR_DTB_PTE0 =0x21 , -IPR_DTB_PTE1 =0xA1 , +IPR_DTB_TAG0 =0x20 ,/* 21264 */ +IPR_DTB_TAG1 =0xA0 ,/* 21264 */ +IPR_DTB_PTE0 =0x21 ,/* 21264 */ +IPR_DTB_PTE1 =0xA1 ,/* 21264 */ IPR_DTB_ALTMODE =0xA6 , +IPR_DTB_ALTMODE0 =0x26 ,/* 21264 */ +#define IPR_DTB_ALTMODE_MASK 3 IPR_DTB_IAP = 0xA2, -IPR_DTB_IA =0xA3 , +IPR_DTB_IA =0xA3 ,/* 21264 */ IPR_DTB_IS0 =0x24 ,IPR_DTB_IS1 =0xA4 , -IPR_DTB_ASN0 =0x25 , -IPR_DTB_ASN1 =0xA5 , -IPR_MM_STAT =0x27 , -IPR_M_CTL =0x28 , +IPR_DTB_ASN0 =0x25 ,/* 21264 */ +IPR_DTB_ASN1 =0xA5 ,/* 21264 */ +#define IPR_DTB_ASN_SHIFT 56 + IPR_MM_STAT = 0x27, /* 21264 */ +IPR_M_CTL =0x28 ,/* 21264 */ +#define IPR_M_CTL_SPE_SHIFT 1 +#define IPR_M_CTL_SPE_MASK 7IPR_DC_CTL =0x29 , -IPR_DC_STAT =0x2A , +IPR_DC_STAT =0x2A ,/* 21264 */ /* Cbox IPRs */ IPR_C_DATA =0x2B ,IPR_C_SHIFT =0x2C ,
Signature · 1 line
1.6.2
PATCH 16/24 tb_flush helper should flush the tb (and not the tlb).
Looks to be a typo fix.
--- target-alpha/op_helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-alpha/op_helper.c +1 -1
@@ -29,7 +29,7 @@void helper_tb_flush (void ) { -tlb_flush (env,1 ); +tb_flush (env); }/*****************************************************************************/
Signature · 1 line
1.6.2
PATCH 17/24 Add instruction name in comments for hw_ld opcode.
Make code slightly easier to read.
Also unused hw_ld opcodes now generate an invalid opc fault.
--- target-alpha/translate.c | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-)
target-alpha/translate.c +20 -20
@@ -1793,62 +1793,62 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)tcg_gen_movi_i64 (addr, disp12);switch ((insn >>12 ) &0xF ) {case 0x0 : -/* Longword physical access */ +/* Longword physical access (hw_ldl/p) */ gen_helper_ldl_raw (cpu_ir[ra], addr);break ;case 0x1 : -/* Quadword physical access */ +/* Quadword physical access (hw_ldq/p) */ gen_helper_ldq_raw (cpu_ir[ra], addr);break ;case 0x2 : -/* Longword physical access with lock */ +/* Longword physical access with lock (hw_ldl_l/p) */ gen_helper_ldl_l_raw (cpu_ir[ra], addr);break ;case 0x3 : -/* Quadword physical access with lock */ +/* Quadword physical access with lock (hw_ldq_l/p) */ gen_helper_ldq_l_raw (cpu_ir[ra], addr);break ;case 0x4 : -/* Longword virtual PTE fetch */ -gen_helper_ldl_kernel (cpu_ir[ra], addr); +/* Longword virtual PTE fetch (hw_ldl/v) */ +tcg_gen_qemu_ld32s (cpu_ir[ra], addr,0 );break ;case 0x5 : -/* Quadword virtual PTE fetch */ -gen_helper_ldq_kernel (cpu_ir[ra], addr); +/* Quadword virtual PTE fetch (hw_ldq/v) */ +tcg_gen_qemu_ld64 (cpu_ir[ra], addr,0 );break ;case 0x6 :/* Incpu_ir[ra]id */ - goto incpu_ir[ra]id_opc; + goto invalid_opc;case 0x7 :/* Incpu_ir[ra]id */ - goto incpu_ir[ra]id_opc; + goto invalid_opc;case 0x8 : -/* Longword virtual access */ +/* Longword virtual access (hw_ldl) */ gen_helper_st_virt_to_phys (addr, addr);gen_helper_ldl_raw (cpu_ir[ra], addr);break ;case 0x9 : -/* Quadword virtual access */ +/* Quadword virtual access (hw_ldq) */ gen_helper_st_virt_to_phys (addr, addr);gen_helper_ldq_raw (cpu_ir[ra], addr);break ;case 0xA : -/* Longword virtual access with protection check */ -tcg_gen_qemu_ld32s (cpu_ir[ra], addr, ctx->flags); +/* Longword virtual access with protection check (hw_ldl/w) */ +tcg_gen_qemu_ld32s (cpu_ir[ra], addr,0 );break ;case 0xB : -/* Quadword virtual access with protection check */ -tcg_gen_qemu_ld64 (cpu_ir[ra], addr, ctx->flags); +/* Quadword virtual access with protection check (hw_ldq/w) */ +tcg_gen_qemu_ld64 (cpu_ir[ra], addr,0 );break ;case 0xC : -/* Longword virtual access with altenate access mode */ +/* Longword virtual access with alt access mode (hw_ldl/a)*/ gen_helper_set_alt_mode ();gen_helper_st_virt_to_phys (addr, addr);gen_helper_ldl_raw (cpu_ir[ra], addr);gen_helper_restore_mode ();break ;case 0xD : -/* Quadword virtual access with altenate access mode */ +/* Quadword virtual access with alt access mode (hw_ldq/a) */ gen_helper_set_alt_mode ();gen_helper_st_virt_to_phys (addr, addr);gen_helper_ldq_raw (cpu_ir[ra], addr);
@@ -1856,7 +1856,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)break ;case 0xE :/* Longword virtual access with alternate access mode and -* protection checks +* protection checks (hw_ldl/wa) */ gen_helper_set_alt_mode ();gen_helper_ldl_data (cpu_ir[ra], addr);
@@ -1864,7 +1864,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)break ;case 0xF :/* Quadword virtual access with alternate access mode and -* protection checks +* protection checks (hw_ldq/wa) */ gen_helper_set_alt_mode ();gen_helper_ldq_data (cpu_ir[ra], addr);
Signature · 1 line
1.6.2
PATCH 18/24 Remove PALCODE_ declarations (unused).
--- target-alpha/cpu.h | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)
target-alpha/cpu.h +0 -10
@@ -398,16 +398,6 @@ enum { };enum { -PALCODE_CALL =0x00000000 , -PALCODE_LD =0x01000000 , -PALCODE_ST =0x02000000 , -PALCODE_MFPR =0x03000000 , -PALCODE_MTPR =0x04000000 , -PALCODE_REI =0x05000000 , -PALCODE_INIT =0xF0000000 , -}; - -enum {IR_V0 =0 ,IR_T0 =1 ,IR_T1 =2 ,
Signature · 1 line
1.6.2
PATCH 19/24 alpha ld helpers now directly return the value.
Remove _kernel helpers as they can be directly generated. Replace ld/st_raw with _phys (bug fix).
--- target-alpha/helper.h | 14 +++++------- target-alpha/op_helper.c | 50 ++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 36 deletions(-)
target-alpha/helper.h +6 -8
@@ -116,14 +116,12 @@ DEF_HELPER_0(restore_mode, void) DEF_HELPER_1(ld_virt_to_phys, i64, i64) DEF_HELPER_1(st_virt_to_phys, i64, i64) -DEF_HELPER_2(ldl_raw, void, i64, i64) -DEF_HELPER_2(ldq_raw, void, i64, i64) -DEF_HELPER_2(ldl_l_raw, void, i64, i64) -DEF_HELPER_2(ldq_l_raw, void, i64, i64) -DEF_HELPER_2(ldl_kernel, void, i64, i64) -DEF_HELPER_2(ldq_kernel, void, i64, i64) -DEF_HELPER_2(ldl_data, void, i64, i64) -DEF_HELPER_2(ldq_data, void, i64, i64) +DEF_HELPER_1(ldl_raw, i32, i64) +DEF_HELPER_1(ldq_raw, i64, i64) +DEF_HELPER_1(ldl_l_raw, i32, i64) +DEF_HELPER_1(ldq_l_raw, i64, i64) +DEF_HELPER_1(ldl_data, i32, i64) +DEF_HELPER_1(ldq_data, i64, i64) DEF_HELPER_2(stl_raw, void, i64, i64) DEF_HELPER_2(stq_raw, void, i64, i64)DEF_HELPER_2 (stl_c_raw, i64, i64, i64)
target-alpha/op_helper.c +22 -28
92 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 20/24 Add alpha_cpu_list.
Add alpha_cpu_list and use cpu_model to select the model in cpu_alpha_init. Set implver and amask from the model.
--- target-alpha/cpu.h | 1 + target-alpha/translate.c | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-)
target-alpha/cpu.h +1 -0
@@ -436,6 +436,7 @@ enum {CPUAlphaState *cpu_alpha_init (const char *cpu_model);int cpu_alpha_exec (CPUAlphaState *s); +void alpha_cpu_list (FILE *f,int (*cpu_fprintf)(FILE *f,const char *fmt, ...));/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */
target-alpha/translate.c +35 -2
@@ -2460,17 +2460,50 @@ void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)gen_intermediate_code_internal (env, tb,1 ); } +struct alpha_def { +const char *name; +uint32_t implver; +uint32_t amask; +}; + +static struct alpha_def alpha_defs[] = { +#if 0 + { "21064", IMPLVER_2106x, 0 }, + { "21164", IMPLVER_21164, 0 }, +#endif + { "21264", IMPLVER_21264, (AMASK_PREFETCH | AMASK_TRAP | AMASK_BWX + | AMASK_FIX) }, + { NULL, 0 } +}; + +void alpha_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)) +{ + struct alpha_def *cpu; + + for (cpu = alpha_defs; cpu->name; cpu++) + (*cpu_fprintf)(f, "%s\n", cpu->name); +} + CPUAlphaState * cpu_alpha_init (const char *cpu_model) { CPUAlphaState *env; uint64_t hwpcb; + struct alpha_def *cpu = alpha_defs; + if (cpu_model != NULL) { + for (cpu = alpha_defs; cpu->name; cpu++) + if (strcmp (cpu->name, cpu_model) == 0) + break; + if (cpu->name == NULL) + return NULL; + } env = qemu_mallocz(sizeof(CPUAlphaState)); cpu_exec_init(env); alpha_translate_init(); tlb_flush(env, 1); -/* XXX: should not be hardcoded */ - env->implver = IMPLVER_2106x; + + env->implver = cpu->implver; + env->amask = cpu->amask; env->ps = 0x1F00; #if defined (CONFIG_USER_ONLY) env->ps |= 1 << 3;
Signature · 1 line
1.6.2
PATCH 21/24 Alpha: lower parent irq when irq is lowered.
--- hw/i8259.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/i8259.c +1 -1
@@ -169,7 +169,7 @@ void pic_update_irq(PicState2 *s) }/* all targets should do this rather than acking the IRQ in the cpu */ -#if defined(TARGET_MIPS ) || defined(TARGET_PPC ) +#if defined(TARGET_MIPS ) || defined(TARGET_PPC ) || defined(TARGET_ALPHA ) else {qemu_irq_lower (s->parent_irq); }
Signature · 1 line
1.6.2
PATCH 22/24 Move linux-user pal emulation to linux-user/
Move pal emulation for user emulation from alpha_palcode.c to linux-user/main.c Add generic exception names.
Fix offset for PAL calls.
--- Makefile.target | 5 +-- hw/alpha_palcode.c | 44 --------------------- linux-user/main.c | 96 +++++++++++++++++++++++++--------------------- target-alpha/cpu.h | 39 +++++++++++++++--- target-alpha/helper.c | 4 +- target-alpha/translate.c | 1 - 6 files changed, 87 insertions(+), 102 deletions(-)
Makefile.target +1 -4
@@ -157,10 +157,6 @@ ifeq ($(TARGET_BASE_ARCH), arm) LIBOBJS+= neon_helper.o iwmmxt_helper.o endif -ifeq ($(TARGET_BASE_ARCH), alpha) -LIBOBJS+= alpha_palcode.o -endif - ifeq ($(TARGET_BASE_ARCH), cris) LIBOBJS+= cris-dis.o
@@ -686,6 +682,7 @@ endif ifeq ($(TARGET_BASE_ARCH), alpha) OBJS+= es40.o 21272.o serial.o i8259.o mc146818rtc.o i8254.o pcspk.o dma.o OBJS+= ali1543.o +#OBJS+= alpha_palcode.o # Not currently used until pal is virtualized endif ifdef CONFIG_GDBSTUB OBJS+=gdbstub.o gdbstub-xml.o
hw/alpha_palcode.c +0 -44
53 lines not on this page · raw message
linux-user/main.c +52 -44
135 lines not on this page · raw message
target-alpha/cpu.h +32 -7
@@ -291,7 +291,11 @@ struct pal_handler_t {void (*call_pal)(CPUAlphaState *env,uint32_t palcode); }; +#if !defined(CONFIG_USER_ONLY )#define NB_MMU_MODES 4 +#else +#define NB_MMU_MODES 2 +#endif struct CPUAlphaState {uint64_t ir[31 ];
@@ -318,6 +322,12 @@ struct CPUAlphaState {CPU_COMMON uint32_t hflags; +#if defined(CONFIG_USER_ONLY ) +struct { +uint64_t usp; +uint64_t unique; + } user; +#endif int error_code;
@@ -342,6 +352,8 @@ struct CPUAlphaState {#define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PAL_IDX 4 + +#if !defined(CONFIG_USER_ONLY )static inline int cpu_mmu_index_data (CPUState *env) {return env->mmu_data_index;
@@ -351,8 +363,13 @@ static inline int cpu_mmu_index_code (CPUState *env) {return env->mmu_code_index; } +#else +#define cpu_mmu_index_data cpu_mmu_index_code +static inline int cpu_mmu_index_code (CPUState *env) +{ +return 0 ; +} -#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {if (newsp)
@@ -384,9 +401,20 @@ enum {EXCP_UNALIGN =0x11E0 ,EXCP_OPCDEC =0x13E0 ,EXCP_FEN =0x17E0 , -EXCP_CALL_PAL =0x2000 , -EXCP_CALL_PALP =0x3000 , -EXCP_CALL_PALE =0x4000 , + +/* Generic exception - to be mapped to processor. */ +EXCP_GEN_OPCDEC =1 , +EXCP_GEN_ARITH =2 , +EXCP_GEN_INTERRUPT =3 , +EXCP_GEN_LAST =3 , + +/* User linux exception. */ +EXCP_USER_DFAULT =0x0100 , +EXCP_USER_ITB_MISS =0x0101 , + +EXCP_CALL_PALP =0x2000 , +EXCP_CALL_PAL =0x3000 , +EXCP_CALL_PALE =0x4000 ,/* End of Pal */ /* Pseudo exception for console */ EXCP_CONSOLE_DISPATCH =0x4001 , EXCP_CONSOLE_FIXUP = 0x4002,
@@ -448,11 +476,8 @@ void do_interrupt (CPUState *env);int cpu_alpha_mfpr (CPUState *env,int iprn,uint64_t *valp);int cpu_alpha_mtpr (CPUState *env,int iprn,uint64_t val,uint64_t *oldvalp); -void pal_init (CPUState *env);#if !defined (CONFIG_USER_ONLY )void call_pal (CPUState *env); -#else -void call_pal (CPUState *env,int palcode);#endif static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb)
target-alpha/helper.c +2 -2
@@ -31,9 +31,9 @@ int cpu_alpha_handle_mmu_fault (CPUState *env, target_ulong address, int rw, int mmu_idx, int is_softmmu) {if (rw ==2 ) - env->exception_index =EXCP_ITB_MISS ; + env->exception_index =EXCP_USER_ITB_MISS ;else - env->exception_index =EXCP_DFAULT ; + env->exception_index =EXCP_USER_DFAULT ; env->ipr[IPR_EXC_ADDR ] = address;return 1 ;
target-alpha/translate.c +0 -1
@@ -2508,7 +2508,6 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)#if defined (CONFIG_USER_ONLY ) env->ps |=1 <<3 ;#endif -pal_init (env);/* Initialize IPR */ hwpcb = env->ipr[IPR_PCBB ]; env->ipr[IPR_ASN ] =0 ;
Signature · 1 line
1.6.2
PATCH 23/24 Correctly decode hw_ld/hw_st opcodes for all alpha implementations.
Allow privilegied pal_code only in kernel mode.
--- target-alpha/translate.c | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-)
target-alpha/translate.c +24 -8
@@ -52,6 +52,7 @@ struct DisasContext {int pal_mode;#endif uint32_t amask; +uint32_t implver; };/* global register indexes */
@@ -103,6 +104,20 @@ static void alpha_translate_init(void) done_init =1 ; } +static inline int get_mxcr_iprn (DisasContext *ctx,uint32_t insn) +{ +switch (ctx->implver) { +case IMPLVER_2106x: +return insn &0xff ; +case IMPLVER_21164 : +return insn &0xffff ; +case IMPLVER_21264 : +return (insn >>8 ) &0xff ; +default : +abort (); + } +} + static always_inline void gen_excp (DisasContext *ctx,int exception,int error_code) {
@@ -689,7 +704,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)#if !defined (CONFIG_USER_ONLY ) } else if (palcode < 0x40) {/* Privileged PAL code */ -if (ctx->mem_idx &1 ) +if (ctx->mem_idx !=MMU_KERNEL_IDX ) goto invalid_opc;else gen_excp (ctx,EXCP_CALL_PALP + ((palcode &0x3F ) <<6 ),0 );
@@ -1748,7 +1763,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)if (!ctx->pal_mode) goto invalid_opc;if (ra !=31 ) { -TCGv tmp =tcg_const_i32 (insn &0xFF ); +TCGv tmp =tcg_const_i32 (get_mxcr_iprn (ctx, insn));gen_helper_mfpr (cpu_ir[ra], tmp, cpu_ir[ra]);tcg_temp_free (tmp); }
@@ -2063,9 +2078,9 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)if (!ctx->pal_mode) goto invalid_opc;else { -TCGv tmp1 =tcg_const_i32 (insn &0xFF ); -if (ra !=31 ) -gen_helper_mtpr (tmp1, cpu_ir[ra]); +TCGv tmp1 =tcg_const_i32 (get_mxcr_iprn (ctx, insn)); +if (rb !=31 ) +gen_helper_mtpr (tmp1, cpu_ir[rb]);else {TCGv tmp2 =tcg_const_i64 (0 );gen_helper_mtpr (tmp1, tmp2);
@@ -2088,8 +2103,8 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)gen_helper_hw_rei (); }else {TCGv tmp; - -if (ra !=31 ) { + +if (rb !=31 ) { tmp =tcg_temp_new ();tcg_gen_addi_i64 (tmp, cpu_ir[rb], (((int64_t )insn <<51 ) >>51 )); }else
@@ -2097,7 +2112,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)gen_helper_hw_ret (tmp); tcg_temp_free(tmp); } - ret =2 ; + ret =3 ;break ;#endif case 0x1F :
@@ -2353,6 +2368,7 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, gen_opc_end = gen_opc_buf +OPC_MAX_SIZE ; ctx.pc = pc_start; ctx.amask = env->amask; + ctx.implver = env->implver;#if defined (CONFIG_USER_ONLY ) ctx.mem_idx =0 ;#else
Signature · 1 line
1.6.2
PATCH 24/24 Add full emulation for 21264.
This is still work in progress but complete enough to run the firmware.
Remove old and incomplete code for pal virtualization.
--- cpu-exec.c | 1 + hw/alpha_palcode.c | 37 ++- target-alpha/cpu.h | 243 +++++++++----- target-alpha/helper.c | 842 +++++++++++++++++++++++++++++----------------- target-alpha/op_helper.c | 125 +++++--- target-alpha/translate.c | 44 +-- 6 files changed, 819 insertions(+), 473 deletions(-)
cpu-exec.c +1 -0
@@ -487,6 +487,7 @@ int cpu_exec(CPUState *env1) }#elif defined(TARGET_ALPHA)if (interrupt_request &CPU_INTERRUPT_HARD ) { + env->exception_index =EXCP_GEN_INTERRUPT ;do_interrupt (env); next_tb =0 ; }
hw/alpha_palcode.c +33 -4
@@ -22,10 +22,39 @@#include <stdlib.h> #include <stdio.h> -#include "qemu.h" #include "cpu.h" #include "exec-all.h" +typedef struct pal_handler_t pal_handler_t ; +struct pal_handler_t { +/* Reset */ +void (*reset)(CPUAlphaState *env); +/* Uncorrectable hardware error */ +void (*machine_check)(CPUAlphaState *env); +/* Arithmetic exception */ +void (*arithmetic)(CPUAlphaState *env); +/* Interrupt / correctable hardware error */ +void (*interrupt)(CPUAlphaState *env); +/* Data fault */ +void (*dfault)(CPUAlphaState *env); +/* DTB miss pal */ +void (*dtb_miss_pal)(CPUAlphaState *env); +/* DTB miss native */ +void (*dtb_miss_native)(CPUAlphaState *env); +/* Unaligned access */ +void (*unalign)(CPUAlphaState *env); +/* ITB miss */ +void (*itb_miss)(CPUAlphaState *env); +/* Instruction stream access violation */ +void (*itb_acv)(CPUAlphaState *env); +/* Reserved or privileged opcode */ +void (*opcdec)(CPUAlphaState *env); +/* Floating point exception */ +void (*fen)(CPUAlphaState *env); +/* Call pal instruction */ +void (*call_pal)(CPUAlphaState *env,uint32_t palcode); +}; +/* Shared handlers */ static void pal_reset (CPUState *env);/* Console handlers */
@@ -88,7 +117,7 @@ static void do_swappal (CPUState *env, uint64_t palid) case 0 ... 2: pal_handler = &pal_handlers[palid]; env->pal_handler = pal_handler; - env->ipr[IPR_PAL_BASE ] =-1ULL ; + env->pal_base =-1ULL ; (*pal_handler->reset)(env);break ; case 3 ... 255:
@@ -98,8 +127,8 @@ static void do_swappal (CPUState *env, uint64_t palid)default :/* We were given the entry point address */ env->pal_handler =NULL ; - env->ipr[IPR_PAL_BASE ] = palid; - env->pc = env->ipr[IPR_PAL_BASE ]; + env->pal_base = palid; + env->pc = env->pal_base;cpu_loop_exit (); } }
target-alpha/cpu.h +151 -92
303 lines not on this page · raw message
target-alpha/helper.c +531 -311
904 lines not on this page · raw message
target-alpha/op_helper.c +85 -40
233 lines not on this page · raw message
target-alpha/translate.c +18 -26
75 lines not on this page · raw message
Signature · 1 line
1.6.2
Re: [Qemu-devel] [PATCH 20/24] Add alpha_cpu_list.
In reply to Tristan GingoldQuoted 6 lines · Tristan Gingold
Add
alpha_cpu_listand usecpu_modelto select the model incpu_alpha_init.
Set implver and amask from the model.Signed-off-by Tristan Gingold <[email protected]>+static struct
alpha_defalpha_defs[] = {
"const"
Quoted 8 lines
+#if 0
+ { "21064",IMPLVER_2106x, 0 },
+ { "21164",IMPLVER_21164, 0 },
+#endif
+ { "21264",IMPLVER_21264, (AMASK_PREFETCH|AMASK_TRAP|AMASK_BWX
+ |AMASK_FIX) },
+ { NULL, 0 }
+};
I'd use ARRAY_SIZE macro to determine the size of table for indexing instead of no NULL termination, but this style is also widely used.
Re: [Qemu-devel] [PATCH 20/24] Add alpha_cpu_list.
Quoted 9 lines · Blue Swirl
Quoted 6 lines · Tristan Gingold
Add
alpha_cpu_listand usecpu_modelto select the model incpu_alpha_init. Set implver and amask from the model.Signed-off-by Tristan Gingold <[email protected]>+static struct
alpha_defalpha_defs[] = {"const"
Ohh yes.
Quoted 14 lines
target-alpha/translate.c void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb) · line 2477
Quoted 9 lines
target-alpha/translate.c +5
-0+#if 0 + { "21064", IMPLVER_2106x, 0 }, + { "21164", IMPLVER_21164, 0 }, +#endif + { "21264", IMPLVER_21264, (AMASK_PREFETCH | AMASK_TRAP |
AMASK_BWXtarget-alpha/translate.c +3
-0+ | AMASK_FIX) }, + { NULL, 0 } +};I'd use
ARRAY_SIZEmacro to determine the size of table for indexing instead of no NULL termination, but this style is also widely used.
Re: [Qemu-devel] [PATCH 13/24] Add target-alpha/machine.c with es40 machine emulation.
In reply to Tristan GingoldQuoted 5 lines · Tristan Gingold
The machine emulation is not yet complete, in particular vm save and load is
not yet implemented.Signed-off-by Tristan Gingold <[email protected]>
Quoted 15 lines
+/* Building the firmware for es40:
+
+ The main part of the firmware is called SRM. You can get an original
+ image from HP web site:
+
+ ftp://ftp.hp.com/pub/alphaserver/firmware/current_platforms/v7.3_release/ES40_series/ES40/es40.zip
+
+ Extract the archive and copy cl67srmrom.exe into a directory.
+
+ Then start Qemu using es40-rombuild machine:
+
+ $ qemu-system-alpha -M es40-rombuild -boot n -L .
+
+ This builds the rom, writes es40.rom file and exits. Now you have it.
+*/
I'd put the ROM extraction program somewhere else, it's not related to machine emulation very much.
Re: [Qemu-devel] [PATCH 13/24] Add target-alpha/machine.c with es40 machine emulation.
Quoted 18 lines · Blue Swirl
Quoted 17 lines · Tristan Gingold
The machine emulation is not yet complete, in particular vm save and load is not yet implemented.
Signed-off-by Tristan Gingold <[email protected]>hw/es40.c new file +3
-0+/* Building the firmware for es40: + +The main part of the firmware is called SRM. You can get an original
hw/es40.c new file +8
-0+ image from HP web site: + + ftp://ftp.hp.com/pub/alphaserver/firmware/current_platforms/v7.3_release/ES40_series/ES40/es40.zip + + Extract the archive and copy cl67srmrom.exe into a directory. + + Then start Qemu using es40-rombuild machine: +
Quoted 8 lines
Quoted 5 lines
hw/es40.c new file +3
-0+ $ qemu-system-alpha -M es40-rombuild -boot n -L . + + This builds the rom, writes es40.rom file and exits. Now youhave it.
+*/I'd put the ROM extraction program somewhere else, it's not related to machine emulation very much.
Except that the ROM extraction process need to run alpha code to decompress itself.
Re: [Qemu-devel] [PATCH 09/24] Split cpu_mmu_index into cpu_mmu_index_data and cpu_mmu_index_code.
In reply to Tristan GingoldQuoted 3 lines · Tristan Gingold
This is required by alpha system emulation as PAL mode disable instruction
mmu but not data mmu.
This might also be required for other cpus that have a split I/D mmu enable.
This is true for Sparc64 and PPC32/64 but I think normally both MMUs are enabled.
Quoted 15 lines · Tristan Gingold
this patch series adds alpha system emulation for the es40. The work is
not yet complete (don't expect to boot an OS) but enough to get the firmware prompt.The only processor supported is the alpha 21264 but the infrastructure is here to support other processors or pal emulation.
The system emulated is the ES40
http://www.compaq.com/alphaserver/archive/es40/index.html
It is a mid-range system that is quite well documented, supports all alpha OSes (AFAIK) and its firmware is available.The emulation uses the original firmware. See comment at the head of
hw/es40.cfor building the rom image.
Quoted 8 lines
This work is a first step and I plan to continue this work. That's the reason why I left some (deactivated) debug code and placed a few aborts. Also it is not yet built by default.
Only the last patch adds full cpu emulation. The previous ones fix bugs, clen up, add new devices and es40 machine or add new features.
Comments are welcome,
Nice work. Is there a free/open source BIOS available for Alpha? Do you think OpenBIOS for Alpha would be interesting?
Quoted 4 lines · Blue Swirl
Quoted 3 lines · Tristan Gingold
this patch series adds alpha system emulation for the es40. The work is not yet complete (don't expect to boot an OS) but enough to get the firmware prompt.
[...]
Quoted 1 line
Nice work.
Thanks!
Quoted 1 line
Is there a free/open source BIOS available for Alpha?
Not really. Milo is open source and could be used to boot Linux but only on rather old machines.
Quoted 2 lines
Do
you think OpenBIOS for Alpha would be interesting?
Alpha has its own firmware which is not IEEE-1275 compliant. (And I am not sure it is worth spending time on writing Alpha firmware!)
Tristan.