* [Qemu-devel] [PATCH] ARM CP14 trivial support
@ 2008-10-13 10:42 Daniel Silverstone
2008-10-13 12:39 ` Paul Brook
2008-10-13 12:50 ` andrzej zaborowski
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Silverstone @ 2008-10-13 10:42 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
Hi,
Continuing the patch series aiming at supporting Simtec's development
boards and other Samsung SoC based systems, attached is a patch which
provides trivial coprocessor 14 support.
Regards,
Daniel.
--
Daniel Silverstone http://www.simtec.co.uk/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895
[-- Attachment #2: Trivial CP14 support patch --]
[-- Type: text/x-patch, Size: 1437 bytes --]
ARM9 CP14 support
The ARM coprocessor number 14, in part, is responsible for describing
CPU features. It is also the interface to the JTAG DCC channel which
some systems use to control early-boot-time debugging. All this patch
does is provide enough support that reading/writing cp14 won't fault
the emulation.
Signed-off-by: Daniel Silverstone <dsilvers@simtec.co.uk>
translate.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
=== modified file 'target-arm/translate.c'
--- target-arm/translate.c 2008-09-22 00:52:42 +0000
+++ target-arm/translate.c 2008-10-13 10:33:00 +0000
@@ -2643,6 +2643,19 @@
return 0;
}
+static int disas_cp14_insn(CPUState *env, DisasContext *s, uint32_t insn)
+{
+ uint32_t rd = (insn >> 12) & 0xf;
+ if (insn & (1<<20)) {
+ gen_op_movl_T0_im(0);
+ gen_movl_reg_T0(s, rd);
+ } else {
+ /* Nothing to do on writes to cp14 */
+ }
+ gen_lookup_tb(s);
+ return 0;
+}
+
#define VFP_REG_SHR(x, n) (((n) > 0) ? (x) >> (n) : (x) << -(n))
#define VFP_SREG(insn, bigbit, smallbit) \
((VFP_REG_SHR(insn, bigbit - 1) & 0x1e) | (((insn) >> (smallbit)) & 1))
@@ -5567,7 +5580,9 @@
return 1;
case 10:
case 11:
- return disas_vfp_insn (env, s, insn);
+ return disas_vfp_insn (env, s, insn);
+ case 14:
+ return disas_cp14_insn (env, s, insn);
case 15:
return disas_cp15_insn (env, s, insn);
default:
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 10:42 [Qemu-devel] [PATCH] ARM CP14 trivial support Daniel Silverstone
@ 2008-10-13 12:39 ` Paul Brook
2008-10-13 12:50 ` andrzej zaborowski
1 sibling, 0 replies; 7+ messages in thread
From: Paul Brook @ 2008-10-13 12:39 UTC (permalink / raw)
To: qemu-devel, dsilvers
On Monday 13 October 2008, Daniel Silverstone wrote:
> Hi,
>
> Continuing the patch series aiming at supporting Simtec's development
> boards and other Samsung SoC based systems, attached is a patch which
> provides trivial coprocessor 14 support.
I dislike code that blindly ignores everything. Functions should be explicitly
not implemented (with comments saying exactly what we're not implementing),
or fail loudly when used.
The cp14 interface is also used for other debug monitor hardware (breakpoints,
watchpoints, etc.) and possibly Jazelle DBX. Ignoring those commands is bad.
IIRC cp14 interfaces are device specific (at least before ARMv6), so you need
to figure out which cores your hacks apply to. There are definitely several
different DDC interfaces.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 10:42 [Qemu-devel] [PATCH] ARM CP14 trivial support Daniel Silverstone
2008-10-13 12:39 ` Paul Brook
@ 2008-10-13 12:50 ` andrzej zaborowski
2008-10-13 13:20 ` Paul Brook
1 sibling, 1 reply; 7+ messages in thread
From: andrzej zaborowski @ 2008-10-13 12:50 UTC (permalink / raw)
To: dsilvers, qemu-devel
2008/10/13 Daniel Silverstone <dsilvers@simtec.co.uk>:
> Continuing the patch series aiming at supporting Simtec's development
> boards and other Samsung SoC based systems, attached is a patch which
> provides trivial coprocessor 14 support.
+ case 14:
+ return disas_cp14_insn (env, s, insn);
This will break PXA emulation or anything that already emulates cp14.
Cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 12:50 ` andrzej zaborowski
@ 2008-10-13 13:20 ` Paul Brook
2008-10-13 14:30 ` andrzej zaborowski
0 siblings, 1 reply; 7+ messages in thread
From: Paul Brook @ 2008-10-13 13:20 UTC (permalink / raw)
To: qemu-devel; +Cc: dsilvers
On Monday 13 October 2008, andrzej zaborowski wrote:
> 2008/10/13 Daniel Silverstone <dsilvers@simtec.co.uk>:
> > Continuing the patch series aiming at supporting Simtec's development
> > boards and other Samsung SoC based systems, attached is a patch which
> > provides trivial coprocessor 14 support.
>
> + case 14:
> + return disas_cp14_insn (env, s, insn);
>
> This will break PXA emulation or anything that already emulates cp14.
Anything that emulates cp14 should really be doing it here.
The pxa coprocessor bits are IMHO a hack.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 13:20 ` Paul Brook
@ 2008-10-13 14:30 ` andrzej zaborowski
2008-10-13 14:36 ` Paul Brook
0 siblings, 1 reply; 7+ messages in thread
From: andrzej zaborowski @ 2008-10-13 14:30 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel, dsilvers
2008/10/13 Paul Brook <paul@codesourcery.com>:
> On Monday 13 October 2008, andrzej zaborowski wrote:
>> 2008/10/13 Daniel Silverstone <dsilvers@simtec.co.uk>:
>> > Continuing the patch series aiming at supporting Simtec's development
>> > boards and other Samsung SoC based systems, attached is a patch which
>> > provides trivial coprocessor 14 support.
>>
>> + case 14:
>> + return disas_cp14_insn (env, s, insn);
>>
>> This will break PXA emulation or anything that already emulates cp14.
>
> Anything that emulates cp14 should really be doing it here.
> The pxa coprocessor bits are IMHO a hack.
Coprocessor io has similar potential to mmio or x86 port io. You said
it's device specific. If in a SoC a peripheral is attached through
it, probably the whole peripheral shouldn't be in target-arm/ ?
Regards
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 14:30 ` andrzej zaborowski
@ 2008-10-13 14:36 ` Paul Brook
2008-10-13 14:57 ` andrzej zaborowski
0 siblings, 1 reply; 7+ messages in thread
From: Paul Brook @ 2008-10-13 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: dsilvers
> Coprocessor io has similar potential to mmio or x86 port io. You said
> it's device specific. If in a SoC a peripheral is attached through
> it, probably the whole peripheral shouldn't be in target-arm/ ?
I disbelieve that any chips use the came coprocessor ID for both core and SoC
functionality.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM CP14 trivial support
2008-10-13 14:36 ` Paul Brook
@ 2008-10-13 14:57 ` andrzej zaborowski
0 siblings, 0 replies; 7+ messages in thread
From: andrzej zaborowski @ 2008-10-13 14:57 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel, dsilvers
2008/10/13 Paul Brook <paul@codesourcery.com>:
>> Coprocessor io has similar potential to mmio or x86 port io. You said
>> it's device specific. If in a SoC a peripheral is attached through
>> it, probably the whole peripheral shouldn't be in target-arm/ ?
>
> I disbelieve that any chips use the came coprocessor ID for both core and SoC
> functionality.
I'm talking about coprocessor used for SoC only functionality.
Regards
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-13 14:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-13 10:42 [Qemu-devel] [PATCH] ARM CP14 trivial support Daniel Silverstone
2008-10-13 12:39 ` Paul Brook
2008-10-13 12:50 ` andrzej zaborowski
2008-10-13 13:20 ` Paul Brook
2008-10-13 14:30 ` andrzej zaborowski
2008-10-13 14:36 ` Paul Brook
2008-10-13 14:57 ` andrzej zaborowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).