mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
hw/arm/raspi: add a skeleton implementation of the CPRMAN
The BCM2835 CPRMAN is the clock manager of the SoC. It is composed of a main oscillator, and several sub-components (PLLs, multiplexers, ...) to generate the BCM2835 clock tree. This commit adds a skeleton of the CPRMAN, with a dummy register read/write implementation. It embeds the main oscillator (xosc) from which all the clocks will be derived. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Luc Michel <luc@lmichel.fr> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
74de7145fd
commit
fc14176ba2
7 changed files with 242 additions and 2 deletions
|
@ -121,6 +121,9 @@ static void bcm2835_peripherals_init(Object *obj)
|
|||
/* DWC2 */
|
||||
object_initialize_child(obj, "dwc2", &s->dwc2, TYPE_DWC2_USB);
|
||||
|
||||
/* CPRMAN clock manager */
|
||||
object_initialize_child(obj, "cprman", &s->cprman, TYPE_BCM2835_CPRMAN);
|
||||
|
||||
object_property_add_const_link(OBJECT(&s->dwc2), "dma-mr",
|
||||
OBJECT(&s->gpu_bus_mr));
|
||||
}
|
||||
|
@ -160,6 +163,13 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
/* CPRMAN clock manager */
|
||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->cprman), errp)) {
|
||||
return;
|
||||
}
|
||||
memory_region_add_subregion(&s->peri_mr, CPRMAN_OFFSET,
|
||||
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->cprman), 0));
|
||||
|
||||
memory_region_add_subregion(&s->peri_mr, ARMCTRL_IC_OFFSET,
|
||||
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ic), 0));
|
||||
sysbus_pass_irq(SYS_BUS_DEVICE(s), SYS_BUS_DEVICE(&s->ic));
|
||||
|
@ -355,7 +365,6 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
|||
create_unimp(s, &s->txp, "bcm2835-txp", TXP_OFFSET, 0x1000);
|
||||
create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, 0x40);
|
||||
create_unimp(s, &s->powermgt, "bcm2835-powermgt", PM_OFFSET, 0x114);
|
||||
create_unimp(s, &s->cprman, "bcm2835-cprman", CPRMAN_OFFSET, 0x2000);
|
||||
create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100);
|
||||
create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100);
|
||||
create_unimp(s, &s->spi[0], "bcm2835-spi0", SPI0_OFFSET, 0x20);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue