xref: /openbmc/qemu/include/hw/arm/nrf51_soc.h (revision 079b1252e9de384385c9da910262312ec2e574c8)
1673b2d42SJoel Stanley /*
2673b2d42SJoel Stanley  * Nordic Semiconductor nRF51  SoC
3673b2d42SJoel Stanley  *
4673b2d42SJoel Stanley  * Copyright 2018 Joel Stanley <joel@jms.id.au>
5673b2d42SJoel Stanley  *
6673b2d42SJoel Stanley  * This code is licensed under the GPL version 2 or later.  See
7673b2d42SJoel Stanley  * the COPYING file in the top-level directory.
8673b2d42SJoel Stanley  */
9673b2d42SJoel Stanley 
10673b2d42SJoel Stanley #ifndef NRF51_SOC_H
11673b2d42SJoel Stanley #define NRF51_SOC_H
12673b2d42SJoel Stanley 
13673b2d42SJoel Stanley #include "hw/sysbus.h"
14673b2d42SJoel Stanley #include "hw/arm/armv7m.h"
15b0014913SJulia Suvorova #include "hw/char/nrf51_uart.h"
16f30890deSSteffen Görtz #include "hw/misc/nrf51_rng.h"
17bb42c4cbSSteffen Görtz #include "hw/gpio/nrf51_gpio.h"
184d744b25SSteffen Görtz #include "hw/nvram/nrf51_nvm.h"
1960facd90SSteffen Görtz #include "hw/timer/nrf51_timer.h"
20*c08e6126SPeter Maydell #include "hw/clock.h"
21db1015e9SEduardo Habkost #include "qom/object.h"
22673b2d42SJoel Stanley 
23673b2d42SJoel Stanley #define TYPE_NRF51_SOC "nrf51-soc"
248063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(NRF51State, NRF51_SOC)
25673b2d42SJoel Stanley 
2660facd90SSteffen Görtz #define NRF51_NUM_TIMERS 3
2760facd90SSteffen Görtz 
28db1015e9SEduardo Habkost struct NRF51State {
29673b2d42SJoel Stanley     /*< private >*/
30673b2d42SJoel Stanley     SysBusDevice parent_obj;
31673b2d42SJoel Stanley 
32673b2d42SJoel Stanley     /*< public >*/
33673b2d42SJoel Stanley     ARMv7MState cpu;
34673b2d42SJoel Stanley 
35b0014913SJulia Suvorova     NRF51UARTState uart;
36f30890deSSteffen Görtz     NRF51RNGState rng;
374d744b25SSteffen Görtz     NRF51NVMState nvm;
38bb42c4cbSSteffen Görtz     NRF51GPIOState gpio;
3960facd90SSteffen Görtz     NRF51TimerState timer[NRF51_NUM_TIMERS];
40b0014913SJulia Suvorova 
41673b2d42SJoel Stanley     MemoryRegion iomem;
42673b2d42SJoel Stanley     MemoryRegion sram;
43673b2d42SJoel Stanley     MemoryRegion flash;
44b39dced6SSteffen Görtz     MemoryRegion clock;
459d68bf56SSteffen Görtz     MemoryRegion twi;
46673b2d42SJoel Stanley 
47673b2d42SJoel Stanley     uint32_t sram_size;
48673b2d42SJoel Stanley     uint32_t flash_size;
49673b2d42SJoel Stanley 
50673b2d42SJoel Stanley     MemoryRegion *board_memory;
51673b2d42SJoel Stanley 
52673b2d42SJoel Stanley     MemoryRegion container;
53673b2d42SJoel Stanley 
54*c08e6126SPeter Maydell     Clock *sysclk;
55db1015e9SEduardo Habkost };
56673b2d42SJoel Stanley 
57673b2d42SJoel Stanley #endif
58