RTEMS on QEMU emulated RPi and RPi2

Pavel Pisa pisa at cmp.felk.cvut.cz
Mon Jun 6 09:59:13 UTC 2016


Hello Deval,

On Thursday 02 of June 2016 10:49:34 Deval Shah wrote:
> Hello Pavel,
>
> I would like to work on this problem. Can I get some more details and some
> literature to go through ?

it would be great. I think that I have complete knowledge to
do that in somethink like one or two days but when I have
time is in the sky. So there is my short info from my git
#
#       modified:   hw/arm/bcm2835_peripherals.c
#       modified:   hw/timer/Makefile.objs
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       hw/timer/bcm2835_timer.c
#       include/hw/timer/bcm2835_timer.h

The bcm2835 is significantly modified ARM PrimeCell SP804.
QEMU support for this HW is in file hw/timer/arm_timer.c .
In the long term integration to that source with some
extension to represent these BCM specifics.
But I expect that it is much easier to start with separate
bcm2835_timer.c and not ask maintainer to accept significant
changes to the code that has to be stable for many other targets.

I am attaching hw/timer/arm_timer.c changed to rough skeleton
of hw/timer/bcm2835_timer.c. Not in shape, but I do not get
to continue in next two or more weeks. So you can look at it

New peripheral has to be included

--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -97,6 +97,9 @@ static void bcm2835_peripherals_init(Object *obj)

     object_property_add_const_link(OBJECT(&s->dma), "dma-mr",
                                    OBJECT(&s->gpu_bus_mr), &error_abort);
+
+    sysbus_create_simple("sp804", 0x10011000, pic[4]);
+
 }

 static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)


But sysbus_create_simple is how sp804 is included in other boards.
I think that BCM used style for other for BCM peripherals integration
should be used.

Best wishes,

              Pavel

> On Fri, May 27, 2016 at 1:59 AM, Pavel Pisa <ppisa4lists at pikron.com> wrote:
> > Hello all,
> >
> > it seems that Raspberry Pi QEMU emulation cannot work
> > with current RTEMS BSP because it uses BCM2835_TIMER_
> >
> > as the main clock source, see
> >
> > rtems/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c
> >
> > which is mapped to
> >
> > #define RPI_PERIPHERAL_BASE      0x3F000000
> > #define BCM2835_TIMER_BASE       (RPI_PERIPHERAL_BASE + 0xB400)
> >
> > but when I invoke "info mtree" in QEMU monitor console,
> > it reports
> >
> > address-space: memory
> >   0000000000000000-ffffffffffffffff (prio 0, RW): system
> >     0000000000000000-000000003fffffff (prio 0, RW): ram
> >     000000003f000000-000000003fffffff (prio 1, RW): bcm2835-peripherals
> >       000000003f007000-000000003f007fff (prio 0, RW): bcm2835-dma
> >       000000003f00b200-000000003f00b3ff (prio 0, RW): bcm2835-ic
> >       000000003f00b800-000000003f00bbff (prio 0, RW): bcm2835-mbox
> >       000000003f201000-000000003f201fff (prio 0, RW): pl011
> >       000000003f215000-000000003f2150ff (prio 0, RW): bcm2835-aux
> >       000000003f300000-000000003f3000ff (prio 0, RW): sdhci
> >       000000003fe05000-000000003fe050ff (prio 0, RW): bcm2835-dma-chan15
> >     0000000040000000-00000000400000ff (prio 0, RW): bcm2836-control
> >
> > which means that area 000000003f00b400-000000003f00b7ff is unmapped.
> > Linux and Windows use local Cortex-A CPU timers most probably on RPi2,
> > so actual RTEMS BSP is not compatible with QEMU RPi2 support.
> >
> > It is not so hared to extend RPi2 QEMU support but it requires
> > time.
> >
> > Best wishes,
> >
> >                     Pavel
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcm2835_timer.c
Type: text/x-csrc
Size: 9200 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160606/3a191fd8/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcm2835_timer.h
Type: text/x-chdr
Size: 581 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160606/3a191fd8/attachment-0005.bin>


More information about the devel mailing list