xref: /openbmc/qemu/include/hw/arm/nrf51_soc.h (revision d2dfe0b5)
1 /*
2  * Nordic Semiconductor nRF51  SoC
3  *
4  * Copyright 2018 Joel Stanley <joel@jms.id.au>
5  *
6  * This code is licensed under the GPL version 2 or later.  See
7  * the COPYING file in the top-level directory.
8  */
9 
10 #ifndef NRF51_SOC_H
11 #define NRF51_SOC_H
12 
13 #include "hw/sysbus.h"
14 #include "hw/arm/armv7m.h"
15 #include "hw/char/nrf51_uart.h"
16 #include "hw/misc/nrf51_rng.h"
17 #include "hw/gpio/nrf51_gpio.h"
18 #include "hw/nvram/nrf51_nvm.h"
19 #include "hw/timer/nrf51_timer.h"
20 #include "hw/clock.h"
21 #include "qom/object.h"
22 
23 #define TYPE_NRF51_SOC "nrf51-soc"
24 OBJECT_DECLARE_SIMPLE_TYPE(NRF51State, NRF51_SOC)
25 
26 #define NRF51_NUM_TIMERS 3
27 
28 struct NRF51State {
29     /*< private >*/
30     SysBusDevice parent_obj;
31 
32     /*< public >*/
33     ARMv7MState cpu;
34 
35     NRF51UARTState uart;
36     NRF51RNGState rng;
37     NRF51NVMState nvm;
38     NRF51GPIOState gpio;
39     NRF51TimerState timer[NRF51_NUM_TIMERS];
40 
41     MemoryRegion iomem;
42     MemoryRegion sram;
43     MemoryRegion flash;
44     MemoryRegion clock;
45     MemoryRegion twi;
46 
47     uint32_t sram_size;
48     uint32_t flash_size;
49 
50     MemoryRegion *board_memory;
51 
52     MemoryRegion container;
53 
54     Clock *sysclk;
55 };
56 
57 #endif
58