mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43: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
37
include/hw/misc/bcm2835_cprman.h
Normal file
37
include/hw/misc/bcm2835_cprman.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* BCM2835 CPRMAN clock manager
|
||||
*
|
||||
* Copyright (c) 2020 Luc Michel <luc@lmichel.fr>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef HW_MISC_CPRMAN_H
|
||||
#define HW_MISC_CPRMAN_H
|
||||
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/qdev-clock.h"
|
||||
|
||||
#define TYPE_BCM2835_CPRMAN "bcm2835-cprman"
|
||||
|
||||
typedef struct BCM2835CprmanState BCM2835CprmanState;
|
||||
|
||||
DECLARE_INSTANCE_CHECKER(BCM2835CprmanState, CPRMAN,
|
||||
TYPE_BCM2835_CPRMAN)
|
||||
|
||||
#define CPRMAN_NUM_REGS (0x2000 / sizeof(uint32_t))
|
||||
|
||||
struct BCM2835CprmanState {
|
||||
/*< private >*/
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
/*< public >*/
|
||||
MemoryRegion iomem;
|
||||
|
||||
uint32_t regs[CPRMAN_NUM_REGS];
|
||||
uint32_t xosc_freq;
|
||||
|
||||
Clock *xosc;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue