On 8/18/19 10:30 PM, Jiri Gaisler wrote:
>
>
> On 8/17/19 8:23 PM, Joel Sherrill wrote:
>>
>>
>> On Sat, Aug 17, 2019, 1:07 PM Jiri Gaisler <j...@gaisler.se 
>> <mailto:j...@gaisler.se>> wrote:
>>
>>
>>     On 8/16/19 11:03 PM, Juan Rafael García Blanco wrote:
>>>     Hi,
>>>
>>>     AFAIK, the last qemu major version includes support for leon3. But I 
>>> dont't know if that work was based on these patches.
>>
>>     Indeed. Qemu git head now includes leon3 plug&play and should be able to 
>> run RTEMS images unpatched. Is there a reason why the qemu version built by 
>> RSB is from June 2015 ..?
>>
>>
>> Sadly no one has updated it. Beyond Leon, Zynq and PC, what should be tested?
>>
>> Riscv status in head?
>>
>> Beagle?
>>
>> Any other bsps we use with Qemu?
>>
>> I'd love to see it updated. It's a pain to test across all the hosts and get 
>> working.
>
>
> Unfortunately, qemu HEAD cannot execute RTEMS leon3 images unpatched. The 
> startup code needs a (simple) tweak, and the implementation of the plug&play 
> is not quite correct. An RTEMS binary fails to detect the interrupt 
> controller and subsequently terminates. I have spent a few hours on it but 
> the bug is rather elusive and
>
OK, the problem was that qemu did not implement byte access to the plug&play. 
With the attached patch, most tests for leon3 run:

Passed:        506
Failed:          4
User Input:      6
Expected Fail:   0
Indeterminate:   0
Benchmark:       3
Timeout:         9
Invalid:         2
Wrong Version:   0
Wrong Build:     0
Wrong Tools:     0
------------------
Total:         530
Average test time: 0:00:00.539755
Testing time     : 0:04:46.070129

Maybe we can add it to RSB as qemu4.1, which was released this week. It could 
make it easier to test other targets ...?

Jiri.

diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index 7338461694..eaaedbfbcc 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -228,6 +228,9 @@ static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
 {
     APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);
 
+    if (size != 4)
+        return apb_pnp->regs[offset >> 2] >> ((~offset & 3) * 8);
+
     return apb_pnp->regs[offset >> 2];
 }
 
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to