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 "qom/object.h" 21 22 #define TYPE_NRF51_SOC "nrf51-soc" 23 typedef struct NRF51State NRF51State; 24 DECLARE_INSTANCE_CHECKER(NRF51State, NRF51_SOC, 25 TYPE_NRF51_SOC) 26 27 #define NRF51_NUM_TIMERS 3 28 29 struct NRF51State { 30 /*< private >*/ 31 SysBusDevice parent_obj; 32 33 /*< public >*/ 34 ARMv7MState cpu; 35 36 NRF51UARTState uart; 37 NRF51RNGState rng; 38 NRF51NVMState nvm; 39 NRF51GPIOState gpio; 40 NRF51TimerState timer[NRF51_NUM_TIMERS]; 41 42 MemoryRegion iomem; 43 MemoryRegion sram; 44 MemoryRegion flash; 45 MemoryRegion clock; 46 MemoryRegion twi; 47 48 uint32_t sram_size; 49 uint32_t flash_size; 50 51 MemoryRegion *board_memory; 52 53 MemoryRegion container; 54 55 }; 56 57 #endif 58