xref: /openbmc/qemu/include/hw/arm/nrf51_soc.h (revision 073d9f2c)
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/timer/nrf51_timer.h"
19 
20 #define TYPE_NRF51_SOC "nrf51-soc"
21 #define NRF51_SOC(obj) \
22     OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC)
23 
24 #define NRF51_NUM_TIMERS 3
25 
26 typedef struct NRF51State {
27     /*< private >*/
28     SysBusDevice parent_obj;
29 
30     /*< public >*/
31     ARMv7MState cpu;
32 
33     NRF51UARTState uart;
34     NRF51RNGState rng;
35     NRF51GPIOState gpio;
36     NRF51TimerState timer[NRF51_NUM_TIMERS];
37 
38     MemoryRegion iomem;
39     MemoryRegion sram;
40     MemoryRegion flash;
41     MemoryRegion clock;
42 
43     uint32_t sram_size;
44     uint32_t flash_size;
45 
46     MemoryRegion *board_memory;
47 
48     MemoryRegion container;
49 
50 } NRF51State;
51 
52 #endif
53 
54